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: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Norbert wrote: 1. First of all, given how the joystick code currently works, I was wrong about the (-)30000 values.
Those need to be (-)8000 values or it's impossible to combine directions, such as left+up.
So basically I have to undo this?
Norbert wrote: My suggestion is to use both the D-pad and the joystick for movement left and right, and use buttons to jump and crouch.
SNES also uses buttons for up/down, maybe this is why?
Norbert wrote: I noticed the cutscene before level 2 cannot be interrupted while it's fading in, while this is possible with the original DOS game. I didn't test other cutscenes.
Shift will interrupt it then.
I remember there were some problems with this.

EDIT:
It seems to be related to the use of do_simple_wait vs. do_wait in the fade_*_frame functions.
With do_wait(), I can interrupt the main title but not the cutscenes.
With do_simple_wait(), it's the other way around.
I will have to dig into this...
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5786
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

David wrote:So basically I have to undo this?
Yes.
Norbert wrote:SNES also uses buttons for up/down, maybe this is why?
I think the D-pad on the SNES controller does not allow for movement in diagonal directions, so they didn't really have a choice there.
Which buttons did they use for crouch, jump, 'Shift'?

[Edit: Found an overview:]
A: Sneak, pick up items, hang from edges
B: Jump forward
X: Hang from edges
Y: Display time left
L: Crouch
R: Crouch
Start: Pause the game
Select: Display the menu
Up: Jump up, climb edges
Down: Crouch, climb down from edges
Left: Run to the left
Right: Run to the right
CRxTRDude
Efendi
Efendi
Posts: 6
Joined: December 15th, 2015, 12:50 am

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

Post by CRxTRDude »

Falcury wrote: Both are probably fine to use, I guess?
Yeah, it could be fine to use both the forums and the Issue tracker. Although I'm more aware that you guys are more present here though. It's a matter of preference anyway.

BTW, I'll go ahead and test this new build.

Oh yeah, almost forgot, what is the format used in the res##.pal files? It's not Jasc?

And I got a quirky thing that happens each time I run the game. I have a MinGW installation on my computer.
Each time I run SDLPoP, this happens:

C:\MinGW\bin\libmodplug-1.dll is either not designed to run on Windows or it contains an error. ... Error status 0xc000035a.

Clicking OK though and it still works, but this would be problematic on fullscreen.
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 (pre-release)

Post by David »

CRxTRDude wrote: Oh yeah, almost forgot, what is the format used in the res##.pal files? It's not Jasc?
It's the same format as in the DAT files, this is a PoP-specific format.
CRxTRDude wrote: C:\MinGW\bin\libmodplug-1.dll is either not designed to run on Windows or it contains an error. ... Error status 0xc000035a.
SDL2_mixer.dll tries to load that file.
You could either remove C:\MinGW\bin\ from your PATH, or remove/rename libmodplug-1.dll.
CRxTRDude
Efendi
Efendi
Posts: 6
Joined: December 15th, 2015, 12:50 am

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

Post by CRxTRDude »

David wrote:You could either remove C:\MinGW\bin\ from your PATH, or remove/rename libmodplug-1.dll.
Oh. Actually, I did solve that myself when I found out that the SDL version needed was the i386 one instead of the x86 as it was in the compilation instructions. It also solved my compilation problems as well. Should have found it sooner.
David wrote: It's the same format as in the DAT files, this is a PoP-specific format.
Is there a way to open that for Photoshop or something? Since it's already been extracted, I might as well check out how to do so.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5786
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

CRxTRDude wrote:
David wrote:It's the same format as in the DAT files, this is a PoP-specific format.
Is there a way to open that for Photoshop or something? Since it's already been extracted, I might as well check out how to do so.
Those aren't the base palettes, so you won't be able to open them with Photoshop. SDLPoP's data/SKEL.DAT/res750.pal, for example, is the same file as the PR extracted skel/res750.pal.more, which is some kind of game-specific extension, while the actual base palette resides in skel/res750.pal for the PR extracted version and is not included with SDLPoP. This is because SDLPoP uses the indexed colors of the PNG files directly instead of relying on resources.xml to match up images with the respective palettes. Its .pal file should probably be renamed to .pal.more for consistency and to prevent confusion.
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 (pre-release)

Post by David »

I merged Falcury's commits, and changed some other things: https://github.com/NagyD/SDLPoP/commits/master
Norbert wrote: I noticed the cutscene before level 2 cannot be interrupted while it's fading in, while this is possible with the original DOS game. I didn't test other cutscenes.
I think I fixed this now.
Falcury
Calif
Calif
Posts: 568
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury »

Some new pull requests:
- Add option to start fullscreen, change window dimensions in the INI file
- Better INI processing & new custom gameplay options

