Skip to content

Lua: Provide cheap distance functions for mapmakers #4484

@Loobinex

Description

@Loobinex

A lot of lua code is interested if X is in range of Y. With large maps, loads of creatures and doing square roots to calculate the distances this will lead to slowdowns.

It would be good to offer some functions to mapmaker that compare distances without doing square roots, for example by squaring the value you compare it too, or doing box-distances instead of diagonals.

Suggested functions:

GetDistance, GetDistanceSquared
location.IsInBox, location.IsInCircle

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions