Modding
Comments39this wiki
Dev Page | < Development Pages
| |
Cleanup (issue: check validity of statements;)
To meet Anno 2070 Wiki's quality standards, this article or section may require cleanup. Please help by improving the article.
|
|---|
This page is for discussion about modding / modifying the game's files.
Contents |
A word of warning
Edit
Modifying the files should be done with extreme caution : Any change will be detected by the autopatcher (By checking the MD5 Checksum), and the changed file will be deleted and re-downloaded.
Do not allow internet access when trying to mod.
Basic info
Edit
The games data is stored in the installation directory, in the "maindata" folder (for information about the .rda files, see External tools).
The principle of modding involves modifying in-games values (Wind Park power output for instance) to make the game harder, easier or more balanced.
Avenues of research
Edit
Creating a Patch999.rda file
Edit
In theory, each patch supercede the previous one, therefore, by cloning patch 8 and naming it patch999.rda, it should be possible to mod without incurring the wrath of the autopatcher.
Apparently, the game does not take into account the "new patch", more research needed.
Modding without internet access
Edit
This involves modifying patch3.rda and denying internet access to the autopatcher.
More detailed info
Edit
Such values as building cost, power output/consumation, maintenance cost, ecobalance effect, etc. is stored in patch8.rda/data/config/game/assets.xml and superceded by the assets.xml files of subsequent patches.
Organisation of assets.xml
Edit
The data is divided into groups.
- Animals
- Buildings
- Tycoons
- Residence (houses)
- Public
- Production
- Energy (interesting!)
- Special (ark, ...)
- Ornaments
- Ecos
- Same as the Tycoon organisation
- Tech
- Same as the Tycoon organisation
- Others (fields, ...)
- "Relocation Placeholders"
- Third Party
- Tycoons
- Vehicles
- Tycoons
- Submarine
- Warships
- Trading Ships
- Ecos
- Tech
- Third Party
- Other
- Quest Vehicles
- Tycoons
- Units
- Street
- Testdata
- Unplaceable
- Landscape
- Infolayer
- Props
- Targets
- Disasters
- ... and then enough categories to give you an headache
Values
Edit
Credits (e.g. Values/BuildCost/ResourceCost/Credits and Values/MaintenanceCost/ActiveCost and InactiveCost) are stored in the same unit as in-game credits.
Non-credit maintenance cost like power and ecobalance (Values/MaintenanceCost/ActiveEcoEffect, ActiveEnergyCost, ActiveEnergyProduction + Inactive...) are stored as binary fixed point numers:
ingame_maintenance = datafile_maintenance >> 12 # use binary right shift
ingame_maintenance = datafile_maintenance / 4096 # or divide by 2**12
Amounts of goods (Values/BuildCost/ProductCost/Tools) are stored in kilograms (1000 kg in data file = 1 ton ingame).
Time (Values/WareProduction/ProductionTime) is stored in miliseconds.
Default passive trading prices can be calculated as int(2.5 * properties.xml > .//ProductPrices/{value from assets.xml > /Values/WareProduction/Product}/BaseGoldPrice).
Building size in game tiles can be calculated from .ifo files using this pseudo-algorithm:
cfg_path = assets.xml -> /Values/Object/Variations/Item/Filename
ifo_path = cfg_path.replace("cfg", "ifo").lower()
ifo_file = open ifo_path from data2.rda + patches
x = ifo_file -> .//BuildBlocker/Position/x
z = ifo_file -> .//BuildBlocker/Position/z
x = abs(x) >> 11
z = abs(z) >> 11
See python implementation of reading these values in list_of_buildings.py.