- Oct 14, 2022
- 452
- 3.984
Mods [WIP]
The current modding functionality is a work-in-progress. Check out the example mods and the additional information below to get started with creating mods in Millennia!
Examples:
Installing Mods
Mods can be added to the game by subscribing to them in the Steam Workshop https://steamcommunity.com/app/1268590/workshop/ . After subscribing to an item in the workshop, it will be downloaded and available to use in game. You must re-launch the game to pick up any new mods that you subscribe to.
You can view, enable, and disable mods within the game by clicking the “Mods” button on the main menu
Creating Mods
To create and test your mods before uploading them to the Steam Workshop, you must create a “Mods” folder where the game’s data is:
C:\Users\<username>\AppData\LocalLow\CPromptGames\Millennia\Mods
Sub-folders in this “Mods” directory should contain the individual mods you are working on.
Folder Structure
A mod can contain the following sub-folders depending on the nature of the mod, and these sub-folders are case-sensitive.
Creating a Custom Nation
A Custom Nation mod should contain the following:
The Flags sub-folder needs to have an xml file that lists the flags that are a part of the mod and the flag images:
One custom nation needs a regular flag and a splinter flag, and the splinter flag should be named as <FlagName>_SPLINTER. The flag images should be 256x128 to show up in the game correctly.
Names sub-folder can contain one or more xml file that contains the city and town names for your custom nation. It should follow the following format:
The IDs for the name tables should be unique and the table types should be set correctly based on whether the names are for cities or towns. NTT_City is for city names and NTT_Town is for town names. The names themselves should begin and end with $$. You will need to add various strings for your nation for each city name, town name, the nation name, and the splinter nation name:
The CustomNations sub-folder can contain one or more custom nation xml. An example custom nation xml can be seen below:
NationName is the name that will show up in game for your nation. The CityNameCollection and TownNameCollection should have the IDs of the name tables you created. Flag should be the name of the flag you placed in the Flags sub-folder.
Sprites
Any other images (png or jpg) you want to use in your mod should be placed in the Sprites sub-folder as well as a SpriteInfo.xml file that contains basic information about the sprites.
Image size guide:
Creating and Modifying Decks
To change existing decks, you must specify what deck it is you want to change. You do this by the xml tag:
By default, cards inside a deck that have the <AppendToDeck> xml tag will be added to that existing deck. To modify existing cards within that deck you are changing, you can use the following tags:
If you want to add a deck, and not just modify an existing one, then simply omit the <AppendToDeck> tag from whatever deck xml you have in your Decks sub-folder.
Strings
Once you get your mod working in-game, you will need to create a strings xml in the Strings sub-folder to fill in the text that you want to go along with your mod.
Creating Assets in Unity - [DOWNLOAD MOD PACKAGE HERE]
Assets for mods are loaded through Unity’s Addressables system. To create assets for your mods you must install Unity 2019.4.40f1. Create a new project after installing Unity and import the mod tools package and install the Addressables package
After the project has been created, you must change some settings with Addressables. Window->Asset Management->Addressables->Settings
Build Remote Catalog should be checked. Load path must be set to <custom> and with {MOD_PATH} as the value. Build path is the path where the built catalog and asset bundles will be placed. This path can be set to any folder you choose, but you’ll want to remember that location
The mod tools package includes examples for a unit, a landmark, and an improvement and scripts that you’ll need to attach to prefabs so that they’ll work correctly in game.
Any asset you want to include in your mod from Unity needs to be marked as “Addressable”
Once the assets have been marked, you can build the addressables by navigating to Window->Asset Management->Addressables->Groups and then from that window Build->New Build->Default Build Script. The folder that you set as the Build Path will contain the asset bundles and catalog files you need to copy and paste into the Assets folder of your mod.
Creating a Unit
To create a unit, you must attach the AUnitMemberModel.cs script as a component on the unit prefab that you create. The script is used to configure how the unit is presented in the game and for mapping animations to in-game actions.
Animations that are used for your unit need to be marked as Legacy to work in game
You must also define the unit’s stats and other data in xml.
The UnitMemberPrefab should be set to the addressable key from Unity:
And the Portrait should be set to the sprite image that you place in the Sprites folder.
Creating a Landmark
A landmark does not require any scripts to be attached to it. Create a prefab with the model you want to use for your landmark and follow the instructions to export it as an addressable. You’ll need a landmark xml file in the Landmarks sub-folder and an entity xml file in the Entities sub-folder.
Make sure that the landmark EntityInfo definition has the EntityPrefab data set to the value of the Addressable path from Unity
The landmark entry in the landmark xml should have its MapTile value be the name of the ID of the landmark entity.
Creating an Improvement
An improvement prefab must have the AEntityBuilding and AGameData scripts attached to it to work in-game. You must define the improvement’s data in xml
The IconName should be set to the sprite that you want to show for this improvement and the EntityPrefab should be set to the key of the addressable from Unity.
Uploading Mods to the Steam Workshop
Local mods will be listed in the Mods UI and have an Upload button that is used for uploading to the workshop.
Clicking this button will bring up the upload dialog. Items are required to have a title, but it is a good idea to give your item a preview image and description.
After the item is uploaded, its default visibility will be hidden. You should go to the item’s detail page to make any further edits and to change the visibility to public when ready.
If you are wanting to update an existing mod that you’ve already uploaded, you should fill in the “Existing Steam ID” field with the existing item’s ID. This can be found on the item’s detail page:
Hello Modders!
We have decided to let you see the XML files for Millennia, as they normally aren't available to be seen due to the way the game is normally released. Have a fun time browsing through the files and seeing what you can come up with. This is similar to how on Paradox Grand Strategy games we have a lot of script files available to modders to look through and alter for their mods!You can see the attached file for said XML files!
Happy browsing modders! See the attached ZIP file for the files!
The current modding functionality is a work-in-progress. Check out the example mods and the additional information below to get started with creating mods in Millennia!
Examples:
- Custom Nation - https://steamcommunity.com/sharedfiles/filedetails/?id=3294656708
- Landmark - https://steamcommunity.com/sharedfiles/filedetails/?id=3304663573
- Unit, Improvement, Tech - https://steamcommunity.com/sharedfiles/filedetails/?id=3304668210
- Gouvernment - https://steamcommunity.com/sharedfiles/filedetails/?id=3306586235
Installing Mods
Mods can be added to the game by subscribing to them in the Steam Workshop https://steamcommunity.com/app/1268590/workshop/ . After subscribing to an item in the workshop, it will be downloaded and available to use in game. You must re-launch the game to pick up any new mods that you subscribe to.
You can view, enable, and disable mods within the game by clicking the “Mods” button on the main menu

