Author Topic: Continent variable naming  (Read 1015 times)

0 Members and 1 Guest are viewing this topic.

Offline scient

Continent variable naming
« on: June 11, 2020, 12:22:28 AM »
I've been making progress on the Path class and as part of that working on the Continent structure. It's essentially metrics on each internal map region. For example, the first value of the struct is a tile count and another is how many pods are available. For unk_3, I pretty much know what it is but I'm leaving it alone until I wrap my head around faction sites vs goals. I just finished an initial draft of the the function that sets up unk_6 (it's essentially a bitfield for ocean regions connected to the specific land region/continent). I'm fairly certain unk_5 is padding since I haven't found any references to it.

Then there is unk_2 that I'm having trouble coming up with a name for it. It's specifically land tiles that meet certain criteria. It's used by enemy_move() in a bunch of places to determine doing various actions (this is largest function, so hard to discern what's going on). The good news is the exact criteria can be viewed here. Essentially, it's a count of land tiles, that are rainy or moist, flat or rolling without fungus for a Continent. Not sure why that last check is thrown in there for sea fungus but it's never considered. I thought it might be something related to how easy to traverse or move through a particular region but I'm blanking on a good way to name it. Anyway, thought I would open it up for discussion.


Offline EmpathCrawler

Re: Continent variable naming
« Reply #1 on: June 11, 2020, 03:38:24 AM »
clear_terrain
unobstructed_terrain
open_terrain

Offline Induktio

Re: Continent variable naming
« Reply #2 on: June 11, 2020, 06:51:57 PM »
I think open_terrain is a good choice here. Supposedly it means any non-rocky, non-fungused tile where you need only 1 movement point to travel to it.

The fact that uint8_t unk_6[8] has 64 bits while ocean regions are assigned 64 different IDs also seems to line up pretty well. Maybe the bits are assigned in the same order than the table for facilities built in a base?

Offline scient

Re: Continent variable naming
« Reply #3 on: June 11, 2020, 09:46:55 PM »
I like open_terrain as well. Thanks for input! Will update my source with it. :)

It's likely used by AI to prioritize exploration for continents that have less movement penalties.

The fact that uint8_t unk_6[8] has 64 bits while ocean regions are assigned 64 different IDs also seems to line up pretty well. Maybe the bits are assigned in the same order than the table for facilities built in a base?
Yeah, it's using exact same method as base facilities table. It's set up here. I was going to name it something like "oceanAccess" once I clean up code and make sure I'm understanding exactly what it's doing.

Offline EmpathCrawler

Re: Continent variable naming
« Reply #4 on: June 12, 2020, 03:08:03 AM »
I'm helping!  :o

 

* 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

The wicked have told me of things that delight them, but not such things as your law has to tell.
~Saint Augustine 'Confessions'

* 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: 38.

[Show Queries]