Skip to content

technical engine processor

Vinorcola edited this page Dec 12, 2020 · 1 revision

The processor and the process cycles

Introduction

The processor is in charge of making the game evolve through time. It uses an in-game time representation (through the class CycleDate). It is in charge to regurlarly increment this in-game date and trigger the calculations within the dynamic & static elements that have been registered.

In order to be processed by the processor, the elements must implement the AbstractProcessable interface. Then, they must be registered within the processor. Typically, all the dynamic elements will always be registered while some static elements may not be. There are indeed some static element that does not require processing and are just here for display purpose (grounds, rocks, roads, decoration buildings, etc.)

Processable elements

The processable elements can be of 2 types: the dynamic elements and the static elements.

Dynamic elements will processed at each time-frame, which is 30 frames per seconds by default. Static elements will however be processed much less othen: only once per second by default.

This difference is explained because dynamic elements are moving and need a fluid update. Static elements are process less othen in order to save calculation time. An exception is made by CivilianEntryPoint which is in charge of generating immigrants. This particular static element will be processed each time-frame in order to have a more fluid immigrant generation (rather than generating immigrants each seconds).

Clone this wiki locally