Speed of units

From Unknown Horizons - Wiki
Jump to: navigation, search

This page is part of the Unknown Horizons Design Document. Please discuss everything concerning this topic on the "discussion" tab of this page. If you're not sure whether your ideas are fitting the Unknown Horizons style, either use the related discussion page or ask us. Please don't directly edit the article!




Depending on terrain (including different climates) and performing action units will have different speeds. E.g. Woods will be more difficult to walk through like open plains and when advancing enemies in a close formation units will maybe walk slower to holf formation or at least the speed of a group in formation is depending on the slowest unit in this group.

Some units might move faster through difficult terrain like others or perform actions at higher speed.

Streets might provide speed modifications.

Implementation related notes

As unit of speed in the database we use the number of ticks, that it takes for one straight move, e.g. from (0,0) to (1,0). Technically speaking, this is not speed as such, but it suits our needs. Please keep this in mind when working on unit speed.

Every unit has a base speed(float) and every ground a modifier(float). Those are multiplied and inserted in the unit_velocity table(int). Due to the float to int conversions, rounding errors occur. To fix those or to create special conditions, these final values can be edited manually.

Whenever a new ground or unit is introduced, or a base velocity is changed the values have to be recalculated and manual changes will have to be redone. The recalculation will be done by a script, that is yet to be written. This script will also warn the user if the rounding error is to big (probably between 0.4 and 0.6).

Acceleration (basically different speeds for steps of the path) will be implemented later or never.



Later development.

Personal tools