Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 20 21 [22] 23 24 ... 36

Author Topic: Stress & Psyche: 44.11+  (Read 132862 times)

FantasticDorf

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #315 on: September 13, 2018, 05:35:05 am »

I've had military dwarves in elation just by swapping out their weapons for better ones time to time, there is no reprecussion to them becoming attached to a weapon because the new thought of a shinier one just overlaps whatever process they are supposed to have had.

All down to them being aquisitions to the dwarves inventory than stuff you might say is 'on loan' while they in the military, moreso if its a weapon & material they like such as literally anything else.
Logged

Adequate Swimmer

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #316 on: September 13, 2018, 06:00:28 am »

Aside from performance issues (finding an algorythm that can scale up to 200 instances and doesn't need to update every frame or every N frames) there is a subtle, insidious ideological question at work here.

What sort of humanity are you trying to simulate? Should people, or rather dwarves, be able to accept challenge and survive against the odds, or is everything ultimately just a joke? The presence of suffering, post-traumatic stress and suicidal behavior completely alters the game's tone and presentation. It's like the main characters of a WW2 propaganda movie suddenly and unknowingly ended up at the front door of Auschwitz, or a bunch of foppish, whimsical byronian poets deciding to make a literature club in Sarnath.
Wait, alters from what? Dwarf Fortress has always (except for a recent period when stress just didn't have any effect) had stressed suicidal dwarves killing their children, plunging the cute world of plump helmets and booze into suden dark tragedy. That's what it's known for and why a lot of people love it.

Altered from something that can be fought against and prepared for to an attrition process that laughs in the face of any attempt to control it. Kind of like fighting the Predator compared to trying to arrest and convict the Joker.
Logged
[VALUE:PEACE:0]

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #317 on: September 13, 2018, 06:21:04 am »

Aside from performance issues (finding an algorythm that can scale up to 200 instances and doesn't need to update every frame or every N frames)

For one thing, units (obviously) already do things every tick, so it's not much to add something else to do every tick.

Even were that not the case, if you have it happen every 100 ticks for each unit you can stagger it so that it's only two units per tick without too much trouble. Hell, I even use that trick in some of my mods which have to do things regularly:

Code: [Select]
local function checkEveryUnitRegularlyForEvents()
    for k,v in ipairs(df.global.world.units.active) do
        dfhack.timeout((k%9)+1,'ticks',function() regularUnitChecks(v) end)
    end
end

where dfhack.timeout(x,type,func) calls function() after x [type]s have passed; in this example, it calls that anonymous function after k%9 ticks, where % is the modulo function. I think I could go with k%10, actually, since it runs every 10 ticks, but whatever.

Adequate Swimmer

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #318 on: September 13, 2018, 07:06:08 am »

Aside from performance issues (finding an algorythm that can scale up to 200 instances and doesn't need to update every frame or every N frames)

For one thing, units (obviously) already do things every tick, so it's not much to add something else to do every tick.

Even were that not the case, if you have it happen every 100 ticks for each unit you can stagger it so that it's only two units per tick without too much trouble. Hell, I even use that trick in some of my mods which have to do things regularly:

Code: [Select]
local function checkEveryUnitRegularlyForEvents()
    for k,v in ipairs(df.global.world.units.active) do
        dfhack.timeout((k%9)+1,'ticks',function() regularUnitChecks(v) end)
    end
end

where dfhack.timeout(x,type,func) calls function() after x [type]s have passed; in this example, it calls that anonymous function after k%9 ticks, where % is the modulo function. I think I could go with k%10, actually, since it runs every 10 ticks, but whatever.

Please don't take this as personal criticism, but having a for that goes through all units every n div 9 frames and does something with them is really bad.
I can only assume that the function that gets called if the condition is met also has a for in it.
Logged
[VALUE:PEACE:0]

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #319 on: September 13, 2018, 12:19:58 pm »

I can presume Putnam has measured how bad it is. My expectations have been much tamped since I tried using unpaused lua guis, and could measure no fps slowdown discernable from random fluctations even with another script to average it out (and while I haven't done much yet with it I do now have a tiny script that displays the speed of dwarf I'm following, showing me things like my miner going through stone at 5% the speed of their walking or whether it'd be better to hand-haul a stone to temporary workshop (or place a temporary pile with wheelbarrow that has to be carried to the tile and back))

Adequate Swimmer

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #320 on: September 13, 2018, 02:01:56 pm »

I kind of have a personal history with lua. The only things I ever did in it was bugfixing and refactoring really really bad code, so I tend to never use the language for any reason and treat each lua script with scrutiny and suspition.
Logged
[VALUE:PEACE:0]

darkflagrance

  • Bay Watcher
  • Carry on, carry on
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #321 on: September 13, 2018, 06:40:41 pm »

I'm considering just circumventing this stress change entirely.

For starters, stress vulnerability and anxiety propensity is going to 0 for all my dwarves. They are all getting, say, level 8 of all social skills by default. I hope low vanity will make them miss trinkets less, and high immodesty will help with other clothing related thoughts, I assume.
Logged
...as if nothing really matters...
   
The Legend of Tholtig Cryptbrain: 8000 dead elves and a cyclops

Tired of going decades without goblin sieges? Try The Fortress Defense Mod

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #322 on: September 13, 2018, 08:40:03 pm »

Please don't take this as personal criticism, but having a for that goes through all units every n div 9 frames and does something with them is really bad.
I can only assume that the function that gets called if the condition is met also has a for in it.

There's no condition here. checkEveryUnitRegularlyForEvents() is run every 10 ticks no matter what and it does only what you see it doing. The function it calls on each unit is this:

Code: [Select]
function regularUnitChecks(unit)
    if not unit or not df.unit.find(unit.id) then return false end
    if unitHasCreatureClass(unit,'ZENKAI') and not unitInDeadlyCombat(unit) then
        doZenkai(unit)
    end
    local super_saiyan_trigger=dfhack.script_environment('dragonball/super_saiyan_trigger')
    super_saiyan_trigger.runSuperSaiyanChecks(unit.id)
    if unitUndergoingSSJEmotion(unit) then
        super_saiyan_trigger.runSuperSaiyanChecksExtremeEmotion(unit.id)
    end
    renameUnitIfApplicable(unit)
    setUpNaturalTransformations(unit)
    transformation.transformation_ticks(unit.id)
    if not unitInCombat(unit) or unit.counters.unconscious>0 then
        transformation.revert_to_base(unit.id)
    end
    --12 years of training, approx.
    if ((dfhack.units.isDwarf(unit) and dfhack.units.isCitizen(unit)) or isAdventurer(unit)) and getPowerLevel(unit)>900000000 and not has_whis_event_called_this_round then
        dfhack.run_script('dragonball/whis_event')
        has_whis_event_called_this_round=true
    end
    if dfhack.persistent.get('DRAGONBALL_IMMORTAL/'..unit.id) then
        dfhack.run_script('full-heal','-unit',unit.id,'-r')
    end
end

While most of those are rather opaque, I can tell you that: unitHasCreatureClass is O(n), but only by number of creature classes, which is rarely larger than 4 or 5, where m is creature classes and very small; unitInDeadlyCombat is O(1), and extremely fast; doZenkai is O(nlogn); runSuperSaiyanChecks is O(1); unitUndergoingSSJEmotion is O(n) with the number of emotions the unit has stored, which is usually between 0 and 20; runSuperSaiyanChecksExtremeEmotion is the same as runSuperSaiyanChecks; renameUnitIfApplicable is O(n), again with creature classes; setUpNaturalTransformations is also O(n) in that regard; transformation_ticks(unit.id) is O(n) with number of current transformations, which is never bigger than two as of now; unitInCombat is similar to unitInDeadlyCombat; revert_to_base is O(n) with the number of current transformations; isDwarf, isCitizen, isAdventurer, getPowerLevel are all O(1).

dfhack.persistent.get is easily the worst with unit counts, being O(log n), it using std::multimap.find() and me storing a persistent index for, essentially, every single unit that can zenkai and every transformation.

In total, the complexity of that is O(nlogn), and the actual imprint on FPS is nothing compared to Dwarf Fortress's own issues on this front.

Adequate Swimmer

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #323 on: September 14, 2018, 08:16:37 am »

Also is there a way to take a more proactive qa role in stress-testing stress? How could this be done? Maybe by collecting a folder full of ****ed saves, or by setting up some sort of survey?

eg. How do you unit test the human condition?
« Last Edit: September 14, 2018, 08:22:30 am by Adequate Swimmer »
Logged
[VALUE:PEACE:0]

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #324 on: September 14, 2018, 12:59:34 pm »

An observation regarding fishing and need to wander: "There is nothing to catch in X swamp" apparently causes the whole effort to be wasted: no need satisfaction was observed (nor, obviously, was any fish caught). This matches what was stated above about bringing the catch back to reap the rewards.
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #325 on: September 15, 2018, 01:51:26 am »

Yeah. It's not much of a problem for herbalism or fishing, though - when testing hunters, I found they can kill one animal, and then get interrupted off returning kill by the others in the animal pack around, which prevents need satisfication.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #326 on: September 15, 2018, 08:51:20 pm »

http://www.bay12forums.com/smf/index.php?topic=145840.0
Quote from: 0.40.17 Changelog
Other bug fixes/tweaks
   (*) Made stress levels drop faster the longer no stressors are applied
Stress normalizing on its own is already a thing. According to the wiki, it's affected by Anxiety Propensity.

You do have to somehow prevent bad thoughts from happening to get it to work, however.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

garlicfiend

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #327 on: September 15, 2018, 10:22:54 pm »

Since participating in this thread, I've started a new 44.12 fort. My last fort was an established fort from 44.09, and it's falling into depression after updating to 44.12. I wanted to try starting fresh in 44.12, armed with the knowledge from this thread, to make a better evaluation for myself.

It's an above-ground fort so all my dwarves have a lot of exposure to the elements.

I had some !FUN! in the first year with woodcutting accidents, bugged boulders, and wildlife, which meant that there was plenty of injuries and deaths for some of the dwarves to witness. The worst tragedy, of course, was my only surviving miner suddenly becoming a queen.

I'm currently 3 years, 8 months in, with a population of 81, of which maybe ten are recent migrants, and 7 are human residents.

There has been NO MICROMANAGING for stress. I've just run the fort, getting stuff done, letting stress do what it will.

The result? Out of 81 residents, all but three are neutral or negative stress. It's a happy fort.

Out of those three residents, let's take a closer look --

Broker, 3200 stress - He got rained on enough that it changed his personality. Now he is inclined to depression. Also, he detests mussels. My refuse pile is full of mussel shells. I'm going to keep an eye on him and see if I can meet some unmet needs.

Bookkeeper, 6362 stress - "Be merry!" This is my most stressed dwarf. But he has a pretty complicated personality. Being caught in the rain changed his personality, but it made him accepting and more slow to anger. He may be the most stressed, but his stress has stabilized over the last year and hasn't got any worse.

Papermaker, 1422 stress - "Everything's good" He's not a lot stressed, but he doesn't like the rain much. Also, he often feels dicrouraged and "is not the type to fall in love, or even to develop positive feelings." So I think he's probably prone to it. We'll have to see where this leads.

The main thing I have done in this fortress is have a small crappy tavern. 4x7 wood building, no tables or chairs. Dwarves go in there and socialize, or watch performances. I think this has made a stupidly big difference.

So... maybe stress isn't as broken as I thought? My updated 44.09 fort made stress seem VERY broken. This fort makes it seem workable. I'm going to keep going and see if these three dwarves are joined by new migrants in the stress zone, and if the stressed ones keep the downward slide. Right now, the jury is out...
Logged

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #328 on: September 15, 2018, 10:57:05 pm »

Reports seem to indicate anything up to 15 years for stress to ever become a problem (besides the occassional, intended, lost cause). Or the first siege cleanup. Whichever comes faster.

And then others declare that stress from rain and venegful thoughts about keas make the game completely broken with stress spiralling out of control.

Mostly it's a case of it being hard/impossible to bring dwarves back down to safe stress levels once they start to crack. Seems to be a result of them being socially inept (no hope of good thoughts from forming relationships) and unable to tell what's good for them (will work too hard and then spend their whole break in the temple praying and get stressed about not being able to argue with people).

Throw in some picky eaters and dorfs suffering from kidnapped child syndrome and it can seem like a lost cause.

Still there's a couple more releases to tweak the system more and add some extra levels of nuance. We'll see what happens, I guess.
Logged

Senator Jim Death

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #329 on: September 15, 2018, 11:42:00 pm »

Hopefully a future version will include a non-micromanagement way to let bored dwarves satisfy needs like "practice a craft" or whatever. I can provide a tavern and temple zone so that dwarves can satisfy those needs when they are idle and want to do so--it would be nice to be able to designate a "tinkering zone" with trash rock in it so dwarves can whittle on materials I don't care about without me explicitly having to make jobs so they can practice their craft.

Heck, even if I didn't expressly tell them to make stuff, maybe they should consider stealing office supplies before going insane from boredom. After all, am I going to be more unhappy with a dwarf who sneaks a piece of microcline to make secret crowns and not be bored, or one who gets so bored he ends up being too depressed to wake up one morning? That is not to say that I want my metalsmiths making steel toy axes in their free time, but that would be better then ending up with stressed dwarves.

I guess I don't know how strong boredom is as far as dwarven thoughts go, but I do see it cropping up an awful lot in the lists of thoughts.

Unrelatedly, it reminds me of the fertilizer mill scene in Sinclair's The Jungle. "Meantime, too, they had something to think about while they worked,—they had the memory of the last time they had been drunk, and the hope of the time when they would be drunk again." Sounds like the dwarven psyche to me.
Logged
If it's not trying to be fun, it's not trying to be a video game.
Pages: 1 ... 20 21 [22] 23 24 ... 36