Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Topic started by: bvanevery on March 10, 2018, 02:46:44 AM

Title: ensuring more land
Post by: bvanevery on March 10, 2018, 02:46:44 AM
I'm playing on 256x128 maps nowadays.  I call them Giant maps, 4X larger than Huge.  I'm finding it impossible to generate a world that's mostly land.  Seems like I've gotten those kinds of worlds on smaller maps plenty of times, where it's mostly land, but there will be some "gigantic lake" on the planet somewhere, or maybe 2.  I'm now about to start poking around in the files and see if there's anything I can set to ensure more land gets generated.  Selecting 30%..50% land from the game menu definitely won't do it.  At the Giant scale, I get water worlds.  Sometimes with big continents, oftentimes not.  And I'm usually getting stuck on tiny islands to start with, as Aki Zeta-5 at least.

The purpose of having more land, is to make it easier for the AI to plan and conquer.  I find that the AI completely stagnates when given a water start, especially if it's a small island start.

In alphax.txt I find myself modifying: Land base, Land modifier, Continent base, Continent modif., and Islands.  I also tried changing Deep water to something smaller, but changed it back to its default.  I've made progress with filling the map with more land, but a satisfying ratio of land to water and crinkliness still eludes me.  I'm tired, I will try again tomorow.

crippled factions
crippled factions

This morning I generated a world with the following changed parameters.  Continent base = 36, Continent modifier = 72, Islands = 12.  It looked like an almost all land world, eyeballing the radar readouts.  I guess I should switch to an Alien faction while trying to figure out how these settings work, so that I know for sure.  Played the game for a bit, realized I was on a tiny dry island, although possibly connected by land to the west with an intervening patch of fungus.  Then noticed that 2 factions were dead and 1 severely crippled, which was not the goal creating a world like this.  They probably got pathological 1x1 island starts.

Islands=1
Islands=1

Provisionally, I think the "real continents" quality of the map is much improved by setting Islands=1.  A Pirate would still be able to dominate the oceans of such a world.  Granted, this map also had Continent base=48, Continent modifier=96, but Islands seems to control how much things are broken apart.  I think I'm telling it, "don't break stuff apart into little pieces".

continents default
continents default

The continent seed settings do matter though.  This is what happened when I set them back to default.  In other words, the only setting changed for this map is Islands=1.  Not enough to make good continents.  I will now see how high I have to crank the Continent settings to get good ones.  [Experimentation ensues....]  I have determined that the Continent settings I had are required.  Lower values create "spotty" worlds that the AI will have a difficult time with.

My final solution is: Continent base=48, Continent modifier=96, Islands=1, to produce "nicely solid" continents.  At least on a Giant 256x128 map.

Title: Re: ensuring more land
Post by: bvanevery on March 20, 2018, 06:19:00 PM
clustered factions
clustered factions

For some reason in this game, all factions were started within an area the size of - possibly - a Normal map, even though I created a Giant 256x128 map.  To some extent it makes me wonder, what is the point?  If we're all going to be in contact, then I might as well play on a Huge map at most.  Granted, I did have to get The Empath Guild to find the Peacekeepers, the Cybernetic Consciousness, and the Data Angels.  The University, the Hive, and the Spartans, I found by sailing.  I am the Pirates, which is the aqua colored clump in the middle.

I've had problems with the game putting factions on 1x1 islands.  It happened to Roze this game.  Look at the clump of factions on the map; Roze is in the upper right of the clump.  Not only is she on an island, the island is inside a small lake!  She wasn't given a boat either; that frequently happens with these 1x1 island starts.

This world was generated with a different Islands setting because I was trying to see if it would help with the stillborn faction problem.  I tried Continent base=48, Continent modifier=96, Islands=9 but that is clearly not the answer.  If there is one.  I wonder if Islands=0 will work?
Title: Re: ensuring more land
Post by: bvanevery on March 20, 2018, 09:30:17 PM
Islands equals zero
Islands equals zero

Setting "Islands=0" does not make 1x1 islands go away.  There are plenty of them.
Title: Re: ensuring more land
Post by: bvanevery on March 20, 2018, 09:45:10 PM
sail where
sail where

