Advertisement
Civilization Fanatics' Center  

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Project & Mod Development > Civ4 - Revolution Modpack

Reply
 
Thread Tools
Old Jun 06, 2007, 03:15 PM   #1
Dom Pedro II
Modder For Life
 
Dom Pedro II's Avatar
 
Join Date: Apr 2002
Location: Exit 16, New Jersey
Posts: 6,811
Dynamic Civilization Names

I've started this thread to post all questions, comments and concerns regarding dynamic civ names as implemented in the Revolution mod.

I will try to collect here some comments made by people in the original Revolution thread to see what has been said, how it was addressed, and if it wasn't addressed due to the high posting rate and huge number of posts in that thread, get those issues and suggestions addressed.
__________________
Dynamic Unique Units Modcomp : Announcing Dom Pedro II's Civilization 4: Test of Time : Dom Pedro II's Mod Helper for Python Modders and those who would like to be

One night I dreamt of wondrous things. When I awoke, I made a mod.
Dom Pedro II is offline   Reply With Quote
Old Jun 06, 2007, 03:58 PM   #2
Fosse
Prince
 
Join Date: Feb 2003
Location: U.S.A.
Posts: 467
Having played for a while with the latest version I can say I love the Dynamic Names.

I wouldn't mind seeing the full names of the Civs on the scoreboard when you mouse over them. The only way to see the names right now without opening the diplomacy window is to hover over a tile that is owned by that civ that is within the fog of war (as otherwise you are told the % of the owning civ's culture).

Since the names only appear when mousing over their length shouldn't matter.

Does an entry appear in the replay at the end? "Elizabeth ascends the throne of the newly styled Royal Kingdom of England," and "The people elect Tokugawa as the first President of The Free States of Japan."

Having those events appear in the turn summary and event log would also be great.
__________________
Jazz Hands!
Fosse is offline   Reply With Quote
Old Jun 06, 2007, 05:17 PM   #3
BobTheTerrible
Just Another Bob
 
Join Date: Jan 2003
Location: Middle of Nowhere
Posts: 927
I like them a lot. It adds a really nice touch to the game.
BobTheTerrible is offline   Reply With Quote
Old Jun 07, 2007, 01:47 PM   #4
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Quote:
Originally Posted by Fosse View Post
Having played for a while with the latest version I can say I love the Dynamic Names.

I wouldn't mind seeing the full names of the Civs on the scoreboard when you mouse over them. The only way to see the names right now without opening the diplomacy window is to hover over a tile that is owned by that civ that is within the fog of war (as otherwise you are told the % of the owning civ's culture).

Since the names only appear when mousing over their length shouldn't matter.

Does an entry appear in the replay at the end? "Elizabeth ascends the throne of the newly styled Royal Kingdom of England," and "The people elect Tokugawa as the first President of The Free States of Japan."

Having those events appear in the turn summary and event log would also be great.
Glad you like them! I will cause the full names to show over the scoreboard, having to find empty land to see them is kind of annoying.

Currently there is no recording of the names for the replay, but it's a pretty good idea. I worry about overfilling the replay though ...
jdog5000 is offline   Reply With Quote
Old Jun 24, 2007, 02:34 PM   #5
Aeven
EU Citizen
 
Aeven's Avatar
 
Join Date: May 2007
Location: the Netherlands, EU
Posts: 228
I doubt it would overfill the replay. Also, when you hover over your flag in the UI, it would be nice to see your own name.
Aeven is offline   Reply With Quote
Old Jun 24, 2007, 04:27 PM   #6
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
The hover over your flag is already done and will be in the next version
jdog5000 is offline   Reply With Quote
Old Jun 24, 2007, 09:15 PM   #7
Dom Pedro II
Modder For Life
 
Dom Pedro II's Avatar
 
Join Date: Apr 2002
Location: Exit 16, New Jersey
Posts: 6,811
Quote:
Originally Posted by jdog5000 View Post
The hover over your flag is already done and will be in the next version
Wait... what flag?
__________________
Dynamic Unique Units Modcomp : Announcing Dom Pedro II's Civilization 4: Test of Time : Dom Pedro II's Mod Helper for Python Modders and those who would like to be

One night I dreamt of wondrous things. When I awoke, I made a mod.
Dom Pedro II is offline   Reply With Quote
Old Jun 24, 2007, 09:29 PM   #8
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Your flag, down in the right corner next to the minimap. Also shows you your traits and such.
jdog5000 is offline   Reply With Quote
Old Mar 08, 2008, 10:59 AM   #9
Mohatma
Chieftain
 
