SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.

Moderator: English Moderator Team

Eugene
Efendi
Efendi
Posts: 14
Joined: August 7th, 2014, 2:17 pm

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

Postby Eugene » February 2nd, 2015, 12:59 pm

Hello. David.

1. Blinking is working, indeed. Sorry.
2. What's the problem with the music? Or simply you do not have enough free time?

Thanks...VM

David
The Prince of Persia
The Prince of Persia
Posts: 1340
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Postby David » February 3rd, 2015, 12:16 pm

Eugene wrote:1. Blinking is working, indeed. Sorry.

With or without the change?

Eugene wrote:2. What's the problem with the music? Or simply you do not have enough free time?

I did not do the music yet.

Eugene
Efendi
Efendi
Posts: 14
Joined: August 7th, 2014, 2:17 pm

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

Postby Eugene » February 4th, 2015, 1:48 pm

With or without the change?


Yes, without any change code.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 2955
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Postby Norbert » February 4th, 2015, 1:57 pm

I tested it a while back (on Linux) and I had to change the code as you suggested to see the blinking.

Eugene
Efendi
Efendi
Posts: 14
Joined: August 7th, 2014, 2:17 pm

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

Postby Eugene » February 12th, 2015, 2:37 pm

Hello, David.

I did not do the music yet.


Maybe convert midi music to wav or to mp3?

https://dl.dropboxusercontent.com/u/53327776/pp1wav.zip

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 2955
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Postby Norbert » February 12th, 2015, 5:42 pm

Eugene wrote:Hello, David.

I did not do the music yet.


Maybe convert midi music to wav or to mp3?

https://dl.dropboxusercontent.com/u/53327776/pp1wav.zip


viewtopic.php?p=15497#p15497

http://www.popot.org/get_the_games/vari ... _music.zip

David
The Prince of Persia
The Prince of Persia
Posts: 1340
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Postby David » February 13th, 2015, 8:05 pm

Here is the new version.

Changes:
Added support for music. (finally!)
Fixed some memory leaks.

Music is not included, you have to download it separately. See doc/Readme.txt .
Attachments
SDLPoP_v1.13.zip
(1.29 MiB) Downloaded 74 times

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 2955
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Postby Norbert » February 13th, 2015, 9:37 pm

Nice. Little bit of static during playback. I was messing around playtesting it and ran into what I first thought was an SDLPoP bug but turns out to be something that also happens in the original game. This happens for example in level 2, near the 3rd guard (yellow/orange). When in fighting stance, scoot backwards until you fall to the lower floor and get spiked. Press "r" to resurrect. Then climb up.

David
The Prince of Persia
The Prince of Persia
Posts: 1340
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Postby David » February 14th, 2015, 12:04 pm

Norbert wrote:This happens for example in level 2, near the 3rd guard (yellow/orange). When in fighting stance, scoot backwards until you fall to the lower floor and get spiked. Press "r" to resurrect. Then climb up.

The guard will push the kid off the ledge into the spikes (which are now disabled: stuck-outside).
The kid will have 0 HP, but he will crouch forever instead of dying.

It seems that the disabled spike is the key.
The bug it also possible with the disabled (stuck-inside) spikes found in Apoplexy.
If I use another object that is walkable, but the guard won't fall into it (a solid-loose floor or a stuck-open chomper), then the bug won't happen.

This happens in land() (seg005.c)
if (get_tile_at_char() != tiles_2_spike) is false [spike] -> goto loc_5EE6;
if (is_spike_harmful()) is also false. [disabled]
if (Char.fall_y < 22) is true. [fell only one row]
if (Char.charid >= charid_2_guard || Char.sword == 2) is false. [it's the kid, and he is not holding the sword] -> seq_id = 17; (crouch)

[in the Apple II source: CTRL.S, hitflr routine, "beq :hitspikes" jumps over "lda CharLife"]

That goto jumps into the block of "if (Char.alive < 0)" [is alive] whose condition is false (because Char.alive is 0 [kid is dead]).
Therefore, the game will do as if the kid was alive.
A fix would be to replace "goto loc_5EE6;" with the if block after "loc_5EE6:".

In the original game, this can happen only if someone falls into the spikes (*), and then the kid is pushed (by a guard) into the spikes (**).
If that "someone" is the kid, then this requires cheats (R).
If that "someone" is a guard, then you need to lure a guard to the spikes from another room.
(*) There are no already-disabled spikes on the original levels.
(**) Or is there another way of first dying, and then falling?

Andrew
Wise Scribe
Wise Scribe
Posts: 313
Joined: July 16th, 2009, 4:39 pm

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

Postby Andrew » February 15th, 2015, 6:35 pm

David wrote:CHANGE: Changed project type to GUI. This means that the (empty) console window won't appear under Windows.

This change seems to have got reverted because 1.13 still shows the empty console window.

Would it be possible to allow the game to switch between fullscreen and windowed while it is running using Alt+Enter? Having this ability will certainly be much better than having to run the EXE with the "full" param.

Don't know if it's been discussed earlier, but what's the problem with using the original game music resources instead of comparatively huge OGGs? Is the use of OGGs just a temporary stop-gap measure?

Speaking of sound/music, since SDLPoP uses PoP1 1.0, is the Ctrl+S bug fixed?

Anyway, fantastic as always, and great to see the progress since I last checked SDLPoP out. :)

