Name: | Player HP meter v4.2 |
Authors: | HammerBrother, Iceguy, K3fka, Ladida |
Added: | |
Version History: | View |
Tool: | Asar |
Requires Free Space: | Yes |
Bug Fix: | No |
Featured: | No |
Description: | This patch will add a health system based on the "numerical HP bar". However its has been heavily edited and added new features by GreenHammerBro: -Custom blocks to damage, heal, and increase max HP. -16-bit HP and max HP, you can now have up to 65535HP, Good for hacks that have made collectibles HP upgrades items that are being saved or RPG-styled hacks. Of course, you can change that to 8-bit for HP being less than or equal to 255 to save memory. -display HP also as a bar in percentage (based on the HP meter for sprites in the patch section). -display HP on overworld border, so the player know how much HP they have without the need to be in a level. -All kinds of sprites (normal, custom, cluster, and extended) now have customizable damage, no more several sprites dealing 1HP of damage. -perfect knockback, when hit, rather than the need to have higher backward speed, Mario loses control until he's back on the ground. Also, its programmed to knock away from the sprite rather than backwards. Read the readme and VersionHistory.txt for more info. Note that the bob-omb explosion itself share the damage as the bob-omb, since the explosion is actually the bob-omb sprite. Requirements: -Super status bar patch (recommended, should work with any status bar patches) -uberasm tool -SRAM/BWRAM plus -GPS (if using blocks) -Overworld Border plus (if your hack uses the overworld border) |
Tags: | health bar hitpoints hp bar knockback lifebar lorom pokemon rpg sa-1 |
Comments: | 29 (jump to comments) |
Download
403.75 KiB | 676 downloads
Comments (29)
like Cave Story for example
Can you give me a single example of multiplication with unecessary size when using sa-1?EDIT: I've found the issue, all of the unnecessary bit size and using SA-1 without processing SA-1 are found exclusively on the graphical bar code. The other codes that calls the graphical bar are fine.
I've updated to version 3.15 here.
This define now lets you force it to use SNES multiplication should the user ONLY uses this routine not executed anywhere else using SA-1:
Also, my point was that if you perform a 16-bit * 16-bit multiplication but clear out the high byte in both factors, you perform an 8-bit * 8-bit multiplication but time wasted resources because of the unnecessary processing of four bytes, not two. That was done multiple times and has nothing to do with the bar length or 16-bit addressing of HP.
The reason why the graphical bar routine uses SA-1 multiply and divide registers is because in case if the user needs to use the routine in SA-1 mode; you cannot use WRAM and SNES registers in the SA-1 world.
For initalizing, thankfully that is easy with using uberasm tool's init feature.
Given how complex the patch is, it surely .
That being said, the bar code can take some massive optimisations. Specifically, SA-1 doesn't run during gamemode codes at all! (or even in UberASM altogether).
This means for example, you're free to use SMW's multiplication and division registers to perform a them.
Furthermore, when you need to perform a 8-bit * 8-bit multiplication, you performed a 16-bit * 16-bit one. No need to do that. SNES multiplication registers are unsigned and SA-1's ones are 16-bit so it 8-bit multiplication is unsigned by nature because the high byte is clear in these cases. Likewise, even the forced 32-bit * 32-bit multiplication for an unsigned 16-bit * 16-bit multiplication is overkill just to have an unsigned 16-bit * 16-bit multiplication. There is a much better way to perform an unsigned 16-bit * 16-bit multiplication.
I also dislike the idea that certain variables are saved SRAM. They could be initialised somewhere else as well.
I also have leaved the SA-1 because the patch itself, the blocks and the UberASM codes work with SA-1 but BW-RAM plus doesn't want to initialise the values on my end.
The spazzing is actually due to licecap's framerate recording (up to around 30fps it can record). In actuality, the bar flickers at 60fps to look like a transparent segment representing HP loss (jumps between your previous HP and your current HP). Its common that video games that display HP as bars display the amount loss. Kirby Super Star Ultra have done this.
For the damage for every block. Each block in this package deal fixed damage, therefore if you need a scaling system, you would make duplicate blocks (best to give them different graphics for the player to know that the blocks deal different damage).
Of course, if you wanted to reuse the same block, you have to edit the code to check the level number to determine damage.
And also do you need to setup the damage for every block? What if you want damage to scale?
Uh, No. Mario will remain at least super reguardless of his HP. It doesn’t follow the SMB2 health-to-Mario-Status gimmick.
Also, it’s rare to land on 1HP without dying, as damage often deal more than 1HP loss.
Remove the REP and SEP #$20 as well as turning LDA #$0000 into LDA #$00 if you have !Setting_PlayerHP_TwoByte set to 0.
Healing on the other hand doesn't unfairly cancel out on these situations.
I don't recommend HP countdown during game lock; because it would be inconsistent with the timing of other things (like a glitch with koopas ignoring $9D when they fall and interacting with layer), they shall be affected indiscriminately.
- Mario's death animation will be presented, but he won't fall off the screen yet.
- HP can continuously decrease to 0 while the game is locked.
would be weird. The player will have to wait till the HP hits zero before the animation kicks into gear.
Maybe the game can freeze / lock ($9D) when Mario takes his final hit:
- Mario's death animation will be presented, but he won't fall off the screen yet.
- HP can continuously decrease to 0 while the game is locked.
When Mario's HP goes to 0, then his death animation resumes and he proceeds to fall offscreen.
-Second picture shows the “rolling HP” from Mother/Earthbound.
-Third picture shows the traditional standard damage unlike above.
-Fourth picture shows max HP increased.
-Fifth shows you can have up to 65535 if you have set HP to 16-bit.
-Sixth shows the knockback when set to “remain stunned until StunTimer hits 0 or lands on the ground”
-Seventh shows a knockback that remains stun until the timer hits 0 reguardless if the player is on the ground or not (noticeable that the player gets knocked further).
-Eighth shows you recover 1/2 HP after death when returning to the map.
A couple patches like Extended No More Sprite Tile Limits and Shared Subroutines do it that way.
what do you mean dummy JSL?
For GHB: You could have added a dummy JSL somewhere into the ROM. That way, the user don't have to write down the value for cluster sprite damage. In fact, the same can apply for extended sprites too especially sicne PIXI now supports.
A couple notes for the users: Be careful if you use Iggy and Larry since their platform causes some problems with the knockback and can cause you to die instantly. The other bosses should work fine since they a solid ground and not one which tilts.
Also, if you use SA-1, remember tp change the value at "!Ram_CustSprBit" to $400040 and "!Ram_CustSprNum" to $400083. It would have been better if the patch detected it but... w/e.
You : IT'S OVER 9000
Me : WHAT!?!?!?!
-fix the default freeram issue, I realized its using level tile RAM address.
-use the new bar display
-display bar on OW border
--improve the routine that writes tiles to ow display
-use ObjecTool for the game to remember if a max hp upgrade is picked up.
Nevertheless, it is a really good patch, just have these issues in mind for the possible next version.
-The heal block is was checking if it's healing over the maximum incorrectly: "if the added HP value (before storing it into current HP RAM) is greater than current HP, set hp to maximum". It should now check if the added value is larger than maximum, rather than the current.
-on the overworld, in case you have a lot of vram writing on the boarder, I made it write the meter only ONCE during overworld load init (as in, 1 frame just like the level load), and keep running during "overworld" (the time the player has controls), but not run during save prompt. This reduces the chance of windowing HDMA bugs and top-of-screen flickering.
Codename: programmer
HP: 20/20
ASM: 40
Music: 0
Let's play hacks skill: 25
Opcode tricks: 1
Ability: code understanding. Be able to understand what a block of code does and purpose without comments.