Generated Maps:Study Existing Code and Settings

Studying Lua code and settings from official skirmish maps
Studying the Lua code and settings from official skirmish maps is a great way to accelerate learning. The terrainlayout directory located within the archive Data.sga, contains useful library functions, and the Lua code used to generate these official skirmish maps.

How to extract the contents and access the Lua code:


 * 1) From the Age of Empires IV Content Editor. From the top menu, navigate to File » Open (Not "Open Mod")
 * 2) Navigate to your installed Age of Empires IV game directory and open file: Age of Empires IV\cardinal\archives\Data.sga
 * 3) Once Data.sga is opened, in the directory tree, extract the directory data:scar\terrainlayout to your local disk. You can do this by right clicking on the folder name, "terrainlayout", and selecting "Extract".
 * 4) Choose a location on your local disk to save the terrainlayout directory.
 * 5) You can open and view these extracted files in any text editor/IDE, or the official Age of Empires IV content editor.

Studying attributes/settings from official skirmish maps
Seeing existing settings from an official map can serve as a guide when configuring your map attributes in map_gen_layout. This could be settings such as: resource distribution, contested ranges, erosion, terrain smoothing, and more.


 * 1) From the Age of Empires IV Content Editor. From the top menu, navigate to File » Open (Not "Open Mod")
 * 2) Navigate to your installed Age of Empires IV game directory and open file: Age of Empires IV\cardinal\archives\Attrib.sga
 * 3) Once Attrib.sga is opened, in the directory tree, navigate to attrib:attrib\map_gen\map_gen_layout\skirmish_maps\
 * 4) From the skirmish_maps directory you can open a map ".rgd" file.
 * 5) Open a map rgd file and navigate the data tree to view specific settings.