David
The Prince of Persia
The Prince of Persia
Posts: 1340
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Postby David » February 16th, 2015, 11:43 am

Andrew wrote:
David wrote:CHANGE: Changed project type to GUI. This means that the (empty) console window won't appear under Windows.

This change seems to have got reverted because 1.13 still shows the empty console window.

Oops, it seems I did that change only for the debug project.
Now I fixed this.

Andrew wrote:Would it be possible to allow the game to switch between fullscreen and windowed while it is running using Alt+Enter? Having this ability will certainly be much better than having to run the EXE with the "full" param.

I added it now.
The game seems to crash very-very rarely when using it, I can't reproduce it anymore.
EDIT: It happens if I switch *into* fullscreen while the game is paused.
EDIT: I think I fixed that.

Andrew wrote:Don't know if it's been discussed earlier, but what's the problem with using the original game music resources instead of comparatively huge OGGs? Is the use of OGGs just a temporary stop-gap measure?

It was discussed here: viewtopic.php?p=15488#p15488
The key points are:
* The MIDI player in SDL_Mixer needs instruments in wavetable format.
But the original game stores only a description of them. (ADSR, waveform, etc.)
(Though the Mac version has the instruments as waves.)
* Using a wave format (like OGG) gives mode freedom to the modders.

Andrew wrote:Speaking of sound/music, since SDLPoP uses PoP1 1.0, is the Ctrl+S bug fixed?

I just tested it and Ctrl-S does not turn off "chunk" sounds: digi sounds that were converted for use with SDL_mixer.
Plus if I turn sound off with Ctrl-S, then all currently playing sounds should stop (or mute).
Now I fixed both.
Plus I made sure that sound on/off does not break sound-based timing. (Used for slow-fall, for example.)
And of course, having no sound card should not break it either.

Andrew wrote:Anyway, fantastic as always, and great to see the progress since I last checked SDLPoP out. :)

Thank you! :)

David
The Prince of Persia
The Prince of Persia
Posts: 1340
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Postby David » February 16th, 2015, 1:08 pm

Here is the new version.

Changes:
FIXED: Changed project type to GUI in the "release" project, too.
FIXED: Ctrl-S did not turn off mixer sounds.
FIXED: Ctrl-S did not stop currently playing sounds.
DONE: Toggle fullscreen with alt-enter.
FIXED: If the game is in full screen, and I switch away (alt-tab) and back, most of the screen will be black, until it is redrawn.
Attachments
SDLPoP_v1.14.zip
(1.29 MiB) Downloaded 111 times

Eugene
Efendi
Efendi
Posts: 14
Joined: August 7th, 2014, 2:17 pm

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

Postby Eugene » February 17th, 2015, 12:59 pm

Thanks very much, David.
Nice work!
But....
1. Now is time to think about scaling game window.
On modern monitors window size 320x240 looks "no ice".
It really do?
2. Do you plan to implement the joystick work?

Andrew
Wise Scribe
Wise Scribe
Posts: 313
Joined: July 16th, 2009, 4:39 pm

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

Postby Andrew » February 17th, 2015, 7:40 pm

David wrote:I added it now.
The game seems to crash very-very rarely when using it, I can't reproduce it anymore.
EDIT: It happens if I switch *into* fullscreen while the game is paused.
EDIT: I think I fixed that.

Great, seems to work very well and hasn't crashed so far for me at any point during the game, paused or otherwise.

David wrote:It was discussed here: viewtopic.php?p=15488#p15488
The key points are:
* The MIDI player in SDL_Mixer needs instruments in wavetable format.
But the original game stores only a description of them. (ADSR, waveform, etc.)
(Though the Mac version has the instruments as waves.)
* Using a wave format (like OGG) gives mode freedom to the modders.

Apologies if this sounds dumb, but how about using something like FluidSynth, FMOD Ex, DUMB, BASS/BASSMIDI etc.? Then we can have (with something like BASSMIDI for example) support for MP3, MP2, MP1, OGG, WAV, AIFF, MOD music (XM, IT, S3M, MOD, MTM, UMX), MO3 music (MP3/OGG compressed MODs), MIDI (including SF2 and SFZ SoundFonts)... Of course I have no idea of the amount of effort involved, so it's easy for me to say, but I think MIDI and tracker module support especially would be nice so we can have good music at relatively small sizes.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 2955
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Postby Norbert » February 20th, 2015, 6:07 am

David wrote:DONE: Toggle fullscreen with alt-enter.


I'm still hoping for an SDL2 version of the port, because the current fullscreen doesn't work under Linux, so I get 320x200 on a 1920x1080 screen.

Eugene wrote:2. Do you plan to implement the joystick work?


This would be very easy with SDL2. See, for example, the apoplexy source code. It includes the code to haptic rumble (maybe when the prince gets hit? ;)). For initialization, see the code starting at line 7989. For input processing, see the case SDL_CONTROLLERBUTTONUP and case SDL_CONTROLLERAXISMOTION in, for example, the ChangePos function.


Return to “SDLPoP”

Who is online

Users browsing this forum: Google [Bot] and 1 guest