Quicksave right before the Prince died

Open-source port of PoP that runs natively on Windows, Linux, etc.
Post Reply
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Quicksave right before the Prince died

Post 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 58 times

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

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Bug in Level 13 during Jaffar music

Post 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;
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Bug in Level 13 during Jaffar music

Post 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.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Bug in Level 13 during Jaffar music

Post 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.
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Bug in Level 13 during Jaffar music

Post 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
David
The Prince of Persia
The Prince of Persia
Posts: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Quicksave right before the Prince died

Post 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 )
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Quicksave right before the Prince died

Post 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...
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Quicksave right before the Prince died

Post 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.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Quicksave right before the Prince died

Post 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 52 times
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Quicksave right before the Prince died

Post 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.
David
The Prince of Persia
The Prince of Persia
Posts: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Quicksave right before the Prince died

Post 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
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Quicksave right before the Prince died

Post 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.
Post Reply