Well this is cute.  Exactly what good is that boat supposed to do me?  I'm trying larger land mass settings, but it's not solving the basic problem.  The coasts are just too crinkly and spotty.  Maybe one of the other settings can smooth them out, and eliminate these 1x1 islands and 1x1 lakes.
Title: Re: ensuring more land
Post by: bvanevery on March 20, 2018, 09:58:53 PM
planning normandy
planning normandy

The "Beach" setting makes the coastlines a lot more smoothly varying.  The default is "Beach=10".  I've cranked this up to "Beach=40".  There are very few 1x1 or 3x1 island artifacts, but they do exist.  Maybe the odds are improved that factions won't get degenerate starts, but I have a sinking feeling the game will find a way.  So I will look for ways to completely eliminate the tiny islands.
Title: Re: ensuring more land
Post by: Buster's Uncle on March 20, 2018, 09:59:52 PM
sail where
sail where

Well this is cute.  Exactly what good is that boat supposed to do me?  I'm trying larger land mass settings, but it's not solving the basic problem.  The coasts are just too crinkly and spotty.  Maybe one of the other settings can smooth them out, and eliminate these 1x1 islands and 1x1 lakes.

I wouldn't call that a bug - just bad luck and a shame.  It would take some code space to run a check for at least one adjacent water square, which sounds more doable the more keys I hit saying so.  -Put it up for Yitzi or scient, I guess.
Title: Re: ensuring more land
Post by: bvanevery on March 21, 2018, 01:38:14 AM
That island with the trapped transport is survivable but it's still an egregously lousy start.  Especially on a Giant map where other factions can be presumed to have a gigantic amount of land available to them.  No question that the faction placement code does a bad job of determining whether the position is viable.  It should be considering the map scale as part of the prognosis.  Really, having starts on tiny islands, I mean like 1x3 squares or smaller, is common on a lot of the big maps I've generated.  The only practical answer IMO is to make sure the map generator doesn't create such terrain to begin with.  To wit:

maze

The following settings seem to be absolutely necessary to suppress 1x1 islands: Deep water=30, Shelf=20, Beach=50, Islands=0.  The first 3 settings must be at least that large.  Islands has to be 0.  This I determined by a lot of empirical experimentation.

Furthermore I think that the continent settings may have to be some minimum size or 1x1 islands can happen.  They are still rather uncommon with the above settings though.  The continent settings give some flexibility as to what kind of world happens.  Beach tends to elongate a lot of shapes, which causes them to run into each other and create more of a maze of ribbons than distinct continental masses.  Higher continent settings do consolidate the land more, but there's a point at which higher settings cease to matter.  I have been using the 30%..50% ocean setting in the main game menu, so possibly a world with more ocean might have more isolated continents.  I'm not sure if a world with a continental distribution like our own planet is possible, and still have no 1x1 islands, but I haven't really tried either.

The above map was generated with Continent base=36, Continent modifier=72.  Oh and this is a Giant map, 256x128, 4X larger than Huge.  I haven't tried any of these settings on smaller than Giant maps.  Maybe they can make any map more playable, but I'm still interested in Giant maps for now.  I've also only tried Average settings for erosion.  Cloud cover and fungus were also Average, but I don't expect those to affect the topology.
Title: Re: ensuring more land
Post by: Buster's Uncle on March 21, 2018, 03:08:01 AM
Oh, I totally get all that - if I'm not playing Pirates, water tend to get in the way more than anything - and I never played Pirates much.
Title: Re: ensuring more land
Post by: bvanevery on March 21, 2018, 03:12:21 AM
four stillborn
four stillborn

How did I fail at this??  3 human factions and 1 Alien faction stillborn, using all those great settings above.  I'm playing the Caretakers, toodling along building my Secret Projects, thinking I'm doing awfully well.  Then I notice the power graph.  I switched to Edit mode, something I have almost no experience with, and revealed the entire map.  The Pirates and the Data Angels got normal starts, but the other 4 factions don't seem to have even been placed on the map.  Most of the land on this map was connected, so I wonder if the game got confused about there not being all that many continents?  I got a big island to myself, and there was another big island next to me.  Svensgaard got an ocean.  Roze was on some land; could that all have been counted as "1 continent" ?
Title: Re: ensuring more land
Post by: Green1 on March 21, 2018, 03:14:35 AM
Wasn't there talk of an external map maker years back?

