Parsed stats on units, buildings and technologies from Age of Empires 4 in a developer friendly format.
[ GitHub ]
This project hosts data on all units, buildings, technologies, upgrades and other AoE4 game objects in an opinionated json format ready for developers to use in any project. The data is parsed from game files and reflects what players can read on in-game tooltips.
All units, buildings and technologies are individually available for each civilization that has access to them. Additionally, there’s an ‘unified’ format, that groups together variations of the same item in one file.
| Example File | Description |
|---|---|
/units/english/horseman-2.json |
The English horseman available in Feudal Age |
/units/unified/horseman.json |
All horsemen from all civilizations and all ages |
/units/all.json |
All units from all civilizations and all ages in one list |
/units/all-unified.json |
All units from all civilizations and all ages, grouped by unit |
/buildings/** |
Buildings and landmarks |
/technologies/** |
Technologies, like blacksmith upgrades, uniqiue improvments, etc |
/upgrade/** |
Unit upgrades, i.e. veteran horseman to elite horseman |
The logic to parse game files and output them in our desired format resides in src/attrib.
Requirements: Node, .Net Core
Feel free to open PRs or issues for data that is incorrect or missing, if possible please provide a rationale or source. One-off corrections to data are encoded in src/attrib/workarounds.ts and technology effects in src/attrib/technologies.ts
You will need raw parsed game files to build and update the data. Those files are not included in the repository due to licensing and copyright issues (you will need your own copy of AoE4). First we unpack the so called Archives (SGA) and then parse them using scripts we wrote to JSON files.
Prerequisites
./source/AOEMods.EssenceC:\Program Files (x86)\Steam\steamapps\common\Age of Empires IV\. When you play the gam through XBox, the process is a bit more involved as the game is installed in the hidden and secure windowsapps folder.Automatic process
The powershell script Extract-AOE4Patch.ps1 supports various methodologies. But the main procedure is:
Run in a powershell window:
.\Extract-AOE4Patch.ps1 -GamePath 'C:\Program Files (x86)\Steam\steamapps\common\Age of Empires IV\'NOTE: It’s preferable to use -GamePath, it’ll determine the game version and by default create a versioned directory under ./source. If you used this repository before, you may have to clean up ./source as it’ll only create a junction of source/latest doesn’t exist or is already a junction.
All Parameters:
-ArchivesPath: Use instead of -GamePath. Specify the directory containing the Attrib.sga, UIArt.sga and LocaleEnglish.sga files.-OutputPath: Simply where to put the output, defaults to ./source/{version}. (And creates symlink/junction from ./source/latest to it)-DataStore + -Patch: Can be used to keep an archive of all game patches & exports. It uses a patches/12.2.1234 subdir structure, in my case on a zfs storage for dedup reasons. But that requires local changes in config.ts too.-ExtractXml: Switch to also convert attrib to xml format in another directory.-ExtractExtraImages: Extracts all icons instead of only races, also extracts civ flags & map images.-RemoveTemp: Removes the extracted sga content after conversion (attrib-raw and uiart-raw dirs)-AOEModsEssenceDir: Specify an alternative dir containing AOEMods.Essence.CLI.dll; defaults to ./source/AOEMods.EssenceManual process
Note: Make any of the specified directories as needed
/source
cardinal\archives\Attrib.sga for all stats and attributescardinal\archives\UIArt.sga for the icons (optional if you want to update icons)cardinal\archives\LocaleEnglish.sga for the names and descriptionsdotnet AOEMods.Essence.CLI.dll sga-unpack ./source/Attrib.sga ./source/attrib-rawdotnet AOEMods.Essence.CLI.dll rgd-decode ./source/attrib-raw ./source/ -b -f jsondotnet AOEMods.Essence.CLI.dll sga-unpack ./source/LocaleEnglish.sga ../source/localedotnet AOEMods.Essence.CLI.dll sga-unpack ./source/UIArt.sga ./source/uiart-rawdotnet AOEMods.Essence.CLI.dll rrtex-decode ./source/uiart-raw/ui/icons/races ./source/ui/icons/races -bsource
├── attrib
│ ├── instances
│ ├── templates
│ └── etc...
├── ui
| └── icons
│ └── races
│ ├── abbasid
│ ├── chinese
│ └── etc...
└── locale
└── en
└── cardinal.en.ucs
yarn install && yarn parse to update the data.effect.ts.yarn build to update the optimzed json files and library.Parsing can be relatively slow due to the total amount of files involved. If you’re just working on data for a specific civ you can add an additional flag to the the parse command to only parse a specific civ. I.e. yarn parse --civ japanese
Note: It’s not slow anymore, but the option still exists.
Created and maintained by Robert van Hoesel from AoE4 World
All of this data is open source, you may use it in your projects, websites and apps. However, Microsoft owns the Copyright on the game, and for this reason you can’t use this data in commercial contexts, excepts as described in Microsoft’s Game Content Usage Rules. Whenever you are using the data in this repository or other media from Age of Empires 4, please make sure to abide by the rules.
Age Of Empires 4 © Microsoft Corporation. Aoe4world/data was created under Microsoft’s “Game Content Usage Rules” using assets from Age Of Empires 4, and it is not endorsed by or affiliated with Microsoft.