Planet Simulator

I just wanted to thank you for taking the time to improve this script. It really is great and has lots of potential.

You're welcome!

Here ya go

Thanks! The bad news is that this not a bug I'll be able to fix unless it shows up somewhere else. The good news is it looks Worldbuilder-specific and there's a good chance it will never show up in Civ proper.

I couple of suggestions from the Communitas script I'd like to see implemented are:
  1. ensure NWs are not within the boundaries of CSes.
  2. better placement and number of resources across the map

I'll look into #1, that is a change I would also like but I don't know how hard it is to code. (Both CS and NW placement are currently handled by the default AssignStartingPlots functions, and I don't know how much rewriting would be necessary to add this feature.)

As for #2, the Planet Simulator code uses Civ's default resource placement code and I don't plan on adding my own resource code. That said, because PS uses the default resource placement and I believe resource generation is fairly self-contained (I think?), I suspect it might be straightforward to copy and paste your preferred resource placement code over into this script. If you have a specific map script's resource placement in mind (and its author(s) don't mind others using their code), you can point me at the script and I'd be happy to see if a 10 minute copy-and-paste is sufficient to add it as an option. I'm probably not going to put much more time than that into it though since it's not a personal priority.

When you choose Map Preset in the Advanced Setup with this script there are three options: Continents, Pangaea, and Other (n/a). What kind of world does the third option give you?

"Other (n/a)" is not actually functional; I believe it defaults to Pangaea. If I remember I'll remove the option in the next version.

Would there be interest if I added a "Random" option to Map Preset?
 
The mapscript I use is the Communitas script that has been 'slightly' modified by @Gazebo as found in the CBP.
@Thal's original script also had these features though so I'd imagine that it also contains much the same.
Comparing a standard resource placement as defined in Communitas to that of Continents, or Continents Plus has Communitas placing tiles of strategics with 1,2 or 4 quantities quite well whereas with Continents you get a lot of 1 tiles and then a couple of tiles with 6 or 7, often inside the CS boundaries.
 
You guys are doing God's work here. Not enough love goes into mapscripts, and they are really the heart of this game. I'm testing the last version of this shortly. :)
 
I love this map, merge in some of the Communitas map features and we have a winner.
 
Hi, just tried this out last night and it is very cool love how there are actually mountain ranges now and not a single CTD!!! Communitas was my favourite map for a long time but it is so buggy so if you could fold the best bits of it into PS I know a whole lot of people would be extremely grateful.
And I do have another request if I may be so bold, how about a step up in map size and a step down in continent size I love exploring and sea-faring so love it when civs spawn each on there own small continent but there really isn't a map out that caters for my epic length tastes and I am sure there must be others.
Anyway cheers for putting in the hard yards this is now officially my new favourite map.
 
The next release of Planet Simulator is here! This release includes bugfixes and the incorporation of some of Bobert13's Beyond Earth code. Detailed changes are in the changelog at the start of the file, but of particular note is the removal of the bug causing rivers to sometimes end too soon when flowing into an inland sea.

Given the enthusiasm for Communitas-style resources and natural wonders, I have started looking at integrating those, and they are currently my principle goal for the next release. It looks like those two together are what's covered by Communitas' override of some AssignStartingPlots functions, so I'm hoping that porting those into Planet Simulator will be a relatively straightforward process. That said, it's somewhere around 3000 lines of code I'll be merging in, and the ASP code is really fundamental to how Civ generates its maps, so there are bound to be challenges.

As always, please let me know if you find any bugs or if you have any requests. I'll try hard to address bugs, and while I make no promises about fulfilling requests, I am more excited about working on features other people are also enthusiastic about.
 

Attachments

  • Planet Simulator vLL3.7z
    39 KB · Views: 7,404
Same - thanks! Will give this one a whirl.
3000 lines... ugh. I hate it when its only 50 lines and then fixing all the build errors due to methods/vars/includes missing...
 
One thing I've noticed with this over my current prefferred mapscript, Communitas, is the placement of the major civs. On a number of maps now most of them are all close together on the same landmass, sometimes within only a few tiles from each other and it makes for some hectic games.

Notice how 4 of the 6 players are all on the on continent within a stones throw of one another.

Spoiler :


