SDLPoP; David's open-source port of PoP

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

Moderator: English Moderator Team

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

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

Postby David » July 31st, 2014, 8:10 am

It is written in C. (Plus it uses the SDL library.)
But since C and C++ are so similar, it might also compile as C++.
Are you asking this only out of curiosity, or do you want to recompile it?

salvadorc17
Calif
Calif
Posts: 513
Joined: August 27th, 2011, 2:04 am

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

Postby salvadorc17 » July 31st, 2014, 9:22 pm

Just curiosity, this port will use levels.dat and will be compatible with apoplexy???

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

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

Postby David » August 1st, 2014, 10:37 am

The next version will support levels.dat. (I added it to my version right now.)
The game will look for it in the folder of the exe (that is, not the "data" folder) for compatibility with Apoplexy.

I tried to play some mods, and I already found a bug:
On level 4 of Micro Palace, after the kid enters the exit door, the chomper bites him.

User avatar
musa
Vizier
Vizier
Posts: 111
Joined: March 27th, 2011, 2:06 pm
Location: Nairobi, Kenya

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

Postby musa » August 3rd, 2014, 4:29 pm

Will it be compatible with the rest of the .DAT files?
-- Michael, the boy who makes Shaw's Nightmare.
Visit here to download Shaw's Nightmare: http://shawsnightmare.ucoz.com

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

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

Postby David » August 5th, 2014, 9:37 am

musa wrote:Will it be compatible with the rest of the .DAT files?

I might do that later.

Here is the new version.
Changes:
FIXED: Keys did not repeat themselves.
FIXED: Starting a new game after winning a previous one makes all texts in the game blue instead of white.
FIXED: When the screen is flashing, there may be black rectangles around the moving objects.
FIXED: Can't do level 7 trick.
DONE: Support LEVELS.DAT
FIXED: Can't interrupt fading of title screen.
FIXED: (Micro Palace, level 12) If kid is on the very left (in bottom row), then shadow is in wrong direction (looking left), and is constantly turning around.
Attachments
PORT_PoP_v1.02.zip
(888.91 KiB) Downloaded 26 times

salvadorc17
Calif
Calif
Posts: 513
Joined: August 27th, 2011, 2:04 am

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

Postby salvadorc17 » August 5th, 2014, 9:21 pm

Can you allow this port to use custom tileset graphics???

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

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

Postby Norbert » August 7th, 2014, 1:41 am

This is just a detail, but the sword fighting is a little bit different than what I'm used to.
Normally, when I move forward until I get attacked, I can start with a parry, then Shift, parry, Shift, and so on, and always win.
I tested this fairly thoroughly with the fat guard in level 6, and there's definitely a noticeable difference.
Again, just a detail, and not yet confirmed by others, just something I think I noticed.

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

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

Postby David » August 7th, 2014, 9:01 am

You seem to be right. I already noticed this, and now I tried it with the fat guard and Jaffar.

I already have a newer version -- the biggest change is that it supports all DAT files (except those with the sounds, of course).
I don't know if I should release it before of after I fix this bug.

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

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

Postby David » August 7th, 2014, 12:07 pm

Here is the new version.
Changes:
FIXED: (Micro Palace, level 4) After kid enters exit door, chomper bites kid.
FIXED: shadow is partially green when he is looking to the right
FIXED: (Prince of Wateria, level 5 room 3) Empty potion has red bubbles.
DONE: Use .DAT files. (Of course the PNG files are still supported; I don't want to remove that feature.)
To use dat files, they must be in the current directory.
Now you can play mods! (And discover bugs that appear only in mods. :) )
Note that this port does not recognize if the PRINCE.EXE of the mod was changed.

About the swordfight bug: I found three mistakes in parry(), but the bug remained even after I fixed them. (They are fixed in this version.)
Attachments
PORT_PoP_v1.03.zip
(894.33 KiB) Downloaded 24 times

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

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

Postby Norbert » August 7th, 2014, 2:32 pm

Nice work on fixing so many bugs over the last few releases.
I'll be checking out some mods using your conversion.

David wrote:Note that this port does not recognize if the PRINCE.EXE of the mod was changed.


Right. So, at some point, we may need to move forward with this idea, but (obviously) put it in a separate XML file (and not in one or all of the XML level files).
CusPop should have an XML export option. :lol:

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

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

Postby Eugene » August 7th, 2014, 2:33 pm

Hello. David.

Strange bug...
About version 1.03 (and version 1.02 too)
My system is Windows 7 64 bit.

Strange bug...
Don't work combination keys "shift+left/right: careful step".
If use left/right key on separate cursor block - that's all right.
But.... If use left/right key on numpad - "careful step" don't work.

Thanks.

P.S.It correct if "NumLock" key is not pressed. :-)
P.P.S. Now I compiled prince (v1.03) in Centos 7 64-bit.
Combination keys "shift+left/right: careful step" working correct regardless of the "NumLock" button.

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

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

Postby Norbert » August 7th, 2014, 3:30 pm

David wrote:To use dat files, they must be in the current directory.
Now you can play mods! (And discover bugs that appear only in mods. :) )


I get "Can't load sprites from resource <n>." errors.
Maybe I'm not doing things right, I tried putting the DAT files in the root and in data/.

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

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

Postby David » August 7th, 2014, 5:22 pm

Norbert wrote:I get "Can't load sprites from resource <n>." errors.
Maybe I'm not doing things right, I tried putting the DAT files in the root and in data/.

You need to put them into the directory of the executable.
And make sure you don't delete data/font.
And that the file names are all-uppercase.

Eugene wrote:If use left/right key on numpad - "careful step" don't work.

I seems that if I hold the shift and press any numpad key, SDL sends a "shift released" message.

I couldn't find this in their buglist, but found something similar: https://bugzilla.libsdl.org/show_bug.cgi?id=1188

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

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

Postby Norbert » August 7th, 2014, 6:17 pm

David wrote:You need to put them into the directory of the executable.
And make sure you don't delete data/font.
And that the file names are all-uppercase.


norbert@stimpy ~/Desktop $ ls
0000127.zip PORT_PoP_v1.03.zip
norbert@stimpy ~/Desktop $ unzip -q PORT_PoP_v1.03.zip
norbert@stimpy ~/Desktop $ unzip -q 0000127.zip
norbert@stimpy ~/Desktop $ cp -i 0000127/* PORT_PoP
norbert@stimpy ~/Desktop $ cd PORT_PoP/
norbert@stimpy ~/Desktop/PORT_PoP $ make -s 2>/dev/null
norbert@stimpy ~/Desktop/PORT_PoP $ ./prince
Segmentation fault
norbert@stimpy ~/Desktop/PORT_PoP $ ./prince
Can't load sprites from resource 700.
norbert@stimpy ~/Desktop/PORT_PoP $ ./prince
Can't load sprites from resource 700.
norbert@stimpy ~/Desktop/PORT_PoP $ ./prince
Segmentation fault
norbert@stimpy ~/Desktop/PORT_PoP $

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

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

Postby David » August 7th, 2014, 6:38 pm

Hm, that's weird. Resource 700 is the sword.
I'll look into that.

EDIT: It works for me under Linux.
But... Are you using 64-bit? (The apoplexy Linux binary is 64-bit, that's why I think that.)
Perhaps the types used in DAT-related structures (short, long) have different size under 64-bit?


Return to “SDLPoP”

Who is online

Users browsing this forum: No registered users and 0 guests