Not that I think anything ever came of it..
Title: Re: ensuring more land
Post by: Geo on March 21, 2018, 06:20:59 AM
Are factions allowed to respawn when eradicated in these testgames? Because that would solve the issue of the initial colony pod being snagged by native life on turn one or so.
Title: Re: ensuring more land
Post by: bvanevery on March 21, 2018, 01:12:11 PM
They are allowed to respawn but I guarantee you that isn't solving anything.  Best I can tell, from examining piles of freshly started games in the Scenario Editor, is that factions are not even being placed on the map in the 1st place.  Sometimes it is so bad that I get Conquest Victory immediately upon starting the game!  My leading theory so far, is that "a lack of distinct continents" causes the bug.
Title: Re: ensuring more land
Post by: bvanevery on March 21, 2018, 01:33:32 PM
huge map no continent modifiers
huge map no continent modifiers

The above was generated on a Huge map without changing Continent base or Continent modifier.  Settings that were changed are: Deep water=30, Shelf=20, Beach=20, Islands=0.  I wonder if Continent base or Continent modifier are used to determine starting positions?  Like if they're too high, especially for a highly connected map, then the placement algorithm chokes.  Strict separation of continents is obviously not required on a Huge map though.  In fact the algorithm is often "cute" and places factions rather close to each other.  Which I don't want; using a larger map, is supposed to be about factions taking longer to get to each other.
Title: Re: ensuring more land
Post by: bvanevery on March 21, 2018, 03:19:59 PM
cute

I have found that the Deep water, Shelf, and Beach settings are not necessary to prevent degenerate starts.  Setting the Continent settings sufficiently large, and setting Islands=0, is sufficient on a Huge map.  The above was generated with Continent base=30, Continent modifier=60, Islands=0.  However no matter what settings I try on a Huge map, I cannot solve the problem of the faction placement algorithm getting "cute" and putting factions too close together.  In the above, the Morganites are stuck behind the Data Angels on a small amount of land.  The Data Angels are squeezed between the Morganites and the Gaians on not very much land.  The Believers and the Cybernetic Consciousness are started right next to each other, although at least they both have room to go their own ways.  Only the University and the Peacekeepers were given "unobstructed" starts.

My testbed is 7 human factions, all on land, all placed immediately at the beginning of the game.  I think Cha Dawn gets placed 3 turns late, because he was found in the fungus or some nonsense like that.  The Alien factions of course get placed 3 turns late.  I am trying to ensure maximum crowding.   I chose these specific 7 factions so that I can see their color dots more readily on the map.  I'm not sure if faction aggression levels or social engineering biases have anything to do with placement.  I suspect that it's random, but just in case, I didn't duplicate 7 yellow colored Morganites for instance.  Although, that might be a fair test for determining whether placement is random, or the faction has some influence over placement.

I probably can't do any better with the settings on a Huge map, but I will run a few more tests to be sure.  Once I'm done with that, I'll see whether the same settings hold up on a Giant map, or if I get degenerate starts again.  Also whether the "cuteness" problem goes away just for the sheer amount of land available.
Title: Re: ensuring more land
Post by: bvanevery on March 21, 2018, 03:46:27 PM
gigantic degeneracy
gigantic degeneracy

Well !#!@# using the exact same settings above on a Giant map, I got 2 degenerate 1x1 islands placements including myself, an unacceptable 5x2 island placement, and 3 factions not placed at all.  Only Morgan got a normal placement, and he was the 1st faction in the turn order.  I've rearranged the faction order to be alphabetical by the faction's short name, i.e. the Angels shall be 1st in the list now.

What gives?!?  I wonder if it's a wraparond bug and a slightly smaller map size would fix everything.  What I do know, is the Giant maps are very consistent about dropping factions, with settings that are fine for Huge maps.

Title: Re: ensuring more land
Post by: bvanevery on March 21, 2018, 04:06:41 PM
240x120 still dropping
240x120 still dropping

I changed the definition of a Giant map to 240x120.  This is not sufficient to prevent dropped factions, but it happens less frequently.  At 256x128 it was all but guaranteed, now it takes ~5 map generations to see factions dropped.  1x1 island starts are still exceedingly common and the generated maps are not basically usable.  I will try dropping to 120x120.

Title: Re: ensuring more land
Post by: bvanevery on March 21, 2018, 04:49:11 PM
80x160 is stable
80x160 is stable

