Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Bashe

Medikit question

Recommended Posts

Did the "You picked up the medikit that you REALLY need!" message ever appear in Vanilla Doom? I seem to only be able to get it in Zdoom.

Share this post


Link to post

It only shows up in a strange circumstance in the original Doom, due to an error in the source code. You only get it if you pick up a medkit right after you take an immense amount of damage. I'm sure someone else here can point out the relevant line of code.

Share this post


Link to post

I actually don't remember ever having got it in all the years I played vanilla doom. I didn't know of its existence at all until I saw the message in DeHackEd.

Share this post


Link to post

There's something else like that. If you turn godmode on straight after taking damage, he sometimes has a "surprised" face.

Share this post


Link to post

I'm pretty sure getting the surprised face is directly connected to the same circumstances you would get the medikit message: taking a lot of damage, and then quickly regaining health.

Share this post


Link to post

The ouch face (STF_OUCH) appears when you take damage at the same time (it needs to be the same gametic, I presume) as your health increases overall by more than 20. This is due to an error in the code: it was meant to be if you lost more than 20 health all at the same time. Thus you can expect to see it if you are running across a damaging floor and pick up a medikit or a soulsphere, for instance. It also appears if you start a level in the pain state (e.g. in a damaging sector). link

The "really need" message was meant to be displayed if you picked up a medikit when your health was less than 25. This is from cph's LxDoom changelog, under "Changes v1.3.7 to v1.4.0":

- Fixed Doom bug where the "got a medikit you REALLY needed" message was never used. Thanks to James "Quasar" Haley for pointing that one out.

AFAIK, these two bugs are not connected. Certainly, fixing the "really need" issue doesn't affect the circumstances under which the "ouch face" appears.

Share this post


Link to post

The message was supposed to be displayed if you got a medikit when your health was under 25%. However, a logic bug in the code which handled the medikit powerup prevented it from ever being displayed. The code looks like this:

If the player picks up a medikit {

    Give the player 25% health

    If the players health is < 25% {
        Display "Picked up a medikit you REALLY NEED!"
    } else {
        Display "Picked up a medikit"
    }
}
As the player always has >0% health when alive and cannot pick up medikits when dead, the health is always increased to a value greater than 25% before the check is made, so the normal "picked up a medikit" message is always displayed.

The correct code should be as follows:
If the player picks up a medikit {

    If the players health is < 25% {
        Display "Picked up a medikit you REALLY NEED!"
    } else {
        Display "Picked up a medikit"
    }

    Give the player 25% health
}
Some ports fix this. I fixed it in SMMU (and Eternity has thus inherited it) and I think the fix got passed on to PrBoom as well.

The "ouch" face bug is not related to this, although it is similar to this in that a simple logic error prevented things from being displayed.

Share this post


Link to post
fraggle said:

I think the fix got passed on to PrBoom as well.

Yes, via LxDoom, which merged with PrBoom.

Share this post


Link to post
DarkJedi188 said:

It always showed up in Duke Nukem 3D when health was either 25% or below....But I never ever got to see it in vanilla DOOM.

Jacknife said:

Never seen that in vanilla doom before.

YES, WE JUST EXPLAINED WHY YOU NEVER SEE IT. READ THE THREAD, YOU IDIOTS.

Share this post


Link to post
Bloodshedder said:

I'm pretty sure getting the surprised face is directly connected to the same circumstances you would get the medikit message: taking a lot of damage, and then quickly regaining health.

They arent connected. The "picked up a medikit you really need!" message is never displayed.

Share this post


Link to post

Just for comparison, Wolfenstein Spear of Destiny uses the correct programming of the "shock" face. If the hit is damaging enough (not sure how much damage) he'll use the "shock" expression. Much, much more common than in Doom.

Share this post


Link to post

IIRC, there are some early versions of DOOM in which the STFOUCH face is displayed properly (can anyone verify this, perhaps with a screenshot?). I seem to remember seeing it at the appropriate time when playing a long, long time ago with some old version. At any rate, the error in the status bar code is actually just an inverted test, like people have mentioned. Here's the pseudocode, like fraggle provided:

if(player damagecount > 0 
   AND player attacker is valid
   AND player attacker != player)
{
    // being attacked
    priority = 7;

    if(player health - old player health > 20) // ****
    {
	st_facecount = ST_TURNCOUNT;
	st_faceindex = ST_calcPainOffset() + ST_OUCHOFFSET;
    }
    else
    {
	// do normal pain face ...
    }
    ...
}
The line with four asterisks by it is the incorrect line. The "old player health" is the health since the last face widget update. If the player's current health minus the old health is greater than 20, that means the player's health increased, not decreased. But notice that this code segment is only entered when the player is counting down time since the last time he was hit (that's what damagecount is). Thus, the STFOUCH face only appears, as other people have noted, when you collect health while getting hurt at the same time.

Inverting the test to if(old player health - player health > 20) fixes the error and makes the ouch face work properly, where it appears whenever you take more than 20 damage, and then changes back to the normal pain face after a few gametics (the priority = 7 line is what causes this). Somebody just got that one line backwards.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×