4D prince guards

Windows and Linux editor of PoP1 (for DOS and SNES) and PoP2 (for DOS).

Moderator: English Moderator Team

emrtss
Efendi
Efendi
Posts: 10
Joined: November 8th, 2014, 11:15 pm

4D prince guards

Postby emrtss » November 8th, 2014, 11:18 pm

Some guards in Prince of Persia 4D look really weird, this is not due to graphical modifications as it changes with the levels.dat.
I was simply wondering how he had done this, below is a picture of how it looks in apoplexy.
http://i.imgur.com/11opLiN.png

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

Re: 4D prince guards

Postby Norbert » November 8th, 2014, 11:46 pm

That particular guard's color is 254 (0xFE), which is outside the (0-6) range the game is build to work with.

As you can read on page 16 of this document:
"Other codes may generate random colours because the game is reading the palette from trashed memory. This may also cause a game crash."
This is why the guard looks strange in-game:

Image
(mirror)

What you see in the image you posted is how apoplexy displays guards with colors outside the regular 0-6 range.

emrtss
Efendi
Efendi
Posts: 10
Joined: November 8th, 2014, 11:15 pm

Re: 4D prince guards

Postby emrtss » November 8th, 2014, 11:49 pm

Thanks for your answer, would it be possible to edit the guard color outside the range of 0-6 in apoplexy? Or would I have to modify my prince.exe for that?

emrtss
Efendi
Efendi
Posts: 10
Joined: November 8th, 2014, 11:15 pm

Re: 4D prince guards

Postby emrtss » November 9th, 2014, 12:03 am

You've got to excuse me for my ignorance, but I have got yet another question for you. In the apoplexy editor itselfl, some tiles are marked with a red exclaimation mark. I've seen one of these being used in the Repetition of time mod, however upon trying those myself all it did was creating graphical errors (distorting the level). Are there any use for these tiles at all?

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

Re: 4D prince guards

Postby Norbert » November 9th, 2014, 12:04 am

emrtss wrote:Thanks for your answer, would it be possible to edit the guard color outside the range of 0-6 in apoplexy? Or would I have to modify my prince.exe for that?


Currently, apoplexy only allows users to place regular guards of the seven (0-6) color combinations the game itself is build to work with.

If you want the game to generate colors based on trashed memory (like 4D Prince of Persia), then you would have to modify LEVELS.DAT with a hex editor to set a color greater than 6. However, if the document I cited above is correct, then the change could result in a game crash.

Another, better solution would be to modify the regular seven color combinations by editing PRINCE.EXE. As far as I know, CusPop has no options to do this (yet).

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

Re: 4D prince guards

Postby Norbert » November 9th, 2014, 12:40 am

emrtss wrote:Are there any use for these tiles at all?


The short answer is: no. They are there only to make the tile locations on the 'tiles screen' the same for the dungeon and palace environments. For example, on the tiles screen for dungeon levels, the first tile with an exclamation mark is where the mirror is on the tiles screen for palace levels. This makes it easier for mod authors to remember the tile locations. The longer answer is: some of them actually show stuff without distortion, but the visuals depend on the where the tiles are being used. Also, distortions could make levels quite tricky. ;) Finally, I wouldn't be surprised if it's possible to somehow add, for example, the mirror resource to dungeon levels.

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

Re: 4D prince guards

Postby David » November 9th, 2014, 1:19 pm

Norbert wrote:because the game is reading the palette from trashed memory

The color of the weird guards changes if I start the game with the stdsnd parameter (pcspeaker mode).
Maybe that memory is related to sounds?

Norbert wrote:Another, better solution would be to modify the regular seven color combinations by editing PRINCE.EXE.

They are stored in PRINCE.DAT, PR exports it as "guard palettes.pal".

Norbert wrote:That particular guard's color is 254 (0xFE), which is outside the (0-6) range the game is build to work with.

Actually, the regular guards use 1-7, and the "special" ones (fat, Jaffar) use 0 (but the color is ignored for them).
And that weird guard has color 0xFF. (level 2 room 23)
But I see that Apoplexy subtracts 1 from the color, so that explains the differences.

emrtss wrote:some tiles are marked with a red exclaimation mark. I've seen one of these being used in the Repetition of time mod

Do you mean level 12, room 15?
That level is changed to palace in the mod's PRINCE.EXE.

Norbert wrote:Finally, I wouldn't be surprised if it's possible to somehow add, for example, the mirror resource to dungeon levels.

It's possible:
* In resources.xml, copy the mirror section from the vpalace section to the vdungeon section.
* Export both DAT files.
* Copy the mirror folder from vpalace to vdungeon.
* Reimport vdungeon.
* Place a mirror on a dungeon level. (In Apoplexy, it's on the left side of the broken floor.)

This is the result:
dungeon_mirror.png
A mirror in the dungeon.
dungeon_mirror.png (3.99 KiB) Viewed 694 times


If you want to change those images, you should fix the palettes of the BMP files.
(They still have the vpalace palette, but the game will use the vdungeon palette.)
The easiest way to do this is to re-export vdungeon.

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

Re: 4D prince guards

Postby Norbert » November 9th, 2014, 3:06 pm

David wrote:
Norbert wrote:Another, better solution would be to modify the regular seven color combinations by editing PRINCE.EXE.

They are stored in PRINCE.DAT, PR exports it as "guard palettes.pal".


Ah, yes. What a weird location (prince/binary/) for that PAL file.
I was looking at the PAL files in guards/ (that contain just 0's) and unjustly concluded the colors had to be set in PRINCE.EXE.

David wrote:
emrtss wrote:some tiles are marked with a red exclaimation mark. I've seen one of these being used in the Repetition of time mod

Do you mean level 12, room 15?
That level is changed to palace in the mod's PRINCE.EXE.


Yep, that's the location emrtss meant. (See the chat history, 2014-11-08 23:11:58 and further.) emrtss had copied over just the LEVELS.DAT file, and not also the PRINCE.EXE file. If the latter is also added to prince/, then apoplexy (2.6b and newer) will automatically show the correct environment.


Return to “apoplexy”

Who is online

Users browsing this forum: No registered users and 1 guest