Author Topic: Specific terrain bit flag identification  (Read 882 times)

0 Members and 1 Guest are viewing this topic.

Offline scient

Specific terrain bit flag identification
« 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


Offline Fibonacci

Re: Specific terrain bit flag identification
« Reply #1 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?

Offline Fibonacci

Re: Specific terrain bit flag identification
« Reply #2 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.

Offline scient

Re: Specific terrain bit flag identification
« Reply #3 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.

Offline scient

Re: Specific terrain bit flag identification
« Reply #4 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.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

Our ancestors harnessed the power of a sun, and so again shall we.
~Comissioner Pravin Lal 'The Science of Our Fathers'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 37.

[Show Queries]