Posts: 545
Threads: 22
Joined: Dec 2005
Applause - I want to use this map for an OCC project I'm working on.
Notes after poking at it a bit:
Bonuses seem to be really dense on a 32x32 map w/ Waterways. 3x3 blocks of land with no resources in them were rare. Larger maps sizes do better, maybe, so perhaps the problem is that I don't have a good intuition for what the dimensions should be for each size?
If I'm reading the code correctly, doStartPlots occasionally pulls a random plot from inside the BFC. It looks as though it can also be checking plots in someone elses BFC. There are several forms of clever that could be used to speed up those 1000x iterations, but I'd want to first be sure that's really where the bottle neck was before I started experimenting.
Code: if self.plotTypes[neighbor] != self.OCEAN and self.plotTypes[neighbor != self.PEAK]:
That second condition looks funny.
May 17th, 2013, 02:31
(This post was last modified: May 17th, 2013, 02:32 by SevenSpirits.)
Posts: 7,766
Threads: 94
Joined: Oct 2009
(May 17th, 2013, 01:37)VoiceOfUnreason Wrote: Applause - I want to use this map for an OCC project I'm working on.
Notes after poking at it a bit:
Bonuses seem to be really dense on a 32x32 map w/ Waterways. 3x3 blocks of land with no resources in them were rare. Larger maps sizes do better, maybe, so perhaps the problem is that I don't have a good intuition for what the dimensions should be for each size?
I'm doing quantity of resources pretty much exactly like stock Civ IV (though it's possible I round a bit later, or of course that there's a bug):
Food resources (and a few strategic ones like copper) scale in quantity with the number of tiles on the map that meet their placement requirements. You might see a very slightly higher than average density of food resources over the whole map, because this map has less tundra, ice, and desert. But if you look at the temperate part of a pangaea and one of these, I think the density will be similar.
Luxuries and strategic resources (including the ones from earlier, too) scale with number of players in the game. For example, the number of gold resources on the map is supposed to be 0.5-1 per player. So if you increase the player count for a map of the same size, you will get a denser luxury and strategic resource distribution. Default settings for this script, with dimensions 32x32, are IMO appropriate for 5 players, and produce a similar number of land tiles to what default scripts would use for 5 or 6 players. I'm thinking it's possible you generated a 32x32 map for 7 players (default number for a "standard" map) and therefore saw some unusually high resource counts.
Additionally, another factor is that the default civ iv rule is that some resources (essentially, some luxuries) will tend to clump together. This adds some really high-density areas which naturally result in lower density elsewhere. In this script, I ignore the clumping rule entirely because I don't like it, so that would be contributing to slightly higher typical resource density too.
Finally, the standard civ IV behavior is to try to not place resources adjacent to other ones. I also mildly discourage placement of resources within a BFC of other resources. It's possible that my placement pattern results in a more even distribution.
Quote:If I'm reading the code correctly, doStartPlots occasionally pulls a random plot from inside the BFC. It looks as though it can also be checking plots in someone elses BFC. There are several forms of clever that could be used to speed up those 1000x iterations, but I'd want to first be sure that's really where the bottle neck was before I started experimenting.
Code: if self.plotTypes[neighbor] != self.OCEAN and self.plotTypes[neighbor != self.PEAK]:
That second condition looks funny.
I tried varying the number of iterations and it doesn't make a big difference, actually. Having played around with it a bit more, using settings more like what Krill would use (primarily, much larger maps), I think the slowdown is more due to the water layout and resource placement, which uses an algorithm that considers every tile a candidate every time it wants to place a single ocean tile or resource (and generates random numbers for each!). These parts are certainly flagrant about their inefficiency, but I also don't think that a delay on the order of a minute is really important here, since the idea is to generate just a couple maps per hundreds or thousands of hours of gameplay.
Haha, thanks for the bug find. So let's see, neighbor != self.PEAK should evaluate to 0 most of the time, which means that it's checking if it has a non-ocean neighbor AND the bottom left of the map has non-zero plot type i.e. it is not a peak tile (the fact that 0=peak here is a funny coincidence). So once in a blue moon, if you roll a peak in a certain tile of the map, you'd get every water tile on the map thinking it can't have seafood because it's not next to any land.
Posts: 5,294
Threads: 59
Joined: Dec 2004
Yeah, I think from a bang-for-buck perspective you're much better off making a map-script generator better rather than faster. Even playing fast on standard size my games go about 8 hours, so paying an extra few minutes up front is unnoticeable in the grand scheme of things .
Blog | EitB | PF2 | PBEM 37 | PBEM 45G | RBDG1
Posts: 2,504
Threads: 29
Joined: Oct 2009
I would be interested in playing a PBEM using this new map script. It looks fantastic. Nice work Seven.
Posts: 7,766
Threads: 94
Joined: Oct 2009
I would like to play a PBEM on it too...
By the way, thank you for the praise, Kyan and everyone else.
Posts: 2,504
Threads: 29
Joined: Oct 2009
(May 17th, 2013, 03:45)SevenSpirits Wrote: I would like to play a PBEM on it too...
By the way, thank you for the praise, Kyan and everyone else.
It's very much deserved.
As for the PBEM, I'm at work with limited time to get online right now but if you wanted to start a thread for a new game, consider me in. If it gets to the relevant stage today (unlikely), consider my votes for any settings to echo yours for counting purposes.
Posts: 23,441
Threads: 132
Joined: Jun 2009
(May 16th, 2013, 18:11)SevenSpirits Wrote: (May 16th, 2013, 15:16)Krill Wrote: Just wondering if it's possible to use this method to generate maps like those seen in PB5 and PB8: mainly stringy continents and islands. I think it's probably possible if the water %age were increased but I think a lot of the time the map might end up with tones of 1 tile islands and stringy 15 islands rather than proper continents.
Having said all that, if we ever wanted to give a 30 player PB game a try I think this is the perfect mapscript. Just might take a while to find the map to play on
OK, I'm working on it.
Since my personal preferences go towards a map with more land (e.g. waterways, inland seas, or inland oceans options on this map), it would be really helpful to hear what aspects of a more water-heavy map like pb5 or pb8 you prefer, so I can focus on including those.
OK, I hope this is a helpful method of describing what I feel are the important aspects; it's very possible this isn't what you are looking for though:
- 90% of the land has to be accessible via galley (so either coastal connections or you can settle a city and pop borders to cover 1 tile of ocean).
- Everyone has be contactable via galley; this is why I think maps like tilted axis, medium and small, and others, are not good map scripts. So basically I view big and small as 1 map, but medium and small is effectively 2 or more separate maps that are generated and then placed in one large ocean. The former is ideal, the latter is not wanted in any shape or form.
- Potentially (I'm unsure how this could work from a map generation PoV) but sometimes maps that have a large %age of the land on a single continent or maybe 2 continents rather than split into 5+ islands are more balanced for MP play in the context of large PB games.
(As an aside, I think it's helpful to view big and small maps as a continuation of a lakes map script. As more and more land is turned into ocean, the lakes grow and the Pangaea is split into multiple continents with islands present).
- Actually, that is about it, because I think the majority of the other points this map script solves anyway: the starts are all playable and not perfectly balanced, which is the ideal solution IMO, and each player has plenty of land to expand into because of how you iterate the starting locations.
FWIW, I think the only potential problem is that as you decrease the amount of land it's feasible that certain starts end up having access to less land to expand into than others.
As an aside, there are certain requests I would have for usability of the script. For example, it's hard to know exactly how much land is going to be generated on any of the dimensions due to the "waterways" settling. Would it be possible for you to state in that setting the %age water produced on a map? Or maybe in a readme file if you package the script in as a .zip or .rar?
Current games (All): RtR: PB80 Civ 6: PBEM23
Ended games (Selection): BTS games: PB1, PB3, PBEM2, PBEM4, PBEM5B, PBEM50. RB mod games: PB5, PB15, PB27, PB37, PB42, PB46, PB71. FFH games: PBEMVII, PBEMXII. Civ 6: PBEM22 Games ded lurked: PB18
Posts: 6,077
Threads: 36
Joined: Jul 2010
(May 17th, 2013, 03:45)SevenSpirits Wrote: I would like to play a PBEM on it too...
(May 17th, 2013, 04:42)Kyan Wrote: As for the PBEM, I'm at work with limited time to get online right now but if you wanted to start a thread for a new game, consider me in. If it gets to the relevant stage today (unlikely), consider my votes for any settings to echo yours for counting purposes.
Assuming you guys don't mind someone whose BTS is a bit rusty on the roster, I'm interested .
fnord
Posts: 2,504
Threads: 29
Joined: Oct 2009
(May 17th, 2013, 08:37)Thoth Wrote: (May 17th, 2013, 03:45)SevenSpirits Wrote: I would like to play a PBEM on it too...
(May 17th, 2013, 04:42)Kyan Wrote: As for the PBEM, I'm at work with limited time to get online right now but if you wanted to start a thread for a new game, consider me in. If it gets to the relevant stage today (unlikely), consider my votes for any settings to echo yours for counting purposes.
Assuming you guys don't mind someone whose BTS is a bit rusty on the roster, I'm interested .
I don't mind who plays. You'd be very welcome in my opinion, especially if you organised things...
Posts: 7,766
Threads: 94
Joined: Oct 2009
(May 17th, 2013, 06:38)Krill Wrote: OK, I hope this is a helpful method of describing what I feel are the important aspects; it's very possible this isn't what you are looking for though:
- 90% of the land has to be accessible via galley (so either coastal connections or you can settle a city and pop borders to cover 1 tile of ocean).
- Everyone has be contactable via galley; this is why I think maps like tilted axis, medium and small, and others, are not good map scripts. So basically I view big and small as 1 map, but medium and small is effectively 2 or more separate maps that are generated and then placed in one large ocean. The former is ideal, the latter is not wanted in any shape or form.
- Potentially (I'm unsure how this could work from a map generation PoV) but sometimes maps that have a large %age of the land on a single continent or maybe 2 continents rather than split into 5+ islands are more balanced for MP play in the context of large PB games.
(As an aside, I think it's helpful to view big and small maps as a continuation of a lakes map script. As more and more land is turned into ocean, the lakes grow and the Pangaea is split into multiple continents with islands present).
- Actually, that is about it, because I think the majority of the other points this map script solves anyway: the starts are all playable and not perfectly balanced, which is the ideal solution IMO, and each player has plenty of land to expand into because of how you iterate the starting locations.
FWIW, I think the only potential problem is that as you decrease the amount of land it's feasible that certain starts end up having access to less land to expand into than others.
As an aside, there are certain requests I would have for usability of the script. For example, it's hard to know exactly how much land is going to be generated on any of the dimensions due to the "waterways" settling. Would it be possible for you to state in that setting the %age water produced on a map? Or maybe in a readme file if you package the script in as a .zip or .rar?
So, having played around with it some, I can tell you we are not going to get a B&S-like map out of it. The problem is that the water placement algorithm was basically designed for the waterways setting - it looks only at direct neighbors of tiles, which works great when what you are aiming for is shapes that are only 1-3 tiles wide anyway, but not good for creating large, thick, continents. I think that takes a different enough approach that I would need to redo the base terrain generation, so probably it would be split off into another script.
I did end up with a sort of dense archipelago thing that could potentially be used, which I will post. Basically by inverting land and water from the Inland Oceans setup.
Default water level is 29%, just a bit under circumnavigation threshold. Others are multiples of it and say so. I've taken your suggestion though and updated it to just the percentages.
|