v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Talk:Attribute

From Dwarf Fortress Wiki
Jump to navigation Jump to search

How attributes are actually calculated:

  • Take the 7 XXX_ATT_RANGE values from the raws as A:B:C:D:E:F:G
  • Pick a random number N between 0 and 11999, inclusive
    • For N in 0-1999, calculate X = (1999 - N) * A and Y = (N - 0) * B
    • For N in 2000-3999, calculate X = (3999 - N) * B and Y = (N - 2000) * C
    • For N in 4000-5999, calculate X = (5999 - N) * C and Y = (N - 4000) * D
    • For N in 6000-7999, calculate X = (7999 - N) * D and Y = (N - 6000) * E
    • For N in 8000-9999, calculate X = (9999 - N) * E and Y = (N - 8000) * F
    • For N in 10000-11999, calculate X = (11999 - N) * F and Y = (N - 10000) * G
  • The attribute value itself is initialized to (X + Y) / 1999
  • The attribute's maximum value is set to either (value * XXX_ATT_CAP_PERC) / 100 or value + D, whichever is higher

Exactly how this should be translated into a readable form for the article, I'm not sure, but hopefully somebody will be able to manage. --Quietust (talk) 20:22, 30 May 2025 (UTC)

What's the distribution of N? I've understood the attribute range system as being a bunch of linear buckets that approximate a normal distribution. This sounds like it might actually be distributed normally? DPhKraken (talk) 00:17, 31 May 2025 (UTC)
N is calculated as trandom(12000), so every result should have (more or less) equal probability. Basically, each of the 6 buckets has equal probability (i.e. a 1/6 chance for each one), and the values you get within those buckets are also equal probability (i.e. within the F-G bucket, you have an approximately equal chance of rolling the lowest value, the highest value, or any value in between). I ran a script to calculate all of the probabilities, and the very first entry in each bucket ended up having a slightly higher change (e.g. 11/12000 instead of 10/12000) and the very last entry had a slightly lower chance (e.g. 9/12000 instead of 10/12000), but that's fairly insignificant overall. --Quietust (talk) 00:30, 31 May 2025 (UTC)
CancelHideAbout

Rating Talk:Attribute