sage / data-files /README.md
Siewart's picture
SAGE dataset (anonymized)
8a015f3
|
Raw
History Blame Contribute Delete
6.96 kB

AoE2:DE reference data extraction — README

Extracted directly from the game's own empires2_x2_p1.dat (Genie engine format) via a custom C++ tool built against the official Tapsa/genieutils. Two snapshots exist:

  • may2026/ VER 8.8, 59 civs, 1510 techs, 1409 effects.
  • kotd4/ — matched to the KOTD4 tournament dataset, VER 7.4, 39 civs, 851 techs, 851 effects.

The contents of these files are released under the Mi

Each snapshot's display strings (display_name, description, etc.) are resolved against that same install's key-value-strings-utf8.txt,

Files

  • aoe2_civs.json — one entry per civilization.
  • aoe2_techs.json — one entry per tech (includes hidden/auto-research techs used internally for civ bonuses and tech-tree gating — see is_civ_bonus).
  • aoe2_units.json — one entry per skirmish-relevant unit: filtered to unit ids that appear in the game's own tech-tree UI (TechTree .UnitConnections / BuildingConnections). This excludes scenario-editor entities — corpse variants (_D suffix), duplicate age-specific building meshes (Shipyard2/3/4, Port 2/3/4), decorative props, and unused duplicate entries — that share id ranges with real units but were never wired into the tech tree. So this excludes gold mines, trees, rocks, and other gaia props, as well as the "dummy" units.
  • aoe2_effects.json — every effect group (id + name + raw command list), for looking up an effect_id referenced from anywhere else in these files.

IDs (civ id, tech id, unit id) match the raw .dat values and were cross-checked against the SAGE/KOTD4 per-match parquet export pipeline's own id space — they align.

Text fields

  • internal_name — old internal codename (e.g. "British"), not the in-game display name.
  • display_name — resolved in-game name. For civs this isn't stored in the dat file at all; it's a hardcoded engine convention (string id = 10270 + civ id).
  • Units: creation_text (train-button label), help_text, and description — the official train-button tooltip ("Strong vs. X, Weak vs. Y" blurb) which lives at an string offset (21000).
  • Techs: description, help_text, tech_tree_text (tech-tree panel text).
  • Civs: overview_text — the civ-selection-screen blurb (bonuses, unique unit/techs, team bonus), resolved from another undocumented convention (string id = 120149 + civ id). team_bonus_text is the "Team Bonus:" section parsed out of that same blurb.

Effect commands (type/a/b/c/d)

Every place an effect's command list appears, each command has been enriched in place with type_name and meaning (a decoded, human-readable one-liner) using the field semantics from Tapsa/AGE (the actual AoE2 modding editor's source — the tool players use to hand-edit these exact values, so it's authoritative, not inferred).

The type number encodes both a base operation and a scope: type = base + scope_offset, where scope_offset is 0 (self), 10 (team), 20 (enemy), 30 (neutral), or 40 (gaia), and base is one of: 0 set attribute, 1 set/change resource, 2 enable/disable unit, 3 upgrade unit, 4 change attribute (+/-), 5 multiply attribute, 6 multiply resource, 7 spawn unit, 8 modify tech, 9 set civ name. Types 101/102/103 (tech cost/disable/research-time modifiers) don't get scope variants.

Known gap: the a/b/c/d → class-name lookup for attack/armor bonuses (class N in meaning) is only populated through class id 61; AoE2 DE has since added more unit classes for newer content, so some decoded lines show a wrong or generic class name (e.g. "vs Tree" where the real target is a newer class not in the table) or fall back to unit N for a few unresolved ids in some team bonuses. Treat meaning as a best-effort gloss, not a certified translation — the raw type/a/b/c/d values are always present alongside it if you need to re-derive.

Civ access / tech-tree fields

  • civs_with_access / civs_disabled (on units) and disabled_techs (on civs) / disabled_for_civs (on techs) are two ends of the same data, built from two independent sources:
    1. civ-restricted bonus techs (Tech.Civ >= 0) and their effects, and
    2. each civ's own dedicated "Tech Tree" effect (Civ.TechTreeIDEffects), which is not reachable through any Tech row at all — it's a direct field on the civ record. This is where most type=102 "Disable Tech" commands live (e.g. Britons' tech-tree effect disables Bombard Tower, Stone Shaft Mining, etc. — 51 techs in the current snapshot). An earlier version of this extraction missed source (2) entirely, which is also why civs_with_access/unique_to_civ came back empty far more often than they should have.
  • An empty civs_with_access list does NOT mean "no civ has this unit." Most units have no explicit per-civ restriction at all and are available to every civ by default (e.g. Archer, Militia-line) — for those, empty is correct and expected. The list is only populated when a specific civ-only unlock command was found; treat it as "explicitly restricted to these civs," not as the full roster.
  • unique_to_civ is derived from civs_with_access having exactly one entry — same caveat applies (a unit with no restriction at all is neither "unique" nor generically "shared," it's simply unrestricted).

These choices a reflection of the game's internal logic, not a design decision` of this extraction tool.

Team bonus (fixed)

team_bonus.effect_id (Civ.TeamBonusID) is a direct index into Effects, not a tech id. An earlier version of this tool wrongly treated it as a tech id and looked up Techs[TeamBonusID].EffectID, which for Britons (TeamBonusID=399) silently landed on an unrelated tech and decoded as something nonsensical (Vikings' unique unit). This is now fixed and cross-checked against team_bonus_text (the string-based version) — they agree for all civs in both snapshots.

repeatable on techs

repeatable=true does not mean "can be researched multiple times in a normal game" — the great majority of techs in the dat (1154 of 1510 in the current snapshot, including ordinary one-shot techs like Loom and Crop Rotation) carry this flag. It only takes effect under specific game/lobby settings that permit re-research; in a standard game almost everything behaves as single-research regardless of this flag. Don't treat it as a reliable "can be researched N times" signal on its own.

AI Use

This document was generated using AI, then manually reviewed and edited for accuracy. The AI was used to summarize the contents of the files and provide explanations for AI was also used to extract the information from the game's data files and organize it into a readable format, following the author's direction.