Useless glitches

Discuss PoP1 for DOS here.
dronno
Sheikh
Sheikh
Posts: 20
Joined: June 27th, 2020, 1:53 pm

Useless glitches

Post by dronno »

I was thinking about the well-known glitches of Levels 5, 7, 10, where the prince falls/moves into an unexpected part of the level, effectively saving time.

Are there any other of these glitches (the prince ending in a weird place, and yet surviving) that do not result in saving time?
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1776
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Useless glitches

Post by atrueprincefanfrom18 »

There's a less known glitch in Level 4, which never ever results in saving time, hope this is what you wanted? :)





I am still finding more, will post here if I find anything more...
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Useless glitches

Post by dmitrys »

I fell through the floor below the left gate in the room to the left of the starting room on level 4 once right after a running jump. I was not able to reproduce it since.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5572
Joined: April 9th, 2009, 10:58 pm

Re: Useless glitches

Post by Norbert »

dmitrys wrote: October 12th, 2020, 12:37 am I fell through the floor below the left gate in the room to the left of the starting room on level 4 once right after a running jump. I was not able to reproduce it since.
Unless I'm mistaken, that's trick 128:

(Of course, it only requires the right distance, not the exact movements as shown in the video.)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Useless glitches

Post by dmitrys »

That is very helpful. I'll try to see if I can find the bug in the code that causes the kid to fall through.
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Useless glitches

Post by dmitrys »

I was able to fix the bug. But the reason is pretty strange. In that case the "Char" reference does not have the same values as the "Kid" reference even though the character id is kid.

Here is how I fixed it but there is probably a bigger issue that needs to be fixed to ensure the coordinates match.

Code: Select all

void __pascal far check_on_floor() {
	if (cur_frame.flags & FRAME_NEEDS_FLOOR) {
		if (get_tile_at_char() == tiles_20_wall) {
			in_wall();
		}
		// Bug fix: when kid does a running jump and falls into a lower row right next to the wall (popot trick 128),
		// Char.curr_col is not the same as Kid.curr_col causing the floor check to fail.
		if (Char.charid == charid_0_kid &&
			Char.curr_col != Kid.curr_col &&
			Char.frame >= frame_40_running_jump_1 && Char.frame <= frame_44_running_jump_5) {
			get_tile(Kid.room, Kid.curr_col, Kid.curr_row);
		}
		if (! tile_is_floor(curr_tile2)) {
Before:


After:
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Useless glitches

Post by dmitrys »

I think I found a better solution. it seems the "Char.curr_col" is not being updated fast enough when the "get_tile_at_char()" function is getting called. So the solution would be to calculate it from the "Char.x" coordinate instead.

Code: Select all

void __pascal far check_on_floor() {
	if (cur_frame.flags & FRAME_NEEDS_FLOOR) {
		if (get_tile_at_char() == tiles_20_wall) {
			in_wall();
		}
		
		// Bug fix: when kid does a running jump and falls into a lower row right next to the wall (popot trick 128),
		// the Char.curr_col value does not update fast enough.
		if (Char.frame == frame_44_running_jump_5) {
			get_tile(Char.room, get_tile_div_mod_m7(Char.x), Char.curr_row);
		}
		
		if (! tile_is_floor(curr_tile2)) {
David
The Prince of Persia
The Prince of Persia
Posts: 2760
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Useless glitches

Post by David »

Norbert wrote: October 12th, 2020, 2:47 pm
dmitrys wrote: October 12th, 2020, 12:37 am I fell through the floor below the left gate in the room to the left of the starting room on level 4 once right after a running jump. I was not able to reproduce it since.
Unless I'm mistaken, that's trick 128:
This might be related: viewtopic.php?p=15042#p15042
That change made the level 7 trick possible, which is mentioned in the description of trick 128.

(There is also a fix in SDLPoP called FIX_JUMP_THROUGH_WALL_ABOVE_GATE. Its description mentions the level 7 trick as well.)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Useless glitches

Post by dmitrys »

Yeah, enabling the FIX_JUMP_THROUGH_WALL_ABOVE_GATE fixes that glitch as well. Thanks.
User avatar
VelCheran
Vizier
Vizier
Posts: 122
Joined: May 28th, 2020, 7:26 pm

Re: Useless glitches

Post by VelCheran »

I think this trick is also very much useless :lol:

User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1776
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Useless glitches

Post by atrueprincefanfrom18 »

It is useful! Let me try to replicate it after a few hours...
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5572
Joined: April 9th, 2009, 10:58 pm

Re: Useless glitches

Post by Norbert »

VelCheran wrote: February 17th, 2021, 12:20 am I think this trick is also very much useless :lol:

[video]
Interesting. Can you describe how to do it?
I know the video shows arrow keys, but I'm unable to replicate it.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1776
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Useless glitches

Post by atrueprincefanfrom18 »

Norbert wrote: February 17th, 2021, 10:28 am Interesting. Can you describe how to do it?
I know the video shows arrow keys, but I'm unable to replicate it.
I think it only works when Prince has 1 HP. Check the hit points in the video. I think it's basically the case where Prince HP becomes 0 (because of lose tile has hit him), and the game doesn't check if it should stop the Prince from going through the wall when he jumps. The jump keys should be pressed perfect enough, otherwise you would die. I think it's the only frame where you can perform this trick. One frame before or one frame later and the trick won't work. I could do it in SDLPoP (needed 20+ Quickloads, but it should be possible with DOSBox too):

the_trick.p1r
(3.11 KiB) Downloaded 19 times

Could be useful if merged with trick 88.

Norbert, I think you should add this to PoPOT (something after a long time ;))...
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
VelCheran
Vizier
Vizier
Posts: 122
Joined: May 28th, 2020, 7:26 pm

Re: Useless glitches

Post by VelCheran »

Basically, the same thing happens when bumping too late into the wall to avoid the falling tile and pressing up nonetheless: the prince will jump, hang a little while, then fall and die.
To perform this trick, you have to try to use a standing jump to avoid taking damage from the falling tile, but jumping too late to avoid it. I was able to do it using dosbox-x (a fork of Dosbox with savestates).
David
The Prince of Persia
The Prince of Persia
Posts: 2760
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Useless glitches

Post by David »

Falling through the floor on level 7: https://github.com/NagyD/SDLPoP/issues/229
Post Reply