Here I’m trying to collect all the information that may be useful for everyone trying to mod the game, including myself If you got something to contribute, correct errors or have any question about general knowledge about InfraSpace‘s internals, please post it here. I’ll constantly update the main post.
Distance units
InfraSpace used several measures of distance. Here we cover where they are used, how long they are and how they convert into each other.
World distance
By far the most important distance measure. This is the unit used by the world coordinate system and most things use it. Initially assume anything distance related uses world distance. Examples:
- Map coordinates and size. The first premade map has a playable size (length of the square) of 512. The total world is 1024. The random map is twice of that in each direction.
- Building sizes (more exact: the sizes of their collides). A habitat is 4x4 in size.
- Radius of effects. A power pole has an electric coverage of 10.
- If you use the object inspector of the development tool panel, most objects report their position in this unit.
1 unit very roughly corresponds to 10 meters in the real world.
Grid distance
This is the size of the grid when activated in the game. One grid cell has a world size of 2x2 world units. It’s what most players are thinking in.
- A habitat is 2x2 grid cells in size.
- The colossal adamantine is 23x23 in size. That name is very well chosen.
The 1:2 conversion from grid to world makes it so that the center of grid cells are always integer coordinates in world units. This has several advantages: building coordinates are always anchored to the center and road nodes are also always on the center of grid cells.
Car distance
„Infrastructure“ distance would also be an accurate name. This unit is often stored as integers and sometimes even uses integer arithmetics (for performance and maybe accuracy). One unit of world distance equals 1000 car units.
- A car is 600 car units long.
- A car on a concrete road travels at 60 car units per frame. That equals 3 world units per second or 1.5 grid cells per second.
- A tier 1 train reaches a maximum speed of 150 car units per frame.
- Roads and rails use car units to store where cars are on them and how far they still have to travel.
District units
The playable map area is divided into 4096x4096 pixels (or maybe “distrixels”?) to assign districts to each of them, since each distrixel can only belong to 1 district at a time. This sub-sampling is done for memory reasons.
- On the random map a distrixel is 0.25x0.25 world units big.
Terraforming progress units
The whole world is divided into 64x64 pixels (“terrafoxels”?) that store terraforming progress (for performance) reasons.
- On the premade map a terrafoxel is 8x8 world units big.
Time units
There are several ways how progress through time is tracked and calculated.
Actual time
In some places you will find Unity‘s DeltaTime
. That’s where actual time is used and that’s in seconds. This is subject to the frame rate running at 60 fps. Usually this is not used for very important things like animations.
- Antares’ laser cannon deals 1 damage per second to objects.
Simulation frames
Most of the actual time related things in the game work directly with the simulation frame discretization. 50 of such frames constitute 1 second of real time given that the computer is able to compute them this fast. Otherwise the time measured by a single frame increases and your game runs slower.
- One simulation frame equals 20ms of actual time.
- In one frame a truck on a concrete road can travel 60 car units.
- In one frame the durability of high tech tools will decrease by 0.00167%, making them last 20 minutes in total.
Many actions in the game only take place every x-th frame for performance reasons. For example production progress is only updated every 10th frame for factories and similar buildings. This is spread out semi randomly across buildings, so every frame approximately 1/10 of all factories update their production.
Production ticks
Production times are using this unit. It’s tracking progress rather than time. 1 production tick is the amount of progress a factory of 1% efficiency makes in each frame. Assuming 100% efficiency and 50 frames per second we get a factor of 5000 to 1 for conversion to second.
- A small sand mine‘s production definition has a cycle time of 25000 ticks. This equals 250 frames at 100% efficiency or 5 seconds of actual time.
Resource units
These measures are used to track the amount of something.
Goods
In most cases resources are stored and handled as integer numbers that directly denote the amount.
- A sand mine produces 1 sand in each production cycle.
- Trains have a maximum capacity of 200/400/600 respective per transport difficulty.
- Each pink truck carries one worker from the spaceport to a habitat (or 0 on the way back).
Construction material
Once goods are delivered to a storehouse (small or normal size) they change from the above good denomination to the construction material denomination, which is the same value but multiplied by 100.
- A truck carrying 1 unit of concrete will deposit 100 units of concrete construction material to your storage on arrival at a storehouse.
- Your construction material storage of concrete and steel is displaying the actual number divided by 100 (rounded down). Same for the adamantine panel and the storehouse info panel.
- A basic habitat costs 1000 units of concrete.
- A stretch of gravel roads costs 10 concrete according to its definition. This price is always valid for 1 world unit. The price displayed in the construction menu is displayed for 10 world units, so that would be 100 concrete. Divided by the factor of 100. One grid cell of gravel road costs 20 concrete, or 0.2 in normal units.