The "dead skeleton" bug

Open-source port of PoP that runs natively on Windows, Linux, etc.
Post Reply
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

The "dead skeleton" bug

Post by David »

When a skeleton falls down 2 rows, it will do weird things, both in the original game and in SDLPoP.
(Mentioned here and here.)

I think I found why.
This code handles landing after falling 2 rows: https://github.com/NagyD/SDLPoP/blob/ma ... 005.c#L151

Code: Select all

			} else if (Char.fall_y < 33) {
				if (Char.charid == charid_1_shadow) goto loc_5EFD;
				if (Char.charid == charid_2_guard) goto loc_5F6C;
				if (! take_hp(1)) {
					play_sound(sound_16_medium_land); // medium land
					is_guard_notice = 1;
					seq_id = seq_20_medium_land; // medium land (lose 1 HP, crouch)
				} else {
					goto loc_5F75;
				}
			} else {
As you can see, the case of charid==charid_4_skeleton is not handled separately.
Instead the code assumes that if Char is not the shadow or a guard then it must be the kid.
So it plays the "medium land" sequence that uses frames that are appropriate only for the kid.

Now the question is: what *should* happen in this case?

In the SNES version, the skeleton "dies"... until the prince jumps over it.
But that version has graphics for this, while the DOS version doesn't.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: The "dead skeleton" bug

Post by Falcury »

I think the "logical" behavior (at least for the DOS version) would be the "soft landing"? After all, in the original Level 3 something similar happens when the skeleton drops to the room below (it reappears alive while standing active).
Although of course, in Level 3, the skeleton's landing happens off-screen, as a hard-coded special event.
User avatar
oitofelix
Wise Scribe
Wise Scribe
Posts: 227
Joined: February 17th, 2016, 1:59 pm
Location: Brazil
Contact:

Re: The "dead skeleton" bug

Post by oitofelix »

David wrote:Now the question is: what *should* happen in this case?
In case it matters how it's done in MININIM, character types SHADOW, GUARD, FAT_GUARD, VIZIER and SKELETON are all of the meta-type "guard" and thus are handled by the same code. This implies that all such characters, including the skeleton, behave mostly equally in all situations unless a special event manipulate them to do otherwise. Thus skeleton has a count of lives and as many styles as any other guard. The skeleton in level three is different in the sense that it gets up by itself and has unlimited lives, but that is done by special event code.

MININIM, however, supports any type of guard anywhere, in any quantity, at any level. So its behavior may not be considered sound for engines with restrictions in that regard.
Bruno Félix Rezende Ribeiro (oitofelix)
MININIM author
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: The "dead skeleton" bug

Post by Norbert »

David wrote:Now the question is: what *should* happen in this case?
Your question seems to imply something needs to be fixed/improved.
If SDLPoP isn't crashing and behaves as the original DOS game, maybe it's fine as is.
You could polish away such quirks, but you might be removing the game's personality.
If what 'should' happen is subjective, maybe the original game already answers the question.
It's charming, like how a falling mouse in level 8 transforms; a magical world where anything can happen.
User avatar
oitofelix
Wise Scribe
Wise Scribe
Posts: 227
Joined: February 17th, 2016, 1:59 pm
Location: Brazil
Contact:

Re: The "dead skeleton" bug

Post by oitofelix »

Norbert wrote:If SDLPoP isn't crashing and behaves as the original DOS game, maybe it's fine as is.
This implies the original game is perfect as it is, and therefore has no bugs. That's false for any non-trivial piece of software, what that engine surely is.
Norbert wrote:You could polish away such quirks, but you might be removing the game's personality.
It's clear that the engine behaves like it does because the scenario that triggers the glitch was not foreseen by the programmer. That's expected given the proprietary nature of the program which was targeted at a very narrow commercial circumstance at the time it was developed. With engines like MININIM and SDLPoP, people are not hostage of the developer's errors anymore.
Norbert wrote:If what 'should' happen is subjective, maybe the original game already answers the question.
Having more than one sound behavior (like the skeleton soft falling, or falling and dying) doesn't imply all behaviors, including the bugs of the original engine, are sound.
Norbert wrote:It's charming, like how a falling mouse in level 8 transforms; a magical world where anything can happen.
Having developed an engine from scratch to solve the exact same game, I've come across all sorts of "magical" things. The only ones that have remained are those that surprised me not because they behaved in an unexpected manner, but because I did not expect them to behave correctly as they did.

After some weeks developing MININIM, it became clear that the original engine is not the answer for everything, as I could do way better in several areas. Those "quirks" are not personality nor magical, they are simple and blatant programming errors.
Bruno Félix Rezende Ribeiro (oitofelix)
MININIM author
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: The "dead skeleton" bug

Post by Norbert »

oitofelix wrote:
Norbert wrote:If SDLPoP isn't crashing and behaves as the original DOS game, maybe it's fine as is.
This implies the original game is perfect as it is, and therefore has no bugs.
Not at all.
The game isn't perfect, it has bugs, and it has imperfections: I like it that way, to me it's fine as is.

I didn't read the rest of your post, sorry.
User avatar
oitofelix
Wise Scribe
Wise Scribe
Posts: 227
Joined: February 17th, 2016, 1:59 pm
Location: Brazil
Contact:

Re: The "dead skeleton" bug

Post by oitofelix »

Norbert wrote:The game isn't perfect, it has bugs, and it has imperfections
Indeed.
Norbert wrote:I like it that way, to me it's fine as is.
You are totally entitled to your likes and dislikes. I respect that.
Norbert wrote:I didn't read the rest of your post, sorry.
That's unfortunate.
Bruno Félix Rezende Ribeiro (oitofelix)
MININIM author
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: The "dead skeleton" bug

Post by Norbert »

oitofelix wrote:That's unfortunate.
When I see that every sentence I wrote got its own response in a point by point rebuttal style (example, example, example), I choose to play a fun video game instead of reading forum posts. This is not your 'fault', it's just the kind of person I am/have grown into. Although I must admit that I am getting tired of reading about MININIM's greatness/superiority in almost all of your replies. Maybe the repetitiveness is just too much for me.
User avatar
oitofelix
Wise Scribe
Wise Scribe
Posts: 227
Joined: February 17th, 2016, 1:59 pm
Location: Brazil
Contact:

Re: The "dead skeleton" bug

Post by oitofelix »

Norbert wrote:This is not your 'fault', it's just the kind of person I am/have grown into.
That's fine.
Norbert wrote:Although I must admit that I am getting tired of reading about MININIM's greatness/superiority in almost all of your replies. Maybe the repetitiveness is just too much for me.
That's ok.

Edit: Just to clarify and put my position in perspective, when I argue with someone I'm not aiming to convince that person more than anyone else that may be reading or will read those posts in the future. My arguments rest here as a record of my point of view, style and perception; as a way to convince those who wouldn't be convinced otherwise, how few they might be.
Bruno Félix Rezende Ribeiro (oitofelix)
MININIM author
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: The "dead skeleton" bug

Post by Falcury »

Norbert wrote:
oitofelix wrote:That's unfortunate.
When I see that every sentence I wrote got its own response in a point by point rebuttal style (example, example, example), I choose to play a fun video game instead of reading forum posts. This is not your 'fault', it's just the kind of person I am/have grown into. Although I must admit that I am getting tired of reading about MININIM's greatness/superiority in almost all of your replies. Maybe the repetitiveness is just too much for me.
My apologies about that last example you mentioned...
But regardless of differences, it's still a nice thing that many people here do care strongly about such an old game!

Regarding the skeleton fix: the changed behavior can of course be optional?
User avatar
doppelganger
Vizier
Vizier
Posts: 119
Joined: April 24th, 2015, 9:04 am
Location: India

Re: The "dead skeleton" bug

Post by doppelganger »

Norbert wrote:
oitofelix wrote:That's unfortunate.
When I see that every sentence I wrote got its own response in a point by point rebuttal style (example, example, example), I choose to play a fun video game instead of reading forum posts.
Mine's here, except I had cross-examined David.
Doppelgänger
Hmm.. These mortals know about me.. :evil:

Download 'Hell of A Palace' now from Popot!
_Zaphod_
Beylerbey
Beylerbey
Posts: 60
Joined: January 13th, 2006, 12:01 am
Location: USA

Re: The "dead skeleton" bug

Post by _Zaphod_ »

My opinion is that any bug that does not affect either the original game, or any mod is fair game to fix.

I believe this skeleton behavior is one such bug.

It seems pretty clear that the intent is for the skeleton to survive falls of any distance.

So that should be the behavior.
Post Reply