"BPM" System for in-game battles

I've been trying to figure out how to code a unique battle system that utilizes a "BPM" system. The BPM meter would replace a character's HP and any damage/items used on them that would heal/damage them would instead affect their "BPM" and depending on the "BPM", different effects would occur such as high BPM giving the character an adrenaline rush thus dealing more damage but more sensitive to BPM changes or a lower BPM making the character lethargic decreasing sensitivity to BPM changes but lowering attack stats. I've been trying to figure out how to make it work in RPG Maker MZ but I unfortunately don't have knowledge in writing code... I'm willing to learn but I'm not sure where to start.

Just wondering if there's a way I can bring this idea to fruition, any help or advice would be greatly appreciated. I'm currently using RPG Maker MZ to create this system.
So, first of all, calling it "BPM" really threw me off, as I went in here thinking you are talking about creating some sort of rhythm game or input timing synced to music.

I am not sure I understand 100% how you want this to work, but you don't need to "code" anything. You can do this through eventing.
You just need to get a character's % HP and apply appropriate states to them according to their HP.
For a number of different passive effects, I use this variable control formula to get % of a stat:
hp=percent.png


This is a common event.
Step 1: We need to learn what our actors max HP is and set that to a variable. I called this variable "MaxHP" (My actor's name is Fidel, so I'll be using this name)
Step 2: We need to get the current HP of Fidel and set that to a variable. I called this variable "CurrentHP"
Step 3: We can only use whole integers in variable controls (at least in MV, not sure if that is changed in MZ), therefore we cannot use decimals, so as a result we need to multiply the current HP by 100.
Step 4: To get the percent of health Fidel currently has, we need to divide the current HP by the MaxHP. This will give us an integer between 0 and 100. That integer is the percent.

Now after that is calculated, you can create conditionals based on % HP.
"If CurrentHP ≥ 90%
Apply this state
else
Remove that state"

Once the conditionals have been set up, you can put this common event in troop events and if necessary, you can tack it on to any skills that you use (so it can update the character after any changes to their stats.)

Hope that helps!
Hello! Thank you so much for the tutorial, it helped a lot and it's exactly what I was trying so hard to create from the vague idea I had from my mind. I'll be renaming the system to a heart rate monitor instead, realizing that the name "BPM" is confusing, thank you for pointing that out.

I've been tinkering with the common events for a while and got it to work somewhat, but I can't seem to find a way to call the event at every turn of every battle to check for the actor's HP. Maybe I'm doing something wrong, but thank you for your help!
You will need to place the event inside a troop event.
When you go to your troops tab, there is space for attaching events to this troop. In the existing event tab or by creating a new event tab for the troop, use the drop down at the box to set the condition to run every turn (just called "Turn" iirc).
Then in the event add the "common event" event command (found on page 1 of you list of commands) and select your % Health common event.
Now every turn, this common event will run.
Sometimes you might use items or skills that might restore health (or increase BPM as it were), in which case, you may want to update your character's "BPM" state right away instead of waiting for the next turn to update their "BPM". So in that case, just tack this same common event onto the skills or items you are using. In the extra effects area of skills and items, on the 4th page (iirc) you can select to run a common event with the skill. So you'll select the % Health common event.

And for the record, if I wasn't clear before, whatever needs to be done after the game knows your character's % health (such as applying the states for high or low BPM) should be run in the same common event. So basically the common event performs 2 actions: 1) Get the current % HP. 2) Apply the appropriate state for the current % HP.

P.s. Not at home at the moment, so I am unable to provide screenshots.
Thank you again for taking time to respond... I really appreciate it. I added the common event to the troop events and it seems to work and check for the character's HP every turn.
1687851124297.png

I managed to get it to work after a few attempts and even pasted the common events to certain skills and items so that it would check the HP beforehand instead of the turn ending and it's working!

All I need to figure out is how to change the GUI to make the "BPM" look like an electrocardiogram that changes based on the BPM. I feel like I'll need to learn a thing or two about writing plugins for it to work.

Thank you so much again, I don't think I would've ever been able to event this mechanic without your help!
All I need to figure out is how to change the GUI to make the "BPM" look like an electrocardiogram that changes based on the BPM
Yeah, HUD stuff is complicated in RPG Maker. Unfortunately there isn't many tools for the battle HUD. The Actor Status window (the window that shows the HP/MP, stuff for actors) can be altered with SumRnDde's Hud Maker Ultra, so it might be able to do the job if you just want the electrocardiogram look. It might take some learning, but with effort you might be able to achieve what you are looking for for free (or the price of HUD Maker Ultra Pro)
Alternatively, as many other folks who aren't programmers wind up doing; hiring someone to program the HUD for you.
In this case, you can get something tailor made specificly the way you want it, however, this often is built around whatever plugins you already have installed, so I recommend doing this last, since in all likelihood, you will be adding many plugins during your game's development.
I'll be renaming the system to a heart rate monitor instead, realizing that the name "BPM" is confusing, thank you for pointing that out.
I actually *did* equate "BPM" with heart rate, but I still found it confusing, as I assumed that you must have had some other intended meaning for it.