Creating Mods
To create and test your mods before uploading them to the Steam Workshop, you must create a “Mods” folder where the game’s data is:
C:\Users\<username>\AppData\LocalLow\CPromptGames\Millennia\Mods
Sub-folders in this “Mods” directory should contain the individual mods you are working on.
Folder Structure
A mod can contain the following sub-folders depending on the nature of the mod, and these sub-folders are case-sensitive.

Creating a Custom Nation
A Custom Nation mod should contain the following:
- A custom nation xml file in the CustomNations sub-folder
- A flag image (png or jpg) in the Flags sub-folder
- A names xml file if you want to create custom town/city names for the custom nation placed in the Names sub-folder
- A string xml file
The Flags sub-folder needs to have an xml file that lists the flags that are a part of the mod and the flag images:


One custom nation needs a regular flag and a splinter flag, and the splinter flag should be named as <FlagName>_SPLINTER. The flag images should be 256x128 to show up in the game correctly.
Names sub-folder can contain one or more xml file that contains the city and town names for your custom nation. It should follow the following format:

The IDs for the name tables should be unique and the table types should be set correctly based on whether the names are for cities or towns. NTT_City is for city names and NTT_Town is for town names. The names themselves should begin and end with $$. You will need to add various strings for your nation for each city name, town name, the nation name, and the splinter nation name:

The CustomNations sub-folder can contain one or more custom nation xml. An example custom nation xml can be seen below:

NationName is the name that will show up in game for your nation. The CityNameCollection and TownNameCollection should have the IDs of the name tables you created. Flag should be the name of the flag you placed in the Flags sub-folder.
Sprites
Any other images (png or jpg) you want to use in your mod should be placed in the Sprites sub-folder as well as a SpriteInfo.xml file that contains basic information about the sprites.