Some options were added for setting window dimensions and fullscreen mode at startup. I also added options for changing the kid's starting time and hitpoints, as well as an option to allow triggering of any tile.
It should hopefully be bit easier to add similar modifications now; my earlier implementation of ini_callback() (in options.c) wasn't very elegant.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5786
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

Thanks, Falcury. You are on a roll.
David, maybe a holiday 1.16 release for SDLPoP? :)
Falcury
Calif
Calif
Posts: 568
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury »

I also attempted to improve the fake tiles implementation a bit: manually specifying wall connections is now no longer needed.
So, these have become the fake tile modifiers:
Spoiler: show
Empty tile:
4 = Fake Floor
5 = Fake Wall
12 = Fake Floor / No Blue
13 = Fake Wall / No Blue

Floor tile:
5 = Fake Wall
6 = Invisible
13 = Fake Wall / No Blue
14 = Invisible / Blue

Wall tile:
4 = Fake Floor
6 = Invisible
12 = Fake Floor / No Blue
14 = Invisible / Blue
I think I'll take a break now :)
User avatar
SuavePrince
The Prince of Persia
The Prince of Persia
Posts: 1092
Joined: January 26th, 2015, 6:21 pm

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

Post by SuavePrince »

i wanna use sdlpop in my mods,and all mods ..is possible create a options easy such as apoplexy?...you can create this Norbert??
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5786
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

SuavePrince wrote:i wanna use sdlpop in my mods,and all mods ..is possible create a options easy such as apoplexy?...you can create this Norbert??
The next SDLPoP release will most likely allow its users to modify SDLPoP.ini to specify custom starting minutes, starting hitpoints, and to enable triggering of any tile. Falcury worked on these options.
Falcury
Calif
Calif
Posts: 568
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury »

Norbert wrote:
SuavePrince wrote:i wanna use sdlpop in my mods,and all mods ..is possible create a options easy such as apoplexy?...you can create this Norbert??
The next SDLPoP release will most likely allow its users to modify SDLPoP.ini to specify custom starting minutes, starting hitpoints, and to enable triggering of any tile. Falcury worked on these options.
Adding extra CusPop options as INI settings is fortunately not very hard, now that the basic system works (although there are a LOT of options!). Of course, it is necessary to find the correct spot in the code for each hack. (Is there a reference somewhere for what each of the hacks exactly does at the byte level?)

To see how similar options can be added to SDLPoP with relatively little work, you can for example take a look at this commit. (So far I did a few options going from the top down, on the CusPop page) The commit does the following:
- Pick a name for a new global variable in data.h (for example, "max_hitp_allowed" for maximum life points) and specify the unmodified value.
- Modify the relevant code so that it makes use of the value of this variable (for example, in seg001.c, "if (hpmax > 10) hpmax = 10;" becomes "if (hpmax > max_hitp_allowed) hpmax = max_hitp_allowed;")
- In options.c, in the function ini_callback(), specify how the option in the INI file should be read and then used to set a new value for the newly added global variable when the game starts
- Add the option to SDLPoP.ini

I wonder what should be done with array data. For example, should a guard hp setting be defined in the INI file as follows...?

Code: Select all

guard_hp = {4, 3, 3, 3, 3, 4, 5, 4, 4, 5, 5, 5, 4, 6, 0, 0}
Or should we maybe split this up, like so:

Code: Select all

guard_hp_level1 = default
guard_hp_level2 = default
...
The first option is perhaps cleaner, but using "default" to refer to the unmodified value then becomes a bit unwieldy:

Code: Select all

guard_hp = {default, default, default, default, default, default, default, default, default, default, default, default, default, default, default, default}
So perhaps another option is something like a single character "wildcard" for unmodified values in arrays?

Code: Select all

guard_hp = {*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *}
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5786
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

Falcury wrote:(Is there a reference somewhere for what each of the hacks exactly does at the byte level?)
Yes, this is the newest princehack.xml:
http://www.popot.org/other_useful_tools ... cehack.xml
Falcury wrote:I wonder what should be done with array data.
Maybe use sections, such as this:

Code: Select all

[general]
...

[level 1]
guard_hp = ...

[level 2]
guard_hp = ...
Your array with curly brackets looks prettier/cleaner and saves space, but users will have to start counting to find, for example, the current guard value for level 12b. With the curly brackets solution, using tabs to align all values related to the same level in the same column would be an alternative solution, but tabs may differ per user and given the number of levels there may be line wrapping issues.
Falcury
Calif
Calif
Posts: 568
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury »

Hm, yeah, the sections approach sounds interesting.
I would suggest to only fill in the first level then, by default. Only the differences compared to the original game are needed anyway:

Code: Select all

[Level 1]
environment = ...
guard_hp = ...
guard_res = ...

[Level 2]
; If desired, customization options for this level can be added here

[Level 3]
; If desired, customization options for this level can be added here

...
Post Reply