Skip to content

import_game_data: add objects and terrain steps, support the current game layout - #183

Merged
happyleavesaoc merged 1 commit into
SiegeEngineers:masterfrom
denniske:import-objects-terrain
Oct 19, 2026
Merged

happyleavesaoc merged 1 commit into
SiegeEngineers:masterfrom
denniske:import-objects-terrain

Conversation

@denniske

Copy link
Copy Markdown
Contributor

Extends scripts/import_game_data.py so objects and terrain can be refreshed from the game files like maps and technologies, instead of being added by hand (as in #182).

New steps

  • with_objects reads empires2_x2_p1.dat (via genieutils-py) and adds the missing gaia objects, named from the English strings. Only these unit classes are included: fish 5, forage 7, livestock 8, prey 9, predator 10, bird 11, flora 14, tree 15, stone mine 32 and gold mine 33.
  • with_terrain adds missing terrains with their minimap colors. Each terrain in the dat names three colors as indices into resources/_common/palettes/original.pal, and the existing up/level/down values are exactly those colors: 95 of the 101 current terrains match.
  • No renames or recolors. Existing entries are kept as they are, because other tools match on these names. For example, the game now calls 250 Longship and 126 Grey Wolf.

Running on the current build

The script failed on the current game build (Steam build 25464371) before reaching the new steps:

  • civTechTrees.json is now split into one CivTechTrees/<CIV>.json per civilization. Both layouts are read.
  • Several tech tree node fields are left out when they are empty: Link ID, Prerequisite IDs/Types, Trigger Tech ID, Node Type and others. These now have defaults.
  • Civilizations have a new tech_tree_description_string_id field.

Output against current master

Section Added Changed
maps 0 0
technologies 22 3
objects 158 0
terrain 24 (110–133) 0

Things for review:

  • Objects the script cannot name:

    • Marble Cliffs 2178–2186 have no English string.
    • Mouflon 2340 and Peacock 2537 have their name strings outside key-value-strings-utf8.txt.

    Add newer DE gaia objects and terrains 110-133 to dataset 100 #182 adds these by hand.

  • Flora class 14: this class also brings in eye candy such as bridge pieces, ruins, gates and stumps. The dataset already holds 181 class-14 objects, so I kept it, but it is easy to drop from GAIA_CLASSES if that is too broad.

  • Existing terrain colors that differ from the game: 32, 69, 70, 75, 76 and 101. These were left untouched.

🤖 Generated with Claude Code

with_objects adds the gaia objects (fish, forage, livestock, animals, birds,
flora, trees, mines) the dataset lacks, named from the English strings.
with_terrain adds missing terrains with their minimap colors: the dat stores
them as indices into original.pal, and the existing up/level/down values are
exactly those colors. Existing entries are never renamed or recolored.

The script no longer ran on the current game build: civTechTrees.json is now
one CivTechTrees/<CIV>.json per civilization, several node fields are omitted
when empty, and civilizations carry tech_tree_description_string_id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@happyleavesaoc
happyleavesaoc merged commit 5c59f16 into SiegeEngineers:master Oct 19, 2026
3 checks passed
@happyleavesaoc

Copy link
Copy Markdown
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants