I was interested too! But I don't think the width is the difference. If the width is the reason, there can be many more tricks.
Guide to Prince of Persia tricks (Large Topic)
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: Guide to Prince of Persia tricks (Large Topic)
Re: Guide to Prince of Persia tricks (Large Topic)
I'm pretty much 100% sure it is.
Changing the image dimensions has all kinds of unexpected consequences.
I ran into the same issue when I created the somersault animations.
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: Guide to Prince of Persia tricks (Large Topic)
Re: Guide to Prince of Persia tricks (Large Topic)
This can be replicated on vanilla Level 9, but you can only reach the correct position if you came from the left (which defeats the purpose).
By normal means you can at most end up ONE pixel too far (which explains why caped prince can do this via it's 1-extra pixel cape). It'd be phenomenal if someone found a way to get one pixel closer, but I think crem's tool would've found that already if possible.
Re: Guide to Prince of Persia tricks (Large Topic)
The first part: Why is the prince pushed through the gate?
It happens in check_gate_push(): https://github.com/NagyD/SDLPoP/blob/78 ... 004.c#L504
I added this debug printout before changing Char.x:
Code: Select all
printf("check_gate_push: var_4 = %d, tile_col = %d\n", var_4, tile_col);
(I tried this on level 9, in room 16.)
Code: Select all
check_gate_push: var_4 = 0, tile_col = 9
0 ≤ 9, but 0 is meant in the current room, while 9 is meant in the room to the left.
The problem is (again) that the two column indices are meant in different rooms, and thus they cannot be compared properly.
This is why trick 83 works only if the gate is on the edge between two rooms.
If the gate is anywhere else, the prince is pushed to the right.
Another consequence of this bug can be seen even with the original KID.DAT:
Suppose there is a closing gate on the edge between two rooms, and the prince it crouching near it.
If the gate touches him, he will always be pushed to the left.
You can try this with the first gate of the original level 4:
The second part: Why does this depend on the width of the image?
The width of the prince's image is used in set_char_collision(): https://github.com/NagyD/SDLPoP/blob/78 ... 006.c#L942
Here, the variables char_x_left_coll and char_x_right_coll are set to the coordinates of left and right edges of the prince's sprite.
Then they are used in get_row_collision_data(): https://github.com/NagyD/SDLPoP/blob/78 ... 004.c#L125
I added this debug printout:
Code: Select all
printf("column = %d, right_wall_xpos = %d, char_x_left_coll = %d\n", column, right_wall_xpos, char_x_left_coll);
Code: Select all
column = -1, right_wall_xpos = 64, char_x_left_coll = 64
Code: Select all
column = -1, right_wall_xpos = 64, char_x_left_coll = 63
The consequences of this can be seen in the first part above.
Re: Guide to Prince of Persia tricks (Large Topic)
It seems to be caused by the same issue that I have fixed with guards flying into the other room when hitting a closed gate off-screen. The "tile_col" variable is getting calculated for the room on the left. Its value is used to shift kid in a different room on the right.
It can be easily tested by using "[", "]" keys in debug cheat mode. Kid slides rights through a gate on the very left of a room (col 9 of the room on the left) when his back is turned towards the gate. The bug technically works with the default sprite as well but it might be impossible to position kid "correctly" using arrow keys in the game because it is not as wide.
The same fix would work. But you only need the second part of the if statement where the "curr_room" is on the left of "Char.room" because gates on the right side of the room are located in the same room. The first part of the if statement would make things worse when kid is collided with the gate on the right of the room but is already in the next room behind the gate.
https://github.com/NagyD/SDLPoP/blob/78 ... 002.c#L922
Edit: there is also need to be a x-coordinate check to ensure kid does not get bumped back from the next room. Here is the code that seems to work in the "check_gate_push" before setting "Char.x" to push kid into the correct direction and going through the gate backwards.
It can be easily tested by using "[", "]" keys in debug cheat mode. Kid slides rights through a gate on the very left of a room (col 9 of the room on the left) when his back is turned towards the gate. The bug technically works with the default sprite as well but it might be impossible to position kid "correctly" using arrow keys in the game because it is not as wide.
The same fix would work. But you only need the second part of the if statement where the "curr_room" is on the left of "Char.room" because gates on the right side of the room are located in the same room. The first part of the if statement would make things worse when kid is collided with the gate on the right of the room but is already in the next room behind the gate.
https://github.com/NagyD/SDLPoP/blob/78 ... 002.c#L922
Edit: there is also need to be a x-coordinate check to ensure kid does not get bumped back from the next room. Here is the code that seems to work in the "check_gate_push" before setting "Char.x" to push kid into the correct direction and going through the gate backwards.
Code: Select all
if (curr_room == level.roomlinks[Char.room - 1].left && tile_col == 9) {
left_x = 60;
if (Char.direction == dir_0_right) {
left_x += 6;
}
if (Char.x > left_x) {
tile_col -= 10;
}
}
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: Guide to Prince of Persia tricks (Large Topic)
I found another trick! Check the p1r file. If you go through the chomper and the gate similar to Trick 37, if you are at a specific pixel with respect to the gate, you can press right and hit the gate and the gate will push you and you can fall down in a proper way to be then able to go through the wall. Cool trick! 

Re: Guide to Prince of Persia tricks (Large Topic)
Is it okay if I add to 37: "The trick can be expanded to subsequently go through the lower-floor wall, as demonstrated here." ?atrueprincefanfrom18 wrote: ↑April 18th, 2021, 6:39 am I found another trick! Check the p1r file. If you go through the chomper and the gate similar to Trick 37, if you are at a specific pixel with respect to the gate, you can press right and hit the gate and the gate will push you and you can fall down in a proper way to be then able to go through the wall. Cool trick!
replay.zip
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: Guide to Prince of Persia tricks (Large Topic)
Well, maybe not. Since players might be searching for tricks to go through wall, this might not show up or may be shown wrongly. Better a new trick I would suggest. But again, upto you.
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: Guide to Prince of Persia tricks (Large Topic)
I'm quite late, but it seems you still didn't figure out how to perform the first trick?Norbert wrote: ↑November 5th, 2014, 9:37 pm There are still two tricks that I don't know how to do:
- http://www.youtube.com/watch?v=asNckj9O53M#t=119
- http://www.youtube.com/watch?v=-4_K4vbCwkY
I think the first one is very difficult. The second one is easy, but someone who can do it will need to describe in words what to do after sliding forward...
Here's the video:
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: Guide to Prince of Persia tricks (Large Topic)
Found another one:
Re: Guide to Prince of Persia tricks (Large Topic)
Sup, guys! I like to talk about trick 164.
I didn't answer on SNES thread 'cause I thought I'd see the real trick for that one once Norbert led KneeTie to the modder. So, thanks to atrueprincefanfrom18, there's a trick now which, I didn't do it, hahaha. I mean, maybe I'm doing wrong, but, I think DOS's chomper is slower than SNES n' I think the Prince there goes further left than on SNES. Or is just, I'm getting the wrong timing.
So, the 1st is what's happening n' the other 2, are to show how I knocked down that loose:



The 3 of them starts at the same way. The 2nd, is the same trick I use to skip crushers. Or course, crushers are slow. So, you need to do that once. But chompers n' guillotine are faster then, you need to get the right time for that.
Some time later doing my mods, I learned an easier way by getting the frame with Select. It's what you see in the 3rd.
Anyway, I just wanted to share that. We know both versions has differents ways to do tricks n' even, exclusive ones for each. I'll stick with the 3rd one
I didn't answer on SNES thread 'cause I thought I'd see the real trick for that one once Norbert led KneeTie to the modder. So, thanks to atrueprincefanfrom18, there's a trick now which, I didn't do it, hahaha. I mean, maybe I'm doing wrong, but, I think DOS's chomper is slower than SNES n' I think the Prince there goes further left than on SNES. Or is just, I'm getting the wrong timing.
So, the 1st is what's happening n' the other 2, are to show how I knocked down that loose:



The 3 of them starts at the same way. The 2nd, is the same trick I use to skip crushers. Or course, crushers are slow. So, you need to do that once. But chompers n' guillotine are faster then, you need to get the right time for that.
Some time later doing my mods, I learned an easier way by getting the frame with Select. It's what you see in the 3rd.
Anyway, I just wanted to share that. We know both versions has differents ways to do tricks n' even, exclusive ones for each. I'll stick with the 3rd one

May the Moon light your path.
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: Guide to Prince of Persia tricks (Large Topic)
Yeah, I think SNES chompers are not the same as DOS ones, but good thing is the trick is possible in SNES. Maybe Norbert can append this to the trick video or simply create another trick. There's definitely gonna be one person who would try to perform same actions and would give up at the end. No wonder this trick is superb and difficult 
Edit: 1st one is actually bad because the Prince is aligned a bit right and the game thinks chomper can cut him. On DOS the Prince is a bit to the left and the game doesn't think the chomper can cut him, so he survives.

Edit: 1st one is actually bad because the Prince is aligned a bit right and the game thinks chomper can cut him. On DOS the Prince is a bit to the left and the game doesn't think the chomper can cut him, so he survives.
Re: Guide to Prince of Persia tricks (Large Topic)
Agreed, and done.
Thanks for the useful information, NITM-T.
I've added a link to your forum post under the new trick at PoPOT.