If we could have an option to spread them out more evenly.
The reverse side of this is sometimes you're alone on an island it makes it hard to keep up with everyone when there's interaction before you can cross the oceans.
 

Attachments

  • Civ5Screen0000.jpg
    Civ5Screen0000.jpg
    271.3 KB · Views: 1,552
One thing I've noticed with this over my current prefferred mapscript, Communitas, is the placement of the major civs. On a number of maps now most of them are all close together on the same landmass, sometimes within only a few tiles from each other and it makes for some hectic games.

With which settings are you generating a map? And is it a consistent effect with slightly different world generation settings?
 
The only setting I touch is the age of the map to generate more mountains, I change it to 3 billion years.
Yes seems to be fairly consistent, not many games with this just yet.
 
The only setting I touch is the age of the map to generate more mountains, I change it to 3 billion years.
Yes seems to be fairly consistent, not many games with this just yet.
And the map size?
 
I had noticed some slightly claustrophobic starts myself, but it was subtle enough that I thought I might just be having bad luck or noticing minor problems more because I was trying to check a script I was working on. Based on this feedback, I generated some maps, took screenshots of the minimap, and marked down the starting locations. I've attached the results to this post.

My conclusions:
  1. Clustered starts sometimes happen.
  2. Mountain ranges sometimes make a start tighter than it would otherwise be.
  3. The starting location code doesn't handle several continents of varied sizes particularly gracefully.

Planet Simulator uses Civ's default start placement code. The Communitas script technically doesn't quite use the default start placement code, but it is extremely similar. It is possible that when I finish adding the Communitas ASP code these start issues will be addressed, but I doubt it -- it doesn't look like this is what the start location changes in Communitas are trying to accomplish. I think instead the issue is that the start placement algorithm is somewhat poorly tuned for Planet Simulator. Two things in particular jump out at me:
  1. The start placement code measures the fertility of each continent (meaning "region of contiguous land"). It then tries to create a number of regions equal to the number of players with each region having roughly equal fertility by breaking large continents into multiple regions. This ends up ignoring small continents, which may be close enough to a player to be reasonable for them to colonize as soon as they can embark settlers. This isn't a problem for base Civ, which only has large continents or islands (and in particular doesn't have multiple continents of wildly different sizes). (For maps with many islands like archipelago, Civ has a different start placement algorithm, which I'll discuss below.)
  2. Civ ignores mountains for start placement, just treating them as infertile land tiles. This means that Civ will be oblivious to whether mountains push Civs toward each other when determining starting locations.

This doesn't leave much in the way of good options. Here's what I've thought of (if someone has other suggestions, let me know):
  1. Use Civ's archipelago start placement code. This is an easy change to make, but I suspect it will cause more problems than it solves (I believe it breaks the map into rectangles of approximately equal fertility without considering how connected/disconnected the tiles in each rectangle are. This seems problematic for maps that don't have land evenly distributed across the map). I'll give it a try though.
  2. Try to rewrite the start code to account for mountains and mixed continents. These features do not mesh well with the way the start code currently works, and I fear it might result in a montrous undebuggable mess that doesn't really do what we want.
  3. Write start placement code from scratch. This is a lot of challenging work.
  4. Try to rewrite the continent and mountain generation code to make the continents more equally sized and make the mountain ranges less of a barrier. I feel like this would destroy some of the things that make Planet Simulator great, and I don't plan on doing this.
  5. Decide the problem isn't a big deal and ignore it. Certainly straightforward for me, probably what I will be doing at least for now (unless the archipelago code works better than expected).
  6. Hope the Communitas code integration fixes it. That would be wonderful! I doubt that's what will happen though.
  7. Try to mitigate the problem. This means using fewer mountains (i.e. older worlds) and maps with more land per civ (fewer civs for than the default for the map size used and/or lower sea levels).

Given that the current state of affairs seems to be "start placement is sometimes somewhat clustered" rather than "start placement is routinely heavily clustered", I am going to make adjusting the start placement a low priority. If I see an opportunity for improvement I'll certainly take it. But for now, I'm going to treat this as a case of "if you have a script that generates more varied maps, sometimes that variation will cause starts to be unusually challenging". Making bad starts more likely is certainly not my goal with this script, but I don't currently see a way to fix it here without a serious investment of time and energy or a sacrifice of other goals I value more.

