HP

  Рет қаралды 662,715

UncommentatedPannen

UncommentatedPannen

Күн бұрын

I explain all about how HP works in SM64, also known as health or power. HP is displayed on the HUD as a circle made up of 8 sectors, and so it displays a number of sectors between 0 and 8 inclusive. However, the actual variable that represents Mario’s HP is a short, which ranges from 0 to 2176 (or 0x0000 to 0x0880 in hexadecimal). Specifically, the upper byte represents how many full sectors of health Mario has, and the lower byte represents what portion of the next sector Mario has. Thus, one sector is equivalent to 256 HP units. The number of sectors displayed is the truncated version of the actual number of sectors. The maximum health is 2176 HP units (8.5 sectors). Mario will die if he goes below 256 HP units (1 sector).
There are also two bytes related to health: the increase counter and the decrease counter. When Mario gains or loses an integer number of health sectors, it’s these counters that manage that. Specifically, these counters specify how many increments of 64 HP units (one quarter sector) Mario should gain or lose. For example, if Mario touches a goomba, the decrease counter increases to 4. Thus, over the next 4 frames, Mario will lose 64 HP units on each frame, resulting in one full health sector lost.
Separately, there are many things that change Mario’s HP directly, rather than going through the counter system. These include being underwater, being at the surface of water, being in cold water, being in toxic gas, and being burned by fire. Additionally, there are some things that set Mario’s HP to a particular value. These include being eaten by bubba, dying, selecting a save file, and letting the demo play.
Big thanks to Peter Fedak, since he explained to me the finer points of HP, told me how the spinning heart works, and told me how the fire timer works. You can find Peter's channel here: / @peterfedak64
Additional Notes
(1) I said that when being burned by fire, the burn will end when the fire timer is at least 161 and Mario’s in the running animation. However, there are also many other ways to stop the burn prematurely, which don't rely on the fire timer. For example, the burn will stop if Mario touches water, starts a twirl, enters a cannon, collects a star, or enters a warp zone.
(2) Once Mario's HP goes below 256 (1 sector), then he's dead, and there's no way to restore HP at that point. Mario can still collect coins to increase the INC counter, but the INC and DEC counters no longer function. For example, if you have 255 HP and collect a yellow coin, then INC will increase from 0 to 4, but it will just stay at 4 while Mario does the dying animation. Interestingly, Mario cannot collect stars while having less than 256 HP.
(3) Going out of bounds, going near the death barrier, going into the whirlpool in DDD, and going into the quicksand in SSL all kill Mario, but they don't actually change his HP.
(4) Collecting an air bubble underwater increases INC by 20 (+5 sectors).
(5) The HP short is signed, so even if there was a way to push it below 0, it would not wrap around to 65535. Instead, you'd have to push it below -32768 to wrap it around to 32767. Of course, if HP is above 2176, it will just get set to 2176. So no shenanigans can be done with trying to overflow the HP variable.
(6) If Mario remains in the squished state for 10 seconds straight, then his HP will be set to 255, and he will die.
(7) Going through a manta ring increases INC by 8 (+2 sectors).

Пікірлер: 1 500
Why Some 1-Ups Don't Flicker Before Disappearing
11:46
pannenkoek2012
Рет қаралды 527 М.
SM64 - The 255 Coin Limit
30:17
pannenkoek2012
Рет қаралды 1,5 МЛН
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 1,7 МЛН
GIANT Gummy Worm Pt.6 #shorts
00:46
Mr DegrEE
Рет қаралды 63 МЛН
Vertical Speed Conservation (VSC)
15:08
UncommentatedPannen
Рет қаралды 276 М.
Coin Count
14:56
UncommentatedPannen
Рет қаралды 507 М.
The B Button Challenge
14:49
UncommentatedPannen
Рет қаралды 117 М.
Mario 64 but you lose 1 coin every second. Die at 0.
17:34
Nathaniel Bandy
Рет қаралды 535 М.
The Worst Fake Speedrun on Youtube
17:51
Karl Jobst
Рет қаралды 18 МЛН
Walls, Floors, & Ceilings
37:23
UncommentatedPannen
Рет қаралды 371 М.
How Holding Objects Really Works
12:01
UncommentatedPannen
Рет қаралды 198 М.
SM64 - Watch for Rolling Rocks - 0.5x A Presses (Commentated) [OUTDATED]
24:39
Blinking
8:40
UncommentatedPannen
Рет қаралды 742 М.
The Extent of Speed Conservation
9:08
UncommentatedPannen
Рет қаралды 245 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12