Build #139 - Casting spells via spellbook in middle of casting animation breaks casting/attacking [RESOLVED/CLOSED]

Locked
User avatar
BlueBolt
Posts: 17
Joined: Tue May 01, 2018 11:13 pm

Build #139 - Casting spells via spellbook in middle of casting animation breaks casting/attacking [RESOLVED/CLOSED]

Post by BlueBolt »

So I found out casting certain spells like Waterbreathing via the spellbook then immediately opening the spellbook to cast again in the middle of the casting animation can break your actions and you can't attack/cast spells anymore. Unequipping and re-equiping or switching weapon hands doesn't fix the issue, nor does reloading the save. Your actions break again as soon as you try casting another spell upon reloading a save. Relaunching the game fixes the issue, however.

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

Re: Build #139 - Casting spells via spellbook in middle of casting animation makes you unable to cast/attack anymore

Post by Hazelnut »

Sounds very similar to the bow breaking during animation, certainly causing the same symptoms. In that case the animations run concurrently and when the bow broke, the array of frames is changed as the bow was auto-unequipped. Threw an exception if the coroutine was in the middle of accessing the frame array. All I did to fix it was catch and swallow the exception (don't tell anyone at work :o ) instead of implementing proper thread safe code. That would be complete overkill since the animation should just stop anyway.

That should help IK to fix this when he gets to it. (I hope)
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: Build #139 - Casting spells via spellbook in middle of casting animation makes you unable to cast/attack anymore

Post by Interkarma »

I've not able to reproduce this one yet. There is already handling in place to block new casting while a cast is in progress, and recasting spells even accounts for animation playing. This should all be fairly robust, so it sounds like an edge case of some kind.

I can take a punt at the cause and shore up the process even further. I've pushed some new code now to prevent player from opening spellbook while cast animation is playing or from setting a new ready spell while a cast is in progress.

Please Let me know if you can reproduce after next round of builds.

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

Re: Build #139 - Casting spells via spellbook in middle of casting animation breaks casting/attacking [FIX IN TESTING]

Post by pango »

As indicated in the original report, it seems to only happen with specific spells, so can it be explained by an issue in casting animation?
On the other hand to "heavy handed" solution of preventing casting while the animation is playing may very well prevent lots of concurrency issues in spells...
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: Build #139 - Casting spells via spellbook in middle of casting animation breaks casting/attacking [FIX IN TESTING]

Post by Interkarma »

pango wrote: Wed Nov 21, 2018 5:57 pm As indicated in the original report, it seems to only happen with specific spells, so can it be explained by an issue in casting animation?
Yep, I got that. Still not able to reproduce. :)

pango wrote: Wed Nov 21, 2018 5:57 pm On the other hand to "heavy handed" solution of preventing casting while the animation is playing may very well prevent lots of concurrency issues in spells...
This has been the design since casting was first built. My feeling is something else is happening or its an edge case of some kind. I've shored up the process even further now, and will see if problem persists. Otherwise, I'll close this one down the track.

Locked