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

Maps with realistic starting positions for all civs

Discussion in 'Civ4 - Pre-made Maps' started by The_J, Mar 7, 2010.

  1. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,053
    Location:
    Aotearoa
    I've just added a new map to my mod which, dimensions-wise, would be considered Large. I only want to allow 7 civilizations on it (for now) but I don't want to change the size setting to Standard as I feel balance would be better using the parameters of a Large map, despite there being 2 fewer civs.

    Starting Points gets confused by this. It places the player's civ correctly but all other civs are completely random. If one of those civs is valid for the map it will be placed correctly but if not it will not get placed at all. Is it possible to change this so once all valid civs are placed, any additional slots are silently killed off?
     
  2. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,703
    Location:
    DE/NL/FR
    :hmm: you could just use the map as normal map with preset civs, then you'd not have that problem.
    :think: but good point. Theoretically it should not add invalid civs. No idea where that is coming from :hmm:. Will dig into that later today.
     
  3. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,053
    Location:
    Aotearoa
    I considered that but I don't want to lose choice of leader.

    Thanks! I've attached the map and xml files, if they're any help. The civs are set up for my mod and would need to be reassigned to run without it, but I haven't changed any terrain or resources yet so that should be fine.
     

    Attached Files:

  4. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,703
    Location:
    DE/NL/FR
    Can't reproduce it :dunno:.
    If I start that map, I'll only get 4 civs, nothing more.

    How did you check which civs are present?
    Because if you only take a look at the civ list in the worldbuilder drop down menu, then you'll also see which civs were present at the beginning. That will include civs, which are not anymore on the map, because the script killed them.

    If that is not the case, then my next question would be if you have python exceptions enabled (guessing for some differences between Python 2.4 and 2.3; I hope you don't have them enabled, but I guess you have).
     
  5. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,053
    Location:
    Aotearoa
    Okay I've discovered something interesting. The first time you launch it, Starting Points works exactly as it should, even on the map I attached above. However, if you then exit to menu, and load up any map (including the previous one) the selection of civs is completely random. No attention is paid to which civs are valid or not for that map as defined in the xml, and the invalid ones simply don't appear on the map.

    Checking the world builder drop down and zooming to each start location to see if the units are there.

    Yeah I have them enabled and no errors are being thrown in game or in the logs. I haven't tried Starting Points' debugging option though, where does that output to?
     
  6. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,703
    Location:
    DE/NL/FR
    Can't reproduce that either :dunno:.
    Started the mod, went with a test scenario on a medium sized map with 3 civs, worked. Went back the the main menu, started the same map again, got again the 3 civs.
    Back the the main menu, choose another map, worked again.
    :dunno:

    :confused: I'm not sure if I get what you're saying.

    What about the invalid civs?

    Sometimes valid civs will be discarded. That's more meant for maps with more civs than slots, so that you get a bit more diversity. On maps with less civs than slots this might lead to occassions where you just have less civs than defined in the XML.

    Not sure if that will be useful (because that's a bit of a mess :mischief:, should have reworked that), but worth a try.
    Besides that it will throw you lots of messages in the ingame log, the stuff will be written to the logs\PythonDbg.log (in the users folder; no idea where this is on a Mac, but I think I don't have to tell you where to search ^^).
     
  7. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,053
    Location:
    Aotearoa
    Curious. It could be a Mac only bug. I've noticed that Mac BTS doesn't free up all the memory it should when quitting and restarting a game so maybe Aspyr have messed up that process in other ways too. Yet another bug they'll refuse to fix :(

    I'll just have to advise people to always quit BTS between loading new maps.

    Say I choose the Iroquois on that North American map. The other valid civs for that map are the Americans, Sioux, Anasazi, Aztec, Maya, and Scandinavians. When I load the map the Iroquois I'm playing will be in the correct location but the other civs in the game will be randomly chosen from all civs available in the mod. For example, the world builder drop down will list:

    • Iroquois
    • Phoenicia
    • Korea
    • Greece
    • America
    • Mali
    • Zululand
    • China
    • Persia

    Since America is a valid civ for the map, they will be placed at their correct location. The rest of the civs are invalid for the map so their starting units will not be placed anywhere on the map, leaving it as a game with just the Iroquois and America. Sometimes I get games with no other civs on the map besides the one I chose to play.

    They will not appear on the map at all.

    Yep, this seems to work just fine, on first load at least.

    I'm familiar with that file, thanks. I'll take a look and see if it says anything useful.
     
  8. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,703
    Location:
    DE/NL/FR
    ...mmhh....if it's only a problem with the python memory (which could be), then you should try to add 2 lines to your CvEventManager file:
    on top, where the "import" stuff is, add
    PHP:
    import gc as garbage
    and also in the CvEventManager file, after onGameLoad, add
    PHP:
    garbage.collect()
    I don't really think that will help, but if there's only a small chance...

    That's a side effect of an intentional part...I had not thought that it would be that bad.
    After some short thoughts, I'll be able to prevent that.
    Will do so tomorrow (today I promised someone else to help with modding, so I'm already occupied).


    Better give it to me, because it will be easier for me to sort it out ;).
     
  9. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,053
    Location:
    Aotearoa
    Attached 2 PythonDbg logs. The first one is from a fresh launch where all works as expected, the second is from the subsequent launch where things went awry.

    I've not tried the garbage collection yet, I'll give that a go now. EDIT: No difference.

    No urgency, I appreciate you looking into this for me.
     

    Attached Files:

  10. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,703
    Location:
    DE/NL/FR
    Your logs look normal.

    Not sure what's going on, but I think I've been able to reproduce the bug which you described and I think I also fixed it.
    Could you please make a test and replace your StartingPointsUtil.py with the attached one?


    The problem...if it was the problem...was that I saved all used or invalid civs in a separate list, so that the script did not check them again...and then I forgot to empty the list between the maps, so that at some point no more civs were available.
    That should also have manifested itself before, so I'm not sure what was going on :hmm:.
     

    Attached Files:

  11. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,053
    Location:
    Aotearoa
    That seems to have fixed the problem! Good job!
     
  12. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,703
    Location:
    DE/NL/FR
    Phew, glad to hear :).
    -> and also thanks for the bug report, else that would still be there.

    Will reupload the whole mod in the next hour.
    Edit: Or faster, done.
     
  13. The Fool King

    The Fool King Chieftain

    Joined:
    Feb 26, 2007
    Messages:
    73
    Thanks a lot for this, I'd been looking for a Europe map with realistic starting positions.
     
  14. Soxbadger

    Soxbadger Chieftain

    Joined:
    Jul 14, 2008
    Messages:
    12
    I tried to load the mod but when it loads it goes to the "technology advisor screen" with nothing on it. When you hit "exit" the game comes up but it says "Buginit Cannot find xml init for this mod"

    I am running BUG mod, so im not sure what exactly to do. Any tips would be appreciated, im not that well versed in this stuff.
     
  15. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,703
    Location:
    DE/NL/FR
    May I guess that you're on WinVista or 7? If so, then please start the mod/civ in general once with admin rights, so that BUG can create some of the necessary files. That should (hopefully) solve the problem.
     
  16. Soxbadger

    Soxbadger Chieftain

    Joined:
    Jul 14, 2008
    Messages:
    12
    I am using XP, but I will try, althoughI know so little Im not even sure if I can figure out what starting with admin rights mean haha
     
  17. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,703
    Location:
    DE/NL/FR
    On XP you should only have that problem if you don't work with admin rights (but the default is with admin rights).
    If you don't have admin rights, then make a right click -> execute as... -> choose an account with admin rights and type in the password.

    Next option would be to disable BUG for this mod, but I'm not sure if you want to do that...
     
  18. Soxbadger

    Soxbadger Chieftain

    Joined:
    Jul 14, 2008
    Messages:
    12
    Yeah I have admin rights. Im going to try and reinstall bug with this mod already saved, maybe that will do the trick. Otherwise Ill just start playing with it because the maps are loading, the civ is at the right spot (Egypt was at the Nile), just some of the files dont seem to be working exactly right, so it has to be something thats fixable. Just frustrating because this mod is exactly what ive been looking for as Id like to play more games that have civs starting in historical spots.

    Hopefully the simple reinstall works.
     
  19. Soxbadger

    Soxbadger Chieftain

    Joined:
    Jul 14, 2008
    Messages:
    12
    When I uninstall bug it works, so clearly thats the problem. If anyone has any tips or solutions that would be great, otherwise ill just turn off bug for a while and play.
     
  20. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,703
    Location:
    DE/NL/FR
    *facepalm* just realized that I already thought about the problem and know where the cause is. Basically it's so that this mod is not compatible with a default BUG installation, because it messes with some of the Python, which is restructured by BUG.

    There are 2 options:
    1) Installing BUG as mod and merging this mod into it or
    2) Turning BUG off.


    1) can be done, can give instructions how to do that.
    2) is easy. Requires you to open the Mods\StartingPoints\StartingPoints.ini file and changing
    PHP:
    Custom XML and Python from user folder are not loaded
    NoCustomAssets 
    0
    to 1.


    I think I should maybe write this somewhere down :hmm:.
     

Share This Page