carenalgas / popochiu

Godot plugin to make point n' click games in a similar way to tools like Adventure Game Studio and Power Quest.
MIT License
159 stars 17 forks source link

Props with animations imported from Aseprite jump around at scene load #192

Closed drbloop closed 2 months ago

drbloop commented 3 months ago

Bug description

Props that have animations jump around when loading a Room scene for a few seconds until they eventually snap to their correct location.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a Room
  2. Create a Aseprite file for that room with a layer that has an animation
  3. Import Aseprite file for room, creating Props
  4. Play the scene with F6, see the Props with animations jump around. This also happens when entering the Room from another Room consistently.

Expected vs observed behavior

Expected: On Room load Props are in their correct location running default animation

Observed: Props jump around scene for a few seconds until they resolve into their correct position. Props with slower animations take more time to resolve.

I recorded this happening in a video: Screencast from 04-01-2024 12:30:51 PM.webm

As shown in the video, I see several instances of the same error in the Godot Debugger:

E 0:00:02:0150   set_frame: Index p_frame = 2 is out of bounds (vframes * hframes = 2).
  <C++ Source>   scene/2d/sprite_2d.cpp:235 @ set_frame()

Environment information (please complete):

Additional context

Props without animations have the correct placement when scene loads - this is only an issue with Props with animations imported with Aseprite. I did also test a non-Aseprite imported Prop with animation, and this did not show the jumping around behavior so maybe this is an issue in the Room importer code.

mapedorr commented 3 months ago

Thanks for reporting the issue @drbloop .

@stickgrinder I assigned this to you since you worked on the importer, but let me know if you prefer to focus on your current tasks so I can try to fix the issue. Could be related not with the importer itself but the work we did to store some properties of the Props in the room scene (in that case, I should be the one in charge of fixing the thing).

stickgrinder commented 3 months ago

@drbloop @mapedorr sorry for leaving this unattended for all this time, I was focused on the docs for the last release.

I'll look into this later this week and try to understand what happens. Thanks for reporting this.

stickgrinder commented 2 months ago

@drbloop would you mind sharing the codebase where this happens with me?

We can get directly in touch on another channel for that.

stickgrinder commented 2 months ago

@drbloop Sorry, ignore my previous message. I've been able to reproduce the bug. I'll look into that. Thanks

stickgrinder commented 2 months ago

Closed under sage suggestion by @mapedorr. Thanks mate!

mapedorr commented 2 months ago

You're welcome @stickgrinder !!! I'm glad I could help.