BUG: checkpoint reset not working properly

BUG: checkpoint reset not working properly

Postby Tedium » 26 May 2013, 12:06

Hello everyone,

Sadly I have another bug to report :cry:. This one is also very odd. You can try it on level 19 "Volcano" of the default levelpack:

1. Move the main character to the checkpoint. Save when the moving spike is at it's highest position!
2. Now step on the pressure pad and immediately press F3 to reset. When timed correctly, the moving spike will no longer move. Touching the pressure pad will "fix" the moving spike.
3. You can now finish this level without your shadow.

The level replay will result in the death of your main character.
Good luck with debugging ;)!
User avatar
Tedium
 
Posts: 122
Joined: 19 Oct 2011, 10:40

Re: BUG: checkpoint reset not working properly

Postby acme_pjz » 27 May 2013, 15:35

Bug confirmed :| But I don't have spare time in this week :|
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: BUG: checkpoint reset not working properly

Postby Edward_Lii » 27 May 2013, 21:36

Hello Tedium,

Thanks for reporting this bug, I'm able to reproduce this bug.
I've found the source of the problem, when the game state is loaded the eventQueue isn't cleared.
A simple eventQueue.clear() in the loadState solves this problem, but is by no means good. :|

We need to set the state back to how it was when the state was saved.
So we need to have the exact same eventQueue before and after.
We could store a copy of the eventQueue OR we somehow make sure the queue is empty before saving... :think:

Any suggestions?
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: BUG: checkpoint reset not working properly

Postby acme_pjz » 28 May 2013, 11:10

Hi Edward_Lii,

I think the event queue should be empty when saving :| Maybe you can add some test code to print out whether the event queue is empty when saving :|
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: BUG: checkpoint reset not working properly

Postby Edward_Lii » 28 May 2013, 14:39

Hello acme_pjz,

acme_pjz {l Wrote}:I think the event queue should be empty when saving :| Maybe you can add some test code to print out whether the event queue is empty when saving :|

At the moment the eventQueue is almost always filled with one or two events when saving at a checkpoint (PlayerIsOn events).
One way to be sure that the eventQueue is empty, is by moving the save/load code after the event handling code.

This works reasonable and probably flawless for the default block event handling, but with scripting there might be some problems.
If a block moves "into" the player through scripting at the same moment the player saves, he will get squashed instead of pushed when the state is loaded.
This is because there are no save variables for dy/dx, which can easily be solved by adding them, but I'm afraid there might be more similar problems with this approach... :|

Anyway, it should work, so I've committed a fix to svn, it's in svn revision 667. ;)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Who is online

Users browsing this forum: No registered users and 1 guest

cron