View Full Version : Dynamic City Naming


Xyth
Jul 11, 2012, 05:05 PM
Dynamic city naming is something I've wanted to implement ever since I started playing Civ, and I've decided to tackle it for 1.19 as I think my Python skills are up to the task now.

In Civ4 (and thus HR), citylists are static; you found the first city on a civilization's list, then the next, and so on. This is not only boring, it makes for many ahistorical situations with certain leaders, eras, and other factors. Here's a list of what I hope to achieve with this feature:



Leaders in the same civilization can have different capitals. For example, Agamemnon would start with Mykenai, Pericles with Athens, Leonidas with Sparta, Alexander with Pella.


Cities (or groups of cities) can have different priorities for different leaders. Goslar is much more likely to be founded by Karolus or Maxmillian than it is by Frederick or Bismarck. Peter and Catherine are much more likely to found the Siberian cities than Yaroslav.


The era you are in can also alter the priority for a city or group of cities. The Nubians are unlikely to found Khartoum in the early eras, but are very likely to from the Industrial era onwards. The chance for the Persians to found Ctesiphon diminishes after the Medieval era. Era-appropriate barbarian cities too.


Cities that belonged to several different civilizations won't get founded more than once. The Greeks won't found Byzantium and the Turks won't found Istanbul if the Byzantines have already founded Constantinople.


Cities can have different names under different 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'll be founded as Volgograd instead.


I've made good progress so far and I'll probably also release this as a module for other modders to use - which will also help with finding and fixing bugs. Cities and city groups can be added in XML format so it's easily tailored to suit. it will also fall back on the standard citylists whenever a civilization's priority list is empty, so there's no need to convert entire citylists at once.

Let me know what you think or if you have any suggestions.

Opera
Jul 11, 2012, 06:21 PM
That sounds very interesting.

From what I gather, which name gets used is now based on a set of factors and left to some chance rather than picked of off a list, right?

kiwitt
Jul 11, 2012, 06:36 PM
That sounds like an excellent plan.

Xyth
Jul 11, 2012, 07:33 PM
That sounds very interesting.

From what I gather, which name gets used is now based on a set of factors and left to some chance rather than picked of off a list, right?

Pretty much. 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. In most cases there will be several such cities at the same priority so one of them is chosen randomly.

Cities can have several different names assigned to them so the one that best matches the player's civ, leader, and the current era is chosen. Finally, once the city is built and named the city is removed from the eligibility list of all other players (if on any), so it can't be built again, even if destroyed.

Capitals are chosen in the same way, but only some cities are flagged as capitals so its a much smaller list to choose from.

Boggy
Jul 12, 2012, 04:24 AM
That sounds nice:)

Eucalyptus
Jul 12, 2012, 04:24 AM
Dynamic city naming is something I've wanted to implement ever since I started playing Civ, and I've decided to tackle it for 1.19 as I think my Python skills are up to the task now.

Finally, once the city is built and named the city is removed from the eligibility list of all other players (if on any), so it can't be built again, even if destroyed.

Let me know what you think or if you have any suggestions.

This sounds good, and ambitious to implement!


Check: It precludes assigning one's own names, yes? No more founding "Donaldduckville" and no more renaming cities at will? If I can assign my own names, then, even if I am not English, I can name a city "York" and stop England from using the name.

Corollary: After conquest, cities cannot be renamed, even if the majority of their culture is of the conqueror. That's a pity!


Request: Could the founding of each new city come with a pull-down menu listing the top (say) 20 currently-available name choices?

ales_
Jul 12, 2012, 04:35 AM
This idea is very good, but for the beginning I think you should rewrite all citylists (that you haven't rewrite yet).

Xyth
Jul 12, 2012, 04:45 AM
Check: It precludes assigning one's own names, yes? No more founding "Donaldduckville" and no more renaming cities at will? If I can assign my own names, then, even if I am not English, I can name a city "York" and stop England from using the name.

Corollary: After conquest, cities cannot be renamed, even if the majority of their culture is of the conqueror. That's a pity!

I haven't yet worked out how city renaming will (or won't) fit into the system. Once I'm a bit further along I'll let you know, there's a few technical hurdles to jump first.

