• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Showing developer posts only. Show all posts in this thread.

PDXKatten

Community Programs Specialist
Administrator
Paradox Staff
Moderator
QA
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
1.png


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.
2.png


Creating a Custom Nation

A Custom Nation mod should contain the following:
  1. A custom nation xml file in the CustomNations sub-folder
  2. A flag image (png or jpg) in the Flags sub-folder
  3. A names xml file if you want to create custom town/city names for the custom nation placed in the Names sub-folder
  4. 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:
3.png


4.png


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:
5.png


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:
6.png


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


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.
8.png


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:
9.png


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:
10.png


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.
11.png

12.png


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
13.png


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


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”
15.png


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.

16.png


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.
17.png


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


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


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


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
21.png

22.png


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


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
24.png


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.
25.png


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.
26.png


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:
27.png






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

  • Millenia_XML_Examples.zip
    629,6 KB · Views: 0
Last edited by a moderator:
  • 1
  • 1Like
Reactions:
Each "Personality" is controlled by two "Attributes"
Attributes affect how likely they are to send/accept Diplomatic Messages (Send Gift, Open Borders, Open Embassy, etc.)

Aggressive - More likely to declare war/resistant to ending wars & is hostile towards more powerful Nations

Reserved - Fearful of more powerful Nations & less likely to take "mean" diplomatic actions (Threaten, Demand, etc.)

Opportunist - More likely to take "mean" diplomatic actions & Fearful of more powerful Nations

Militant - More likely to take "mean" diplomatic actions & more likely to declare war/resistant to ending wars

Isolationist - Less likely to accept Bilateral agreements & less likely to declare war/willing to end wars

Cooperative - More likely to send "nice" diplomatic actions (Gifts) & extra friendly towards Nations with positive Diplomatic Opinion

Careful - Extra friendly towards Nations with positive Diplomatic Opinion & fearful of more powerful Nations

Diplomat - Less hostile towards Nations with negative Diplomatic Opinion & is more likely to accept Bilateral agreements

All AI Personalities are affected by many factors, it's just that each Personality emphasize two factors more