There is massive slowdown when you enter the dungeon in the attached save.
The console gets spammed with
IndexOutOfRangeException: Array index is out of range.
DaggerfallConnect.Arena2.BsaFile.GetRecordId (Int32 record) (at Assets/Scripts/API/BsaFile.cs:247)
DaggerfallWorkshop.SoundReader.GetAudioClip (Int32 soundIndex) (at Assets/Scripts/SoundReader.cs:72)
DaggerfallWorkshop.DaggerfallAudioSource.GetAudioClip (Int32 soundIndex) (at Assets/Scripts/Internal/DaggerfallAudioSource.cs:212)
DaggerfallWorkshop.Game.EnemySounds.IsReady () (at Assets/Scripts/Game/EnemySounds.cs:123)
DaggerfallWorkshop.Game.EnemySounds.FixedUpdate () (at Assets/Scripts/Game/EnemySounds.cs:75)
The problem appears ever since this commit:
https://github.com/Interkarma/daggerfal ... f9b233361c
Windows #58 Massive slowdown in dungeon [resolved]
-
- Posts: 379
- Joined: Fri Oct 07, 2016 10:41 am
Windows #58 Massive slowdown in dungeon [resolved]
- Attachments
-
- SAVE7.zip
- (44.38 KiB) Downloaded 119 times
Last edited by R.D. on Sun Oct 08, 2017 8:10 am, edited 1 time in total.
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Windows #58 Massive slowdown in dungeon
Thanks for the report.
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Windows #58 Massive slowdown in dungeon
Uh sorry, i used the soundindex before this check (if (!soundFile.GetSound(soundIndex, out dfSound))). Should i just move it back where it was? But why is passing a wrong index in the first place?
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Windows #58 Massive slowdown in dungeon
It's all good. Code changes, something breaks, it get fixed again.TheLacus wrote:Uh sorry, i used the soundindex before this check (if (!soundFile.GetSound(soundIndex, out dfSound))). Should i just move it back where it was? But why is passing a wrong index in the first place?
I definitely wouldn't trust the sound index without verification. It's possible for the game data to reference invalid sound IDs, so a "bad index" is actually an expected input to handle. That's the reason my original implementation was defensive around this input.
GetSound() will usually bounce index for one of two reasons:
- Most likely: Input sound index is out of range (< 0 || >= count).
- Less likely: Failed to read valid record index from sound BSA file.
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
-
- Posts: 379
- Joined: Fri Oct 07, 2016 10:41 am
Re: Windows #58 Massive slowdown in dungeon
I'm no longer getting the slowdown after the latest commit, thanks!
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Windows #58 Massive slowdown in dungeon
Great, thanks for following up!
-
- Posts: 379
- Joined: Fri Oct 07, 2016 10:41 am
Re: Windows #58 Massive slowdown in dungeon
I wonder if a particular enemy type caused this. I had the slowdown in the dungeon in the attached save, and then in another I tested, but then not in a third one. Also the issue had existed for a while but I don't know that anyone has mentioned it, so maybe its a somewhat uncommon enemy.
Using the "killall" command in the save file I see human enemies, atronachs (all types), gargoyles and zombies were in the dungeon.
Using the "killall" command in the save file I see human enemies, atronachs (all types), gargoyles and zombies were in the dungeon.
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Windows #58 Massive slowdown in dungeon
Yep, definitely worth running down the source of the problem as well. I'm leaving this open until then, and your save game will help reproduce.
-
- Posts: 833
- Joined: Mon Nov 30, 2015 6:32 pm
Re: Windows #58 Massive slowdown in dungeon
Hmm...Run through the dungeon again and see if any of them don't make sounds?
Previous experience tells me it's very easy to misunderstand the tone, intent, or meaning of what I've posted. If you have questions, ask.