-------------

Qualanqui: You should be able to accomplish this with High sea levels on a larger map with fewer civs than default for that map size. If even high sea levels give too little water for your taste, I can definitely add even higher sea levels. (Unfortunately I can't add more map sizes -- as far as I can tell the size categories are not modifiable by map scripts.) If Huge maps are still too small for you, I could probably come up with a workaround ... but also you can adjust this yourself by changing the numbers in the line:
Code:
[GameInfo.Worlds.WORLDSIZE_HUGE.ID] = {128, 80}
to something bigger (make sure to keep them both even, and if you make them too big Civ will start having issues).
 

Attachments

  • Civ PS Starts 1.png
    Civ PS Starts 1.png
    67.9 KB · Views: 397
  • Civ PS Starts 2.png
    Civ PS Starts 2.png
    63.9 KB · Views: 441
  • Civ PS Starts 3.png
    Civ PS Starts 3.png
    79.3 KB · Views: 398
  • Civ PS Starts 4.png
    Civ PS Starts 4.png
    65.3 KB · Views: 370
  • Civ PS Starts 5.png
    Civ PS Starts 5.png
    67 KB · Views: 405
Cheers LamilLerran, I always play huge maps with high sea level and 8 civs/16 cs.
Is there a function where I can raise sea levels myself like the map size one you attached? Or alternatively how much work is it to convert it to an Archipelago map? Is it something a raging noob like me can do?
 
Nice work in the examination of the placement.
How does the code handle settlement placement when the sea levels are changed instead of the mountains? I understand the concept of the tiles being seen as infertile when more mountains are set so I'm curious to know how it treats more sea tiles as the end result is similar: less tiles to choose from for placement.
Whichever way you want to handle it is fine by me, it is afterall you doing the work.
 
Qualanqui: Yes. In the function MapConstants:InitializeSeaLevel(), in the elseif block commented "High", change the number in "self.landPercent = 0.25" to be something lower (e.g. if you want a world that's 85% ocean, change it to 0.15). This will change how much land/ocean there is when you use the high sea level option (if you like, you can change the "low" and "standard" sea level amounts as well).

As a warning, setting landPercent below about 0.1 or above about 0.45 may lead to unexpected and unwanted results (failure to achieve target land percentage, a pangaea when you asked for continents, weird lake/island patterns, possibly other things).

ExpiredReign: Unless the mountain range / sea goes all the way from coast to coast without a pass / isthmus, it should not make much of a difference to settlement placement (it will make a small difference as coast tiles have non-zero fertility, but this is unlikely to do very much). For mountain ranges that do go coast-to-coast, the script will consider both sides to be part of the same continent for placement purposes, whereas if it were a sea channel it would consider them different continents, but coast-to-coast mountains aren't super common.

The issue with the mountain ranges is that the start placement code doesn't consider the geometry of the terrain; it only considers "are these tiles connected by land" and "how far apart are start locations as the crow flies" (along with fertility considerations which treat mountains essentially the same as deserts). So if mountains box in a small area, the script can place a start in this boxed in area while thinking it's given you a much bigger region. It could even put a city state on top of the only pass out (or even another player, if that pass is far enough away), because it has no way to recognize that this is a major barrier.
 
Qualanqui: Yes. In the function MapConstants:InitializeSeaLevel(), in the elseif block commented "High", change the number in "self.landPercent = 0.25" to be something lower (e.g. if you want a world that's 85% ocean, change it to 0.15). This will change how much land/ocean there is when you use the high sea level option (if you like, you can change the "low" and "standard" sea level amounts as well).

As a warning, setting landPercent below about 0.1 or above about 0.45 may lead to unexpected and unwanted results (failure to achieve target land percentage, a pangaea when you asked for continents, weird lake/island patterns, possibly other things).

Cheers for the info bro.
 
Hi ! A big thanks to Bobert and Lamil for creating and updating this map ! I'm trying out the version Lamil posted in the page before and the results are amazing. It beats Communitas (which is great) as it does create enough desert and jungle, while Communitas has too many plains and grasslands. Also, when compared to Tectonics, Planet Simulator has the option of a Terra start with everyone on the same continent, and this is really nice.
 
Top Bottom