[Map Script] PerfectWorld2.py

Cephalo, in modifying PW2 for more landmass, pangaeas, peaks and smaller mapsizes I seem to have broken something. I'm getting very few rivers, oases and lakes during generation. Any suggestions how I can get my freshwaters back?

There's a variable that controls river frequency.(I cant remember the exact name) Also, keep in mind that water comes in from the ocean. If the pangaea is too big, the amount of rain getting inland might get smaller than can be differentiated with a floating point number. You can run into number resolution problems when the cutoff for desert vs. plains is like 0.000000000004 rainfall.
 
My pleasure! :)
However, do you think I could fix this map for higher difficulty just by making the player's start better? I can certainly do something a little different in this regard when the difficulty is higher.
I guess that'd be enough, yes. As a quick fix I could also change the handicap file when playing PW2 maps. If I set the iStartingLoc value for Emperor to 50, I should get one of the good spots while still "enjoying" all the other disadvantages of that difficulty level :lol:

I will test this as soon as I'm home...
 
My pleasure! :)

I guess that'd be enough, yes. As a quick fix I could also change the handicap file when playing PW2 maps. If I set the iStartingLoc value for Emperor to 50, I should get one of the good spots while still "enjoying" all the other disadvantages of that difficulty level :lol:

I will test this as soon as I'm home...

Actually no, PW does everything differently than the default way. I never used the iStartingLoc value for the placement routines in PW.

Also, don't knock the 'new world' before you try it. It's pretty fun! The AI handles it well in my experience. If you think not, then maybe that's the edge you need in an Emperor game. :D See if you can escape to the new world.
 
one question about out "Start in the Old World" works: if the largest continent has more than 60% of the land, the script sets all civs to start there and that's it.

however: when the largest continent is less than 60%, the script will start considering other, smaller continents as "Old World" , until it reaches 60%, when it stops and assigns starting spots.

I guess this is when my question comes into being, possibly linked with IronClown's "difficult" starts: is there a specific way in which the additional continents are chosen when the main one is less than 60% , or is it random?

for example, does it choose the second biggest one first, or does it choose the smallest, or does it choose the one that will bring the land count above 60% and as close to 60% as possible or what?

depending on the map layout and how this routine is carried out, I can see a couple possible issues arising. namely:

1) if it chooses the second biggest continent, you could end up with a single civ having a whole large-ish continent for themselves. however:

2) if it chooses the smallest/just enough to go above 60% , it seems to me that you could definitely have a civ start on a tiny tiny island, with a larger continent ( which would probably be more fair if associated with the isolated civ stranded on a tiny island ) considered New World and uninhabited.

judging from the maps I've generated lately, it seems to me that 2) is more likely. I've definitely had a map composed of main continent with 4/5 civs, a tiny island, a decent-sized island and a small island. 2 civs got stranded on the small island, whereas it would have seemed to be more fair to place them on the decent-sized island.

of course, I do see how this algorithm is very complicated and very hard to be made balanced. just wondering :D
 
There's a variable that controls river frequency.(I cant remember the exact name)
Ooops, looks like a typo of mine was responsible! Very careless.

Also, keep in mind that water comes in from the ocean. If the pangaea is too big, the amount of rain getting inland might get smaller than can be differentiated with a floating point number. You can run into number resolution problems when the cutoff for desert vs. plains is like 0.000000000004 rainfall.

This is my next problem, my continental interiors are very dry. Making tectonic plates grow in the Y axis more often then the X helped, but I'm still getting blocky continents on occasion.
Would it be possible to target the meteors such that they land on solid coastlines such that they create inlets, so there will be less tiles very far from the ocean?


Edit: I probably shouldn't be editing while you're possibly typing a reply, but I just noticed I'm still not getting any freshwater lake formation. I wasn't able to make much sense of the depression lakes or siltification factors, so I don't know if they have inappropriate values or are not happening at all. But even with related values returned to default, they don't form.
 
[to_xp]Gekko;8285302 said:
one question about out "Start in the Old World" works: if the largest continent has more than 60% of the land, the script sets all civs to start there and that's it.

