Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 9 10 [11]

Author Topic: Stress & Psyche 47.05  (Read 26919 times)

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Stress & Psyche 47.05
« Reply #150 on: May 04, 2021, 11:19:28 am »

As far as I understand the "Don't Care About Anything Anymore" wording is misleading, and it's instead the final step of the "Getting Used To Tragedy" development, i.e. they shrug at friends and family being dismembered and continue to fight the invaders (and clean them up afterwards), but they still enjoy the few moments of joy they have in their lives.
Logged

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Stress & Psyche 47.05
« Reply #151 on: May 04, 2021, 04:54:59 pm »

Yeah this is a text issue, not an emotion problem. dwarves who are used to tragedy get "doesn't feel anything" even though they actually do. They feel fondness with their friends, lusty at the elven dancers, and satisfied with a fine mechanism. "Getting used to tragedy" (the step before doesn't feel anything) for longer or a new "is used to tragedy" text would solve the issue.
Logged

QuQuasar

  • Bay Watcher
    • View Profile
Re: Stress & Psyche 47.05
« Reply #152 on: May 07, 2021, 04:01:53 am »

Okay, let's get some data!

Firstly: how emotions work. While the thought text is white on the emotions page, they are experiencing that emotion and it is actively changing their stress level. As soon as the thought text goes grey, it immediately stops affecting their stress. (Edit) This may not be true. I hypothesized below that the unmet needs may be affecting stress drain, but it might actually be some sort of gradual accumulation from stale (grey text) thoughts. I genuinely don't know. Damn this is complicated.

Data Format
Stress: [STRESS_LEVEL];  [EMOTION];[CAUSE];[Strength];[Severity];[unk2]


I have no idea what unk2 is, but it seems important.

Spoiler (click to show/hide)

Stress drifts back towards zero over time. You can see this happening in the data above. However, to my surprise, this drift doesn't seem to be determined by [ANXIETY PROPENSITY], which is what the wiki states. It's highly variable (I've seen drifts as high as 12 and as low as 2), but my most anxious citizen (goblin hammerwoman, ANXIETY = 73) loses stress even faster than my least anxious (axedwarfette, ANXIETY = 5) when no thoughts are present.

This requires additional science, by I have a hypothesis that it's affected by the Focus/Needs system. Dwarves who are distracted will drain stress more slowly than dwarves who are focused. As evidence for this, I observed this dwarves stress drain drop from 4 to 2 after a bunch of NeedsUnfulfilled thoughts were applied:

Spoiler (click to show/hide)

Generally speaking, the two things that matter most for stress are Strength, which determines how rapidly the thought causes stress change, and how long it lasts. As far as I can tell, most thoughts do not persist for very long (around 600 ticks), but they can be maintained by syndrome effects (inebriation consistently lasts longer) and combined with new thoughts of the same type.

Thoughts seem to negate stress drain for as long as they last, and they round up to the nearest 1, so even the lowest strength thought possible will affect stress level if no other thought is happening at the time.

Spoiler (click to show/hide)

The thought combination system means that new thoughts of the same type can both extend the duration and increase the strength of prior thoughts, if they're applied quickly enough. This results in an exponential stress change that lasts as long as the thought is continually applied. This is most apparent in the case of skill demonstrations, and may explain why militiadwarves tend to be very happy critters.

Note the strength of "TeachSkill" and "LearnSkill" starting at 3 and scaling up to 45 as the demonstration continues, after which the thought lasts for another few ticks.

Spoiler (click to show/hide)

Honeslty, I still don't have any answers about how to exploit all this information. Keeping dwarves happy is complicated. Fun to science, though.

Here's the script. It's a cheap-n-nasty bastardization of the list-memories script that was posted earlier.

Code: [Select]
-- Prints out all the memories of the selected unit, along with some metadata.

local help = [====[

Select a unit in dwarf fortress, then run this script.
It will print out three blocks of information:
Short term memories, long term memories, and memories which have been
reflected upon.

The number in brackets after the thought is metadata used to store extra
details about the type of memory. It tracks things like who was talked to,
which book was read, etc.

The strength variable probably determines which memories get overwritten.

The severity variable seems to store metadata such as the value of a room
or the quality of an tem of clothing.

Memories in the "reflected memories" category don't seem to cause new
thoughts, but any personality changes which resulted from those memories
are displayed.

The date format is "YYY-MM-DD HH:TT", where TT runs from 0 to 50.
There are 50 ticks per hour so this seemed more elegant.

Options:

    -help   show this help screen
   
    -all    include overwritten and uninitialized memory slots in the output

]====]
utils = require('utils')
local validArgs = utils.invert({'help', 'all'})
local args = utils.processArgs({...}, validArgs)
if args.help then
    print(help)
    return
end

local color_A = 10
local color_B = 11
local color_uninit = 8
local color_overwritten = 13

function get_thought_type(agr)
    return df.unit_thought_type[agr]
end

function get_emotion_type(agr)
    return df.emotion_type[agr]
end

function get_facet_type(agr)
    return df.personality_facet_type[agr]
end

function get_value_type(agr)
    return df.value_type[agr]
end

function sort_emo(emo1, emo2)
    return (emo1.year < emo2.year) or ((emo1.year == emo2.year) and (emo1.year_tick < emo2.year_tick))
end

function sort_reflection(ref1, ref2)
    return sort_emo(ref1.memory, ref2.memory)
end

function pairs_sorted(t, f)
    local a = {}
    for key,value in pairs(t) do table.insert(a, value) end
    table.sort(a, f)
    return pairs(a)
end

function get_date_string(emo)
    local year = emo.year
    local tick = emo.year_tick
    if year == -1 then return "None" end
    if tick == -1 then
        return string.format("Before year %d", year)
    end
    local month = math.floor(tick / 33600) + 1
    local day = math.floor((tick % 33600) / 1200) + 1
    local hour = math.floor((tick % 1200) / 50)
    local minute = math.floor((tick % 50))
    return string.format("%d-%02d-%02d %02d:%02d", year, month, day, hour, minute)
end

function print_emotion(emo)
    local datestr = get_date_string(emo)
    local feeling = get_emotion_type(emo.type)
    local event = get_thought_type(emo.thought)
    local subthought = emo.subthought

    if feeling == "ANYTHING" then
        return ""
    else
        return string.format("%s;%s;%s;%s;%s", feeling, event, emo.strength, emo.severity, emo.unk2)
    end
end

function display_emotions(emotions, stressLevel)
    local outputString = string.format("Stress:%d;", stressLevel)
    for ii, emo in pairs_sorted(emotions, sort_emo) do
        local color = -1
        if ii%2 == 0 then
            color = color_A
        else
            color = color_B
        end
        if emo.thought == -1 then color = color_overwritten end
        if emo.year == -1 then color = color_uninit end
        dfhack.color(color)

       
        if emo.unk2 > 0 then
            outputString = string.format("%s %s", outputString, print_emotion(emo))
        end

    end
        print(outputString)
    dfhack.color(-1)
end

sel = dfhack.gui.getSelectedUnit()
if not sel then qerror("No unit selected.") end
if not sel.status.current_soul.personality.memories then
    qerror("The selected unit doesn't have a memory struct.")
end
emotions = sel.status.current_soul.personality.emotions
mem_short = sel.status.current_soul.personality.memories.shortterm
mem_long = sel.status.current_soul.personality.memories.longterm
mem_reflected = sel.status.current_soul.personality.memories.reflected_on
dfhack.color(-1)
display_emotions(emotions, sel.status.current_soul.personality.stress_level)

Follow a dwarf and run it with the following to get an output over time:

Quote
[DFHack]# repeat -time 200 -timeUnits ticks -command [ list-memories ]
« Last Edit: May 07, 2021, 04:03:39 am by QuQuasar »
Logged

Moeteru

  • Bay Watcher
    • View Profile
Re: Stress & Psyche 47.05
« Reply #153 on: May 07, 2021, 02:30:41 pm »

That's some very, very nice science!
I think you've cracked the question of how stress gets modified by thoughts.

Note the strength of "TeachSkill" and "LearnSkill" starting at 3 and scaling up to 45 as the demonstration continues, after which the thought lasts for another few ticks.
This is one of the most interesting parts because it very clearly shows that the rate of stress change scales with the strength of the thought.
The next thing to do would be to try changing the strength of an active emotion and see if that has the same effect.
I wonder if the reason the TeachSkill and LearnSkill thoughts increase in strength is actually because multiple copies are getting merged.
Logged

Haggoroth

  • Bay Watcher
    • View Profile
Re: Stress & Psyche 47.05
« Reply #154 on: June 24, 2022, 01:27:18 pm »

Personally, I remember why I was drawn to the game in the first place: Partly because of its memetic difficulty, but even moreso because of its reputation for simulationism. What I have always wanted most out of all my games is detailed, accurate simulation. So in this case I don't care if DF is hard or easy, as long as it's correct, which to me means that dwarves behave in a way that's psychologically realistic... which, based on my life experience, pretty much means they should be freaking out from stress all the time.

I really think what this comes down to, to a large degree, is disagreement about what DF is. Is it a game to be balanced, or a simulation to be accurate? I've always thought of it as the latter, and it would be disappointing to me for it to go the other way, but ultimately that decision is up to the dev.

You've never been a Dwarf, nor lived with Dwarves in a mountain home.  You have no idea what their mental state should be.  Your life experience gives you zero insight into the mental durability and stress a Dwarf can sustain as they don't exist in your world.
Logged

Salmeuk

  • Bay Watcher
    • View Profile
Re: Stress & Psyche 47.05
« Reply #155 on: June 24, 2022, 10:28:23 pm »

Personally, I remember why I was drawn to the game in the first place: Partly because of its memetic difficulty, but even moreso because of its reputation for simulationism. What I have always wanted most out of all my games is detailed, accurate simulation. So in this case I don't care if DF is hard or easy, as long as it's correct, which to me means that dwarves behave in a way that's psychologically realistic... which, based on my life experience, pretty much means they should be freaking out from stress all the time.

I really think what this comes down to, to a large degree, is disagreement about what DF is. Is it a game to be balanced, or a simulation to be accurate? I've always thought of it as the latter, and it would be disappointing to me for it to go the other way, but ultimately that decision is up to the dev.

You've never been a Dwarf, nor lived with Dwarves in a mountain home.  You have no idea what their mental state should be.  Your life experience gives you zero insight into the mental durability and stress a Dwarf can sustain as they don't exist in your world.

you know. . . maximum spin is making a different kind of point, drawing a line between the simulationist vs gamified styles of development, arguably both of which we have seen in recent years. While it is a bit cheesy to claim, um, 'realism' in a fantasy world like DF, there has been a long standing tradition to view these worlds with an almost scientific perspective. They represent the perfect fodder for the amateur empiricist. So I think people who enjoy that aspect of mimesis, in that a DF world's structure and history are a sort of reflection of our own and can be studied or interacted with in a similar manner, might see something lost in the game when possibilities of generation are lost due to simplification, or gamification.
Spoiler (click to show/hide)

for instance, the modest mod has an option to remove all varieties of wood, leaving only a sort of nebulous wood, and this sort of thing is sought after by players who find it tedious or unnecessary to sort though endless lists of what is honestly meaningless differentiation between minor characteristics. in contrast, many players like myself enjoy this variety, since one can imagine the sort of difference between a cherry wood dresser, and a dresser made from a fungal tower cap!

I think maximum spin has a valid point in drawing that line. 

Spoiler (click to show/hide)
« Last Edit: June 24, 2022, 10:30:01 pm by Salmeuk »
Logged

Haggoroth

  • Bay Watcher
    • View Profile
Re: Stress & Psyche 47.05
« Reply #156 on: June 25, 2022, 08:24:40 pm »

Personally, I remember why I was drawn to the game in the first place: Partly because of its memetic difficulty, but even moreso because of its reputation for simulationism. What I have always wanted most out of all my games is detailed, accurate simulation. So in this case I don't care if DF is hard or easy, as long as it's correct, which to me means that dwarves behave in a way that's psychologically realistic... which, based on my life experience, pretty much means they should be freaking out from stress all the time.

I really think what this comes down to, to a large degree, is disagreement about what DF is. Is it a game to be balanced, or a simulation to be accurate? I've always thought of it as the latter, and it would be disappointing to me for it to go the other way, but ultimately that decision is up to the dev.

You've never been a Dwarf, nor lived with Dwarves in a mountain home.  You have no idea what their mental state should be.  Your life experience gives you zero insight into the mental durability and stress a Dwarf can sustain as they don't exist in your world.

you know. . . maximum spin is making a different kind of point, drawing a line between the simulationist vs gamified styles of development, arguably both of which we have seen in recent years. While it is a bit cheesy to claim, um, 'realism' in a fantasy world like DF, there has been a long standing tradition to view these worlds with an almost scientific perspective. They represent the perfect fodder for the amateur empiricist. So I think people who enjoy that aspect of mimesis, in that a DF world's structure and history are a sort of reflection of our own and can be studied or interacted with in a similar manner, might see something lost in the game when possibilities of generation are lost due to simplification, or gamification.
Spoiler (click to show/hide)

for instance, the modest mod has an option to remove all varieties of wood, leaving only a sort of nebulous wood, and this sort of thing is sought after by players who find it tedious or unnecessary to sort though endless lists of what is honestly meaningless differentiation between minor characteristics. in contrast, many players like myself enjoy this variety, since one can imagine the sort of difference between a cherry wood dresser, and a dresser made from a fungal tower cap!

I think maximum spin has a valid point in drawing that line. 

Spoiler (click to show/hide)

I agree with your assessment of what point was trying to be made, but I was making a different point:  You can't and shouldn't use your experiences in our world to project what you think is realistic in Dwarf Fortress.  Dwarf Fortress needs to be realistic to itself, not to our world.  So therefore when balancing realism vs playability, make sure you think about realism for the Dwarves, not realism for us.
Logged
Pages: 1 ... 9 10 [11]