Currently, it seems health can only increase/decrease by an integer value, and decimals are either floored or rounded. But would it be a major undertaking to track the fractions of health as well, invisibly, behind the scenes?
For example, 10 hits of .1 damage would eventually cost that single health point (such hits are completely harmless as of now).
Other examples:
- Radius damage from weak explosions could now deal fractional damage
- Continuous ray attacks could deal fractional damage (but do so rapidly)
- Weak life drain attacks (A_CustomPunch) would become much easier to balance (currently, slightly too low a lifedrain factor will completely nullify the drain effect)
Health: could it be "tracked" by decimals?
Moderator: GZDoom Developers
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Health: could it be "tracked" by decimals?
In short: Yes.D2JK wrote:But would it be a major undertaking to track the fractions of health as well, invisibly, behind the scenes?
If you want finer detail, scale HP and damage values up by a thousand or so. This isn't something that can change in the engine by this point.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Health: could it be "tracked" by decimals?
It's not that simple. While making 'health' a fixed point property is not an issue - it will most definitely alter the effect of damage to a degree that is noticable by players, and that's never a good idea.
- StrikerMan780
- Posts: 486
- Joined: Tue Nov 29, 2005 2:15 pm
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: Health: could it be "tracked" by decimals?
How viable would it be to make it a GAMEINFO thing? (Being able to specify integer or fixed-point health/damage)Graf Zahl wrote:It's not that simple. While making 'health' a fixed point property is not an issue - it will most definitely alter the effect of damage to a degree that is noticable by players, and that's never a good idea.
Re: Health: could it be "tracked" by decimals?
Most assuredly never. That would require code branching absolutely everything relating to health. It would also break telefrag damage and anything related, as that needs all 32bits. (Well, 19bits, but you need room for overflows and the signed bit.)
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Health: could it be "tracked" by decimals?
Wow, TELEFRAG_DAMAGE is still only a million? I could've sworn it was increased after certain mods had bosses with a couple million HP...
Does this mean it couldn't be changed to ~2 billion and work properly? But I would think overflow cases would only be places where it shouldn't be undergoing modification anyway. (For example, a really old bug where it was affected by armor.)edward850 wrote:(Well, 19bits, but you need room for overflows and the signed bit.)
Re: Health: could it be "tracked" by decimals?
It probably could be increased, but as 1mil has already been the invulnerability foiler for some time (telefrag damage doesn't need to be achieved through telefragging explicitly to work), you could break some mods. It'd be a hard time finding which, though.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Health: could it be "tracked" by decimals?
I would argue that there's a good reason it's a #define in the source. We've had [wiki]DamageThing[/wiki] and [wiki]Thing_Damage[/wiki] since Hexen support, so it's simple enough to instantly kill actors without using magic numbers worth of damage. Besides, any random mod using 1mil damage to kill would probably still work, unless the mod is using ungodly amounts of HP for things. (In which case it's already got problems.
)
One good argument for increasing it as high as possible would be what I mentioned earlier: Achieving "fractional" health by scaling everything up by a thousand. A little over two billion as the "sure kill" threshold still leaves you two million "fixed point" HP. The current value acts mainly as a deterrent from using insane HP values, and uh... Well, I might have just argued myself out of this idea.

One good argument for increasing it as high as possible would be what I mentioned earlier: Achieving "fractional" health by scaling everything up by a thousand. A little over two billion as the "sure kill" threshold still leaves you two million "fixed point" HP. The current value acts mainly as a deterrent from using insane HP values, and uh... Well, I might have just argued myself out of this idea.
