Modmodding Q&A Thread

No, in that case I would recommend copying only the resources to your own mod and continue from there.
 
After my most recent Windows 11 update, GameFontEditor stopped working - it starts up and I can see the application in my taskbar, but the window won't display on any of my monitors. It's not off-screen; moving it doesn't help. The preview on hover-over is a window with an all black content frame. Alt-tabbing to it doesn't work either. Just wondering if anyone else has encountered this.

Turns out it was off screen - somehow. Please excuse my incompetence.
 
Last edited:
I've been out of the loop for a bit, but I'm in the process of updating my mod-mod-mod to use the "new" 1.18 Cities.csv and CityNameTranslations.py systems. Is there a post going over the workflow about how best to edit these files? I can see how they work internally, but it seems very hard to manually create. I'm assuming I'm missing a step of automation somewhere. Is there metadata embedded in the .ods file about translations? I see there's comments about possible translations, but not in a unified format. Thanks!
 
The .ods file isn't used directly, I only use it for ease of editing and then export the content to the corresponding .csv file that is being read by the game.

The basic principle of how it works is that the base name for a city comes from the Cities.csv map, and the CityNameTranslations.py defines the translations for each language. In some cases the language has multiple translations that are associated with a condition. In that case they are tried in order until the first one is found where the condition is satisfied. Translations marked as found, rename, or relocate permanently change the base name of the tile.

There is a lot of extra logic involved to determine fallback languages and fallback city names in case your civ's language isn't defined for the current tile, but you can generally ignore that when defining translations.

Is there something in particular that you think is missing?
 
No, it's not missing anything, it seems very rich in features. I guess what I was wondering is was the CityNameTranslations.py file all handwritten? Maybe it was crowd sourced? I have a custom map, and the sheer volume seems daunting!
 
It was crowd sourced to some extent, the Cities.ods file contains suggestions for different names and evolutions in its comments, which are ultimately sourced from a Google Sheet that people could contribute to. But every entry in CityNameTranslations went through my own eyes and hands, verifying the suggestions (in Wikipedia at least), looking for additional translations if possible, and coming up with concrete conditions for changes beyond translations. It definitely was a lot of effort, I spent a few months doing not much more than that.
 
So are the <Cities> lists in CIV4CivilizationInfos.xml used at all anymore then? If you have the Toltec wander up to the US East Coast, they can found "New York"?
 
It's still possible for a civ to have no matching languages for a tile with no fallbacks, but I generally want to avoid it. And yeah they would.
 
The DLL is aware of the map dimensions, but iirc it is not used for anything critical, so you should be able to open a map without DLL changes.
 
Does this work?
 
I am not, I downloaded it ages ago from CFC.
 
Methodology question I've been curious about: is there a particular reason CityNameTranslations.py starts by referencing a city's name, rather than its coordinates? Doesn't that risk some confusion in case two cities have the same name?
 
The key that it references is not the current name of the city, it is the name associated with the tile in the city name map. So there is never a risk of two different cities using the same name unless it is deliberately put into the city name map. This is never an issue because the base name from the map can be anything, so when there is a conflict you can use the name in another language, or a completely arbitrary identifier. For example, Portland, Maine uses "Portland" while Portland, Oregon uses "Neerchokikoo", which is the native name associated with the city. Since both are translated to "Portland" for the English language, that is still fine and works. Jamestown on Saint Helena literally uses "Jamestown, Saint Helena" (to avoid collision with the North American Jamestown) which is "translated" to just "Jamestown" in English.

Another way of putting it is that I am kind of using your approach: you start with the coordinates, but then as the immediate next step you look up the base name in the map at those coordinates. Then you use that to look up the translation.

The reason why I am not using the coordinates directly is that it immediately makes the CityNamesTranslation file completely incomprehensible. It is very unlikely that I immediately know which names are associated with a pair of coordinates. But I usually know what "Constantinopolis" is.

The other reason is that you can easily define translations for base names that don't exist on the map and don't have coordinates associated with them. For example, I can define translations for "Constantinopolis" and "Istanbul" in the exact same way. Then all I have to do is tell the game to use "Istanbul" from now on instead of "Constantinopolis". All permanently changed city names are managed that way.
 
Back
Top Bottom