Documentation (Prince of Persia 1 Special Events)

Are you creating new levels/mods for DOS or did you finish your work? Tell us here!

Moderator: English Moderator Team

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

Documentation (Prince of Persia 1 Special Events)

Post by Norbert » July 12th, 2012, 3:07 am

I have created a document that describes all the special events that take place in PoP1:

2015-08-07_PoP1_Special_Events.pdf

The source document (.odt; OpenDocument) is also available, here.
Its main page on popot.org is here.
Feedback is welcome. Just post it in this thread or send an e-mail.

[Edit: Updated the links to point to the latest version of the document. Several times.]

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by David » July 13th, 2012, 1:25 pm

There are some things you could add:

Level 1: You start the level without sword. Falling entry.
When you crouch the first time, a music is played. Normally, this crouch is after landing from the falling entry.
The crouch after a two-storey drop doesn't count. (I remember there was a mod that started with a two-storey drop.)
Room 5, tile 3 is pressed at start. On the original level 1, this closes the door behind the prince.
If this tile is a loose floor, it will drop. If it's a door or exit door, it will open. If it's a chomper, it will chomp once. If it's a spike, it will come out, then go back. (see also level 13)

Level 3: The closing sounds of the gate in room 2 can be always heard, not just in the room it is in.
"Approaching the skeleton" means touching tile 4 in any row.
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.
Checkpoint: Leaving room 7 to the left seems to be enough.

Level 4: There is a different music after going up on the level door.
Actually, the mirror is placed at the moment the level door is fully opened, but it is drawn only when the room is reentered, or if you go to that tile without leaving the room. (Which is possible only on an edited level.)
Also, after reentering, a music is played.

Level 6: If you fall out the bottom of room 1, you'll arrive to the next level. (Even if there is no room below room 1.)
A music is played when entering the shadow's room.
The jump doesn't have to be in the middle row, or to tile 3. If the prince enters a certain frame in the run-jump sequence (the frame where one of his feet touch the floor), and he is in tiles 1-5, the shadow will step forward.
Interestingly, if you put a potion or sword in front of the shadow, it will crouch instead of step, as if he was trying to pick it up.

