Can PoP1 have more levels?

Discuss PoP1 for DOS here.
Post Reply
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Can PoP1 have more levels?

Post by robert »

This will be a horrible question, but I'll do it anyway:

Can prince of persia 1, both pc or snes version, have more than 14 playable levels or 20 levels?

I don't mean less levels, because you can do it with cuspop (pc) or with the level editor for snes. But I just want to know if there is a way to make more levels than the original limit of them.

Thanks

[Edit: Changed post subject from "Question ¿?" to "Can PoP1 have more levels?". --Norbert]
Image
This will be my face if you can't win any of my mods
User avatar
mk1995
The Prince of Persia
The Prince of Persia
Posts: 1160
Joined: February 27th, 2009, 10:09 pm
Location: Germany

Re: Question ¿?

Post by mk1995 »

Probably. As for PoP PC you would have to add something like an additional levels.dat and hack the .exe so it goes into that after you're through with the first one. As for the SNES, the only way to do it would be to extend the ROM size and add a shit ton of pointers, so spare yourself the effort.
Image
Just to make something clear: I will not reply to daft PMs like "Where can I find X?" or "Can you give me a link to Y?". Most of your questions are likely answerable if only you took your bloody time to look through these forums and use Google if all else fails. Sheesh...
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Re: Question ¿?

Post by robert »

mk1995 wrote:Probably. As for PoP PC you would have to add something like an additional levels.dat and hack the .exe so it goes into that after you're through with the first one. As for the SNES, the only way to do it would be to extend the ROM size and add a shit ton of pointers, so spare yourself the effort.
Thank you!

Can you explain me how to do it for pc, if you know?. If not do you know if someone in the forum knows about this? Thanks again

I'm sure Kashglnoon should know about this, doesn't he? If you Kashlgnoon are seeing this can you help me with please?
Image
This will be my face if you can't win any of my mods
User avatar
mk1995
The Prince of Persia
The Prince of Persia
Posts: 1160
Joined: February 27th, 2009, 10:09 pm
Location: Germany

Re: Question ¿?

Post by mk1995 »

As far as I've heard Butcher actually wanted to do a mod that'd use two levels.dat files, but since he's a fuckwad and long banned you needn't bother asking him.
Image
Just to make something clear: I will not reply to daft PMs like "Where can I find X?" or "Can you give me a link to Y?". Most of your questions are likely answerable if only you took your bloody time to look through these forums and use Google if all else fails. Sheesh...
David
The Prince of Persia
The Prince of Persia
Posts: 2878
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Question ¿?

Post by David »

I have started hacking the DOS version to have more levels, and it actually works.
However, there are hardcoded tables in the EXE that specify things for each level, like: level type (dungeon/palace), guard hit points, guard types, allowed tiles, cutscenes.
I've decided to drop the allowed tiles table and simply allow all tiles on all levels.
I think the others should be moved into the unused parts of the level data, i.e. 0x8F0 would store the level type, 0x8F1 the guard type, 0x8F3 the guard hp.
A big problem would be editing levels, because current level editors can handle only levels 0..15.
My solution would be:
- edit the levels in a regular levels.dat,
- exporting the levels with PR,
- hex-editing them to contain the level type etc.,
- and then importing them with a custom resources.xml.

Also, the title of the topic should be changed to something like "Can PoP1 have more levels?".
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5796
Joined: April 9th, 2009, 10:58 pm

Re: Question ¿?

Post by Norbert »

David wrote:allow all tiles on all levels [and] others should be moved into the unused parts of the level data
This sounds like a good solution.
However, there would still be an upper limit to how many levels a mod can have, given the available freed space.
David wrote:A big problem would be editing levels, because current level editors can handle only levels 0..15.
I could change apoplexy to work with both regular and extended mods.
One byte in the freed space could be set to a value that's normally never used there to indicate it's an extended mod, another (the next) byte could indicate how many levels are being used.
David wrote:- edit the levels in a regular levels.dat,
- exporting the levels with PR,
- hex-editing them to contain the level type etc.,
- and then importing them with a custom resources.xml.
This sounds complicated (for users).
PR could probably check for the byte as well(*) and work with both regular and extended mods.
(*) Since apoplexy relies on PR, if PR can handle more levels, changing apoplexy would be quite easy.
David wrote:Also, the title of the topic should be changed to something like "Can PoP1 have more levels?".
Done.

[Edit: Maybe we should focus on FreePrince instead. It would allow us to do far more and more interesting things. In that context: I'm not sure we really need to have FreePrince work with the .DAT files that came with the original game. There could be a converter for the graphics for example, to make them far easier to edit and use whatever color combinations we'd want. Then again, who has the time to work on all that stuff...]
David
The Prince of Persia
The Prince of Persia
Posts: 2878
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Question ¿?

Post by David »