however: when the largest continent is less than 60%, the script will start considering other, smaller continents as "Old World" , until it reaches 60%, when it stops and assigns starting spots.

I guess this is when my question comes into being, possibly linked with IronClown's "difficult" starts: is there a specific way in which the additional continents are chosen when the main one is less than 60% , or is it random?

for example, does it choose the second biggest one first, or does it choose the smallest, or does it choose the one that will bring the land count above 60% and as close to 60% as possible or what?

depending on the map layout and how this routine is carried out, I can see a couple possible issues arising. namely:

1) if it chooses the second biggest continent, you could end up with a single civ having a whole large-ish continent for themselves. however:

2) if it chooses the smallest/just enough to go above 60% , it seems to me that you could definitely have a civ start on a tiny tiny island, with a larger continent ( which would probably be more fair if associated with the isolated civ stranded on a tiny island ) considered New World and uninhabited.

judging from the maps I've generated lately, it seems to me that 2) is more likely. I've definitely had a map composed of main continent with 4/5 civs, a tiny island, a decent-sized island and a small island. 2 civs got stranded on the small island, whereas it would have seemed to be more fair to place them on the decent-sized island.

of course, I do see how this algorithm is very complicated and very hard to be made balanced. just wondering :D

The whole 'old world' or 'world' is divided up evenly by value. A player will only be placed on his own island if the land value is roughly equal to what everyone else gets. If you have a large continent and a smallish island and 5 players, a player will only place on the island if it's value is similar to the value of the big continent divided by the remaining 4 players.
 
This is my next problem, my continental interiors are very dry. Making tectonic plates grow in the Y axis more often then the X helped, but I'm still getting blocky continents on occasion.
Would it be possible to target the meteors such that they land on solid coastlines such that they create inlets, so there will be less tiles very far from the ocean?

There's not alot of control for these factors. Generally if you increase the landmass, you'll get builkier continents. The meteors would basically have the effect of lowering the landmass.
 
I see! yeah, it makes sense since a huge continent is going to have a huge unusable desert, so in the end the good terrain/4 will have roughly the same value as a small island.
 
All right, something dark and sinister is at work here... I just generated 7 times on DEITY level with EXACT SAME SETTINGS as yesterday and I got very nice, non-isolated starting locations EVERY time. One time I had six food resources AND grassland AND hills AND nice surrounding land. There was never any ice to be seen.

For comparison I generated some maps on settler level and there was no notable difference. Some starts were ok, some good, all not strikingly better or worse than the AI starting positions.

Well... I guess it was just bad luck after all. To my defense I have to say that such a streak of bad luck seems extremely unlikely, and especially that it started just when I tried this new map script. I still don't get it. I mean, more than a dozen abysmal/isolated starts in a row? And then today seven good or great ones in a row? That's absolutely weird.

Anyway, I don't think you need to change the script after all :D (Unless you put something in that always generates bad starts for the player on mondays)
 
nice to see you're getting good results now :D

are you still using 12 civs on a large map, or are you using the default 9? beware, perfectworld sizes are larger than normal to make up for the fact that there's a lot of desert and water, so if you choose large you'll be actually be playing on huge. make sure your pc can handle it ;)

btw, if you have 6 food resources it probably means you don't have much room to expand without bumping into opponents. if you got no resources, it usually means the opposite.
 
All right, something dark and sinister is at work here... I just generated 7 times on DEITY level with EXACT SAME SETTINGS as yesterday and I got very nice, non-isolated starting locations EVERY time. One time I had six food resources AND grassland AND hills AND nice surrounding land. There was never any ice to be seen.

For comparison I generated some maps on settler level and there was no notable difference. Some starts were ok, some good, all not strikingly better or worse than the AI starting positions.

Well... I guess it was just bad luck after all. To my defense I have to say that such a streak of bad luck seems extremely unlikely, and especially that it started just when I tried this new map script. I still don't get it. I mean, more than a dozen abysmal/isolated starts in a row? And then today seven good or great ones in a row? That's absolutely weird.

Anyway, I don't think you need to change the script after all :D (Unless you put something in that always generates bad starts for the player on mondays)

If the starting position is so important on the higher difficulty levels, maybe I should do something about that. There's currently nothing in there that takes that into account.
 
