SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury »

spaztron64 wrote: March 10th, 2018, 12:21 am One neat feature to have would be multi-channel sampling (multiple sounds at once), unless that feature has already been implemented and I'm missing something.

What do you think?
Yes, we could definitely try that. I wonder what that would sound like.
Maybe in some cases we still want a sound to suppress other sounds. For example, when the feather fall music is playing, it might be a bit strange to hear footsteps and other sounds.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5746
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

Falcury wrote: February 17th, 2018, 2:56 pm
Norbert wrote: February 17th, 2018, 2:52 pm Another fix that could be part of the use_fixes_and_enhancements bit is that merging with the shadow requires waiting for the music or flashing to end before the hidden tiles show up/work.
Yeah, good idea, that has always annoyed me!

Edit: Here's the proposed fix:
https://github.com/NagyD/SDLPoP/pull/158
At 17:33 of this video, why doesn't he have to wait?
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury »

Norbert wrote: March 17th, 2018, 1:08 pm At 17:33 of this video, why doesn't he have to wait?
He does wait, though? After merging, he first goes right for a bit, then turns around, maybe because that allows him to delay for a predictable amount of time. After the flashing has stopped, you're good to go (you don't need to wait for the music).
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5746
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

Falcury wrote: March 17th, 2018, 2:02 pmAfter the flashing has stopped, you're good to go (you don't need to wait for the music).
Ah. Didn't know that.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5746
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP (pre-release)

Post by Norbert »

Falcury wrote: May 27th, 2015, 2:05 pm
David wrote:That sound exists only in pcspeaker format. SDLPoP does not play those.
That's a pity. Perhaps we could somehow convert the sound to a waveform version, so that emulation of the pc speaker won't be necessary.
Dunno if this is still on a TODO somewhere.
See also segra's comment under it.
Not that important, definitely not for 1.18.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury »

No big deal if this doesn't make it into 1.18, but here are two more small bug fixes:
https://github.com/NagyD/SDLPoP/pull/166
Norbert wrote: March 17th, 2018, 2:16 pm Dunno if this is still on a TODO somewhere.
See also segra's comment under it.
Not that important, definitely not for 1.18.
Yeah, maybe for the next release.
Instead of converting the sounds like I suggested in that post, we could synthesize the waveform in the audio callback. (I think it should be a square wave)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5746
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

I don't think integer (pixel perfect) scaling works under Linux, not at 4:3 nor at the default 16:9.
At least, I don't see any changes. Does it work under Windows?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5746
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

On Twitter, someone comments:
Guys I found a bug on Level 7. After the Prince drops down from Level 6, instead of falling all the way from the top, he just lands instantly at the bottom, next to the exit door, completely unharmed, and can instantly bypass the entire Level!
I can't replicate this. Not on Linux and not on Windows (Wine).
David
The Prince of Persia
The Prince of Persia
Posts: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Norbert wrote: March 18th, 2018, 10:36 am On Twitter, someone comments:
Guys I found a bug on Level 7. After the Prince drops down from Level 6, instead of falling all the way from the top, he just lands instantly at the bottom, next to the exit door, completely unharmed, and can instantly bypass the entire Level!
I can't replicate this. Not on Linux and not on Windows (via Wine).
This happens only if the "Fix hang on teleport bug" is turned on.
Looks like the fix is not perfect...
User avatar
spaztron64
Efendi
Efendi
Posts: 14
Joined: February 29th, 2016, 12:13 am

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

Post by spaztron64 »

Any chance of fixing the screaming guard bug (and maybe even the fall thru floor bug, unless that's already an option and I didn't notice)?
https://www.youtube.com/watch?v=yUuX6VOxTU4
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury »

spaztron64 wrote: March 18th, 2018, 2:12 pm Any chance of fixing the screaming guard bug (and maybe even the fall thru floor bug, unless that's already an option and I didn't notice)?
https://www.youtube.com/watch?v=yUuX6VOxTU4
I think the fall through bug already has a fix.

