DD/Units/Speed of units

From Unknown Horizons

Jump to: navigation, search
Image:Note.png

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 discussion page, talk to us, or edit the "Questions" section of this page, but please don´t directly edit the other parts.


Proposal

Summary

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.


Open questions

Question Open question:
Should units accelerate?

totycro

Answer Suggestion:
Yes, but maybe acceleration should be used for see units only, I think. For me it does not make much sense to accelerate land units. To tell the truth I have no idea if acceleration for units makes sense at all.

--dauerflucher 01:28, 9 August 2008 (UTC)

Question Open question:
How many fields should it take a unit to accelerate? Should it be an equal amount of fields for any unit? Should there be differences according to unit class (ship, land unit, horse-driven unit)?

totycro

Answer Suggestion:
No matter which unit classes are affected by acceleration there should be differences. E.g. a small sea vessel will accelerate faster than a ship of line. As a simple formular for calculating the fields needed to achive maximum speed I would suggest [unit's length] x 2. The multiplier could be modified at any time when not working as expected.

--dauerflucher 01:28, 9 August 2008 (UTC)

Question Open question:
Should the values of acceleration be calculated automatically (where rounding errors will occur) or should every value be defined explicitly (more work for developers, but more precise)?

totycro

Answer Suggestion:
Currently I cannot tell how important the acceleration values might be for gameplay. Personally I would like to see them defined for every single unit via modifier in the database.

--dauerflucher 01:28, 9 August 2008 (UTC)

Question Open question:
The different grounds make the unit move faster or slower (e.g. street faster than grass). Should the values be defined excplicitly or calculated via a multiplier?

totycro

Answer Suggestion:
One formular for calculating the base speed modified with a modifier for each unit then again modified with a multiplier for ground types;
([base speed] x [unit speed modifier]) x [ground type modifier].

--dauerflucher 01:28, 9 August 2008 (UTC)

Phasing

General

Later development.

Personal tools
Unknown Horizons
Design Document