-
Notifications
You must be signed in to change notification settings - Fork 41
Temporal dynamics
Many events occur at regular intervals in order to keep the game world running and humming. The unit of time for all temporal dynamics is the turn
(not to be confused with turns in the turn-based battle system).
The duration of a turn in real-world time is defined in the config in the economyCycles.turnDuration
field. This provides one single location where the overall speed of the game can be changed (e.g. for test or simulation purposes you can set a turn duration to 1ms).
All other in-game dynamics (also called cycles, see beow) define their intervals in terms of turns (see economyCycles
section of the config), not in terms of real-world time. The only exception are the update rates of the game entities and the clients (set up in GameServer.setUpdateLoops()
based on the updateRates
section of the config), which have to happen very frequently and are not related to the rhythm of the game.
The following activities occur cyclically in the game world:
- Civs spawn: civ camps (
server/Camp.js
) produce new Civs (server/Civs.js
) at regular intervals, provided that the camp is not destroyed, and up to maximum of 5 alive Civs per camp - Wildlife spawn: spawn zones (
server/SpawnZone.js
) produce new Animals (server/Animal.js
) at regular intervals, provided that the spawn zone is active and up to a variable maximum of alive animnals - Items spawn: plants and items that can be picked up on the ground (
server/Item.js
) respawn randomly at regular intervals (seeGameServer.respawnItems()
) - Hunger: the food level of players decreases by a certain amount at regular intervals, whether the players are connected or not (for disconnected player, the decrease is actually applied when they connect, based on how long they have been offline)
- Production: resource buildings produce items every
x
turns, depending on the item in question (and whether production is boosted with food) and up to a limit set by the stock limit of the building