Overview
Dynamic City Naming is a Python component for modders that adds much more flexibility when defining the list of cities for a civilization.
In BTS citylists are sequential and unchanging, the same no matter what leader you're playing or the era you are in. Dynamic City Naming (DCN) uses a priority system instead. Each player will have an internal list of cities it is eligible to found, and each city in this list has an assigned 'priority' value which is determined by leader or civilization choice. When the player builds a city, priorities are adjusted for the current era, and the highest priority city is selected from the list. If there are several cities at the same priority one of them is chosen randomly.
Cities can be flagged as capitals and have several different names assigned to them so the one that best matches the player's civilization, leader, and the current era is chosen. Finally, once the city is built and named it is removed from the list of all other players (should it be on any), so it cannot be built again.
Note that this is not a standalone mod. It does not include adapted citylists for all BTS civilizations. But it does include instructions and examples for modders to create the dynamic citylists they may need.
Features
Installation
Note that DCN won't work if your mod is installed in the 'My Documents' (Windows) or 'Documents' (OSX) folder. It needs to be placed in the Mods folder found in the same location as the Beyond the Sword application. The same place as Afterworld, Road to War and the other mods that shipped with BTS are found. I hope to fix this eventually. There are 4 files to install:
Debugging
Although CIV4CityInfos.xml and CIV4CityListInfos.xml use XML formatting for familiarity, they are not true XML; there are no schema and they are not read by Civ4's XML parser. No errors will be generated at launch if tags are missing or broken, or if invalid data is entered. Useful debugging information is output to PythonDbg.log though; check there first if you encounter any issues (search for 'DCN').
There is also a global variable 'bDCNDebugging' in CvEventManager.py - set this to 'True' for more detailed output to PythonDbg.log.
Feedback
A discussion thread for Dynamic City Naming can be found here.
Credits
Thanks to The_J and God-Emperor for some borrowed code and advice.
Dynamic City Naming is a Python component for modders that adds much more flexibility when defining the list of cities for a civilization.
In BTS citylists are sequential and unchanging, the same no matter what leader you're playing or the era you are in. Dynamic City Naming (DCN) uses a priority system instead. Each player will have an internal list of cities it is eligible to found, and each city in this list has an assigned 'priority' value which is determined by leader or civilization choice. When the player builds a city, priorities are adjusted for the current era, and the highest priority city is selected from the list. If there are several cities at the same priority one of them is chosen randomly.
Cities can be flagged as capitals and have several different names assigned to them so the one that best matches the player's civilization, leader, and the current era is chosen. Finally, once the city is built and named it is removed from the list of all other players (should it be on any), so it cannot be built again.
Note that this is not a standalone mod. It does not include adapted citylists for all BTS civilizations. But it does include instructions and examples for modders to create the dynamic citylists they may need.
Features
- Capitals, cities, or even entire citylists can be assigned to individual leaders. Agamemnon could start with Mykenai, Perikles with Athens, Leonidas with Sparta, Alexander with Pella. Brennus could found the Celtic settlements from the continent while Boudica could found those from from the British Isles.
- Capitals, cities, or even entire citylists can be assigned to different eras. The Indians could found Vedic cities in the Ancient Era, Mauryan cities in the Classical era, Gupta cities in the Medieval Era, Mughal cities in the Renaissance Era, and so on.
- Cities can have different names under different civilizations, leaders, or eras. Stalin will found Stalingrad but the other Russian leaders will found Tsaritsyn - unless it's the Modern Era in which case it can be founded as Volgograd instead.
- Cities can be assigned to multiple civilizations or leaders and they won't be founded more than once, even if they have different names. The Greeks won't found Byzantium and the Turks won't found Istanbul if the Byzantines have already founded Constantinople. The Romans won't found Londinium if the English have founded London.
- You can define as few or as many cities as you need - the system falls back on the list defined in CIV4CivilizationInfos.xml once it runs out of cities for a player.
- Renaming of cities is supported; DCN will try and match the new name with cities you've defined.
- Common non-ASCII characters in city names are supported.
Installation
Note that DCN won't work if your mod is installed in the 'My Documents' (Windows) or 'Documents' (OSX) folder. It needs to be placed in the Mods folder found in the same location as the Beyond the Sword application. The same place as Afterworld, Road to War and the other mods that shipped with BTS are found. I hope to fix this eventually. There are 4 files to install:
<your mod>/Assets/XML/Civilizations/CIV4CityInfos.xml
This file is used to define settings for individual cities. Instructions and examples are in the file itself.
<your mod>/Assets/XML/Civilizations/CIV4CityListInfos.xml
This file is used to define settings for groups of cities. Instructions and examples are in the file itself.
<your mod>/Assets/Python/DynamicCityNaming.py
You do not need to change anything in this file.
<your mod>/Assets/Python/CvEventManager.py
You need to merge the DCN changes in this file into your mod's existing CvEventManager.py. Each section is labelled, search for "Dynamic City Naming". In the first section there are 2 path variables that show DCN where to find its XML files. You need to change these to match the name of your mod.
This file is used to define settings for individual cities. Instructions and examples are in the file itself.
<your mod>/Assets/XML/Civilizations/CIV4CityListInfos.xml
This file is used to define settings for groups of cities. Instructions and examples are in the file itself.
<your mod>/Assets/Python/DynamicCityNaming.py
You do not need to change anything in this file.
<your mod>/Assets/Python/CvEventManager.py
You need to merge the DCN changes in this file into your mod's existing CvEventManager.py. Each section is labelled, search for "Dynamic City Naming". In the first section there are 2 path variables that show DCN where to find its XML files. You need to change these to match the name of your mod.
Debugging
Although CIV4CityInfos.xml and CIV4CityListInfos.xml use XML formatting for familiarity, they are not true XML; there are no schema and they are not read by Civ4's XML parser. No errors will be generated at launch if tags are missing or broken, or if invalid data is entered. Useful debugging information is output to PythonDbg.log though; check there first if you encounter any issues (search for 'DCN').
There is also a global variable 'bDCNDebugging' in CvEventManager.py - set this to 'True' for more detailed output to PythonDbg.log.
Feedback
A discussion thread for Dynamic City Naming can be found here.
Credits
Thanks to The_J and God-Emperor for some borrowed code and advice.