[to_xp]Gekko;8285694 said:
btw, if you have 6 food resources it probably means you don't have much room to expand without bumping into opponents. if you got no resources, it usually means the opposite.

Yeah, this can be a real gotcha on this map. Be careful what you wish for! :D
 
It was 12 civs on a large map again, same as yesterday. There was also enough room... I prefer playing with fewer but better cities anyway. Having heaps of crappy cities is for the AI ;)

If the starting position is so important on the higher difficulty levels, maybe I should do something about that. There's currently nothing in there that takes that into account.
Well, if a simple regeneration of the map solves it (factoring out odd streaks of bad luck), I wouldn't mind too much about it. Exceptionally bad positions occur on all map types from time to time. I wouldn't even say it's especially important... only if you're playing "on the edge", such a disadvantage makes the difference between a challenge and a hopeless game.

Starting location generation was always a weak and badly balanced part of Civ4. That's particularly annoying in MP because most of the time at least one player gets a really bad start, and of course he can't just regenerate the map...
 
can perfectworld2 use resources tagged as strategic in the XML ( like horses and metals ) to soften bad starts? I just had a start in FF with 2 reagents in the BFC, which is weird cuz reagents are a rare strategic resource. then again, perfectworld2 may not know what reagents are at all :D
 
[to_xp]Gekko;8290621 said:
can perfectworld2 use resources tagged as strategic in the XML ( like horses and metals ) to soften bad starts? I just had a start in FF with 2 reagents in the BFC, which is weird cuz reagents are a rare strategic resource. then again, perfectworld2 may not know what reagents are at all :D

There is actually a separate tag in the XML (I forget the name) that determines whether a resource can be used this way. I believe most strategic resources have it set to zero. It's possible that the reagents are why that place became a starting city. Sometimes the bonuses come before the starting position.
 
ah, I guess you were thinking about the <bNormalize></bNormalize> tag, right? it's true, they have it set to one! so that's why I've been having so many freakin reagents around lately. thanx for solving the mystery cephalo! :goodjob:


totally unrelated question: I've read somewhere that when you up land percentage in PW2 you also have to up self.peakpercent and self.hillpercent , do you confirm that? so for example if I up land percent to 46 ( roughly 29*1.6) , should I also multiply the default values for those 2 variables by 1.6 ? this seems to be right, but I just can't make up my mind if it's working 100% right and I don't wanna screw up the algorithm :D is there any other variable that should be changed when changing the land percentage, or these 2 only?

also, when upping land percentage should I also up self.hillchanceatone and self.peakchanceatone, or ar those unrelated? thanx in advance for the help :)
 
[to_xp]Gekko;8291383 said:
totally unrelated question: I've read somewhere that when you up land percentage in PW2 you also have to up self.peakpercent and self.hillpercent , do you confirm that? so for example if I up land percent to 46 ( roughly 29*1.6) , should I also multiply the default values for those 2 variables by 1.6 ? this seems to be right, but I just can't make up my mind if it's working 100% right and I don't wanna screw up the algorithm :D is there any other variable that should be changed when changing the land percentage, or these 2 only?

also, when upping land percentage should I also up self.hillchanceatone and self.peakchanceatone, or ar those unrelated? thanx in advance for the help :)

Yes, currently those percents are the percents for every map tile. So, if you up the land percent, you will get less peaks if you don't change them to match. This is something that I will change soon, so that all these percents will be independant.

PeakChanceAtOne et al are just there to make high altitudes bumpier. Normally that sort of thing is based on altitude differences, but these are absolute.
 
I'm really liking this map script, however, I've run into a pretty major bug. The map is bordered by black, as opposed to scrolling around, as it normally does. Apologies if this has been asked before.

 
I'm really liking this map script, however, I've run into a pretty major bug. The map is bordered by black, as opposed to scrolling around, as it normally does. Apologies if this has been asked before.


The only way that's supposed to happen, is if you somehow accidently chose a flat map. The wrapping options are cylindrical (x wrap), toroidal(x and y wrap) or flat (no wrapping). Generate a few more, and check them out in World Builder to make sure it's what you are expecting.
 
Top Bottom