Request: Could the founding of each new city come with a pull-down menu listing the top (say) 20 currently-available name choices?

That idea crossed my mind but such a popup can break multiplayer if not coded well. I won't attempt it at this stage in order to avoid the added complexity. Perhaps later though.

Xyth
Jul 12, 2012, 04:48 AM
This idea is very good, but for the beginning I think you should rewrite all citylists (that you haven't rewrite yet).

That's actually the motivation for creating this system. I started reviewing a few citylists for 1.19 and found the limitations of a sequential list frustrating. Once I've got it working, reviewing citylists becomes a lot more flexible and fun!

Absolution
Jul 13, 2012, 03:13 PM
And here is the return of the Holy Roman citylist!

A great idea!
Brilliant!

Now you can divide the Turks, can divide Sumeria, can make Susa a city of 3 civs, and divide the celts and the Phoenicians!

But you'll have alot of work in China and India! XD

If you need, I can help you setting three ages of Israeli citylist:
- Ancient and biblical.
- Hellenist era (2nd temple). Maybe unique for Herod(?).
- Modern Zionist cities.


I would also like to see what you will do with Perisa. I'm very interested in their post-Achaemenid history.

But you can't make Peter and Cathrine find Siberian cities. They'll have to find Moscow or Kiev before that. I think the Siberian cities will have to be at least 6th or 7th in the list. If not more than that.

Azoth
Jul 14, 2012, 12:51 AM
Excellent!

I didn't mention this in my Annal but the city names for India are less than ideal:
Delhi, Bombay, Vijayanagara, Pataliputra, Varanasi, Agra...
They're all over the place: geographically and chronologically!

I'm looking forward to dynamic city naming.

davidtylr
Jul 14, 2012, 07:22 PM
Does the dynamic city naming factors in wether the city is on the coast or not?

Xyth
Jul 14, 2012, 11:20 PM
Now you can divide the Turks, can divide Sumeria, can make Susa a city of 3 civs, and divide the celts and the Phoenicians!

Yep! The system will make a big difference for civs like these.

But you'll have alot of work in China and India! XD

Indeed. It will probably take several versions of HR to work through every civ.

If you need, I can help you setting three ages of Israeli citylist:
- Ancient and biblical.
- Hellenist era (2nd temple). Maybe unique for Herod(?).
- Modern Zionist cities.

Help like this is certainly welcome.

I would also like to see what you will do with Perisa. I'm very interested in their post-Achaemenid history.

Yeah, a lot to sort there. I'd like to add a fourth Persian leader at some point too, one from a later period of history.

But you can't make Peter and Cathrine find Siberian cities. They'll have to find Moscow or Kiev before that. I think the Siberian cities will have to be at least 6th or 7th in the list. If not more than that.

The Siberian cities wouldn't have higher priority than the key western cities, but they'd be set to higher priority for Peter and Catherine than they would for Yaroslav.

I didn't mention this in my Annal but the city names for India are less than ideal:
Delhi, Bombay, Vijayanagara, Pataliputra, Varanasi, Agra...
They're all over the place: geographically and chronologically!

Yep, HR still uses the terrible Firaxis city list for India, I never got very far in remaking it. That should change once this system is in place.

Does the dynamic city naming factors in wether the city is on the coast or not?

No, but it could, as well as other geographical factors. These are things that could be added at a later time; best to keep the system straight forward to begin with.

Xyth
Jul 20, 2012, 05:25 PM
Progress on this is going very well, the system is written and fully functional. Renaming of cities is supported. The one problem still existing is that certain non-standard ASCII characters in a city's name can sometimes throw errors. Working on it.

Packherd2
Aug 12, 2012, 09:45 PM
Very, very cool!

I would note that there are LOTS of possible iterations regarding the current New World civs. The Sioux, in particular, need some help.

Absolution
Sep 07, 2012, 07:41 AM
What are your plans regarding to the Persian city list?

The important Achaemenid cities were Pasargadae, Ecbatana, Persepolis and Susa.
Asaak and Ctesiphon rose to prominence in the Parthian era.
So are you willing to include all of those in the "ancient era" list, and divide it between the leaders?
I suggest this:
Cyrus's list: Pasargadae, Susa, Ecbatana, ...(the rest can be other cities from the existing list)..
Darius's list: Persepolis, Susa, Pasargadae, ...(the rest can be other cities from the existing list)..
Chosroes's list: Ctesiphon, and other cities like Nisbis, Herat, Nishapur, Bishapur...

But the most important thing is to add at least one Islamic leader.
You can add Mahmud of Ghazni, Muhammad Ghori, Abbas I, and maybe Nader Shah.
A citylist for these eras should be reconsidered only after another leader is added.

Xyth
Sep 07, 2012, 03:34 PM
I haven't done a lot of work on the Persian list yet, but what I have done matches your suggestions. The list needs considerable reworking; as usual, Firaxis have made some very unusual or blatantly incorrect selections. I definitely want to add a 4th leader to Persia, most probably Abbas I.

In general, I'm not going to have time to completely rework most city lists for 1.19, but I'll at least try and have capitals and a few key cities set for each leader.

lindsay40k
Nov 04, 2012, 08:12 PM
This is a great idea, I like it very much!

Would it be possible to have cities dynamically rename? Say, when certain eras begin, Civics change, or events such as city capture happen? St Petersburg, London, York and Istanbul are all obvious candidates that come to mind.

ales_
Nov 05, 2012, 03:20 AM
DCN's possibilities are listed here: http://forums.civfanatics.com/showthread.php?p=11691425#post11691425

Xyth
Nov 07, 2012, 03:26 AM
This is a great idea, I like it very much!

Would it be possible to have cities dynamically rename? Say, when certain eras begin, Civics change, or events such as city capture happen? St Petersburg, London, York and Istanbul are all obvious candidates that come to mind.

It doesn't currently but it wouldn't be too difficult to add such functionality in the future. Eras and change of ownership at least; while name changes with civics are possible, it's a lot more complex.

lindsay40k
Dec 09, 2012, 06:59 AM
Is this the place to report oddities in the city names? Ezana of Axum (Ethiopia) just put down Roha as his capital. Roha is a small town in India :confused: - EDIT: answered below :)

