Documentation (Prince of Persia 1 Special Events)

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by David »

tacosalad wrote:PS: I will explain the undocumented tile-change event in level 4 shortly. In "Delusions" I used it to selectively transform a Weightless potion into a Health potion, but it could be used to cause all sorts of other interesting transformations too!
You already did it here: viewtopic.php?p=12199#p12199
tacosalad
Sheikh
Sheikh
Posts: 48
Joined: October 3rd, 2005, 6:03 am
Location: Oregon, USA
Contact:

Re: Documentation (Prince of Persia 1 Special Events)

Post by tacosalad »

David wrote:
tacosalad wrote:PS: I will explain the undocumented tile-change event in level 4 shortly. In "Delusions" I used it to selectively transform a Weightless potion into a Health potion, but it could be used to cause all sorts of other interesting transformations too!
You already did it here: viewtopic.php?p=12199#p12199
True, but that discussion was undoubtedly too technical. Too esoteric.

For modders, what matters is that a tile in room 4 will transform when the exit opens on level 4. The transformation occurs when the mirror is placed in that room. The location of the tile in room 4 corresponds to the location of the exit door tile in the room that contains the exit door that opened. This picture shows how any potion on that tile would instantly become an ordinary healing potion. The exit is located in the second row, 5th tile from the right (orange rectangle), so the tile in room 4 that transforms in located in the second row, 5th tile from the right.
After the exit opens, a tile in room 4 will change
After the exit opens, a tile in room 4 will change
If you design a level with multiple exits, then the tile that transforms in room 4 is determined by the position of whatever exit the player opens first. (Such a level should be designed to prevent the player from opening more than 1 door. One way to do that is to exploit the fact that an exit door can be opened by a drop event, as explained here, so you can design each door-open tile so it closes gates that block access to the others.)

Below is a video that demonstrates several of the possible transformations that occur. Note: in some segments the prince entered the room before the tile was changed so the change didn't get drawn even though the tile did change; you can distinguish those segments by the fact that the mirror wasn't drawn either.

Typical transformations:
  • Any wall (plain, decorated, window) becomes a plain wall.
  • Any foor (plain, decorated, wallpaper) becomes a floor with a wall stripe.
  • Any potion (empty, healing, life, weightless, etc.) becomes a healing potion.
  • Any gate (open or closed) becomes a broken gate, impassable.
  • Spikes become harmless, but cause drawing glitches.
  • Chomper is unaffected.
  • Raise or drop tiles become inactive. (But not "stuck" on.)
  • Any tapestry becomes blank.
  • Loose tile becomes non-loose, but causes drawing glitches.
(EDIT: If my explanations of this tile change and the blue potion behavior are still too technical, someone please try to simplify it!)
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Documentation (Prince of Persia 1 Special Events)

Post by David »

tacosalad wrote:Raise or drop tiles become inactive. (But not "stuck" on.)
Actually, they become assigned to event 43. (May be useful.)
tacosalad wrote:Chomper is unaffected.
A stuck chomper becomes a working one. (May be useful.)

- An exit door will become open. (But, since the "first" exit door opened, you could enter this "second" door anyway. May be useful if you combine irregular room linking with similar rooms? - But then you could trigger both exit doors with the same button.)
- A torch will skip a frame, you can see this better in shift-B mode. (Of course, this is not very useful.)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert »

Something I ran into while working on Prince of Wateria that I cannot yet explain: in level 2, the two gates in room 10 do not make a sound when slowly going down.
In the original game, when I put gates at these two locations, they do make the normal sound when slowly going down. Strange...
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Documentation (Prince of Persia 1 Special Events)

Post by David »

David wrote:After the skeleton falls off room 1, it will appear in room 3, middle row, tile 5, facing right, but only if room 3 is below room 1.
Actually, if any skeleton that falls into room 3, it will appear at that position.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert »

tacosalad wrote:Loose tile becomes non-loose, but causes drawing glitches.
Not when all resources have been enabled. (In, for example, the PoP1 package at popot.org.)
Then it becomes an invisible tile, as can be seen in Potion of Illusion.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert »

tacosalad wrote:Any potion (empty, healing, life, weightless, etc.) becomes a healing potion.
Fun fact about this: you don't need to re-enter the room for those to change.
In this sample video, the blue bubbles change to red, and the potion becomes a health potion:

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert »

tacosalad wrote:Any gate (open or closed) becomes a broken gate, impassable.


Image
(mirror)
User avatar
yaqxsw
Wizard Scribe
Wizard Scribe
Posts: 727
Joined: June 18th, 2012, 3:35 pm
Location: Germany

