SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: SDLPoP; David's open-source port of PoP

Post by VelCheran »

Ok, my bad, I assumed I had to extract the mod on a prince installation (as it's done for most game mods), and not that the mod archive was a standalone :oops:
Anyway, the level 7 ending is working perfectly with this version, thank you ;)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5787
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

VelCheran wrote: June 7th, 2020, 2:59 pmAnyway, the level 7 ending is working perfectly with this version
Good to read.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5787
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

This is apparently only possible with SDLPoP:
viewtopic.php?p=29763#p29763
Bug, or?
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: SDLPoP; David's open-source port of PoP

Post by atrueprincefanfrom18 »

Norbert wrote: July 5th, 2020, 7:03 pm This is apparently only possible with SDLPoP:
viewtopic.php?p=29763#p29763
Bug, or?
Norbert, were you able to replicate it? Using same DAT file or using custom level?
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5787
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

atrueprincefanfrom18 wrote: July 5th, 2020, 7:09 pmNorbert, were you able to replicate it?
No. Someone will have to analyze the p1r file to learn what is happening.
I'll point Falcury to this.
Maybe somehow it's related to PC speaker sounds, but that's just a random guess.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: SDLPoP; David's open-source port of PoP

Post by atrueprincefanfrom18 »

It would also be great if someone (David or Falcury) goes into deep explaination (or share some document) which would help me understand how P1R file is created, what it's content are.
I want to know if there's any way to convert P1R to a video format.

I went through the source file of replay and I also think would it be possible to remember the tick when the user QuickSaved the level and then when they Quickload it, SDLPoP can just load the game from that tick and delete the movements from the QuickSave to QuickLoad while recording the P1R file.

For example:
I QuickSaved my game after playing for 5 seconds and then after total of 15 seconds, I Quickloaded it. Currently what SDLPoP is doing is Quickloading, but also disrupting the recording for the P1R file. Instead what I think SDLPoP can do better is this: As the P1R file has data for 15 seconds (check on click of F9), what the code should do is two things: Firstly, load the game at the 5th second and delete the contents from 5 seconds to 15 seconds and continue appending the movements to the same file. This would result in generating a single P1R file instead of creating multiple.

Currently, it's the case of use P1R file feature and drop QuickLoading one. Or vice-versa. It would be great if QuickSave & QuickLoad and replay feature, all gets into one frame. And then, for recording, it would be too easy, just replay the file and keep screen recording on. So, the viewers can also see what really got into play, instead of seeing what and how player went wrong, although some viewers also like to see failed attempts.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

Norbert wrote: July 6th, 2020, 3:33 pm No. Someone will have to analyze the p1r file to learn what is happening.
I'll point Falcury to this.
Maybe somehow it's related to PC speaker sounds, but that's just a random guess.
In the Git version, I have already fixed the bug which switches SDLPoP to PC speaker sounds when opening certain replay files.
But the prince doesn't drink the potion in this version either, so it must be something else.


Okay, I've tested this in the DOS version.
The prince drinks the potion only if I do the following:
* Release shift after the prince lets go of the first ledge.
* Press shift again to grab the second ledge.

If I keep shift pressed for the whole time then the prince won't drink the potion.

It doesn't matter whether I keep shift pressed after the prince lets go of the second ledge.

SDLPoP does the same.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5787
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

David wrote: July 7th, 2020, 10:40 amIf I keep shift pressed for the whole time then the prince won't drink the potion.
I cannot replicate this...
[Edit: Oh, I see. You need to keep Shift down even when you walk towards the tile edge and turn around.]
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: SDLPoP; David's open-source port of PoP

Post by atrueprincefanfrom18 »

Same here... I tried both ways, but still I couldn't do it...
Edit: Oh, so keep SHIFT pressed as much as you can, so maybe game assumes key is dead so doesn't trigger it, or something like that.
Interesting.
Norbert, this should be posted to PoPOT :)
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