I think that maybe what threw me off is that I don't consider heart rate to be a logical replacement for HP. Typically, when a person experiences pain, or sustains injuries, their body responds by releasing stress hormones, and their heart rate *increases*. The goal is to increase oxygen and nutrient delivery to vital organs so that the body can better respond to the threat. At least, that would generally be the case up until the person is on death's doorstep, in which case their body might go into shock and then heart rate would decrease.

This is just my opinion, but I think that the heart rate angle would make more sense if it were a value that is displayed in tandem with (and inverse to) HP, rather than replacing it.
Hi Arthan!
Typically, when a person experiences pain, or sustains injuries, their body responds by releasing stress hormones, and their heart rate *increases*.
Yeah! That's the idea I was going with, what I did was to reverse all the damage formulas of certain skills so that they would "Heal" the Characters HP thus increasing the Actor's BPM. If the Actor's HP reached 100% or <=30%, the actor would die from going into Cardiac arrest or shock. The entire goal of the mechanic is to balance out the Character's BPM and whether or not to take the risks of increasing or decreasing your BPM during battle.

This is just my opinion, but I think that the heart rate angle would make more sense if it were a value that is displayed in tandem with (and inverse to) HP, rather than replacing it.

Ah, you're right. Though I'm not quite sure how to execute that.. Having both HP and the BPM exist as different values seems complicated especially in battle scenes. Would it be okay for me to ask you to expand more on this?

Thank you for taking time to respond to this thread..
Arresting from sinus tachycardia is not really common. That would be more of a v-tach thing which is not likely to occur from adrenaline without underlying cardiomyopathy. Sinus tachycardia is more likely to result in syncope. Sometimes that does result in some cardioinhibition but the majority of these are only a few seconds long and would not require any intervention to return to a normal sinus rhythm.

Just thought I’d comment that since I’m both (former) medical personnel and also have cardioinhibitory syncope. My heart has stopped for 2-3 seconds but I can legit get up and walk away once I reboot.

I don’t super diss medical things for being a bit dramatic or a little inaccurate for the sake of drama, but a full out cardiac arrest or shock from adrenaline would be pretty OTT for me. Syncope would still serve as a necessary means for the character to reset since it puts you out on your ass pretty bad still…definitely more accurate though.
Ah, you're right. Though I'm not quite sure how to execute that.. Having both HP and the BPM exist as different values seems complicated especially in battle scenes. Would it be okay for me to ask you to expand more on this?
Now this is just my opinion (and I'll be the first to admit that I'm no expert at any type of design), but the first idea that pops into my head for the battle scene would be to have the HP gauge function as a normal HP gauge (i.e. it decreases as HP decreases), but to also give the gauge a pulsating outer glow effect. As BPM increases, the glow pulses faster. However, while it sounds cool in my head, it seems like it might be the type of thing that could be annoying in practice, so without seeing it in action, I'm not sure.

Alternatively, you could just put an animated beating heart icon somewhere on the status display, and simply scale the animation speed with BPM.

Dunno why, but I intuitively feel inclined to keep it so that the BPM value is implied to the player, with visual cues, rather than displayed as a concrete number... but I'm not sure why.
Apologies for replying late..
I don’t super diss medical things for being a bit dramatic or a little inaccurate for the sake of drama, but a full out cardiac arrest or shock from adrenaline would be pretty OTT for me.
Thank you for the insight! To be honest I've been having trouble researching how to make the mechanic make sense to the player and from a medical standpoint (since this game heavily leans into those themes.) I'll try reviewing more about Syncopes seeing that it's a lot more accurate than what I had initially planned.
Alternatively, you could just put an animated beating heart icon somewhere on the status display, and simply scale the animation speed with BPM.
Yep yep! That's the idea I had. The display of the BPM would be an Electrocardiogram that changes speed and color depending on the BPM. I thought of also having the BPM affect the battle music's BPM, the idea sounds good on paper but I feel like it would quickly get annoying considering how many times you'd be changing your BPM and how it would ruin certain fights if the BPM was too low.

Dunno why, but I intuitively feel inclined to keep it so that the BPM value is implied to the player, with visual cues, rather than displayed as a concrete number...
You have a point... Giving the player a vague idea of the BPM makes it more immersive and would make them more cautious when playing around with the system. But I feel like that vaugueness would ultimately lead to confusion and a misunderstanding of the entire mechanic... But I will consider adding more visual cues, it does feel much better than showing a concrete number.

Thank you for taking time to answer this thread! It really helps me a lot! I've been learning so much more thanks to everyone's input here.
I’m not a doctor/nurse or anything like that, I was a tech…but pretty much all my experience was in trauma and emergency if you ever want to run anything by me for at least a sniff test.
I’m not a doctor/nurse or anything like that, I was a tech…but pretty much all my experience was in trauma and emergency if you ever want to run anything by me for at least a sniff test.
I'd be extremely grateful! However, I'm still working on fleshing out the story, so I don't have anything else for you to look at right now... But thank you for the offer! If that's okay with you, I'll consider contacting you through this site if I ever need assistance regarding this matter.

Thank you again for the help! I'll be referring back to your response frequently as I work on the story!

Original thread: https://forums.rpgmakerweb.com/threads/bpm-system-for-in-game-battles.158708/