Adventure Game Studio

AGS Development => Engine Development => Topic started by: Snarky on Sun 09/02/2020 12:55:01

Title: Bug Report: Walk crashes after Character.LockViewFrame()
Post by: Snarky on Sun 09/02/2020 12:55:01
I've come across a bug in the AGS engine that causes a fatal crash when a character walks after I've called Character.LockViewFrame(). I've tested this in 3.4.3 and 3.5.0, and the bug is present in both versions.

To trigger this error, I have a character, Roger, that has walking view 1 (with 4 loops), and a special view 2 used for a particular animation (with 1 loop).

I want to "freeze" Roger, locking him to a certain frame of his special animation, so I call:

Code (ags) Select
function room_Load()
{
  cRoger.LockViewFrame(2, 0, 0, eKeepMoving);
}


Then I begin walking him around. Immediately one issue becomes apparent: although Roger should be locked to the particular frame, once he starts moving the special animation starts playing, as if it were the walk animation.

Then, once the walk-path requires him to turn, the game suffers a fatal engine crash (not a script crash):

QuoteUnable to render character 0 (Roger) because loop 1 does not exist in view 2.

So apparently it uses the NormalView to work out how many loops there are and which one to show given the direction of the next walk-path segment, but tries to apply this to the view that the character has been locked to.

Here's (https://www.dropbox.com/s/g9o6gymat3bwu2x/TestAnimation.zip?dl=0) a test game that demonstrates the problem (to trigger the crash, click for example on the floating rocks to have Roger walk over there).
Title: Re: Bug Report: Walk crashes after Character.LockViewFrame()
Post by: Crimson Wizard on Sun 09/02/2020 16:49:41
Not to deny there may be a mistake in the engine, but "fatal crash" is when it shows something like "Access violation at memory adress xxx", or system message "Application stopped responding" appears. Above looks like a regular game error report (it misses necessary resource). It's just that, I don't understand how do you use these terms, what is "fatal engine crash" and "script crash" in your terminology?
Title: Re: Bug Report: Walk crashes after Character.LockViewFrame()
Post by: Snarky on Sun 09/02/2020 18:50:00
Fair enough. What I mean is that it's not a script that crashes, but an internal engine crash. It's not caught by the debugger, it's not associated with any particular line in the script, etc.