Guide to Prince of Persia tricks (Large Topic)
Re: Guide to Prince of Persia tricks (Large Topic)
Yes, it took me time to remember that this works if you're one tile away from the wall, maybe I got it after this playthrough
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: Guide to Prince of Persia tricks (Large Topic)
I don't think we have this trick right? Or is it just a bug?
Re: Guide to Prince of Persia tricks (Large Topic)
It looks like a room switching bug. Can you upload the LEVELS.DAT file?
Does it work without spikes? Sometimes trobs can affect the logic like that trick with hanging on to a loose tile in the room above that puts you an extra room down.
Does it work without spikes? Sometimes trobs can affect the logic like that trick with hanging on to a loose tile in the room above that puts you an extra room down.
- SuavePrince
- The Prince of Persia
- Posts: 1091
- Joined: January 26th, 2015, 6:21 pm
Re: Guide to Prince of Persia tricks (Large Topic)
Nice..that "trick" was discovered by the master yqwasx
- 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)
The logic in the link below prevents switching the room when the last column of the room is a door top. But it does not do the same if the first tile in the next room is a wall (walls from non-existing rooms are handled elsewhere).atrueprincefanfrom18 wrote: ↑June 14th, 2022, 6:32 am The bug is Kid doesn't die even though he lands on spikes.
https://github.com/NagyD/SDLPoP/blob/13 ... 002.c#L474
So the scenario where there is some sort of a floor tile in the column 9 of a room and a (real) room on the right with a wall in column 0 is not handled by the game correctly. When prince comes close to the wall in the room on the right, the game switches to that room and you cannot see prince because of the wall. But the prince's room is now set to the room on the right.
The code that activates a spike animation/sound happens while the prince is landing. It checks spikes behind and at the prince which causes the spike to activate.
However, the code that checks the spike below is actually harmful uses prince's coordinates which is in the wrong room.
https://github.com/NagyD/SDLPoP/blob/13 ... 06.c#L1643
To fix the issue you would have to ensure the left room is shown when prince is hanging from the wall to the left of column 0 or is standing next to it.
Also, you cannot see prince from the room on the left either when he is standing right next to the wall. So the wall push function would have to push him a couple of pixels further to the left in that scenario.
Re: Guide to Prince of Persia tricks (Large Topic)
Here is some barely tested code that seems to work.
The "looking right" block code of the "leave_room()" function. "Looking left" code probably also needs to be adjusted since the room now switches when prince is turned left next to the wall.
The "in_wall()" function.
The "looking right" block code of the "leave_room()" function. "Looking left" code probably also needs to be adjusted since the room now switches when prince is turned left next to the wall.
Code: Select all
// looking right
if (get_tile(Char.room, 10, Char.curr_row) == tiles_20_wall && char_x_right <= 62) {
leave_dir = 0;
} else {
if (curr_tile2 != tiles_20_wall &&
get_tile(Char.room, 9, Char.curr_row) != tiles_7_doortop_with_floor &&
curr_tile2 != tiles_12_doortop &&
char_x_right >= 201
) {
leave_dir = 1; // right
} else if (char_x_right <= 57) {
leave_dir = 0; // left
} else {
return -1;
}
}
Code: Select all
short delta_x;
delta_x = distance_to_edge_weight();
if (delta_x >= 8 || get_tile_infrontof_char() == tiles_20_wall) {
delta_x = 6 - delta_x;
// pushed back by a wall in column 0
if (Char.direction == dir_0_right && tile_col == 0) {
delta_x -= 4;
}
} else {
delta_x += 4;
}
Char.x = char_dx_forward(delta_x);
load_fram_det_col();
get_tile_at_char();