Image size guide:
- Unit Portraits – 256 x 256
- Improvement Icon – 256 x 256
- Tech image – 256 x 256
- National Spirit Icon small – 64 x 64
- National Spirit Icon – 180 x 60
- National Spirit Portrait – 640 x 1080 (should also have transparent background)
- Event images (innovation, chaos) – 16:9 aspect ratio
Creating and Modifying Decks
To change existing decks, you must specify what deck it is you want to change. You do this by the xml tag:

By default, cards inside a deck that have the <AppendToDeck> xml tag will be added to that existing deck. To modify existing cards within that deck you are changing, you can use the following tags:

If you want to add a deck, and not just modify an existing one, then simply omit the <AppendToDeck> tag from whatever deck xml you have in your Decks sub-folder.
Strings
Once you get your mod working in-game, you will need to create a strings xml in the Strings sub-folder to fill in the text that you want to go along with your mod.


Creating Assets in Unity - [DOWNLOAD MOD PACKAGE HERE]
Assets for mods are loaded through Unity’s Addressables system. To create assets for your mods you must install Unity 2019.4.40f1. Create a new project after installing Unity and import the mod tools package and install the Addressables package

After the project has been created, you must change some settings with Addressables. Window->Asset Management->Addressables->Settings

Build Remote Catalog should be checked. Load path must be set to <custom> and with {MOD_PATH} as the value. Build path is the path where the built catalog and asset bundles will be placed. This path can be set to any folder you choose, but you’ll want to remember that location
The mod tools package includes examples for a unit, a landmark, and an improvement and scripts that you’ll need to attach to prefabs so that they’ll work correctly in game.
Any asset you want to include in your mod from Unity needs to be marked as “Addressable”

Once the assets have been marked, you can build the addressables by navigating to Window->Asset Management->Addressables->Groups and then from that window Build->New Build->Default Build Script. The folder that you set as the Build Path will contain the asset bundles and catalog files you need to copy and paste into the Assets folder of your mod.

Creating a Unit
To create a unit, you must attach the AUnitMemberModel.cs script as a component on the unit prefab that you create. The script is used to configure how the unit is presented in the game and for mapping animations to in-game actions.

Animations that are used for your unit need to be marked as Legacy to work in game

You must also define the unit’s stats and other data in xml.

The UnitMemberPrefab should be set to the addressable key from Unity:

And the Portrait should be set to the sprite image that you place in the Sprites folder.
Creating a Landmark
A landmark does not require any scripts to be attached to it. Create a prefab with the model you want to use for your landmark and follow the instructions to export it as an addressable. You’ll need a landmark xml file in the Landmarks sub-folder and an entity xml file in the Entities sub-folder.
Make sure that the landmark EntityInfo definition has the EntityPrefab data set to the value of the Addressable path from Unity


The landmark entry in the landmark xml should have its MapTile value be the name of the ID of the landmark entity.

Creating an Improvement
An improvement prefab must have the AEntityBuilding and AGameData scripts attached to it to work in-game. You must define the improvement’s data in xml

The IconName should be set to the sprite that you want to show for this improvement and the EntityPrefab should be set to the key of the addressable from Unity.
Uploading Mods to the Steam Workshop
Local mods will be listed in the Mods UI and have an Upload button that is used for uploading to the workshop.

Clicking this button will bring up the upload dialog. Items are required to have a title, but it is a good idea to give your item a preview image and description.

After the item is uploaded, its default visibility will be hidden. You should go to the item’s detail page to make any further edits and to change the visibility to public when ready.
If you are wanting to update an existing mod that you’ve already uploaded, you should fill in the “Existing Steam ID” field with the existing item’s ID. This can be found on the item’s detail page:

Hello Modders!
We have decided to let you see the XML files for Millennia, as they normally aren't available to be seen due to the way the game is normally released. Have a fun time browsing through the files and seeing what you can come up with. This is similar to how on Paradox Grand Strategy games we have a lot of script files available to modders to look through and alter for their mods!You can see the attached file for said XML files!
Happy browsing modders! See the attached ZIP file for the files!
Attachments
Last edited by a moderator:
- 1
- 1