80x160 seems to place factions just fine from run to run.  120x120 also works, but the aspect ratio in the minimap looks terrible.  Everything is squished horizontally.  In the 1:2 format, everything higher than 80x160 seems to result in dropped factions.  In particular, 100x200 will not work consistently.  So I guess I'll go with 80x160, which is only a little bit better than a Huge map, but I'll take what I can get.  Not certain if I have come up with the ideal settings, but the settings I used above for Huge maps work "ok" at 80x160.  Those are: Continent base=30, Continent modifier=60, Islands=0.

What will I call this size of map?  I don't want to use the word "Giant", because I've already been using that to describe 128x256 maps.  A word that's a bit huger than huge, but still isn't Giant.  Ogre?  Nah.  Really Huge?  Nah.  Trumpian?  No.  Titanic, Mega?  Getting bored.

For now I'm gonna call it "4X Standard" because that's exactly what it is.
Title: Re: ensuring more land
Post by: gwillybj on March 21, 2018, 09:47:09 PM

For now I'm gonna call it "4X Standard" because that's exactly what it is.


Giant
"Bigger"?
Huge


I wrote a post in December 2017 addressing a different topic, but mentioning #WORLDBUILDER.

In 2004 smacksim wrote a series of posts at Apolyton: "Improving the AI: Part I: The Worldbuilder section of alphax.txt". His work has been invaluable to me.

I extracted the entire discussion, pasted it into Word, spell-checked it, and reformatted the paragraphs (in all of this changing none of the context). I saved the results both as a nice Word 2016 document with color and outlines and such, and as a simple text file. I've attached both files [t]here. Someone else might get as much out of smacksim's work as I have.

http://alphacentauri2.info/index.php?topic=20260.msg109203#msg109203 (http://alphacentauri2.info/index.php?topic=20260.msg109203#msg109203)
Title: Re: ensuring more land
Post by: bvanevery on March 21, 2018, 10:46:59 PM
I can't take "Bigger" seriously.  I snigger and think of Valley Talk like "ginormous".  I did think of "Huger" but dismissed it.  1) Sounds like a stupid person saying "Huge", 2) very close in spelling to "Huge" and could be easily typoed.

New dumb idea: Bonus Huge.

The smacksim analysis, has some of the concerns I looked into, and others I wasn't even aware of.  "Won't settle on highland plains" is an interesting phenomenon or quandry, one that I can't say I've directly noticed.  I have noticed that the AI spreads itself out way too much, if it's got land to do so.  I wonder why it doesn't try to pack itself in more tightly?

I have indeed theorized that there's an optimal size of continent for a strong AI.  Problem is, the AI is crap at attacking over water.  That's part of why I've made worlds where enemies are reachable by land.  So far it seems like 4 times out of 5, the distribution of 7 factions in the world is reasonably spread out.  1 time in 5, there will be a substantial clump of factions all in the same area.  I think that's the "big continent" phenomenon that smacksim mentioned, or what I've called the placement algorithm being "cute".

I notice that smacksim did not change the continent size ratio settings.  I haven't either.  In the past 24 hours I've pretty much worn myself out rerolling worlds.  I'm ready to proceed to actual game playing for now.  But I think adjusting the continent size ratios, might be an area where better results could be obtained.  (Enough weasel words in that?)
Title: Re: ensuring more land
Post by: Buster's Uncle on March 21, 2018, 11:04:43 PM
Bonus Huge would work. ;nod
Title: Re: ensuring more land
Post by: bvanevery on March 30, 2018, 07:15:57 PM
I've got it!  I will call it an "Enormous" map.  Even though Huge and Enormous could be considered synonyms, Enormous is a longer word.
Title: Re: ensuring more land
Post by: Buster's Uncle on March 30, 2018, 08:21:13 PM
-A 'bigger' word...
Title: Re: ensuring more land
Post by: bvanevery on March 30, 2018, 08:23:08 PM
Not necessarily.
Title: Re: ensuring more land
Post by: Buster's Uncle on March 30, 2018, 08:23:34 PM
Yessir.
Title: Re: ensuring more land
Post by: bvanevery on April 02, 2018, 02:33:20 AM
I just tried a lot of different continent ratio settings.  The default settings are "3,6,12,18,24 ; Ratio    (Continent size ratios)".  Changing those didn't seem to have any impact on map generation at all.  I tried making them lower, higher, fewer than 5 settings, more than 5 settings.  No differences that I could discern.  I even tried completely quitting the game and loading "cold" rather than just starting new games, in case alphax.txt was only being read once.  No luck.  So until I run into someone with alternate experiences, I'll leave them at their defaults.
Title: Re: ensuring more land
Post by: bvanevery on January 14, 2020, 03:19:54 PM
I changed the definition of a Giant map to 240x120.  This is not sufficient to prevent dropped factions, but it happens less frequently.  At 256x128 it was all but guaranteed, now it takes ~5 map generations to see factions dropped.  1x1 island starts are still exceedingly common and the generated maps are not basically usable.

