SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Norbert wrote: April 1st, 2022, 3:29 pm Not a big bug, but I think maybe quicksave doesn't remember dead guards? I've not tested this at all. Either way, at 00:46:18 here, there's a dead guard, then after a partial level finish, quickload is used, and shortly thereafter the guard is alive again.
Let's see.
The guard dies at 45:56.
The player presses quicksave at 46:06.
We see the guard is still dead at 46:16.
Then he presses quickload at 46:22.
And we see the guard is alive again at 46:32.

Indeed, the guard should be dead.
I don't know why is this.

I did a quick test, although not with the level in the video.
For me, dead guard stays dead.

Maybe I try it with the level in the video as well...
(Micro Palace, level 11)

UPDATE: I tried it on that level. I even pressed quicksave where we see it in the video.
The guard stays dead for me after quickload.

EDIT: Attached the quicksave file.
Attachments
Micro_Palace_QUICKSAVE.ZIP
(556 Bytes) Downloaded 101 times
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

I'm confused... is this post from Dmitry not on-topic here?
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Norbert wrote: April 3rd, 2022, 5:09 pm I'm confused... is this post from Dmitry not on-topic here?
I think it belongs to that thread.
The link points to a commit on the "keep_fallen_guard" branch.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

David wrote: April 10th, 2022, 1:40 pm
Norbert wrote: April 3rd, 2022, 5:09 pm I'm confused... is this post from Dmitry not on-topic here?
I think it belongs to that thread.
The link points to a commit on the "keep_fallen_guard" branch.
But on the other hand, not only does Dmitry's text appear to be a reaction to my post, both its (non-standalone) phrasing and going into quick saving and loading, but the linked commit also includes summary text "Fixed a bug where dead fallen guards get saved as live guards". I'm still confused. I'm also guessing you have not fully read Dmitry's post, or you probably would have pointed to more than just the linked branch. Maybe Dmitry misunderstood my post because I coincidentally mentioned something very similar to what he was working on?
dmitry_s
Developer
Developer
Posts: 148
Joined: July 27th, 2021, 7:22 am

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

Post by dmitry_s »

That video showed a bug that I had in the original commit. Sorry for the confusion.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

dmitry_s wrote: April 10th, 2022, 7:13 pm That video showed a bug that I had in the original commit. Sorry for the confusion.
The video by VelCheran, you mean?
So, he played with your SDLPoP fork?
Or your own video?
[Edit: Never mind, it's not important.]
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 »

Is this bug already known? Sometimes, when going to the next level, the kid loses his extra hit points.
As you can see in this video, I drink the extra life potion on level 7 but I only have three hit points in level 8.
https://www.twitch.tv/videos/1471154635?t=00h44m34s
dmitry_s
Developer
Developer
Posts: 148
Joined: July 27th, 2021, 7:22 am

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

Post by dmitry_s »

Are you using Ctrl-A to speed up the exit sequence? If so, it tries to reload level 7 with previous hit points but the level number is already incremented so you end up on level 8.
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 »

Oh indeed! The original game has the same behaviour. Thanks, I'll keep that in mind next time.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

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

Post by atrueprincefanfrom18 »

Can the teleports branch be merged into the main/master branch with an added enhancement flag perhaps?
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

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

Post by atrueprincefanfrom18 »

I wonder if there'll be a new release as it's been pretty long since last release.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
FluffyQuack
Vizier
Vizier
Posts: 80
Joined: June 6th, 2004, 7:05 pm

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

Post by FluffyQuack »

Made a PR focusing on refactoring code to make it more readable: https://github.com/NagyD/SDLPoP/pull/290

You can let me know if I want too far with the changes, or if anything should be edited.

I might do even more refactoring like this. Since I'm writing my own engine for running Prince of Persia, I'm using SDL-PoP as a reference quite often, and while I'm doing that I can try to rename variables, replace magic numbers, or add comments where it's applicable. Maybe one day we'll have no variables called "var_2" anymore.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

FluffyQuack wrote: September 25th, 2022, 11:56 pm Made a PR focusing on refactoring code to make it more readable: https://github.com/NagyD/SDLPoP/pull/290
I have merged it.
FluffyQuack wrote: September 25th, 2022, 11:56 pm I might do even more refactoring like this.
Feel free to!
FluffyQuack
Vizier
Vizier
Posts: 80
Joined: June 6th, 2004, 7:05 pm

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

Post by FluffyQuack »

David wrote: October 1st, 2022, 9:49 pm
FluffyQuack wrote: September 25th, 2022, 11:56 pm I might do even more refactoring like this.
Feel free to!
I made another PR but I may have gone a bit overboard: https://github.com/NagyD/SDLPoP/pull/291

It's basically a ton of small changes:
  • Renamed a bunch of var_# variables.
  • Removed vsync argument from a bunch of functions related to palette code as it wasn't used.
  • Removed all references to __pascal, near, and far as I assume the project isn't meant for a 16-bit compiler, and I think this improves readability quite a lot. While removing those, I tried to edit any pointers to have the * symbol after datatype rather than before variable name as I get the impression that's what's prefered in the codebase.
  • Moved a ton of variable declarations within functions to where they're first used. I think this improves readability, and also it might slightly improve optimization during compilation due to variables having a more limited scope.
If anything should be changed or removed, let me know.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

FluffyQuack wrote: October 4th, 2022, 3:26 pm I made another PR but I may have gone a bit overboard: https://github.com/NagyD/SDLPoP/pull/291
I have merged it.

I made some further cleanups, I linked to the commits from my comment on the PR.
Post Reply