Documentation (Prince of Persia 1 Special Events)
-
- Calif
- Posts: 553
- Joined: August 27th, 2011, 2:04 am
Re: Documentation (Prince of Persia 1 Special Events)
What tool application are you using for showing this special events, also you can made new ones???
Check my Prince in C# https://github.com/salvadorc17/Prince-Monogame
Re: Documentation (Prince of Persia 1 Special Events)
My bad. What happened is this: I did use room 4 when I noticed it didn't work as expected. However, I had already touched other events in the process, so I recreated the rooms in another LEVELS.DAT and when I saw "4" of "level 4" I thought I was once again using the correct room.David wrote:1. The change happens in the room where the mirror appears. This is room 4 by default, but your button is in room 7.
Thanks for figuring that out. To be honest I'll have to look at the code to understand exactly what is going on.David wrote:It's because the bottom five bits of the corresponding byte of "door II" (sSecondDoorEvents) should be zero.
I will add a note about that in the next version of this PoP1 Special Events document.David wrote:That is, you should prepare event 44, not 43.
No, I was actually trying something quite different but noticed that the 'button change' wasn't working as expected, so I created this simplified sample level that could be used to easily reproduce the problem I was running into.David wrote:(By the way, did you get the idea from level 3 of my mod? )
Re: Documentation (Prince of Persia 1 Special Events)
Special events can be observed in-game (while playing), get discovered by accident/chance, people use reverse engineering, disassemblers, hex editors, look at Mechner's source code, use debuggers, stepping, read assembly, and so on. Some of it is extremely technical and is almost magic to mere mortals.salvadorc17 wrote:What tool application are you using for showing this special events, [...]
The short answer to that would be: yes. The longer answer is that, while possible, changing them (with CusPop or some of the tools mentioned above) is easier than making new ones. Showing/discovering events can be tricky; making new ones... better to just recreate PoP from scratch and then add whatever you'd want to that new code. In practice, only adding certain things would be doable and all of it is lots of work.salvadorc17 wrote:[...] also you can made new ones???
Re: Documentation (Prince of Persia 1 Special Events)
Oh, I sort of forgot about this.Norbert wrote:Thanks for figuring that out. To be honest I'll have to look at the code to understand exactly what is going on.David wrote:It's because the bottom five bits of the corresponding byte of "door II" (sSecondDoorEvents) should be zero.
David, if I add, in "void EventRoom (int iRoom)", under "sBinarySDoors[2] = sTempBinary[5];", the following...
Code: Select all
sBinarySDoors[3] = '0';
sBinarySDoors[4] = '0';
sBinarySDoors[5] = '0';
sBinarySDoors[6] = '0';
sBinarySDoors[7] = '0';
I've added fullscreen support to apoplexy, in addition to the existing zoom functionality, so I may as well fix this event issue before releasing a next version.
Re: Documentation (Prince of Persia 1 Special Events)
I tried it, and that fixes it. (When I set the room of the event.)...that'll fix it, correct?
(By the way, I see it's already done in LoadXML().)
However...
Without the fix, the event works only if the kid is standing on the button when the change happens.
With the fix, the event works only if the kid is *not* standing on the button when the change happens.
I attached a zip with two levels.dat files. "with_ones" and "with_zeroes" refer to the contents of those 5 bits.
(Problems 1. and 3. are fixed in both.)
Something related that I wanted to know: Why do you use int<->binary conversion instead of bit operations? Do you find them easier to understand?
And some less related... Why do you write "+ 2" in array declarations? Why is WriteCharByChar needed? (Perhaps these should be answered elsewhere.)
- Attachments
-
- event_43.zip
- (17.18 KiB) Downloaded 139 times
Re: Documentation (Prince of Persia 1 Special Events)
I do.David wrote:Do you find them easier to understand?
It's just an old habit. A long time ago I decided to pick char[] over char*+malloc() wherever possible, for various (subjective) reasons. I subsequently ran into array overflows on a number of occasions, because: a. array index numbers start at zero while humans start counting from one, and b. sometimes explicit null character termination is essential. So, I decided: you know what, I'll just always add +2 and never run into overflow problems again. It worked!David wrote:Why do you write "+ 2" in array declarations?
Re: Documentation (Prince of Persia 1 Special Events)
I think I found something that is not yet documented:
When the player completes level 12 and level 13 starts:
- the kid's HP is not restored to full,
- the level number and remaining time are not shown.
Note that this happens only with the completion by the special event, and not in any of these cases:
- when exiting level 12 with shift-L,
- when completing level 12 by entering an exit door,
- when you restart level 13,
- when you load level 13 from a saved game.
When the player completes level 12 and level 13 starts:
- the kid's HP is not restored to full,
- the level number and remaining time are not shown.
Note that this happens only with the completion by the special event, and not in any of these cases:
- when exiting level 12 with shift-L,
- when completing level 12 by entering an exit door,
- when you restart level 13,
- when you load level 13 from a saved game.
Re: Documentation (Prince of Persia 1 Special Events)
Another addition (mentioned by xhul): in level 12a, when the prince enters room 15 from the right and there is no sword on the second tile from the top left, his health gets fully regenerated.
Re: Documentation (Prince of Persia 1 Special Events)
I know how to reproduce it and I also more or less know what is happening.David wrote:* I remember there was a bug about dying on level 14, but I can't reproduce it.
Here are the basics:
- Die (e.g. spike).
- Press Enter or Ctrl+a (both work).
- Wait (or do stuff) for ~18 seconds: "Press Button to Continue" will appear.
- Wait (or do stuff) for ~5 more seconds: the game restarts.
What is happening is that the death/restart-timeout countdown is not stopped when restarting. In the original game, the prince cannot die in the princess level. If you wait ~10 seconds while dead and then restart the level (Enter or Ctrl+a), the time you need to wait before the "Press Button to Continue" message appears is (~18 minus ~10 =) ~8 seconds. Most keys, including Space, Shift and arrow keys, do not stop the countdown. Some do, including -, + and Ctrl+j.
I have updated the document to both fix it and complement it with all the things mentioned after the 2013 version was published.Norbert wrote:I will add a note about that in the next version of this PoP1 Special Events document.
New download links are in the first post of this thread. Also, here is a direct link to the new PDF.
Re: Documentation (Prince of Persia 1 Special Events)
I already posted about this in May: viewtopic.php?p=16408#p16408 (the second half of the post)
On other levels it is stopped by showing the level number.Norbert wrote:What is happening is that the death/restart-timeout countdown is not stopped when restarting.
Because they display some text in the status line.Norbert wrote:Some do, including -, + and Ctrl+j.
That's why this bug was not discovered by the authors/testers.Norbert wrote:In the original game, the prince cannot die in the princess level.
Re: Documentation (Prince of Persia 1 Special Events)
Oh, I missed that, apparently.David wrote:I already posted about this in May: viewtopic.php?p=16408#p16408 (the second half of the post)
Anyway, now there's a link from here to there, so some good came from it after all.
Re: Documentation (Prince of Persia 1 Special Events)
- Attachments
-
- example2.zip
- example 1
- (337.09 KiB) Downloaded 159 times
-
- example1.zip
- example 2
- (337.12 KiB) Downloaded 147 times
Re: Documentation (Prince of Persia 1 Special Events)
How could I best explain what's mentioned at the bottom of page 21 of this PDF?
SuavePrince noticed peculiar behavior of a mod and I tried to explain it as pasted below.
But he has difficulty understanding what I wrote.
- - - - - - - - - - - - - - - - - - - -
After Jaffar died, the first time you enter a room from the right, the top-left in room 24 is triggered.
That tile at the top-left in room 24 doesn't have to be a raise button.
If it is not a raise button, then it will still trigger an event.
The event it triggers is: modifier+1.
1. Click the tile in the top-left in room 24.
2. Go to the custom tiles screen (button with gear icon).
3. Look at the modifier number.
4. Modifier number + 1 = event that triggers
For your mod, after killing Jaffar if you enter a room from the right, event 3 is triggered.
Because the top-left in room 24 has a modifier with 2.
And 2+1=3.
If you make the top-left in room 24 a custom tile with modifier 10, then event 10+1=11 will trigger.
- - - - - - - - - - - - - - - - - - - -
SuavePrince noticed peculiar behavior of a mod and I tried to explain it as pasted below.
But he has difficulty understanding what I wrote.
- - - - - - - - - - - - - - - - - - - -
After Jaffar died, the first time you enter a room from the right, the top-left in room 24 is triggered.
That tile at the top-left in room 24 doesn't have to be a raise button.
If it is not a raise button, then it will still trigger an event.
The event it triggers is: modifier+1.
1. Click the tile in the top-left in room 24.
2. Go to the custom tiles screen (button with gear icon).
3. Look at the modifier number.
4. Modifier number + 1 = event that triggers
For your mod, after killing Jaffar if you enter a room from the right, event 3 is triggered.
Because the top-left in room 24 has a modifier with 2.
And 2+1=3.
If you make the top-left in room 24 a custom tile with modifier 10, then event 10+1=11 will trigger.
- - - - - - - - - - - - - - - - - - - -
- SuavePrince
- The Prince of Persia
- Posts: 1091
- Joined: January 26th, 2015, 6:21 pm
Re: Documentation (Prince of Persia 1 Special Events)
I undersatnd(i guess so)You can (or other guy)enable this event in my level dat?but remmber,dont add raise or drop in room 24..thanxs,Maybe David can help meNorbert wrote:How could I best explain what's mentioned at the bottom of page 21 of this PDF?
SuavePrince noticed peculiar behavior of a mod and I tried to explain it as pasted below.
But he has difficulty understanding what I wrote.
- - - - - - - - - - - - - - - - - - - -
Re: Documentation (Prince of Persia 1 Special Events)
Which mod, and what behavior?Norbert wrote: SuavePrince noticed peculiar behavior of a mod and I tried to explain it as pasted below.
You don't need to enable it, it's already enabled.SuavePrince wrote: You can (or other guy)enable this event in my level dat?
I don't understand this...SuavePrince wrote: but remmber,dont add raise or drop in room 24..