Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shared Game Data

Civilization’s resident modules and overlays share a common data area called DGROUP. It holds rule tables, civilization state, entity arrays, strings, scratch buffers and the execution stack. Changing the active overlay leaves this state available.

Principal Record Arrays

Offsets below are relative to DGROUP.

OffsetArrayRecordsRecord size
0282terrains1219 bytes
112Autypes2834 bytes
70ECtownbuf12828 bytes
81D4armydata8 × 12812 bytes

The record declarations show their fields. src/GAME.C also defines the 46-entry production table, containing city improvements, spaceship parts and wonders.

Civilization-wide variables track treasury, science and tax rates, technological knowledge and diplomatic relations. The save transfer sequence shows which state is written to disk and in what order.

Larger arrays, including map visibility, power history and the city-name pool, use separate storage. Tile attributes are accessed through screen page 2.