Re: Documentation (Prince of Persia 1 Special Events)

Post by yaqxsw »

WOW! that so cool!
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Documentation (Prince of Persia 1 Special Events)

Post by David »

I found some events that are not (yet) in the documentation:
On level 4, when you exit room 11 to the left the first time after the level door is open, then the mirror music is played. (The music is already mentioned, but it says "when the player reenters the room".)
(On the original level 4, left from room 11 is room 4, where the mirror is put.)
On level 13, when you exit room 3 to the right (every time, not just the first time) and Jaffar is alive, then Jaffar's music is played, and Jaffar waits for 28/12=2.33 seconds before taking the fighting pose.
On level 13, when you kill Jaffar, then the remaining time is shown. (In addition to the white flash.)
And don't forget the clarifications about the skeleton and about the shadow.
About the shadow on level 6: the step is done internally by a shift+forward simulated keypress, that's why he tries to pick up a potion or sword.

And some bugs related to special events:
On level 6, after the shadow music is played, you can enter any exit door. (This is not a problem on the original level.)
On level 13, after Jaffar is killed, you can enter any exit door. (This is not a problem on the original level, because you can't go to the exit door without leaving a room to the left.)
The problems are caused by that the game uses the "level door is open" flag for other purposes; for example, to remember whether some music was played already.
These both can be fixed with this: viewtopic.php?p=13128#p13128
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert »

Looks like it's time to update the document.
I'll do that later today.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert »

I've updated the document: pdf, odt.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Documentation (Prince of Persia 1 Special Events)

Post by David »

About the skeleton: Sorry, maybe I was not clear enough, but the "only if room 3 is below room 1" part is not true. The skeleton may fall from any room.
Also, according to this, the player has to touch the 3rd or 4th tile, and the direction does not matter.

Some other (new) events: (with help from the disassembly)
* On level 13 and 15 there is no music when the kid enters the exit door.
* Ctrl-A does not work on level 15.
* If the kid dies on level 0 or 15, there is no death music or "Press Button to Continue" message.
* Time stops on level 13 after killing Jaffar, and time is always stopped on level 14 and 15.
* When jumping through the mirror on level 4, room 4, the image of the shadow is clipped at x-coordinate 137. (So the shadow appears as coming from the mirror, not just being there.)
If the kid jumps through a mirror that is in that room, but not it column 5 (any row), then:
- if the mirror is right of column 5: the shadow appears partly behind (left to) the mirror,
- if the mirror is left of column 5: the shadow appears too late (when he reaches x-coordinate 137).
In case of mirrors in other rooms or other levels, the shadow is not clipped at all.
* This may be hard to test: landing loose floors hurt the kid when he is running, but only on level 13.
* I remember there was a bug about dying on level 14, but I can't reproduce it.
The descriptions of some mods mention it:
[url=http://www.popot.org/custom_levels.php?mod=0000072]Battle Hardened III[/url] (IMPORTANT.txt) wrote: 3. Level 14 is highly recommended to save since if u die, the game will reset to its intro, ignoring whether u restarted the level. A well-known bug in a lot of mods.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert »

David wrote:
tacosalad wrote:Raise or drop tiles become inactive. (But not "stuck" on.)
Actually, they become assigned to event 43. (May be useful.)
Interestingly enough, I get yet another result.
For me the raise button appears to remain unchanged.

See the attached LEVELS.DAT file.
When the level door opens, wait.
Then step on the next raise button.
The second gate should open, but the first opens.
Attachments
LEVELS.DAT
Test file.
(36.16 KiB) Downloaded 153 times
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Documentation (Prince of Persia 1 Special Events)

Post by David »

1. The change happens in the room where the mirror appears. This is room 4 by default, but your button is in room 7.
tacosalad wrote:For modders, what matters is that a tile in room 4 will transform when the exit opens on level 4.
2. But there is an other problem:
If I fix the above mistake (swap room 7 and 4 and change doorlinks from room 7 to 4), or manually set the button to event 43, it will become stuck.
It's because the bottom five bits of the corresponding byte of "door II" (sSecondDoorEvents) should be zero.
But they are all ones in your level, just like on the original level 4. It seems Apoplexy does not change these bits.
I had to set this manually in level4.plv .
This bug went unnoticed probably because people usually assign only events with small numbers, and the five bits of those events are already zero (because the original level uses them).

3. And yet another thing: Apoplexy counts doorlinks from 1, so modifier 43 means event 44.
That is, you should prepare event 44, not 43.

After I fixed these, everything seems to work correctly.

(By the way, did you get the idea from level 3 of my mod? :) )
Post Reply