Level 7: Falling entry. Works only if the player starts in room 17, bottom row.
If the player starts in room 17, but not the bottom row, an integer overflow will occur.
(Just like viewtopic.php?p=11204#p11204)

Level 12: Sword disappearance: leaving room 18 to right seems to be enough.

Level 13: Running entry.
Flash when Jaffar dies.
After Jaffar died, entering any room from the right will trigger the top left tile of room 24. On the original level, this opens the exit door.
Interestingly, if the tile is not a button, but its modifier refers to a door event that triggers a level door, then the level door will open. (see also level 1)
If you put doors where the falling loose floors are, they are instantly opened, when you enter the rooms below.
Loose floors don't shake if you jump up, only when they will fall down.

Level 15: Letters appear. One of the potions is changed into an open potion.
A hurt potion takes half of your hitpoints instead of one.

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert » July 13th, 2012, 2:04 pm

Thanks a lot for these new entries, David.
I will look through them, test everything myself, and then update the document to include the extra information.
(And credit you at the end of the document as "David from the Princed Forum".)

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert » July 14th, 2012, 7:24 pm

David wrote:There are some things you could add: [...]
Thanks again.
I've updated the document: pdf, odt.

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert » October 28th, 2012, 11:34 pm

Small correction/clarification for a future version of the document. On page 9 (about level 4), where it says "A tune is played when the player reenters the room, [...]" it should say "A tune is played when the player exits room 11 from the top left the first time after the level exit door has been fully raised, [...]".

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert » November 5th, 2012, 10:22 pm

The document should also contain a warning for levels 6, that the level exit door - if it's used - should be fully open before entering the shadow's room, or the level exit door will get stuck and keep making the raise sound.

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert » November 29th, 2012, 3:37 pm

For level 12b (13), the document mentions what happens to gates if they are used instead of the loose tiles that fall down.
It could also mention what happens to chompers (they chomp and then have blood on them), walls (turn into unavailable resources), certain potions (flip/blue/empty turn to regular red), level door (opens) and spikes (go out).
I'll include this information in a future updated version of the document.

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert » December 1st, 2012, 3:22 pm

Norbert wrote:For level 12b (13), the document mentions what happens to gates if they are used instead of the loose tiles that fall down.
It could also mention what happens to chompers (they chomp and then have blood on them), walls (turn into unavailable resources), certain potions (flip/blue/empty turn to regular red), level door (opens) and spikes (go out).
I'll include this information in a future updated version of the document.
Another thing related to this level that's not yet mentioned in the document:
If Jaffar hasn't been killed yet ("k" cheat does not count; screen has to flash), then exiting room 3 to the right in any row will play a sound.

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert » December 25th, 2012, 12:20 pm

Also, in level 12b (13), when the screen flashes after killing Jaffar, it also shows how much time is left (even though you didn't press space).

tacosalad
Sheikh
Sheikh
Posts: 42
Joined: October 3rd, 2005, 6:03 am
Location: Oregon, USA
Contact:

Re: Documentation (Prince of Persia 1 Special Events)

Post by tacosalad » December 27th, 2012, 4:30 am

David wrote:Level 4: There is a different music after going up on the level door.
More specifically, the s_shadow (shadow man) musical motif always plays at the conclusion of level 4. The same melody plays if the player dies fighting the shadow man.

Here's the source code that selects a song to play at the end of a level, edited to show how the execution path at the end of level 4 causes it to cue the music s_shadow...

Code: Select all

*-------------------------------
* Char has gone upstairs
* What do we do?
*-------------------------------
GoneUpstairs
 lda level
 cmp #13
 beq :ok ;no music for level 13
 cmp #4
 bne :1 ;mirror level is special
:3 lda #s_Shadow
 bne :2
 .
 .
:2 ldx #25
 jsr cuesong
Here's the source code, edited to emphasize the execution path when the player dies fighting the shadow cues the music s_shadow...

Code: Select all

*-------------------------------
*
* Play death song
*
*-------------------------------
deathsong
 lda ShadID
 cmp #1
 beq :shad ;if opponent was shadowman
 .
 .
:shad lda #s_Shadow
 bne :2
 .
 .
:2 ldx #255
 jmp cuesong
]rts rts

tacosalad
Sheikh
Sheikh
Posts: 42
Joined: October 3rd, 2005, 6:03 am
Location: Oregon, USA
Contact:

Re: Documentation (Prince of Persia 1 Special Events)

Post by tacosalad » January 19th, 2013, 7:39 am

This isn't a level-specific event, but here's a detailed explanation of blue potion events.

The door-opening blue potion was introduced in the IBM PC version for use by the copy-protect scheme. If the top-left tile in room 8 is a RAISE or DROP switch, then drinking a blue potion will activate that tile and do nothing else. If the top-left tile in room 8 is not a RAISE or DROP switch, then drinking the blue potion will trigger a DROP for event x and it might activate the top-left tile of room 8 depending on the condition of that event.

Which event is x? It depends. By default x is event 1, but sometimes it moves to event 2 or event 3 for a particular level. Evidently it's an unintentional behavior, but once you've identified event x for a particular level design it will behave predictably according to this flowchart...
Blue potion flowchart.PNG
Blue Potion flowchart
Blue potion flowchart.PNG (8.9 KiB) Viewed 2562 times
(Scalable SVG version of this flowchart available on request)

When the top-left tile in room 8 is activated (and it isn't a switch) the action depends on what that tile is:
- An ordinary chomper it will chomp once. A stuck chomper it will become a normal chomper.
- A shut gate will open
- A loose tile will fall
- Spikes will operate. Stuck spikes will become normal spikes.


By using this flowchart you can combine a blue potion, a loose tile, a drop trigger, and a stuck RAISE or DROP switch to create very complex dependencies like the one shown in this video:
- Event 1 is the lower gate, with the guard.
- Event 2 is the upper gate, with the potion.
- At lower left is a DROP for event 2 (it will close the gate to the potion)
- At lower right is a RAISE for event 1 (it will free the guard)
- Somewhere above, room 8 has a loose tile in the top-left corner. If the loose tile drops it will fall into this room and land on the DROP switch at left.
As the video shows, the only way to reach the life potion is to knock down the loose tile so event 1 is "stuck" (right switch) then drink the blue potion. The blue potion will trap the guard by closing the gate, but because Event 1 is "stuck" it won't release the loose tile in room 8 so it won't fall onto the drop switch at left.

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by David » January 19th, 2013, 12:58 pm

Yes I've seen some of these in your new mod. :)
I'd guess the same method is used for the automatic triggers on level 1 (close the door behind the prince), and level 13 (open level door after Jaffar died, and maybe the falling floors).

Also, a clarification to the shadow on level 5:
If there is a potion on the 4th tile, the shadow will be placed offscreen at the top-left corner when you enter the room.
You won't see him yet, unless there is no floor there, in this case he will fall.
This means that if you can drink the potion, and then open the door, the shadow will still come, unless you leave and re-enter the room between the two.
One more thing: the game doesn't check whether the 2nd tile is a gate, so for example you may place a tile that already has the required modifier (80=0x50 or above), or a tile that animates itself (e.g. sword - this will make the shadow start at random times).

tacosalad
Sheikh
Sheikh
Posts: 42
Joined: October 3rd, 2005, 6:03 am
Location: Oregon, USA
Contact:

Re: Documentation (Prince of Persia 1 Special Events)

Post by tacosalad » January 19th, 2013, 9:10 pm

David wrote:Yes I've seen some of these in your new mod. :)
I'd guess the same method is used for the automatic triggers on level 1 (close the door behind the prince), and level 13 (open level door after Jaffar died, and maybe the falling floors).
Good observations. A few details worth documenting:
  • Delusions level 1 used a raise event in room 5 tile 3 instead of the usual drop event. That made the door to the LP open once at the start of the level then never again.
  • Delusions level 13 used a drop event in room 8 tile 1 instead of the usual raise event, so the opening of the level door is inextricably linked to closing of the gate in room 13. It's a subtle detail, but any Level Exit Door can be opened using a drop so can link the opening of the exit to the closing of one or more gates on any level you choose. That raises additional level design possibilities/puzzles because you can build a level where the prince can't open the exit without simultaneously closing a gate.
David wrote:Also, a clarification to the shadow on level 5:
If there is a potion on the 4th tile, the shadow will be placed offscreen at the top-left corner when you enter the room.
You won't see him yet, unless there is no floor there, in this case he will fall.
This means that if you can drink the potion, and then open the door, the shadow will still come, unless you leave and re-enter the room between the two.
One more thing: the game doesn't check whether the 2nd tile is a gate, so for example you may place a tile that already has the required modifier (80=0x50 or above), or a tile that animates itself (e.g. sword - this will make the shadow start at random times).
Important detail: leaving the room is not sufficient to make the shadow disappear--you must enter a room containing a guard (dead or alive). The shadow remains waiting offscreen until another guard is displayed in another room. In Delusons level 5, for example, the shadow waits at the yellow rectangle in the picture. After you drink the blue potion you can make the shadow disappear by entering room 5 or room 11 because I placed guards in those room. Even though you never fight them those guards aren't just decorations. If those guards weren't there then the only way to solve the puzzle would be by falling through the tapestry as shown here which I judged too difficult.
Level5rooms.png
Location of guards denoted by red rectangles, location of Shadow man by yellow rectangle
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!

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

Re: Documentation (Prince of Persia 1 Special Events)

Post by Norbert » January 20th, 2013, 1:28 am

Interesting, these last couple of posts.
Man, I must say that understanding everything that happens in Potions of Delusion feels like an advanced math course. :)
The mod has introduced a lot of new possibilities, which is pretty cool.

tacosalad
Sheikh
Sheikh
Posts: 42
Joined: October 3rd, 2005, 6:03 am
Location: Oregon, USA
Contact:

Re: Documentation (Prince of Persia 1 Special Events)

Post by tacosalad » January 20th, 2013, 6:42 am

tacosalad wrote:Which event is x? It depends. By default x is event 1, but sometimes it moves to event 2 or event 3 for a particular level. Evidently it's an unintentional behavior, but once you've identified event x for a particular level design it will behave predictably according to this flowchart...
Further testing shows x for the drop event is (unsurprisingly) determined by the modifier byte for the top-left tile in room 8. So if the top left tile in room 8 is an ordinary loose tile (modifier byte 0) then the drop event associated with drinking a blue potion will be 0...which translates to "event 1" in Apoplexy because counting starts at 1.

In Potions of Delusion level 11 I put a closed chomper at the top-left tile in room 8; as a consequence the blue potion triggers drop event 2 ("event 3" in Apoplexy) and starts the chomper...unless the player has knocked down the loose tile in room 6 (the room with a guard) which will cause event 2 ("3") to become stuck, thereby bypassing tile activation in the flowchart. (If you knock down the loose tile in room 6 before drinking the potion then the level cannot be completed because the chomper will never open.)

Here's a sample "room 8" I built to demonstrate the effects of different tiles in the top-left corner. The gates are linked to the first 5 events, in order from left to right. This shows how the blue potion activates various events on the top-left tile, and how the choice of tile affects which gate will close. Particularly noteworthy: if you put a stuck chomper or stuck spikes in the top left corner then the gate ("event x") will change after the animation.


I did one test (not shown) with a sword in the top-left tile. You could open the gate only if the sword just happened to "sparkle" when the prince swallowed the potion--an excruciatingly difficult task to accomplish! (Please don't design a mod like that!)

Post Reply