Dynamic Civ Names

Tried and tested, humans and AIs follow the same rules. Unless you specified new rules.

If I thought it was a problem in your mod I would have reported it there not here. I am just keeping people up to date on where I am at.

The form "Egyptian Empire" or "Empire of Egypt" must be coming from somewhere as I don't specify it anywhere. I thought it might be in default BtS but it maybe in a different part of Revolution mod when DynamicCivNames is off. Unfortunately I have been through the code and there is no "if off" or "if on ... else.." option anywhere, which implies it is done as part of the initialization somewhere.

The 'only working for the human player' just means that one of the other modules is not modular python safe and is stopping the processing getting through to this module unless it is for the human player(s). I can solve that by either changing the order of the modules or changing the offending module.
 
If I thought it was a problem in your mod I would have reported it there not here. I am just keeping people up to date on where I am at.

The form "Egyptian Empire" or "Empire of Egypt" must be coming from somewhere as I don't specify it anywhere. I thought it might be in default BtS but it maybe in a different part of Revolution mod when DynamicCivNames is off. Unfortunately I have been through the code and there is no "if off" or "if on ... else.." option anywhere, which implies it is done as part of the initialization somewhere.

The 'only working for the human player' just means that one of the other modules is not modular python safe and is stopping the processing getting through to this module unless it is for the human player(s). I can solve that by either changing the order of the modules or changing the offending module.
After searching python and xml files for relevant words I only found this in NamesCivs_Civ4GameText.xml
Code:
	<TEXT>
		<Tag>TXT_KEY_CIV_ARABIA_DESC</Tag>
		<English>
			<Text>Arabian Empire</Text>
		</English>
...........................
 
Dont know if 0 means off or 1 means enabled??

1 means on zero is off.

After searching python and xml files for relevant words I only found this in NamesCivs_Civ4GameText.xml
Code:
	<TEXT>
		<Tag>TXT_KEY_CIV_ARABIA_DESC</Tag>
		<English>
			<Text>Arabian Empire</Text>
		</English>
...........................

Both those mean that there are bits I did not remove when I removed the code part of the Revolution DynamicCivNames. I did get most of the text and remove the option from BUG.
 
@TB there is something in the dll that is putting "Empire" or "Empire of" on the civ names which then appear in the scoreboard. I suspect that it is done when we don't have the option for DynamicCivNames on. I removed the option from BUG, and the Python code that defines, reads and sets the option.

The only place I could find reference to DynamicCivNames in the dll code is in CvPlayer.cpp. It is Revolutions code.

Can you look at the code sometime to see if you can identify when and where it is setting this prefix and suffix and remove it, or at least don't set them ie leave them blank.
 
I know AIAndy was working on something along those lines. But I'll look.

