Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Numbered "false" values in df.global.d_init?  (Read 524 times)

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Numbered "false" values in df.global.d_init?
« on: July 17, 2017, 07:35:26 am »

Was browsing with gui/gm-editor a bit, and noticed that there are some d_init settings not shown in d_init.txt that have no name either:

df.global.d_init.flags1:


df.global.d_init.flags2:


df.global.d_init.flags3:


df.global.d_init.flags4:


Tbh, I presume those numbered flags are probably just old unused settings, per "don't copypaste old d_init" warning, that don't do anything or worse (there's handful of unnamed flags in init settings as well). Still, if that's not the case it'd be nice to know what they are for.

A bit more interesting case is invasion_soldier_cap (50 in init):



and invasion monster cap (37 in init):



Would I be correct to presume those lower caps are about how much to send at progress triggers 1 and 2, when 3 has yet to be reached?

lethosor

  • Bay Watcher
    • View Profile
Re: Numbered "false" values in df.global.d_init?
« Reply #1 on: July 17, 2017, 10:19:37 am »

The numbered "false" values are unused values in bitfields. Bitfields must consist of 8, 16, 32, or 64 values, regardless of how many of those elements are actually used, so the remaining ones are all false and unnamed. (You can still access them by number for testing purposes, e.g. if a new flag was added and you want to see what it does, but you should almost always access them by name otherwise.)

Edit: Bit arrays, on the other hand, are a custom class Toady implemented that allows any number of flags (although it appears to require a multiple of 8). d_init.flags1-4 are bit arrays (8, 8, 8, and 24 elements, respectively).

As for the caps (in d_init, actually), you might be correct about their purpose. They don't seem to be in d_init.txt, so I expect they're just in d_init in-game because it makes it easier for Toady (since all 3 numbers are in the same array).
« Last Edit: July 17, 2017, 10:22:49 am by lethosor »
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Numbered "false" values in df.global.d_init?
« Reply #2 on: July 17, 2017, 10:45:50 am »

I see, thanks for answering. Less interesting than I hoped for, but it's something to check with low pop forts perhaps - not sure how they behave with modding goblins to siege at lower values.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Numbered "false" values in df.global.d_init?
« Reply #3 on: July 17, 2017, 12:15:06 pm »

I set all races to have all invasion triggers at 1 (=20), and the invasions I've seen do not seem to differ from using standard values (back in 0.40.X), i.e. usually (but not always) a first invasion of about 10 and then various versions of "full" size (ignoring hello/goodbye sieges), although there are sometimes "intermediate" size ones with around 50 or so troops plus trolls.

Another speculative guess as to the function of numbers 0 and 1 is that it might be the number of high quality units. Trolls, for instance occasionally come as soldiers rather than as "monsters" (Mmm, an ogre in full steel wielding a greatsword...), or possibly trolls vs ogres in the case of "monsters". I guess testing might shed some light on it.

An easy test would be to play with the exposed settings and see how the 0 and 1 values vary.
Logged