Also, the Iroquois seem to keep founding Salamanca as their Capital, regardless of leader. Surely Buffalo Creek?

ales_
Dec 09, 2012, 07:53 AM
Is this the place to report oddities in the city names? Ezana of Axum (Ethiopia) just put down Roha as his capital.
http://en.wikipedia.org/wiki/Lalibela

Xyth
Dec 09, 2012, 07:21 PM
Is this the place to report oddities in the city names? Ezana of Axum (Ethiopia) just put down Roha as his capital. Roha is a small town in India :confused: - EDIT: answered below :)

Looks like I neglected to flag the capitals for the Ethiopian leaders correctly. Ezana should have Aksum, Lalibela should have Roha, and Selassie should have Addis Ababa. At the moment it's a (weighted) random choice between the 3 cities. Fixed for 1.20.

Also, the Iroquois seem to keep founding Salamanca as their Capital, regardless of leader. Surely Buffalo Creek?

The Iroquois are one of the civilizations I've not applied dynamic city naming to yet. I think their list might be straight out of Civ3, basically unchanged. If someone wants to improve it or make a better one, feel free! They're not a civilization I know a lot about.

lindsay40k
Dec 10, 2012, 11:11 AM
My previous googling didn't bring up Salamanca, NY. The city names make sense to me now :)