In another thread, someone brought up that allowing a map coordinate to go all the way to an 8-bit integer boundary, might expose more bugs in the game.  They theorized that pathfinding, and the pesky "Interceptor crashing the game" bug, might be driven by this sort of thing.  I wonder if behavior improves simply by changing it to 252x126 ?  I can't really test the postulated midgame bugs, but I can test the faction dropping bug fairly readily.

My SMACX AI Growth mod is still using 256x128 for Giant maps.  I have no idea if anyone actually uses that, and Huge is my recommended map size nowadays.  It would still be good to find the threshold and record this wisdom in the mod, for posterity.
Title: Re: ensuring more land
Post by: Petek on January 16, 2020, 10:46:41 AM
I looked into the problems with enormous maps around 10 years ago. The specific problems are that factions sometimes spawn on small islands, or don't spawn at all. I found that:

The above problems occur only in SMAX, not SMAC. I speculate that the "faction spawning algorithm" in SMAX had to be modified from the one in SMAC to account for several factions starting off later than the others. That is, suitable starting locations had to be reserved for the late-starting factions, especially on smaller maps. The unintended consequence was that starting locations were borked on larger maps. The workaround is to use pre-generated maps. For some reason these maps don't have the above problems. I posted some saved files of largish maps here (https://forums.civfanatics.com/resources/bigsmacxmaps1-zip.19471/) and here (https://forums.civfanatics.com/resources/bigsmacxmaps2-zip.19472/).
Title: Re: ensuring more land
Post by: bvanevery on January 17, 2020, 08:37:51 PM
The other workaround is to reduce map size to a threshold where the bad starts problems don't occur.  I did that in my mod, determining a threshold by sheer trial and error.  I defined the so-called Enormous map at 80x160.  160x160 would also work, but the pixel aspect ratio is horrible.  1:2 is necessary for the map to look nice in the minimap display.

I am currently playing a Giant game with the new 126x252 dimension.  No bugs so far.  That doesn't mean much.  Dropped factions are definitely possible at this size, and an earlier game was missing someone.  I wasn't expecting that problem to be solved though.  I just don't want any other game crashing bugs.  In my current game, 6 factions including myself are healthy and accounted for.  The Usurpers are extant, but I don't know their land extent yet.  I think they have a normal appearance on the power graph, so I don't think they were stillborn.
Title: Re: ensuring more land
Post by: scient on January 17, 2020, 10:26:57 PM
In another thread, someone brought up that allowing a map coordinate to go all the way to an 8-bit integer boundary, might expose more bugs in the game.  They theorized that pathfinding, and the pesky "Interceptor crashing the game" bug, might be driven by this sort of thing.  I wonder if behavior improves simply by changing it to 252x126 ?  I can't really test the postulated midgame bugs, but I can test the faction dropping bug fairly readily.

Most coordinates are stored in game structures as 'signed short' (__int16). There could be instances where they are treated as signed 8-bit causing issues.

The interceptor crash might be a combination of things. The heart of it has to do with two globals not being set correctly (VehLift_xCoord/VehLift_yCoord), causing game to potentially attempt to read invalid memory address inside map struct. The crash occurs inside veh_scoot. The globals get set in veh_lift. My unofficial patch basically sets these globals directly further up in the code. The interceptor function is on my short list to poke around next and implement a more elegant bug fix.

https://github.com/b-casey/OpenSMACX/blob/master/src/veh.cpp#L1281
Title: Re: ensuring more land
Post by: bvanevery on January 17, 2020, 10:57:44 PM
I feel like we're talking about a baby we're not even allowed to breathe on.   :D

How to raise a nerve stapled child.  Just rewrite its base code.