EDIT: Yeah, he has some extensive coding there. Very extensive. In fact, although it would take a while to truly read and comprehend it all, it looks like it should be functional. There's XML to back it up somewhere. I believe he had a thread on it here too a while back and I'm wondering how close it actually is to being the whole solution you were looking for in the first place. It looks pretty capable of whatever one would want from the system and if it was tested some and bugs were determined (I recall he said it was bugged but I didn't know what exactly was bugged about it) then maybe once identified I could sort out any problems with it.

We'd probably do well to find his thread on the topic somewhere around here.

EDIT: Looks like he must not have started the thread but added on to an existing one when he proposed and started working on it. Dang... that's going to make it much harder to find.

I know you've done a lot of work on things here. If this isn't useful then I suppose I could try to figure out how to disable this stuff entirely. Kinda a shame though considering what I'm seeing here appears pretty brilliant, even if not complete. I know I had/have a hard time thinking of what and when naming should change and thus wasn't as supportive of the project as I should've been though. (Same goes here I suppose. And my apologies for that.)

EDIT2: Looks like an extension of the Dynamic Civ Names in python. I'm not seeing where it assigns anything directly so it makes it all the more confusing.

You may be able to help me to determine where this is being set by identifying exactly what functions or variables are called for when the name is painted on the screen.
 
It was bugged, crashing to be exact, so if you want to use it, you would need to fix it first.
The entry point is CvPlayer::getNewCivName, which I just called from Python somewhere at the start of the Dynamic Civ Name code.

The XML is in CIV4CivNameInfos.xml, but the text referenced from there is also important.
What it is supposed to be doing, is using the data in the XML as name building rules.
Each rule entry has condition expressions that activate it.
All rules are split into root names, prefix and suffix.

Every Civ name starts with a root name which can then include prefixes and suffixes. Those are chosen randomly from prefix and suffix rules and can themselves need more prefixes or suffixes in them.

So a root name rule might be
Name -> Prefix Empire of Suffix
and have a condition that checks if this is an empire.

The randomly chosen prefix rule might then be
Prefix -> English
and the condition checks for English.
The suffix rule could be
Suffix -> of Capital
with no condition.

The result would then be
English Empire of London
 
It was bugged, crashing to be exact, so if you want to use it, you would need to fix it first.
The entry point is CvPlayer::getNewCivName, which I just called from Python somewhere at the start of the Dynamic Civ Name code.

The XML is in CIV4CivNameInfos.xml, but the text referenced from there is also important.
What it is supposed to be doing, is using the data in the XML as name building rules.
Each rule entry has condition expressions that activate it.
All rules are split into root names, prefix and suffix.

Every Civ name starts with a root name which can then include prefixes and suffixes. Those are chosen randomly from prefix and suffix rules and can themselves need more prefixes or suffixes in them.

So a root name rule might be
Name -> Prefix Empire of Suffix
and have a condition that checks if this is an empire.

The randomly chosen prefix rule might then be
Prefix -> English
and the condition checks for English.
The suffix rule could be
Suffix -> of Capital
with no condition.

The result would then be
English Empire of London

From this above I think it is where we are getting all the "Empire of.." stuff I need to get rid of to get Platyping's DynamicCivNames to work.

The code assigning the names for the mod is fairly trivial. The complexity is in the definition of the conditions which could be done so much simpler in XML.
 
The entry point is CvPlayer::getNewCivName, which I just called from Python somewhere at the start of the Dynamic Civ Name code.
If you want to disable this, I THINK this would be what you'd need to find and cut out.
 
Personally, I would like to get it into the dll and XML. I keep making errors in the entry of the conditions and results in Platypings. I can outline the XML schema needed and the processing steps if you like. Or you can just read Platyping's code.

I would like to get this in before v37 either way. So it can go on hold for now as I have plenty of other stuff to do.
 
Personally, I would like to get it into the dll and XML. I keep making errors in the entry of the conditions and results in Platypings. I can outline the XML schema needed and the processing steps if you like. Or you can just read Platyping's code.

I would like to get this in before v37 either way. So it can go on hold for now as I have plenty of other stuff to do.

I don't see how we'd be improving on anything that hasn't already been done. If we can find the (noted to be crash) bugs in what we already have, why would we not use that? It's pretty cool programming from what I can see but it has some mysteries to me as to what the actual storage objects are for the names.

Also, if it's working for you to the extent that you're finding it was getting in the way somehow, then obviously it's 'on' and I don't know what was disabled in it unless it was just to not include some xml that triggered the problems.
 
Sorry if this is considered a necro but this feature does seem to have been deactivated very temporarily, and then forgotten about. We still have the Python in the SVN as a .7z file (last time I looked anyway). But apparently there's some dll code needed to reactivate it, and maybe other things (for one thing it was an option that has presumably been removed). If the 'new improved' version causes crashes and can't be fixed, I'd settle for the old one that was working semi-adequately up until sometime in the v37 cycle.
 
Sorry if this is considered a necro but this feature does seem to have been deactivated very temporarily, and then forgotten about. We still have the Python in the SVN as a .7z file (last time I looked anyway). But apparently there's some dll code needed to reactivate it, and maybe other things (for one thing it was an option that has presumably been removed). If the 'new improved' version causes crashes and can't be fixed, I'd settle for the old one that was working semi-adequately up until sometime in the v37 cycle.
I don't know how it was turned off so I also don't know how to turn it back on. I am not familiar with this region of things at all. I know you may feel I should be able to become easily familiar but it deals with deeper elements of subjects I don't well understand, like python interactions and strings. I would fear that I would waste a LOT of time trying to figure this out, and have a strong chance of introducing bugs I hardly understand how to fix, and I have to admit I personally just don't care about the feature in the least. I would have preferred it had not been manipulated to start with. I didn't understand why it became a priority to adjust what we had.

EDIT: the changes I believe were made on the old SVN so it's even past the point of being able to refer to what was done to turn off the old mechanism. I do recall it was turned off because it would clash with the programming that is currently in place, of which I also don't know how to identify from the original code.
 
Long time ago I tried to replace the Revolution's dynamic names with Platyping's. This was because the Revolution version is in Python and coded to Revolution's Civics while Platyping's is XML based (if I remember correctly) allowing modders to set it up to match. Unfortunately part of the Revolution code is in the dll.

As far as I know it is back to the Revolutions version at this time. The Civ names don't change because the Civics it is based on are not in C2C.
 
Long time ago I tried to replace the Revolution's dynamic names with Platyping's. This was because the Revolution version is in Python and coded to Revolution's Civics while Platyping's is XML based (if I remember correctly) allowing modders to set it up to match. Unfortunately part of the Revolution code is in the dll.

As far as I know it is back to the Revolutions version at this time. The Civ names don't change because the Civics it is based on are not in C2C.
The 2015 version knew the difference between a Republic and a Kingdom, as well as a Provisional Government when in civics anarchy. It could even do "Peoples' Republic": that's what my civ is in my Shaka de Paris save.

I understand you not wanting to work on improving that version, or getting Platyping's working. But could we please have the old version back, and the option reinstated? In time, others may work on them, but even if not, it's a big improvement on nothing imo.
 
I don't know how it was turned off so I also don't know how to turn it back on. I am not familiar with this region of things at all. I know you may feel I should be able to become easily familiar but it deals with deeper elements of subjects I don't well understand, like python interactions and strings. I would fear that I would waste a LOT of time trying to figure this out, and have a strong chance of introducing bugs I hardly understand how to fix, and I have to admit I personally just don't care about the feature in the least. I would have preferred it had not been manipulated to start with. I didn't understand why it became a priority to adjust what we had.

EDIT: the changes I believe were made on the old SVN so it's even past the point of being able to refer to what was done to turn off the old mechanism. I do recall it was turned off because it would clash with the programming that is currently in place, of which I also don't know how to identify from the original code.
I'm not asking you to learn or do anything you don't want to:D. I understand it's not your area. I just hope someone or some combination of someones can work it out.
 
The 2015 version knew the difference between a Republic and a Kingdom, as well as a Provisional Government when in civics anarchy. It could even do "Peoples' Republic": that's what my civ is in my Shaka de Paris save.

I understand you not wanting to work on improving that version, or getting Platyping's working. But could we please have the old version back, and the option reinstated? In time, others may work on them, but even if not, it's a big improvement on nothing imo.
The problem is that many of the key ids of the C2C civics are no longer the same as they were back in 2015. That means is is not as simple as just putting the old code back.
 
The problem is that many of the key ids of the C2C civics are no longer the same as they were back in 2015. That means is is not as simple as just putting the old code back.
If you put it back in the mod as another 'unsupported option', there's a good chance someone will eventually fix that (it doesn't sound like a huge task).
 
I thought id take a look when u first posted and at the top of the page is this
Code:
import ANDAutomationsTab

def remove_diacriticals(text):
  
  return ANDAutomationsTab.remove_diacriticals(text)
first step would be to look for that ANDAutomationsTab file on the site, but im not interested enough
 
Last edited:
Top Bottom