Norbert wrote: July 7th, 2020, 11:51 am I cannot replicate this...
[Edit: Oh, I see. You need to keep Shift down even when you walk towards the tile edge and turn around.]
Hm, you're right, I didn't even notice that.
atrueprincefanfrom18 wrote: July 7th, 2020, 11:54 am Edit: Oh, so keep SHIFT pressed as much as you can, so maybe game assumes key is dead so doesn't trigger it, or something like that.
Interesting.
There is a variable, called "control_shift2" in SDLPoP, which is kind of a "sticky" (or buffered) shift flag.
It becomes set (-1) when you press shift down. (But only if it's currently 0, see here.)
It is cleared by some moves like picking up an item or stepping.
(More exactly, these moves set the variable to 1, from which it can become 0 when you release the shift key. Maybe I should draw a state diagram...)

If the prince crouches near a potion, and this flag is set (-1), then he drinks the potion, even if the shift key is not down.
Conversely, if this flag is not set (is 0 or 1), then the prince won't drink the potion, even if you're holding shift. (Only if you pressed shift down back when the prince was not near the potion.)

Similar "sticky" flags exist for the four arrow keys as well:
Start a standing jump, then immediately press and release one of the arrow keys.
After the prince lands, he will do the move corresponding to the arrow key you pressed before.
But only if he landed in the same row, i.e. if he didn't fall.

Or you can press an arrow key while the prince is drinking. The effect is the same as above.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: SDLPoP; David's open-source port of PoP

Post by atrueprincefanfrom18 »

David wrote: July 7th, 2020, 7:10 pm Maybe I should draw a state diagram...
Would be great if you did so. I read thrice, still didn't understand quite fully. :D
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

atrueprincefanfrom18 wrote: July 7th, 2020, 7:15 pm
David wrote: July 7th, 2020, 7:10 pm Maybe I should draw a state diagram...
Would be great if you did so. I read thrice, still didn't understand quite fully. :D
I made this diagram:
control_shift2.png
control_shift2.png (5.99 KiB) Viewed 9409 times
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

atrueprincefanfrom18 wrote: July 6th, 2020, 6:39 pm It would also be great if someone (David or Falcury) goes into deep explaination (or share some document) which would help me understand how P1R file is created, what it's content are.
@Falcury, do you have some documentation about the P1R format?
Or do we need to write one based on the SDLPoP source?

atrueprincefanfrom18 wrote: July 6th, 2020, 6:39 pm I want to know if there's any way to convert P1R to a video format.
Currently the only way is to play it back in SDLPoP and record the screen.

atrueprincefanfrom18 wrote: July 6th, 2020, 6:39 pm I went through the source file of replay and I also think would it be possible to remember the tick when the user QuickSaved the level and then when they Quickload it, SDLPoP can just load the game from that tick and delete the movements from the QuickSave to QuickLoad while recording the P1R file.
Here is my first attempt on a new branch: https://github.com/NagyD/SDLPoP/commits ... _recording
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: SDLPoP; David's open-source port of PoP

Post by atrueprincefanfrom18 »

David wrote: July 8th, 2020, 4:28 pm I made this diagram.
Made some sense now :D. Thank you!
David wrote: July 8th, 2020, 4:55 pm Here is my first attempt on a new branch: https://github.com/NagyD/SDLPoP/commits ... _recording
Appreciate your (Quick!) start to add this feature!
David wrote: July 8th, 2020, 4:55 pm Currently the only way is to play it back in SDLPoP and record the screen.
Yeah, but that runs into the issue of dropping QuickLoad. Let's see: If QuickLoad and recording work together fine, then just replaying it and recording seems fine.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

atrueprincefanfrom18 wrote: July 8th, 2020, 6:01 pm
David wrote: July 8th, 2020, 4:55 pm Currently the only way is to play it back in SDLPoP and record the screen.
Yeah, but that runs into the issue of dropping QuickLoad. Let's see: If QuickLoad and recording work together fine, then just replaying it and recording seems fine.
Sorry, I don't understand what you mean here.
How is QuickLoad related to converting P1R to video?
Post Reply