Page: [root]/code/rustorion/technical/architecture | src | faq | css

Architecture of RUSTORION

Universe

There is a data structure called Universe which holds all information about a game world. All objects in Universe are indexed by 64-bit IDs.

ID

ID is a 64-bit number used to index all objects in the Universe. There is an incrementing counter that is used to ensure IDs issued are not repeated. To avoid viewers being able to predict IDs or getting an idea of number of objects present, IDs are encrypted with Blowfish before used for storage.

UniverseView

UniverseView is object that contains everything a certain observer knows about universe. Holder of Universe manufactures these views based on intel levels, radar power, forces present, etc.

Cycle

All Observers of universe (like human players or AIs) each turn receive UniverseView data structures. Then Observers submit Action data structures back to Universe holder, which describe how they would like to modify the universe. If these actions can, in fact, be performed by them, Universe holder applies them to Universe. When all observers have submitted their Actions, cycle repeats.

Values

Various values like population, distance, etc. need to be stored. It is important not to lose precision in many transformations they do, so they should be stored as i64. To allow future balance changes, all designed values start at 1000 as very minimum value normally obtainable. This might be handled by a special type as "1".

Coordinates

Locations of objects in universe need to be comparable. Thus, integers are suitable. They might be negative or positive, center of universe being a special point at 0,0. Lowers possible increment is usual value 1000.

When translated to display coordinates, however, coordinates become floats, to allow simpler transformations.


Powered by bitcheese wiki engine