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

Updated City Name Manager

Discussion in 'Rhye's and Fall Modmods' started by Baldyr, Jul 31, 2010.

  1. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I guess that would be a possible exception that could be added then.
     
  2. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Another day, another idea:

    I was thinking about a way of getting away with having just one dictionary for the new dynamic city name changing. So this is the what the previous example of a dictionary setup looked like:
    Code:
    cityNameDict = {
    (66, 32): { iDefault:'Mut', iArabia:'Mut al-Khorab' },
    (66, 34): { iDefault:'Siwa', iArabia:'Siwah' },
    (66, 36): { iDefault:'Xou', :iArabia:'Sakha' },
    (66, 36): { iDefault:'Kyrene', iRome:'Cyrene', iArabia:'Shahat' },
    }
    Now, what if we would allow for dictionary entries like:
    Code:
    (66, 32): { iDefault:'Mut', iArabia:[COLOR="Red"](iPersia, [/COLOR]'Mut al-Khorab'[COLOR="Red"])[/COLOR], },
    This would make the iArabia entry for the this tile an exception: The city would only rename to Mut al-Khorab if it was acquired from the Persians (as an example - not any kind of suggestion). Otherwise it would get the default name of Mut.

    Does this make it easier than having a separate dictionary for the exceptions? (What I did above is I changed the dictionary entry to a tuple containing an integer value and a string. The new City Name Manager would have code to detect this and read these two values separately and also treat is as an exception.)
     
  3. JediClemente

    JediClemente Prince

    Joined:
    Jan 21, 2004
    Messages:
    446
    Location:
    Madrid, Spain
    Uh-oh, I'm having a bit of a headache with the way the thread evolves. Just like an amish watching The Big Bang Theory.

    Let me see if I understand correctly.

    Each applicable map tile (no sea or mountain, obviously) will have:
    - A default name, which will be used by any civ founding or conquering the city if there's no other entry for that civ.
    - Several names for several civs for if they found a city there.
    - Several names for several civs for if they conquer a city there.

    In an example, one tile, say the aztec capital would have a default name "Ciudad de México", a name on aztec founding "Tenochtitlan", and several others like "Mexico City", "Mexico-stadt", etc. for some other civs.

    (in my opinion the default name for Mumbai should be Bombay, BTW, in the same sense as the aztec capital, but indian cities should rename in the event of an indian respawn)

    Apart from that, we would have the question of ussr-names for Russia, and era-specific names.

    Is that so?

    And what about making this work?

    ( (X, Y), 'Mediolanum', {iEngland:'Milan', iGermany:'Mailand', iSpain:'Milán'}, iIndustrial:'Milano'),

    so the default name for the city is Milano on the Industrial Era and beyond?
     
  4. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Sorry about that. :rolleyes:

    Not every single map tile (unless we want to - do we?) has a default name. The raw data I'm generating by script will however look at both the city name maps and the dynamic city name change code - and if there are entries for both in the current setup - then there will be a data entry for that tile. The bi-product, if you will, of this data is that the name found in the city name map can be used as a default name, to fill in the gaps in the various city name maps.

    I'm sorry this makes your head hurt. :p

    Yes, that would be correct.

    I was actually thinking I'd leave the current code intact, as there seems to be few redundancies. So it would only be a lot of work to redo those also.

    This assuming we are happy with the way the code works now? Would we like for it to be the map tile and not the city name that is the condition for the dynamic city name change to take effect?

    All variables starting with the prefix "i" are integer values. I thought I'd hijack the value -1 for iDefault, but the values for the different game eras would collide with the Civ index values (0-31).

    Other than that, sure also Techs and Eras could be fitted into the same setup. But I'm not sure if they should, as it would increase the level of complexity (which is already pretty high). But I do like the notion of having "modern era names" for some tiles...
     
  5. JediClemente

    JediClemente Prince

    Joined:
    Jan 21, 2004
    Messages:
    446
    Location:
    Madrid, Spain
    OK, now I understand, you're generating a new code from the previous one, which can then be polished a bit further.

    I know not all tiles have a name, though it can be interesting to complete some lacking it, especially in Africa. Which would be easy when you finish a version of the new file. I suppose the entries will be sorted?

    The modern era names already exist (for example: Edo turns into Tokyo), similarly to Carycin turning to Stalingrad. If that can remain the same then, nevermind. BTW, could you tell me which line that begins in the current RFC file?
     
  6. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Yeah, by tile.

    Look for the line (#5074):
    Code:
            def sovietNames(self):
    And line (#5106):
    Code:
            def onTechAcquired(self, iPlayer):
    As you can see, these sections take up a small fraction of the whole City Name Manager.
     
  7. nody

    nody Emperor

    Joined:
    Nov 28, 2004
    Messages:
    1,168
    Location:
    Noviomagus, Batavia
    Baldyr, a couple of questions:

    - Are you using the file from my thread or the original file?
    - Will your file also be name Citynamemanager.py and will it replace the original?
    - Do you need to also change other files in order to make your changes work?

    Your friend, Nody ;)
     
  8. JediClemente

    JediClemente Prince

    Joined:
    Jan 21, 2004
    Messages:
    446
    Location:
    Madrid, Spain
    Thanks Baldyr. I see there are a lot of checks for civs and eras.

    And something I didn't know, Edo will only rename to Toukyou if Japan controls the city. Same for all other cases of city naming.

    This is clearly inefficient.
     
  9. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I have made some alterations to the original file in order to be able to process it with my script, so thats what I'm planning on using. (All single quotation marks part of any city name had to be replaced with code. Among other things causing problems.)

    The new file is a replacement that makes the old file superfluous. It simply takes over all duties from the old file and all other files stay unchanged.
     
  10. nody

    nody Emperor

    Joined:
    Nov 28, 2004
    Messages:
    1,168
    Location:
    Noviomagus, Batavia
    Okay, I'm looking forward to it, since my current (personal) changes to the file have spawned some bugs. Not serious, but at least Germany doesn't rename anymore when it conquers a city.
     
  11. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Ok, then. You volunteer to check the raw output then? I can send it to you as soon as I know what exactly you want the output to be. (Tuple vs dictionary, one data structure vs two. How should it be formatted?)

    Since you're gonna work with the data, you might as well get what you need.
     
  12. nody

    nody Emperor

    Joined:
    Nov 28, 2004
    Messages:
    1,168
    Location:
    Noviomagus, Batavia
    You mean beta-testing? Count me in!
     
  13. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I need someone who knows the ins and out of the current dynamic city name changes to check my raw data first. So that I can confirm that my script did what I intended it to do. (Remember how it replaced Portugal with Mali before?)

    There is no point in anyone putting any work hours into anything but a valid set of data. The work that needs to be done, initially, is to weed out double posts for map tiles. (There can only be one dictionary entry per tile.) The will also be some odd cases where there seems to be mistakes in the current City Name Manager. But this comes later and there probably needs to be some debate on certain tiles.

    My task will be to code the actual dynamic city name change for the new setup. But I need the data to be in order before I can start doing this.

    But, as I said before: How do you want the data to be organized? Or maybe you can work with any setup imaginable?

    I can't generate the data before I know how it should look like.
     
  14. nody

    nody Emperor

    Joined:
    Nov 28, 2004
    Messages:
    1,168
    Location:
    Noviomagus, Batavia
    Maybe organize it per core area, starting with Egypt, Babylonia, India, etc.
    Then all the tiles that aren't part of a civs core area and divide them into continents? Like first the European 'spare' tiles, then the African, etc.
     
  15. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I don't know, the logical way to organize things would be to list the tiles after coordinates.

    But I wasn't asking what order you need the tile entries, but rather what they will hold. But I guess I'll just figure this out myself. I hope you can work with whatever I come up with. And once I send you the raw data I could just generate another set of data if you need it to be configured in another way. In the meanwhile, could you PM me your email?
     
  16. usi

    usi Shogun

    Joined:
    Jun 20, 2007
    Messages:
    239
    Location:
    Connecticut, USA
    Baldyr, could you send the data to me also?

    ---

    To help myself choosing right city names for right plots, I made a program to get x and y coordinates for any plot (see the pic), and I would like to share the program with you guys.

    It's written in Java, an you'll need JRE to run it, if your PC doesn't have JRE installed yet. If I knew a webhost that allows JNLP to run, it could've been easier though (using JWS).

    EDIT: Damn, the cursor is not captured in the pic. It's supposed to be on Rome's plot.
     
  17. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I'll publish the data in this thread once its ready. nody will just give it a proper thumbs up before I do - otherwise there will just be confusion with different versions floating around.

    Nice! I could probably make a in-game dynamic city name editor also...
     
  18. Alexius08

    Alexius08 Emperor

    Joined:
    May 28, 2010
    Messages:
    1,108
    Usi,

    I tested your program and I noticed that the y coordinates were wrong after seeing y increase while scrolling down (instead of the usual upwards increase).
     
  19. usi

    usi Shogun

    Joined:
    Jun 20, 2007
    Messages:
    239
    Location:
    Connecticut, USA
    Thanks!
    Now it's fixed.
     
  20. onedreamer

    onedreamer Dragon

    Joined:
    Oct 21, 2004
    Messages:
    6,580
    Location:
    Torino - Italia
    This idea is good to manage "exceptions" caused by incomplete settler maps (I still wouldn't call them exceptions, but since you insist...) and is also more compatible with RAND. Thumb up.
    The only downside is that it requires much work.
     

Share This Page