Author Topic: Bug Report: Walk crashes after Character.LockViewFrame()  (Read 281 times)

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
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: Adventure Game Studio
  1. function room_Load()
  2. {
  3.   cRoger.LockViewFrame(2, 0, 0, eKeepMoving);
  4. }

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):

Quote
Unable 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 a test game that demonstrates the problem (to trigger the crash, click for example on the floating rocks to have Roger walk over there).

Re: Bug Report: Walk crashes after Character.LockViewFrame()
« Reply #1 on: 09 Feb 2020, 16:49 »
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?
« Last Edit: 09 Feb 2020, 16:52 by Crimson Wizard »

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: Bug Report: Walk crashes after Character.LockViewFrame()
« Reply #2 on: 09 Feb 2020, 18:50 »
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.