Mohatma's Avatar
 
Join Date: Nov 2007
Posts: 43
When it changes my civ name, I can't change it back and it changes it only one time, so when I'm on Representation, I'm still "Kindom of ___"
Mohatma is offline   Reply With Quote
Old Mar 08, 2008, 11:25 AM   #10
BobTheTerrible
Just Another Bob
 
Join Date: Jan 2003
Location: Middle of Nowhere
Posts: 927
Speaking of dynamic civ names, do you think you can have civilizations start as "The ___ Tribes" or "Tribes of ____" rather than "____ Empire" ?
BobTheTerrible is offline   Reply With Quote
Old Mar 08, 2008, 11:32 PM   #11
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Quote:
Originally Posted by Mohatma View Post
When it changes my civ name, I can't change it back and it changes it only one time, so when I'm on Representation, I'm still "Kindom of ___"
I'll see what I can do to protect names you've chosen for your civ and allow you to rename your civ midstream too. As for my it's not updating, that's mysterious ... do you have a save you could post?

Quote:
Originally Posted by BobTheTerrible View Post
Speaking of dynamic civ names, do you think you can have civilizations start as "The ___ Tribes" or "Tribes of ____" rather than "____ Empire" ?
Yes, it's totally possible ... when should it switch from Tribes to Empire though? Without any added changes, the switch would happen when you made your first civics change. Other possibilities:
- Found first city (Tribes name wouldn't last long ...)
- Found second city
- Reach some total population
- Meet your first civ
- ???
jdog5000 is offline   Reply With Quote
Old Mar 09, 2008, 07:59 AM   #12
TheLastOne36
Deity
 
TheLastOne36's Avatar
 
Join Date: Jan 2007
Posts: 14,013
Quote:
Originally Posted by jdog5000 View Post
I'll see what I can do to protect names you've chosen for your civ and allow you to rename your civ midstream too. As for my it's not updating, that's mysterious ... do you have a save you could post?
I've had similar problems to...
Quote:

Yes, it's totally possible ... when should it switch from Tribes to Empire though? Without any added changes, the switch would happen when you made your first civics change. Other possibilities:
- Found first city (Tribes name wouldn't last long ...)
- Found second city
- Reach some total population
- Meet your first civ
- ???
How about when you research Writing?

Founding your second city is also a good one.
TheLastOne36 is offline   Reply With Quote
Old Mar 11, 2008, 11:07 AM   #13
BobTheTerrible
Just Another Bob
 
Join Date: Jan 2003
Location: Middle of Nowhere
Posts: 927
Quote:
Originally Posted by jdog5000 View Post
Yes, it's totally possible ... when should it switch from Tribes to Empire though? Without any added changes, the switch would happen when you made your first civics change. Other possibilities:
- Found first city (Tribes name wouldn't last long ...)
- Found second city
- Reach some total population
- Meet your first civ
- ???
I was thinking that if you have the minor civs until writing option turned on, then "tribes" should last as long as the civ in question is a minor civ in the ancient era, although if you switch civics there's a good chance you become a kingdom (I'm thinking the civic switch signifies that you have a central government together), and if you have more than, say, 3 cities you become an empire.
BobTheTerrible is offline   Reply With Quote
Old Jul 09, 2008, 05:21 PM   #14
Hephaistion
Warlord
 
Join Date: Apr 2005
Location: Mt. Vernon, NY USA
Posts: 272
Adding new names to Python

Hi all -- I'd just love it if you could post a how-to on how to add new names to the Dynamic Civ Names python file. For the next version of HephMod I've added a City States government civic, and would like to put this into the files so that civs adopting it be called, "(curAdj) League" or "League of (curShort)." I've monkeyed around in the code, but even when there are no Python exceptions, my additions don't work and render the naming portion of the mod (only) non-functional.

City States is registered as a CanDoElections civic and I gave it a democracy level of 3 so that I could tag it in DynamicCivNames.py. Here's what I did:

Code:
elif( RevUtils.isCanDoElections(iPlayer) ) :
            if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("Names - player can do elections")
            if( pPlayer.getNumCities() == 1 ) :
                if( ' Free ' in curDesc or ('Rep.' in curDesc and capital.getName() in curDesc) ) :
                    if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("Names - keeping prior name")
                    newName = curDesc
                elif( 40 > game.getSorenRandNum(100,'Rev: Naming') ) :
                    newName = curAdj + ' Free State'
                else :
                    if( not cityString == None and len(cityString) < 10 and len(cityString) > 0) :
                        if( cityString in curAdj or cityString in curShort ) :
                            newName = 'Republic of ' + cityString
                        else :
                            newName = curAdj + ' Rep. of ' + cityString
                    else :
                        newName = curAdj + ' Free Republic'
			
			
	     if( RevUtils.getDemocracyLevel(iPlayer)[0] == 3 ) :
			if( 50 > game.getSorenRandNum(100,'Rev: Naming') ) :
				newName = curAdj + ' League'
			else :
				newName = 'League of ' + curShort
                			

            else :
                if( 'Republic' in curDesc and not 'People' in curDesc and not 'Soc. ' in curDesc and not 'Free ' in curDesc ) :
                    if( len(curDesc) < 17 and 20 > game.getSorenRandNum(100,'Rev: Naming') ) :
                        newName = 'New ' + curDesc
                    else :
                        if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("Names - keeping prior name")
                        newName = curDesc
                elif( 50 > game.getSorenRandNum(100,'Rev: Naming') ) :
                    newName = curAdj + ' Republic'
                else :
                    newName = 'Republic of ' + curShort
The spacing didn't come out quite right: my "if" is even with "self.LOG" etc., with no indentation errors on load. Any ideas on how I should have done this?
Hephaistion is offline   Reply With Quote
Old Jul 10, 2008, 01:14 AM   #15
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
You've got an invisible error! No really ... you've got tabs while all my indents are spaces. It can appear to be in the correct position if you're using an editor that shows tabs as one number of spaces but then Civ/Python may consider them another number. Don't worry, you're hardly along on this ... Firaxis has some mixed files that work by the grace of the Python gods as well. I'd really recommend using a good editor like Notepad++ for Python and setting it to display white space and tabs and replace your tab strokes with 4 spaces (if you like to use the IDLE editor that comes with Python you can do most of these things there as well).

One small thing would be to change your if to and elif ... right now you clause will effectively overwrite the only 1 city logic, if that's what you want then move your clause up and make the other an elif.

Another thing you can do is imitate the logic which keeps the form of "League of ___" vs "___ League" consistent when non-consequential civics are changed ... something like:

Code:
if( 'League' in curDesc ) :
    newName = curDesc
elif the rest of your code
With that you should be good to go.
jdog5000 is offline   Reply With Quote
Old Jul 10, 2008, 11:16 AM   #16
Hephaistion
Warlord
 
Join Date: Apr 2005
Location: Mt. Vernon, NY USA
Posts: 272
@jdog:

Thanks so much! This is extremely helpful.

EDIT: Leagues are go! Notepad2 made it much easier!

Last edited by Hephaistion; Jul 10, 2008 at 12:23 PM.
Hephaistion is offline   Reply With Quote
Old Jul 22, 2008, 07:06 PM   #17
wilcoxchar
Warlord
 
Join Date: Oct 2005
Posts: 119
Could you perhaps give a list of all the parts of DynamicCivNames.py which do not need to be included if I am not using it with the Revolution modpack? I would like to basically start from scratch adding my own names and classifications. Also, thank you very much for releasing this, I can't wait to start adding my own civ names.

EDIT: I've been doing some fiddling with the file, and have made some modifications but the game won't show my changes. Here is my code.

Code:
    def newNameByCivics( self, iPlayer, bVerbose = False ) :
        # Assigns a new name to a player based on their civics choices

        pPlayer = gc.getPlayer(iPlayer)
        capital = pPlayer.getCapitalCity()
        playerEra = pPlayer.getCurrentEra()

        curDesc  = pPlayer.getCivilizationDescription(0)
        curShort = pPlayer.getCivilizationShortDescription(0)
        curAdj   = pPlayer.getCivilizationAdjective(0)

        civInfo = gc.getCivilizationInfo(pPlayer.getCivilizationType())
        origDesc  = civInfo.getDescription()
        origShort = civInfo.getShortDescription(0)
        origAdj   = civInfo.getAdjective(0)
        
        if( game.getGameTurn() == 0 ) :
            # Not clear if all game data is properly loaded yet
            if( playerEra < 3 ) :
                newName = curDesc
            else :
                newName = curDesc
            return [newName,curShort,curAdj]

        newName = origDesc
        if( SDTK.sdObjectExists( "Revolution", pPlayer ) ) :
            revTurn = SDTK.sdObjectGetVal( "Revolution", pPlayer, 'RevolutionTurn' )
        else :
            revTurn = None

        if( SDTK.sdObjectExists( "BarbarianCiv", pPlayer ) ) :
            barbTurn = SDTK.sdObjectGetVal( "BarbarianCiv", pPlayer, 'SpawnTurn' )
        else :
            barbTurn = None

        if( not pPlayer.isAlive() ) :
            newName = curAdj + ' Refugees'
            return [newName, curShort, curAdj]

        if( not revTurn == None and game.getGameTurn() - revTurn < 20 and pPlayer.getNumCities() < 3 ) :
            # Maintain name of rebels from Revolution Mod
            newName = curDesc
            return [newName, curShort, curAdj]
        elif( not barbTurn == None and game.getGameTurn() - barbTurn < 20 and pPlayer.getNumCities() < 4 ) :
            # Maintain name of BarbarianCiv created player
            newName = curDesc
            return [newName, curShort, curAdj]

        # Main naming conditions
        if( pPlayer.getNumCities() == 0 ) : 
            if( 'Tribes' in curDesc or 'Peoples' in curDesc ) :
                if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("Names - keeping prior name")
                newName = curDesc
            elif( 50 > game.getSorenRandNum(100,'Rev: Naming') ) :
                newName = curAdj + ' Tribes'
            else :
                newName = carAdj + ' Peoples'
        elif( pPlayer.getNumCities() == 1 ) :
            if( 'Free' in curdesc ) :
                if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("Names - keeping prior name")
                newName = curDesc
            elif( 50 > game.getSorenRandNum(100,'Rev: Naming') ) :
                newName = "Free City of " + CvUtil.convertToStr(capital.getName()) 
            else :
                newName = "Free State of " + CvUtil.convertToStr(capital.getName())
        else : 
            if( 'Kingdom' in curdesc ) :
                if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("Names - keeping prior name")
                newName = curDesc
            elif( 30 < game.getSorenRandNum(100,'Rev: Naming') ) :
                newName = curAdj + " Kingdom"
            else : 
                newName = "Kingdom of " + curShort

        return [newName, curShort, curAdj]
This is all that I have put in the newNameByCivics, but when I load up the mod and start the game, it still shows my civ name as the _____ Empire. Please help!

Last edited by wilcoxchar; Jul 22, 2008 at 10:14 PM.
wilcoxchar is offline   Reply With Quote
Old Jul 24, 2008, 01:06 AM   #18
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
You seem to be doing pretty well in figuring things out, the one catch which is causing your civ to keep the ___ Empire name at the start is an early check for game.getGameTurn() == 0. Remove that bit and then you should start as the Tribes or Peoples.
jdog5000 is offline   Reply With Quote
Old Jul 24, 2008, 05:44 PM   #19
wilcoxchar
Warlord
 
Join Date: Oct 2005
Posts: 119
Hmmm, I got rid of this (I think that's what you were referring to), but it still shows it as empire.

Code:
        if( game.getGameTurn() == 0 ) :
            # Not clear if all game data is properly loaded yet
            if( playerEra < 3 ) :
                newName = curDesc
            else :
                newName = curDesc
            return [newName,curShort,curAdj]
Also, does the game check newNameByCivics every turn? And if it doesn't, is there a way to get it to check every turn?

Thank you for your help, this is a great idea to add more flavor to the game.
wilcoxchar is offline   Reply With Quote
Old Jul 24, 2008, 11:20 PM   #20
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
No, it doesn't run the name checking every turn but that's easy to change if you want ... in the function onBeginPlayerTurn:

Code:
        if( iPrevPlayer >= 0 and iPrevPlayer < gc.getBARBARIAN_PLAYER() ) :
            iPlayer = iPrevPlayer
            pPlayer = gc.getPlayer( iPlayer )
            if( pPlayer.isAlive() ) : self.setNewNameByCivics(iPlayer)
add the bolded line above and remove all the following clauses.
jdog5000 is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Project & Mod Development > Civ4 - Revolution Modpack > Dynamic Civilization Names

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Civ Names jdog5000 Civ4 - Mod Components 80 Aug 11, 2013 04:45 PM
Dynamic Civilization Naming - Submit Names Here! Kweeky Civ4 - Rhye's and Fall of Civilization 133 Jan 04, 2010 12:42 AM
Dynamic names idea flaming_iles Civ4 - Rhye's and Fall of Civilization 8 Jan 02, 2008 03:09 PM
Dynamic Names Splime Civ4 - Rhye's and Fall of Civilization 28 Dec 31, 2007 08:31 PM
dynamic civ names SimonB1er Civ4 - Rhye's and Fall of Civilization 0 Nov 27, 2007 05:27 PM


Advertisement

All times are GMT -6. The time now is 10:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
This site is copyright Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR