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

BansheeXYZ
Posts: 555
Joined: Fri Oct 23, 2015 8:19 pm

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

Post by BansheeXYZ »

Interkarma wrote: Sun May 12, 2019 9:36 pm 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.
I think a good compromise is to lower stamina to a floor of 1 point during training, so as not to trigger this problem. A more sensical and amusing, but more subjective solution would be to have the trainer deny you with new flavor text:

"You'd learn nothing face-down in the dirt. Come back when you've the stamina to train."
"Not when you've already exhausted yourself. Rest up and we'll talk."
"You barely have the energy to stand, let alone train for three hours."
"Did you run a marathon before you got here? I don't train tired students."

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 May 12, 2019 9:36 pm 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.
Ah, do you mean there's now a mechanism for stamina catch up after raising time? Training reduces stamina by the correct amount after stepping time 3 hours as well. (see below) When I originally implemented this, raising the current time didn't reduce stamina hence the reduce fatigue for 180 minutes line.

Code: Select all

now.RaiseTime(DaggerfallDateTime.SecondsPerHour * 3);
playerEntity.DecreaseFatigue(PlayerEntity.DefaultFatigueLoss * 180);
WHat should happen is if all stamina is gone, you get drop to ground msg and another hour passes restoring stamina a little. Maybe that is what is missing?
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 »

Hazelnut wrote: Mon May 13, 2019 11:17 am Ah, do you mean there's now a mechanism for stamina catch up after raising time?
I've just checked rather than relying on my memory, and it appears not. The stamina loss is done via your call to DecreaseFatigue() as you mention above. It's not done through any catch-up mechanism. That's just my memory being faulty. I'll take a closer look at this before bed. I'm too tired to do anything really productive. :)

Edit: Found the issue. Stamina loss is fine, bug is totally unrelated to stamina. It's an issue with trying to spawn guards at an improper time (i.e. the exception that Pango pointed out early on) causing an exception that can result in exhaustion event firing multiple times as the player loop crashes out every time guards fail to spawn. Have pushed a fix now.

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 [RESOLVED]

Post by Hazelnut »

Haha, nice.

(I've been back 5 seconds and already causing you headaches... lol :lol: )
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 [RESOLVED]

Post by Interkarma »

Haha it's all good mate, I appreciate the interplay. :)

Locked