About the screaming guard: in the original game, all characters can scream if their falling speed exceeds a certain value (see do_fall() in seg005.c).
Normally you don't hear guards screaming, because they usually only fall for a short distance until they disappear off-screen and get disabled (see check_guard_fallout() in seg002.c). Also, even if they start to scream, the victory music will usually be triggered shortly after, which cancels the screaming sound. In your video, though, the room is changed before Jaffar disappears off-screen, so the screaming sound is not canceled.
Falcury wrote: February 25th, 2018, 6:40 pm
Norbert wrote: February 25th, 2018, 1:44 pm [Edit: By the way, in CMakeLists.txt it still says 1.17.]
Ah, yes, that version number is for the macOS app bundle.
That's still broken unfortunately because of dependency hell on macOS that I couldn't figure out. :|
I decided to have another go at creating an application bundle for macOS.
See the attached disk image archive.
For those who have a Mac and want to try it: please let me know if it works. :)

GitHub branch: https://github.com/Falcury/SDLPoP/commits/mac_app

Some things to note:
  • Getting the dynamic linking to work correctly was a very hard. After the earlier attempts using CMakeLists.txt failed, I tried to build SDLPoP in XCode, so that I could use the official SDL2 "frameworks" binaries from libsdl.org. I almost got that to work, but not reliably. Also, using XCode inflated the size of the bundle to >10 MB, because the "frameworks" got copied in and those took up a lot of space. So, I again decided to try CMake - I figured it might have become easier now that SDL2_mixer is no longer needed. Unfortunately, I still had to eventually give up on linking the SDL2_image .dylib, and instead switched over to stb_image to circumvent the problem. Overkill, but at least it seems to finally work...
  • Mac .app bundles are supposed to look like single files, but (in general) file operations with bundles are painfully slow, especially if a bundle contains a large number of small files (this often seems to be the case, unfortunately). To reduce the number of files within the SDLPoP bundle, I replaced all the data folders with their .DAT equivalents. (No one would notice the difference anyway, because the files are hidden away)
  • SDLPoP.ini is awkward to get at, because it's inside the bundle. But you can still use the menu to change settings.
Attachments
SDLPoP-1.18.dmg
(1.36 MiB) Downloaded 76 times
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury »

David wrote: March 18th, 2018, 11:08 am This happens only if the "Fix hang on teleport bug" is turned on.
Looks like the fix is not perfect...
This change in exit_room() resolves the problem for me (line 305):

Code: Select all

		if (!(fixes->fix_hang_on_teleport && Char.y >= 211 && Char.curr_row >= 2))
David
The Prince of Persia
The Prince of Persia
Posts: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Falcury wrote: March 18th, 2018, 4:57 pm This change in exit_room() resolves the problem for me (line 305):

Code: Select all

		if (!(fixes->fix_hang_on_teleport && Char.y >= 211 && Char.curr_row >= 2))
I added that, and I also merged a pull request that fixes another bug.
This means two things:
1. We need to release a v1.18.1 soon.
2. I guess we "have no right" anymore to complain about SDL bugs that were not yet there in the pre-release... :|
David
The Prince of Persia
The Prince of Persia
Posts: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

I fixed the removed loose floor on level 3, and also replaced a few numbers with (existing!) custom options.
https://github.com/NagyD/SDLPoP/commit/ ... 9ea9f8b577
https://github.com/NagyD/SDLPoP/commit/ ... fc0a53b2ac -- Note the TODOs.

Hopefully there are no more bugs related to custom options.

A question: Do you think that this should use custom->mirror_level?
YURA
The Prince of Persia
The Prince of Persia
Posts: 1425
Joined: February 9th, 2017, 11:12 pm

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

Post by YURA »

Version 1.18.1 was released by David on 24 March 2018
Please! Lay out the file of the menu in text form that it was possible to translate into other language normally.
Post Reply