Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Bug/Patch Discussion => Topic started by: scient on February 03, 2020, 12:45:10 PM

Title: Specific terrain bit flag identification
Post by: scient on February 03, 2020, 12:45:10 PM
I've been doing some preliminary work on additional map functions used by Path class. Ended up digging into some of map bit flags I haven't identified yet. I figured I would post here to see if anyone had an idea what they are.

0x200:
* Related to rivers, has river flag set (0x80)
* Not river source (this is 0x100 flag)
* Huge map of planet seems to have one tile with this flag set, random placement
* Can be at end of river tile chain or somewhere in middle
* Tile just says river

0x4000:
* Huge map of planet has 26 tiles with this flag set:
FLAG                  X  Y    BIT
BIT_UNK_4000:  18 24 16416
BIT_UNK_4000:  21 25 1073758208
BIT_UNK_4000:  20 26 1073758240
BIT_UNK_4000:  19 27 268451872
BIT_UNK_4000:  54 34 16416
BIT_UNK_4000:  35 37 16384
BIT_UNK_4000:  53 37 16384
BIT_UNK_4000:  36 38 16384
BIT_UNK_4000:  33 39 16384
BIT_UNK_4000:  36 40 16416
BIT_UNK_4000:  35 41 16384
BIT_UNK_4000:  32 42 16416
BIT_UNK_4000:  34 42 1073758208
BIT_UNK_4000:  119 61 16384
BIT_UNK_4000:  122 62 16416
BIT_UNK_4000:  65 89 16416
BIT_UNK_4000:  62 90 1073758208
BIT_UNK_4000:  52 106 16416
BIT_UNK_4000:  49 107 16384
BIT_UNK_4000:  63 109 16416
BIT_UNK_4000:  64 110 16416
BIT_UNK_4000:  61 111 16416
BIT_UNK_4000:  80 112 16384
BIT_UNK_4000:  29 115 16416
BIT_UNK_4000:  79 115 16384
BIT_UNK_4000:  30 118 16384
* Seems to be continent with single tile island off coast
* Can have multiple continent tiles with flag set

Title: Re: Specific terrain bit flag identification
Post by: Fibonacci on February 03, 2020, 05:12:33 PM
0x200 looks like it's an inland river termination, as opposed to a delta when a river empties out to the sea. In your 200-1 picture, since rivers are generated "downhill", it appears you have two rivers that terminated together inland. I'd guess some code that reevaluates river pathing when terrain is raised or lowers might use the flag?
Title: Re: Specific terrain bit flag identification
Post by: Fibonacci on February 03, 2020, 05:23:55 PM
As for 0x4000, my two guesses are that it's probably used when generating the continents, and something is generated between pairs of them to make landmasses? The other guess, are all of them non-rocky/non-fungus? If so, they might be used as hints for the AI to try to establish coastal bases to avoid landlocking? They might even have been generated as rocky or fungal, and were cleaned up to allow a base to be settled there by the map generator.
Title: Re: Specific terrain bit flag identification
Post by: scient on February 03, 2020, 09:06:21 PM
0x200 looks like it's an inland river termination, as opposed to a delta when a river empties out to the sea. In your 200-1 picture, since rivers are generated "downhill", it appears you have two rivers that terminated together inland. I'd guess some code that reevaluates river pathing when terrain is raised or lowers might use the flag?

So far it has always been a landlocked tile from what I can tell. It doesn't happen often. The most I've seen on a map is two separate tiles. I'll churn through some random maps and see if I can provide more data points as well as look at raise/lower terrain. So far I haven't been able to find flag being used other than drawing it.

As for 0x4000, my two guesses are that it's probably used when generating the continents, and something is generated between pairs of them to make landmasses? The other guess, are all of them non-rocky/non-fungus? If so, they might be used as hints for the AI to try to establish coastal bases to avoid landlocking? They might even have been generated as rocky or fungal, and were cleaned up to allow a base to be settled there by the map generator.
It could be related to continent generation. There is a region value part of each tile map structure related to what I believe each continent a tile belongs to. I'll do some comparing with the Planet maps along with some random generated one to see if there is any correlation between instances of this flag and continent count.

From what I've seen, it's a mix at least with regards to fungus. Not sure about rocky. I'll do some more testing and post results.
Title: Re: Specific terrain bit flag identification
Post by: scient on February 03, 2020, 11:26:08 PM
0x4000:
I realized this morning I didn't look for references to this flag like I did for 0x200. Derp. Anyway, I can confirm it's related to AI movement. I found one reference each in two different functions: alien_move() and enemy_move(). It looks like tiles with this flag kill unit movement in someway. So maybe some kind of boundary marker.
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 31 - 840KB. (show)
Queries used: 15.

[Show Queries]