Page 1 of 1

Quicksave right before the Prince died

Posted: February 26th, 2021, 10:34 am
by atrueprincefanfrom18
I don't know if it's a bug, but somehow I could Quicksave right before the Prince got dead:

See this:

quicksave-is-in-it.zip
(1.21 KiB) Downloaded 133 times

P.S: I was not able to attach the Quicksave file directly, so I have created a folder.

Re: Bug in Level 13 during Jaffar music

Posted: February 26th, 2021, 5:14 pm
by dmitrys
The code for the F6 button is as follows. That means there is a frame where you can do a quick save just before kid dies.

Code: Select all

case SDL_SCANCODE_F6:
case SDL_SCANCODE_F6 | WITH_SHIFT:
   if (Kid.alive < 0) need_quick_save = 1;
That can most likely be fixed with

Code: Select all

if (hitp_curr > 0 && Kid.alive < 0) need_quick_save = 1;

Re: Bug in Level 13 during Jaffar music

Posted: February 26th, 2021, 6:03 pm
by atrueprincefanfrom18
dmitrys wrote: February 26th, 2021, 5:14 pm That means there is a frame where you can do a quick save just before kid dies.
True...
dmitrys wrote: February 26th, 2021, 5:14 pm That can most likely be fixed with
[...]
Yes, but it's difficult to test... Some kind of code does that on behalf of us? For example, some code which would be Quicksaving with every tick or something, so that we can just focus on dying? :P

And then stop that Quicksaving code and check the last file which was Quicksaved.

Re: Bug in Level 13 during Jaffar music

Posted: February 26th, 2021, 8:36 pm
by dmitrys
I have a PoP2 like Shift-K cheat combo in my mod for testing those scenarios that takes a hit point from the kid. It makes it easy to reproduce the issue.

Re: Bug in Level 13 during Jaffar music

Posted: February 26th, 2021, 8:46 pm
by dmitrys
It is actually better to add

Code: Select all

hitp_curr > 0
into this "if" statement because there other places like the pause menu where you can save.
https://github.com/NagyD/SDLPoP/blob/ma ... 000.c#L468

Re: Quicksave right before the Prince died

Posted: February 27th, 2021, 2:09 pm
by David
(I moved these posts to a new topic.)

A possible solution could be to allow multiple save states, like in most emulators.
That way, even if your last save is right before death, you can continue from an earlier save.

(I got the idea from here: http://www.designersnotebook.com/Column ... ner_ix.htm )

Re: Quicksave right before the Prince died

Posted: February 27th, 2021, 3:46 pm
by atrueprincefanfrom18
David wrote: February 27th, 2021, 2:09 pm A possible solution could be to allow multiple save states, like in most emulators.
That way, even if your last save is right before death, you can continue from an earlier save.
Yes, that's a good idea...

Re: Quicksave right before the Prince died

Posted: February 28th, 2021, 5:04 am
by dmitrys
I did implement an auto-save in the beginning of each level (except # 1) in my mod. But it would be cool to have Shift-F6/Shift-F9 allow multiple named quick saves similar to the PoP2 save/load menu.

Re: Quicksave right before the Prince died

Posted: April 18th, 2021, 4:35 am
by atrueprincefanfrom18
If this is not yet fixed, it seems there's another bug. If you Quickload and die, after a few seconds, the game would restart thinking that you have died. I guess it's done here. The game thinks the kid is not alive, so it forces to press the button and restart the game.

Here's a sample Quicksave file. I believe I had this issue without using Quicksave too. Somehow pressing CTRL + A at a precise timing doesn't process the variables or something like that, and the game get's confused.

quicksave.zip
(1.38 KiB) Downloaded 133 times

Re: Quicksave right before the Prince died

Posted: April 18th, 2021, 5:08 am
by dmitrys
The game should not quick save if "Char.alive >= 0 || hitp_curr == 0".

"Char.alive" can act as a counter that asks for the player to press the key after prince dies.

Re: Quicksave right before the Prince died

Posted: April 18th, 2021, 10:49 am
by David
atrueprincefanfrom18 wrote: April 18th, 2021, 4:35 am If this is not yet fixed, it seems there's another bug. If you Quickload and die, after a few seconds, the game would restart thinking that you have died. I guess it's done here. The game thinks the kid is not alive, so it forces to press the button and restart the game.

Here's a sample Quicksave file. I believe I had this issue without using Quicksave too. Somehow pressing CTRL + A at a precise timing doesn't process the variables or something like that, and the game get's confused.
The Quicksave is for level 14.
When the prince dies on level 14, Ctrl+A doesn't stop the "Press Button to Continue" timer.

See here:
viewtopic.php?p=16926#p16926
viewtopic.php?p=16408#p16408 (the second half of the post)
viewtopic.php?p=13915#p13915 (the end of the post)

I fixed it now: https://github.com/NagyD/SDLPoP/commit/ ... 4e42314d68

Re: Quicksave right before the Prince died

Posted: April 18th, 2021, 8:16 pm
by dmitrys
Ah, I did not look at the quicksave. Those 2 "text_time" variables have 2 magic values that can cause level restarts. And one of them is 36 (3 sec) which is easy to pick if you want to display a custom text message. Then all of the sudden the level restarts.