Maps with realistic starting positions for all civs

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?
 
:hmm: you could just use the map as normal map with preset civs, then you'd not have that problem.

I considered that but I don't want to lose choice of leader.

: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.

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.
 

Attachments

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).
 
Can't reproduce it :dunno:.
If I start that map, I'll only get 4 civs, nothing more.

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.

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.

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

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).

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?
 
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:

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.

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

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

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.

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?

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 ^^).
 
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:

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.

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

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.

What about the invalid civs?

They will not appear on the map at all.

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.

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

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 ^^).

I'm familiar with that file, thanks. I'll take a look and see if it says anything useful.
 
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.

...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...

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:

[...]

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.

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).


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

Better give it to me, because it will be easier for me to sort it out ;).
 
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.

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).

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

Attachments

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:.
 

Attachments

That seems to have fixed the problem! Good job!
 
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.
 
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
 
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...
 
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.
 
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.
 
*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:.
 
Top Bottom