0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops [RESOLVED]

User avatar
SlainByWoodborne
Posts: 67
Joined: Fri Apr 12, 2019 4:24 am

0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops [RESOLVED]

Post by SlainByWoodborne »

DFUninty_windows_x64-80 version 0.7.91

Description:
The following steps create a massive, albeit unexplained, stamina drain. The only way I've found to counteract its effects is to rapidly cast "Stamina" and go right into "Rest until fully healed". If the following steps are performed correctly, you can watch as the Stamina bar drains from full to empty in a few seconds.

Steps to reproduce:
01) Load the attached save file. Note: This will load the third story of the Fighter's Guild hall.
02) Position character close to wall but not too close (may take some adjusting).
03) Prepare spell "Fireball".
04) Cast the spell.
05) Verify mana regained from spell; if not, adjust position; spell should impact wall and allow absorption by character.
06) Cast and recast in quick succession the prepared spell, "Fireball".
07) Verify messages, "Press button to fire spell. Spell was absorbed." repeating in topmost message log.
08) "Rest until fully healed".
09) Verify continuation of repeating messages.
10) Cast and recast in quick succession the prepared spell, "Fireball".
11) Verify mana is regained from spell.
12) When out of mana (or have managed to repeat cast-absorb cycle for several minutes), proceed to trainer on second story.
13) Verify continuation of repeating messages.
14) Train "Critical Strike".
15) Verify message, "You and the trainer practice for three hours ..."
16) Verify continuation of repeating messages.
17) Verify message, "You drop to the ground, completely exhausted. You awaken one hour later."
18) Verify "exhausted" message repeats.
19) Access the "Save/Load/Exit" menu.
20) Verify the "exhausted" message breaks out of the "Save/Load/Exit" menu to display the looping "exhausted" message.

Edited to provide version.
Attachments
Stamina_drain_SAVE15.7z
(177.51 KiB) Downloaded 89 times

User avatar
pango
Posts: 3358
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: 0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops

Post by pango »

I've reproduced the issue with your save, if I take a training session my stamina is first decreased by expected training toll (32 stamina I think), but then it usually keeps decreasing at a regular pace so you keep crashing on the ground.
It happens even if you open windows: options menu, character sheet, inventory...

I noticed repeating exceptions in the log:

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
  at DaggerfallWorkshop.Game.Entity.PlayerEntity.SpawnCityGuards (Boolean immediateSpawn) [0x00000] in <filename unknown>:0
  at DaggerfallWorkshop.Game.Entity.PlayerEntity.Update (DaggerfallWorkshop.Game.Entity.DaggerfallEntityBehaviour sender) [0x00000] in <filename unknown>:0
  at DaggerfallWorkshop.Game.Entity.DaggerfallEntityBehaviour.Update () [0x00000] in <filename unknown>:0
Just leaving the building, before of after the training, fixes both issues.
My bet is that the root cause is this seemingly unrelated exception.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
SlainByWoodborne
Posts: 67
Joined: Fri Apr 12, 2019 4:24 am

Re: 0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops

Post by SlainByWoodborne »

Thank you. After you mentioned exceptions, I went digging for that file. In mine, I have the same exception and also one that is very similar.

Code: Select all

NullReferenceException
  at (wrapper managed-to-native) UnityEngine.Component:GetComponentFastPath (System.Type,intptr)
  at UnityEngine.Component.GetComponent[PopulationManager] () [0x00000] in <filename unknown>:0 
  at DaggerfallWorkshop.Game.Entity.PlayerEntity.SpawnCityGuards (Boolean immediateSpawn) [0x00000] in <filename unknown>:0 
  at DaggerfallWorkshop.Game.Entity.PlayerEntity.Update (DaggerfallWorkshop.Game.Entity.DaggerfallEntityBehaviour sender) [0x00000] in <filename unknown>:0 
  at DaggerfallWorkshop.Game.Entity.DaggerfallEntityBehaviour.Update () [0x00000] in <filename unknown>:0 
Is there an "output_log.txt" like the one found in the PersistentDataPath that contains timestamps? Also, what is the expected rate of growth of this file? I installed the v0.7.91 (the first version for me) on 20190406 and, today, on 20190413 the file is over 65 MB, which is large for a text file.

User avatar
pango
Posts: 3358
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: 0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops

Post by pango »

SlainByWoodborne wrote: Sat Apr 13, 2019 11:33 am Is there an "output_log.txt" like the one found in the PersistentDataPath that contains timestamps? Also, what is the expected rate of growth of this file? I installed the v0.7.91 (the first version for me) on 20190406 and, today, on 20190413 the file is over 65 MB, which is large for a text file.
It's reset every time Daggerfall Unity starts, so it's unlikely to ever become an issue.
65 MB is larger than what I usually observe (around 1MB), probably because of those exceptions. Also I do a lot of testing so most of my sessions are short.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
SlainByWoodborne
Posts: 67
Joined: Fri Apr 12, 2019 4:24 am

Re: 0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops

Post by SlainByWoodborne »

Neat. I just confirmed it to be down to under 1 MB for my current session.

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops

Post by Interkarma »

Thanks for the patch Pango. I think also training shouldn't lower stamina when stepping time. Thanks for report I'll take a look at this later.

User avatar
pango
Posts: 3358
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: 0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops

Post by pango »

Interkarma wrote: Sun Apr 14, 2019 5:40 am Thanks for the patch Pango. I think also training shouldn't lower stamina when stepping time. Thanks for report I'll take a look at this later.
Just to be sure, what I submitted should prevent the messages from lagging behind too much.
But it's not a fix for the root cause of this bug report, which is (if my analysis is correct) those exceptions in City Guards spawning.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops

Post by Interkarma »

I understand, just wanted to acknowledge with thanks. I'll still take a closer look when I can. :)

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: 0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops

Post by Hazelnut »

Interkarma wrote: Sun Apr 14, 2019 5:40 am I think also training shouldn't lower stamina when stepping time.
Not sure what you meant by this statement, I is confused. :)
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.7.91: "You drop to the ground, completely exhuasted. You awaken one hour later." loops

Post by Interkarma »

Stamina lowers as time passes. When stepping forward time in large increments, such as a few hours for training, the player loop can eject many exhaustion events as it runs stamina catch-up.

The easiest fix would be to remove stamina loss when stepping time for training. Although this no longer matches classic where stamina loss does take place during training. I can also see the RP merit in player pushing themselves to point of exhaustion to become better at their skills.

A better fix is to prevent the "drop to the ground" event triggering more than once per catch-up. This should also be fairly easy, but will need a closer look and testing across more systems.

I'm happy to resolve this one when I have time. I was more making a note to myself than anything.

Locked