Dev build/Linux: exception in OrientEnemy [RESOLVED]

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

Dev build/Linux: exception in OrientEnemy [RESOLVED]

Post by pango »

Issue seems to happen the most often with (Frost?) daedra: all the sudden they're blocked in some direction, with wrong aspect ratio, moving slowly.

An exception is repeatedly raised in OrientEnemy, from what I understand because currentFrame == -1:

Code: Select all

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[UnityEngine.Texture2D].get_Item (Int32 index) [0x00000] in <filename unknown>:0
  at DaggerfallWorkshop.DaggerfallMobileUnit.OrientEnemy (Int32 orientation) [0x00000] in <filename unknown>:0
  at DaggerfallWorkshop.DaggerfallMobileUnit.UpdateOrientation () [0x00000] in <filename unknown>:0
  at DaggerfallWorkshop.DaggerfallMobileUnit.Update () [0x00000] in <filename unknown>:0
(@TheLacus?)

Savegame in some cave behind some idle Frost daedra; If awaken it usually quickly triggers the bug.
Attachments
SAVE1.zip
(501.41 KiB) Downloaded 77 times
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Dev build/Linux: exception in OrientEnemy

Post by TheLacus »

@Interkarma What does -1 represents for an attack animation frame?
UV on classic atlas use the frame as an offset so i think is not intentional to have -1 to reach texture refresh method.

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

Re: Dev build/Linux: exception in OrientEnemy

Post by Interkarma »

The -1 is specific to how Allofich has matched animation frames to classic. It should be getting handled in DaggerfallMobileUnit around line 499. Enemy will attack or shoot then progress to next frame in sequence.

There's possibly an edge case of some kind where the wrong index is computed. Anything to do with enemy animations falls mainly into Allofich's wheelhouse, he has a deeper understanding than myself.

Edit: Allofich has a much better description of the -1 in his PR here to fix this. I'm merging this now and it should be fixed in next builds.

Locked