Bay 12 Games Forum

Please login or register.

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

Author Topic: Stress & Pysche: 44.11+  (Read 21874 times)

Adequate Swimmer

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #315 on: September 13, 2018, 04:15:43 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.
Logged
[VALUE:PEACE:0]

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #316 on: September 13, 2018, 04:45:29 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.
Logged

Splint

  • Bay Watcher
  • War is a valid form of diplomacy.
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #317 on: September 13, 2018, 05:04:30 am »

...
- There are two different needs to get stuff. One for trinkets and one for clothes. The clothes one seems to be satisfied by getting a new uniform armor piece.
...
For the clothes happy thought, in 43.05(?), my military dwarfs only received happy thoughts from the finished goods that were assigned to their uniforms (cloaks, trousers, dress, hoods, etc), and not from the armor items (helms, leggings, etc). Has this changed?

It seems in 44.12 that putting on new uniform parts will count, but only if it's better than what they have on value-wise - I've seen the thought come up for multiple soldiers upon receiving proper armor, which thanks to good smiths was generally of good quality. I also saw it ping when I left troops to sort shit out themselves gearwise and they'd do the song and dance when higher quality gear became available - everyone in the line got a good thought if the armor was of better quality than standard (basically the  "putting on an [insert quality] item." one.)

I have not seen it trigger when donning standard quality armor irrespective of material, so it may need some form of quality modifier to trigger.

Might have to test this out, though I'll need to gen up a fort and train a smith first.

FantasticDorf

  • Bay Watcher
    • View Profile
Re: Stress & Pysche: 44.11+
« Reply #318 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 #319 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 #320 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 #321 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 #322 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 #323 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 #324 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 #325 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 #326 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 #327 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 #328 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 #329 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. Was this inevitable (Y/y)?
Pages: 1 ... 20 21 [22] 23 24 ... 28