1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Bug: Dynamic names getting stuck on "Provisional Authority"

Discussion in 'Civ4 - Caveman 2 Cosmos' started by Jwitti, Jul 28, 2014.

  1. Jwitti

    Jwitti Judas Maccabeus

    Joined:
    Sep 11, 2011
    Messages:
    1,895
    Location:
    Judah
    So I'm playing V34 and I couldn't help but notice that not only has my Civ Description seem to have gotten stuck on "German Provisional Authority" but everyone else is also in some variation thereof.
    Spoiler :

    When I first noticed

    Spoiler :

    quite a bit later, matches the save

    The second is during anarchy, I know, but the first is nowhere near it. View attachment Deustch.CivBeyondSwordSave
    (Sorry for the small pics, I just now found out imageshack is no longer letting me use full-sized images for free)
     
  2. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,544
    Gender:
    Male
    Location:
    Canberra, Australia
    This is a known problem. The code to change the names was being modified to match our civics but the task was never finished.
     
  3. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,814
    Location:
    Brisbane
    What source file is that in? I'd like to take a look.
     
  4. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,544
    Gender:
    Male
    Location:
    Canberra, Australia
    Probably the python DynamicCivNames.py in Python/Revolution/GameReady.
     
  5. Sparth

    Sparth C2C Team Member

    Joined:
    Oct 6, 2013
    Messages:
    2,311
    IIRC Koshling says that Dynamic Names code was moved to DLL already.
     
  6. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,814
    Location:
    Brisbane
    Can someone please clarify which of these areas I need to look in. There is at least a finitesimal chance I could find the problem, but not if I'm looking in the wrong place!:lol:
     
  7. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,424
    In the file that DH mentioned.

    I started making a naming replacement in DLL and XML but never finished it (so it is not active, buggy and not fully functional) and I don't think anyone else made a DLL replacement for that Python.
     
  8. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,814
    Location:
    Brisbane
    Ok so after yet another half-hour attempt to learn Python (my most successful so far:lol:), I had another look at this.

    There is only one place where "provisional" gets put in your civ name, and you have to be in anarchy.

    Therefore the problem seems to be that, when you come out of anarchy, you don't get any new name allocated.

    Has this code been rewritten much for C2C's civics? Because it seems likely that it is not finding any familiar civic by which to give the civ a new name, so it's leaving the civ with the last name allocated ie. the 'provisional' one.

    How does that sound? Where from here? Feedback (and optionally help) please:).
     
  9. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,544
    Gender:
    Male
    Location:
    Canberra, Australia
    The problem is as you say there is no match with the C2C civics. Part of the problem is what civics should be affecting the name of your nation? If I knew that then I should be able to do something about it.
     
  10. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,814
    Location:
    Brisbane
    Could you possibly just get it working as well as before? That is to say, fix the references to civics that no longer exist etc. (rather than adding any enhancements or extra subtleties & nuances).

    First two things I've noticed:
    1. It references a Government civic of 'Federal', and doesn't seem to know about Rule civics at all.
    2. Correct me if I'm wrong here but it calls RevUtils.iscandoelections, whereas that function is in RevCivUtils...
     
  11. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,544
    Gender:
    Male
    Location:
    Canberra, Australia
    Try this. I have done minimal testing so it may fail.
     
  12. Arakhor

    Arakhor Dremora Courtier Moderator

    Joined:
    Mar 27, 2009
    Messages:
    36,025
    Gender:
    Male
    Location:
    UK
    Personally, I addressed that issue by removing "Provisional" from the DCN localization, so the issue was still there, but it wasn't spamming the scoreboard as much.
     
  13. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,814
    Location:
    Brisbane
    Sorry if I ask silly questions. For my part, I think there are some obvious and easy things wrong here, so I do think I might be able to shed some light on them. If I'm mistaken, and you(DH)'ve already spent hours looking at how to fix this, do let me know.

    I've been looking at the RevUtils, and they've pointed me towards the XML tags relating to Rev.

    bFreeSpeech: All civics currently have this set to 0 (false presumably). It's probably true that no one civic guarantees freedom of speech, but given what we've got to work with, I suggest Democracy (Gov't) and Separation of Powers (Power) - at the very least - should have this set to true (what about Magistrates?).

    bNoRealElections: DynamicCivNames is expecting civs to be able to have both 'CanDoElections' and 'NoRealElections'. I suggest that NoRealElections should include all Power civics except Legislature and Separation of Powers.

    bCommunism: currently is only on the KEYNESIAN economic civic. What's with that?:lol: I suggest instead of querying this value, DynamicNames should say if Labour Freedom > 0 and Democracy Level < 0, that civ is communist. Of course this is a huge oversimplification at best (and just plain wrong at worst) but I think it probably works and that's the main thing:goodjob:.

    LabourFreedom: values are currently all over the place. I suggest the following changes:
    Socialism: +3 (is -1)
    Centralized: -1 (is +2)
    Serfdom: -3 (is +2)
    Nationalist: +1 (down from +8)
    Liberal: +2 (currently +10)
    Proletariat: +2 (is -5:eek:)
    Bourgeois: -2 (currently +3)
    Organized Labour: +2 (currently 0)
     
  14. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,203
    Gender:
    Male
    Location:
    Las Vegas
    Without looking TOO deeply, I think you're really onto something the rest of us don't know anything about. So I'd patently accept your proposal. For what it's worth ;)

    Are you also proposing to make these changes? I don't think anyone's taking much direct responsibility for civics lately. I'm not about to try to dive into this mess with all the other's I'm trying to sort out... lol.
     
  15. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,814
    Location:
    Brisbane
    Um yes I could do the XML changes. There's a bit of Python in there as well so I'm hoping to hear from DH...:)
     
  16. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,203
    Gender:
    Male
    Location:
    Las Vegas
    Cool... I figured... just wanted to be sure that's what you were saying.
     
  17. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,544
    Gender:
    Male
    Location:
    Canberra, Australia
    To be honest I have only looked at the "if test" logic for the naming. I have not gone deep enough to figure out where the values come from or what they are supposed to mean.

    I think that the civic was originally named COMMUNISM but had changed so much that the name was changed to reflect what the civic was.
     
  18. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,814
    Location:
    Brisbane
    There's just the one Python change I was hoping you would do: the one changing the test for communism. It would not need much testing - I would just run it across one end-turn and make sure it doesn't crash the game... (As long as it doesn't, it can't be any worse than what we've got now.)

    There's one other Python thing (the Power civics included in NoRealElections) but I'm not really sure about it, and maybe it's less important.

    The rest is XML, so I'll do that.

    If you don't want to do the Python, do you mind if I do it? I would really like to get this particular thing running better, and I feel we're so close!:D
     
  19. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,544
    Gender:
    Male
    Location:
    Canberra, Australia
    If you want to do the python go ahead. The only changes I have made are in the file I posted above. It has not been put on the SVN.
     
  20. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,814
    Location:
    Brisbane
    Well I put my oar in and eventually my "Provisionals" are starting to go away. I made quite a few wild and wacky changes:crazyeye:, but this is the one that I'm claiming credit for (my code in red, the other bit included for context/position):
    Code:
        #Anarchy Naming
        if (pPlayer.isAnarchy and pPlayer.getAnarchyTurns() > 1):
          if( 75 > game.getSorenRandNum(100,'Rev: Naming') ) :
            newName = localText.getText("TXT_KEY_MOD_DCN_PROVISIONAL_GOV", ())%(curAdj)
          else:
            newName = localText.getText("TXT_KEY_MOD_DCN_PROVISIONAL_AUTH", ())%(curAdj)
          return [newName, curShort, curAdj]
        
        [B][COLOR="Red"]if (((not pPlayer.isAnarchy) or (pPlayer.getAnarchyTurns() < 2)) and ("Provisional" in curDesc)):
          if (gc.getInfoTypeForString("CIVIC_HEREDITARY_RULE") == eGovCivic):
            newName = curAdj + ' ' + localText.getText("TXT_KEY_MOD_DCN_KINGDOM", ())
          elif (gc.getInfoTypeForString("CIVIC_REPUBLIC") == eGovCivic):
            newName = localText.getText("TXT_KEY_MOD_DCN_REPUBLIC", ())%(curAdj)
          else :
            newName = curAdj + ' Nation'
          return [newName, curShort, curAdj][/COLOR][/B]
    
    
    There may be a problem if civs coming out of anarchy do not do what the code calls a "Force[d]Update". Without such an update, they sometimes keep their civ name unchanged.

    I realize that my code provides for civs coming out of anarchy to go into one of only three new names. I was hoping that once they weren't provisional any more, the code would pick up the slack and start thinking seriously about what to change them to.

    Until my next laughable attempt to learn Python, I'm gonna just cling to this hope.:scan:
     

Share This Page