Norbert wrote:
David wrote:allow all tiles on all levels [and] others should be moved into the unused parts of the level data
This sounds like a good solution.
However, there would still be an upper limit to how many levels a mod can have, given the available freed space.
I think you misunderstood me. Each level would store its own level/guard type only. (Actually, PoP2 already does this.)
Norbert wrote:One byte in the freed space could be set to a value that's normally never used there to indicate it's an extended mod, another (the next) byte could indicate how many levels are being used.
Levels.dat already contains the number of levels, as part of the resource table.
Norbert wrote:PR could probably check for the byte as well(*) and work with both regular and extended mods.
(*) Since apoplexy relies on PR, if PR can handle more levels, changing apoplexy would be quite easy.
Maybe supply apoplexy with an extended resources.xml, and use that with PR?
Norbert wrote:
David wrote:Also, the title of the topic should be changed to something like "Can PoP1 have more levels?".
Done.
Thanks!
David
The Prince of Persia
The Prince of Persia
Posts: 2878
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Can PoP1 have more levels?

Post by David »

Here is what I made back in 2011.

All the levels were automatically converted from SNES PoP.
PRINCELV.EXE is the EXE to start.
All levels are dungeons, all guards are pitch black and have 0 HP (they die immediately).
That's because I didn't bother to set the level type, guard colors, guard type, and guard HP, so they are all zeroes.

morelevels.txt contains some documentation about the EXE changes.
This includes where within the level data does the hacked EXE expect level type, guard type, and guard HP.
Attachments
morelevels.zip
(699.79 KiB) Downloaded 50 times
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5796
Joined: April 9th, 2009, 10:58 pm

Re: Can PoP1 have more levels?

Post by Norbert »

David wrote: May 24th, 2025, 7:03 pmHere is what I made back in 2011.
Two questions:
1. You wrote (emphasis mine) "That's because I didn't bother to set the level type, guard colors [...]". Aren't those specified in the EXE? I also see no "color" or "colour" in morelevels.txt, and for "guard" I only see type and hp in aforementioned file.
2. I see you start with the level type at 0x8F0. I'm curious why you didn't start 1 byte earlier, at 0x8EF. Page 10 of the Prince of Persia Specifications of File Formats says "Unknown IV (d)" starts at 2287 (0x8EF).

As for resources.xml, if it simply names the PLV files level16.plv and up, then apoplexy wouldn't even need to access it, and could simply read levelnn.plv.
David
The Prince of Persia
The Prince of Persia
Posts: 2878
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Can PoP1 have more levels?

Post by David »

Norbert wrote: June 20th, 2025, 1:36 pm 1. You wrote (emphasis mine) "That's because I didn't bother to set the level type, guard colors [...]". Aren't those specified in the EXE? I also see no "color" or "colour" in morelevels.txt, and for "guard" I only see type and hp in aforementioned file.
By guard colors, I mean the standard per-room guard colors, called guard_colour in FormatSpecifications.pdf, and guards_color in SDLPoP.
Norbert wrote: June 20th, 2025, 1:36 pm 2. I see you start with the level type at 0x8F0. I'm curious why you didn't start 1 byte earlier, at 0x8EF. Page 10 of the Prince of Persia Specifications of File Formats says "Unknown IV (d)" starts at 2287 (0x8EF).
Maybe I wanted it to start at a round (in hex) offset?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5796
Joined: April 9th, 2009, 10:58 pm

Re: Can PoP1 have more levels?

Post by Norbert »

I'm wondering if you know or remember what, in the u0 EXE, are the two bytes that start at 0x1C62E.
I'm asking because I noticed that the standard EXE that ships with apoplexy has FF FF there, while your EXE has 00 00.

Also, it would be useful if programs such as apoplexy could detect whether or not the EXE has been modified to work with more (or less) levels.
Without having to open an accompanying LEVELS.DAT, I mean.
Any suggestions there, perhaps a specific byte that we could toggle?
I could look at e.g. 0x1F1D to see if it contains 0E or 7F (part of the Shift+l change), but this doesn't seem very elegant.

Finally, I noticed that in level 21 the prince instantly dies.
This seems to be because he starts in a strange room + position (0 + 256 (255) respectively).
Maybe an issue with the automatic conversion.
Not a real problem, because an editor should be able to fix that; just something I noticed.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5796
Joined: April 9th, 2009, 10:58 pm

Re: Can PoP1 have more levels?

Post by Norbert »

Inside the attached ZIP file are apoplexy files that can be used to improve apoplexy 3.18 to support editing more (and less) levels.
To use this, start with apoplexy 3.18, and then copy all files from the attached ZIP over apoplexy 3.18.

After starting apoplexy, you can edit more (and less) levels by changing the level count on the F4 screen.

If you want, you can also move David's files from morelevels.zip into the prince/ directory. But then you'll have to, for each level, modify some settings with F2 (environments and enemy resources, guard hit points) and by clicking guards (to change their colors).

If there are bugs, let me know.
Attachments
apoplexy-3.18-ML.zip
(1.47 MiB) Downloaded 6 times
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5796
Joined: April 9th, 2009, 10:58 pm

Re: Can PoP1 have more levels?

Post by Norbert »

Norbert wrote: Yesterday, 12:39 pmIf there are bugs, let me know.
I found a bug when decreasing (lowering) the level count.
When decreasing, after saving the changed level count, at both F4 and the main screen, for now it's best to restart the application before editing further.
Post Reply