A Win Condition defines the basic parameters of a Game Mode mod in the Content Editor.
Filling out the parameters on the Win Condition interface helps fast-track certain non-scripting elements of game mode creation, such as Skirmish or Custom lobby display settings, custom options for match hosts to configure, and the pre-caching of assets.
There are several Win Condition properties already defined in the [mod name].rdo file which only need the information to be passed into the field. Other Win Condition properties require new Elements to be added.
This guide outlines the functionality of each Win Condition field in the Win Condition interface so you can decide which Win Condition parameters you wish to edit for your Game Mode mod.
Editing a Win Condition
When you launch the Age of Empires IV Content Editor and create a new Game Mode mod, one of the files that opens is called [mod name].rdo
Selecting this file allows you to configure your Win Condition using a specialized interface.
If you close this tab, you can find it again in the Asset Explorer by navigating to Mod > Scar > Winconditions and double-clicking on the [mod name].rdo file.
The Display section possesses a number of properties that determine how your mod appears to players in Custom and Skirmish lobbies.
Refer to the entries below for a description of each of these properties and the effect they have on a scenario's Win Condition.
The Display Name is the name of your mod that is displayed to players when selecting it to play in a Skirmish or Custom lobby as the match-host.
The Display Name is primarily when selecting your mod when browsing game types.
The Display Name also appears on the loading screen for a match.
Your mod's Description lets players know what your mod does.
The Description is displayed underneath your mod's name when selecting it in the Custom or Skirmish screen, as well as appearing when hovering over it when your game mode is being selected.
If you do not enter a Description, the message "No Mod/Key" will be shown underneath your mod instead.
The Selected Image is the icon associated with your mod that is displayed in the Custom or Skirmish lobby.
If no image is uploaded, the default banner image will be displayed instead.
To upload an image, you must manually place images in a custom folder within your mod's file structure.
To do this, navigate within your file structure to: Users > YourName > Documents > YourMod > Assets
In the Assets folder, create a folder called "UI."
Then inside the UI folder, create a folder called "Images" and place your new image inside it.
When uploading a custom image to use for your mod, it should adhere to the format below:
- PNG format
- Exactly 428 by 428 pixels
- Bit depth of 32
This assures your image correctly fits into the interface.
To check if your image is properly detected by Age of Empires, open your mod in the Content Editor and check its presence in the Asset Explorer.
It will appear under: UI > Images
Unselected Image Properties
The Unselected Image Properties are not referenced in Age of Empires IV. You can leave this blank.
The Icon Properties referenced in Age of Empires IV. You can leave this blank.
The Modifiers section provides an avenue to add a number of modifiers to your Game Mode mod.
Similar functionality can also be achieved with your Game Mode's .scar script.
This option allows you to choose whether the Town Center will be replaced by a different building in this game mode.
The StartingBuildingKey must be set to "default_mp" to replace the Town Center with another building.
If this field is left blank, the game mode will spawn a Town Center as the starting building.
"Default_mp" correlates to the starting_building key value in Attributes → army, as shown below.
In Age of Empires IV, each civilization's army_bag's starting_building key is "default_mp."
If this value is changed, a new key must be added to your mod's StartingBuildingKey if you wish to replace the starting building.
If the RaceStartingBuildingKey is filled in, your mod will spawn the startup building specified in the army attribute data of this key.
Due to the data structure of the Age of Empires IV Civilizations (referred to as "Races" in the Content Editor), it is advised to leave this field blank.
To add a new element, Right-Click on StartingBuildings and click Add.
Using the Race (civilization) selection, you can choose if you would like a different starting building replacement for each civilization.
To replace the starting building, click the (...) button and select one of the existing buildings from the menu.
Once you have selected a starting building, press Open.
Your selection will appear in the Building field.
Now in-game, the building you selected will replace the Town Center.
Any civilizations not defined here will default to using their civilization's Town Center as normal.
Similarly to Town Centers, you can set a starting squad to replace the default Villagers. In the screenshot above, the normal starting units have been replaced with a Scout.
To replace the starting units, Right-Click on StartingSquads and select Add.
Then, click the (...) button on the new entry and and select one of the existing units from the menu.
Once you have selected a creature, press Open.
This will fill in the Squad field with your selection.
You can also configure a number of upgrades to give to players at the start of a match based on the Civilization they are playing as.
To do this, right-click on PlayerUpgrades and select Add, then click on the (...) button on the new entry and make a selection of the existing buildings from the popup menu.
This allows you to choose whether any existing upgrades / technologies are given to players at the start of the game in your mod.
Note that only global upgrades will work here. Upgrades that apply to specific units will need to be applied via your .scar script.
This allows you to specify the name of an egroup that contains entities you would like to destroy at the start of a match.
In Age of Empires IV, this functionality does not have a lot of immediate value as no egroups exist by default. An example application would be playing this Game Mode on a Crafted Map that contains an egroup that conflicts with the intent of your mode.
This field can be ignored. It allows the game mode to be referenced by a condition in StateTree, but mod data does not utilize this feature.
The Options section offers a degree of control over how the match host can modify how the Game Mode functions.
These options connect to your Game Mode script and can control anything you can achieve with scripting. The Standard Game Mode uses Options to turn on/off win conditions, display player scores, and set starting conditions like resources, starting age, and fog of war.
See Editing a Script for how to hook up your Options once you create them in the [mod name].rdo file.
To add a new Option Section, right-click on the Options row and select Add...
The name of the section of Options you added, displayed in the Custom/Skirmish lobby. In the following example, the "Economy" header is set by the Display Name.
If toggled on, the Display Name and any Boolean Options it contains that are set to true by the match host will be displayed on the loading screen.
For example, the standard game mode in Age of Empires IV features the win conditions activated by the match host.
The option section key will become a table that can be referenced by the Game Mode's .scar file.
You can name this whatever you like as it adheres to scripting variable standards (e.g. no spaces). See the Game Modes scripting documentation for more details.
Right-click on the Options row and select Add to create a new Option in this section. You will then be asked what type of Option you want to add.
Adding a boolean option allows the match host to set the option as active or inactive. For example, the Win Condition options in the Standard Game Mode are boolean options.
Adding an enumeration option allows the match host to choose from a list of items for a given option.
For example, the Starting Resources Option in the Standard Game Mode is an enumeration Option.
Adding an integer option allows the player to select a number using a sliding scale.
Note that the Age of Empires IV UI does not support this option type. While it is functional, it does not present visually very well. We recommend you use Boolean and Enumeration option types to suit your needs instead.
The name of the Option that is presented in the Option Section. In the following example, "Landmarks" and "Starting Resources" are both Display Names for the Boolean and Enumeration Option types.
Not referenced by the Age of Empires IV UI. This can be left blank.
The description of the Option displayed on hover of the Display Name and on the loading screen if the Option is featured.
The Option key will become a table entry in the Option Section table that can be referenced by the Game Mode's .scar file. You can name this whatever you like as it adheres to scripting variable standards (e.g. no spaces). See the Game Modes scripting documentation for more details.
DefaultValue: Sets whether this boolean option will start as True or False
Right-click on the EnumItems row to add an item to your Enumeration Option. Each item will become an entry in the Option's drop-down UI.
A quick walkthrough of this process is included below. This example shows how to add the starting conditions section for the resources players start with.
- This interface appears after the Enumeration item is added.
- The Display Name is a localized value so it can be anything you want. For this example, the Key needs to be set to "option_resources."
- Right-Clicking on EnumItems and selecting +Add allows you to add different amounts for the resource option.
Give each entry a name. Note that the Display Name and Summary can be anything you wish, as this information is localized in the mod.
- The Key needs to be "resources_standard" as this is defined in the Tuning_simulation Attributes category.
- Make sure IsDefaultValue is turned "On" for this first value as this is the normal selection for players.
The rest of the resource options can use a variety of names, such as those shown below. To add each of these entries, steps 4 and 5 shown above.
Display Name: The name of this item that is displayed in the drop-down UI. In the below example, "200 Resources" and "500 Resources" are Display Names for two different items.
Summary: A summary that is displayed in the Overview tab of the Custom/Skirmish screen when this item is selected by the match host.
Key: The Enum key will become an entry in the Option table (which is in the Option Section table) that can be referenced by the Game Mode's .scar file. You can name this whatever you like as it adheres to scripting variable standards (e.g. no spaces). See the Game Modes scripting documentation for more details.
Setup: The DevOnly option can be turned on if you want this option to be hidden for players but visible when you launch the game with the -dev argument to test your Game Mode.
Value: IsDefaultValue can be set to True if you want this Enum item to be selected by default.
This section allows you to point your Win Condition at two relevant points.
Win Condition Script
This option determines which script is run when your Game Mode is played. When you create a new Game Mode it will create a new .scar script and point to it automatically.
This option allows you to specify a script that will run when your Game Mode is played instead of any scenario script that is already associated with the Crafted Map you are playing on, if one exists. This will run alongside your Win Condition script.
You can leave this blank if you do not have a use case for it.
General high level explanation for these settings goes here.
Include a bullet point list with pictures of the front end to show where these settings appear in the game.
The Name is a unique identifier attached to this Game Mode.
This option allows you to choose whether your mod can only be accessed if you launch with the -dev launch argument via Steam. We recommend you leave this option toggled to false.
This option allows you to choose how many teams that can be joined when your Game Mode is selected by the match host in Custom/Skirmish lobbies.
The PrecacheList option allows you to choose which assets you want to load alongside your Game Mode.
You can ignore this unless you are seeing units/objects appear as red cubes when playing your Game Mode. In this case, you will want to add those assets to the precache list so they are loaded properly.
This is most useful in cases where you may want players to play a certain civilization, but spawn in units from different civilizations. A civilization's assets are loaded by default, but assets of civilizations that are not in the match will not be. Those would need to be added to the pre-cache list, otherwise the units may appear as red cubes.
If IIT_PlayerCosmetic is selected, equipped player Monuments will appear in Town Centers. If nothing is selected, only the default town bell Monuments will appear.
The other IIT_ types are legacy options and do not provide functionality in Age of Empires IV.
Legacy functionality that is not leveraged in Age of Empires IV.
If this field takes a Tuning Pack GUID. If entered, when your Game Mode is selected and the match host has the Tuning Pack it will be selected automatically.