Nightstar
Jan 16, 2013, 01:29 PM
In my current 1.19 game (save attached in this post (http://forums.civfanatics.com/showpost.php?p=12151473&postcount=251)), Rome and Syracusa were captured by the raging barbarians. Caesar then went on to found two new cities with the same names, even though the first two were still in existence. (And the first Rome was later captured and liberated by the French, giving Caesar two cities with the same name!)

Xyth
Jan 18, 2013, 06:15 PM
In my current 1.19 game (save attached in this post (http://forums.civfanatics.com/showpost.php?p=12151473&postcount=251)), Rome and Syracusa were captured by the raging barbarians. Caesar then went on to found two new cities with the same names, even though the first two were still in existence. (And the first Rome was later captured and liberated by the French, giving Caesar two cities with the same name!)

Hmm, sound like I've neglected to check barbarian cities when looking to see if a name is in use already. Investigating.

Absolution
Apr 24, 2013, 02:59 PM
I was taking a look at the XMLs and found this:
<CityName>Camulodunon</CityName>
<Civilizations>
<Civilization>
<CivilizationType>CIVILIZATION_CELT</CivilizationType>
<CivilizationCityName>Camulodunon</CivilizationCityName>
<bCivilizationCapital>1</bCivilizationCapital>
<iCivilizationPriority>2</iCivilizationPriority>
</Civilization>
<Civilization>
<CivilizationType>CIVILIZATION_ENGLAND</CivilizationType>
<CivilizationCityName>Colchester</CivilizationCityName>
<bCivilizationCapital>1</bCivilizationCapital>
<iCivilizationPriority>3</iCivilizationPriority>

I understood that it mean that Camulodunon can not be found if Colchester already exists.
But does it mean that the name is switched when England captures Camulodunon?

Xyth
Apr 24, 2013, 03:20 PM
Does it mean that Camulodunon can not be found if Colchester already exists, even though they have a different name?
And does it mean that the name is switched when England captures Camulodunon?

The Celts cannot found Camulodunon if the English have already founded Colchester, and vice versa. If the Celts are lead by Boudica, she will found Camulodunon as her capital. Colchester is not meant to be flagged as a potential capital for England, I'll fix that.

Camulodunon won't automatically be renamed Colchester if the English capture it from the Celts (or vice versa), but that's something I might add in the future.

lindsay40k
Apr 25, 2013, 07:02 PM
The Celts cannot found Camulodunon if the English have already founded Colchester, and vice versa. If the Celts are lead by Boudica, she will found Camulodunon as her capital. Colchester is not meant to be flagged as a potential capital for England, I'll fix that.

Camulodunon won't automatically be renamed Colchester if the English capture it from the Celts (or vice versa), but that's something I might add in the future.

I'd love to see this and for it to include Londinium/London, Jorvik/York, Tenochtitlan/Mexico City, Khanbalik/Beijing, Waset/Thebes, etc.

It's also apply to, say, Edo/Tokyo, if you had different Japanese factions, right? That'd add interest to civil war type scenarios and situations, I think :)

What about expanding this to make cities automatically rename to how they are known in the mother tongue of a conquering nation? If the French capture Londinium from Rome, they'd rename it Londres; then when the Polish grab it, it's Londyn. Finally, the Celts claim the city, and it is henceforth known as Lunnainn :lol:

ales_
Apr 26, 2013, 01:43 AM
What about expanding this to make cities automatically rename to how they are known in the mother tongue of a conquering nation?
I think this is a good idea but translating each city of each civililization in 50 other languages is a very difficult task.

Xyth
Apr 26, 2013, 03:33 AM
I'd love to see this and for it to include Londinium/London, Jorvik/York, Tenochtitlan/Mexico City, Khanbalik/Beijing, Waset/Thebes, etc.

Development of 1.20 is dragging on far longer than I ever intended but I'll have a look and see how complicated it would be to code. It shouldn't be too bad given the really hard part - the database structure - is already up and running. Otherwise, 1.21.

It's also apply to, say, Edo/Tokyo, if you had different Japanese factions, right? That'd add interest to civil war type scenarios and situations, I think :)

Leader naming takes priority over civilization naming when founding cities; assuming I don't have to do anything too different when coding it this would probably happen automatically in such a situation. Assuming Edo/Tokyo is in the database appropriately of course.

What about expanding this to make cities automatically rename to how they are known in the mother tongue of a conquering nation? If the French capture Londinium from Rome, they'd rename it Londres; then when the Polish grab it, it's Londyn. Finally, the Celts claim the city, and it is henceforth known as Lunnainn :lol:

I think this is a good idea but translating each city of each civililization in 50 other languages is a very difficult task.

I don't think it's worth doing for translation purposes, but certainly for civs that are geographically close, invaded, or had some other notable connection. So in the case of London, I reckon it should rename for the Celts, Romans, Scandinavians (assuming they had/have a different name, anyone know?), and perhaps the French.

Xyth
Apr 26, 2013, 05:28 AM
Actually it was pretty straightforward, hardest part was reacquainting myself with the code. I still need to add a message to alert players about the renaming and I need to figure out if I can avoid cities being renamed when razed rather than kept. Other than that, done.

Next step is to flesh out the database more, feel free to contribute suggestions.

ales_
Apr 26, 2013, 08:43 AM
So in the case of London, I reckon it should rename for the Scandinavians (assuming they had/have a different name, anyone know?).
A short research showed that it's Lundúnaborg.

lindsay40k
Apr 26, 2013, 11:24 AM
Fair point about doing it for every city for everybody being a bit surplus to requirements. That said, how's about making all old World civs with a history of transatlantic imperialism rename New World cities to colonial equivalents upon capture? So, say, regardless of who conquers Cahokia, as long as they had a New World colony IRL, it becomes St. Louis?

Absolution
Apr 26, 2013, 01:49 PM
I started working on the Hebrew citylist.
I divide it like this:
- Pre-monarchic cities (circa Iron Age I)
- Monarchic cities (circa Iron Age II)
- Hashmonean/Herodian cities (Classical era)
- Zionist cities (Industrial/modern era)

The thing is that there are several cities which had been founded during the pre-monarchic period (Joshua/Judges), but rose to prominence in the monarchic period.
Should I put them in the pre-monarchic anyway?

And in every period, should I list the cities by importance, or by oldness?


BTW, I don't know when I will finish it, and it might be completed only for 1.21.

Xyth
Apr 26, 2013, 05:57 PM
Fair point about doing it for every city for everybody being a bit surplus to requirements. That said, how's about making all old World civs with a history of transatlantic imperialism rename New World cities to colonial equivalents upon capture? So, say, regardless of who conquers Cahokia, as long as they had a New World colony IRL, it becomes St. Louis?

Yeah, stuff like that can be done easily enough.

I started working on the Hebrew citylist.
I divide it like this:
- Pre-monarchic cities (circa Iron Age I)
- Monarchic cities (circa Iron Age II)
- Hashmonean/Herodian cities (Classical era)
- Zionist cities (Industrial/modern era)

Sounds great.

The thing is that there are several cities which had been founded during the pre-monarchic period (Joshua/Judges), but rose to prominence in the monarchic period.
Should I put them in the pre-monarchic anyway?

And in every period, should I list the cities in an by importance, or by oldness?

With dynamic city naming's priority system we can account for both age and importance. What I suggest you do is list such cities multiple times - once in each of your defined eras where the city existed or was relevant. Put (Low), (Medium), or (High) after each entry to indicate how important the city was for that era.

For example, I imagine Jericho would probably appear in your pre-monarchic list as high priority, medium priority in your Monarchic and Hasmonean/Herodian lists, and either low priority or not appear at all in the Zionist list.

I can then use that information to assign priorities and build a dynamic citylist for Israel.

BTW, I don't know when I will finish it, and it might be completed only for 1.21.

Not a problem.

Absolution
Apr 27, 2013, 03:27 AM
For example, I imagine Jericho would probably appear in your pre-monarchic list as high priority, medium priority in your Monarchic and Hasmonean/Herodian lists, and either low priority or not appear at all in the Zionist list.

I can then use that information to assign priorities and build a dynamic citylist for Israel.

I'll add the priorities later.
But when I make the pre-monarchic list, should I put Jeriho at the top of the list, or should I put the most ancient cities at the top of the list?

Because I saw that you put Eridu (one of the world's earliest cities) first in the Sumerian citylist.

Xyth
Apr 27, 2013, 04:55 AM
I'll add the priorities later.
But when I make the pre-monarchic list, should I put Jeriho at the top of the list, or should I put the most ancient cities at the top of the list?

Because I saw that you put Eridu (one of the world's earliest cities) first in the Sumerian citylist.

Cities of the same priority are selected randomly. So although Eridu is at the top of that particular list (in CIV4CityListInfos.xml), the cities in that section (all priority 3 for Sumer) can be chosen in any order. My advice is to sort cities into their eras, and then rank them by importance within that era.