The present package is a system for dynamically adjusting the time and energy cost of teleportation with respect to distance.
- Energy cost scales quadratically* according to
teleport_dist^2
. - Time required scales logarithmically according to
log(teleport_distance)
, with a minimum time equal toUnitBlueprint.TeleportDelay
. - The above two values are displayed in a reticle adjacent to the teleportation cursor. When multiple teleporting units are selected, the energy displayed will be equal to the sum of the individual costs of all units. The displayed time will be the individual maximum among the selected units.
Technical implementation includes the externalization of the teleport cost function to lua/shared
, allowing access by the sim and the ui, and a reticle class in controls/worldview.lua
with an eye towards future applications.