Page 1 of 7

[v1.0.2] DamNums - Universal Damage Numbers

Posted: Mon Jan 23, 2017 11:02 pm
by Xaser

DamNums - v1.0.2
- Release Archive
- Github

This mod pairs well with coldcite's Top HP Bars mod. Check it out!

[Requires GZDoom 3.5.0 or newer]

DamNums is a pretty simple concept: shoot monsters and little numbers pop out that tell you how much damage you did -- like so:


More giffy previews (click 'em): -- Works on any IWAD! -- Works on mods! Ideally, any mod! ;)

Cool-ass features:
  • It's Universal!: it works with all IWADs, all mods, all everything. Just plug it in and watch the numbers fly!
  • A wide selection of colors and fonts! All IWADs supported!
  • Damagetype colors! The system is easily utilized by mods by adding some definitions to LANGUAGE (see the mod for some samples). No dependency required!
  • Most everything is exposed as a user option, e.g. font/color preferences, enabling/disabling damagetype coloration, and so forth.
Changes in v1.0.2:
  • Shotgun Spray option no longer causes numbers to spawn sky-high when actors die on newer GZDoom builds.
  • Enemies who gain health via a script now have their damage tracked correctly.
  • Fixed a lil' startup warning in GZDoom 3.7.x
  • Simplified the code a ton.
Changes in v1.0.1:
  • Added support for non-standard IWADs (e.g. Delaweare).
Changes in v1.0.0:
  • Fonts added for basically all IWADs (and then some)!
  • Font choice defaults to the game you're playing; in Heretic, you'll get Heretic-y numbers, in Doom you'll get doom fonts, etc.
  • Damage type support! A few values are baked in (e.g. for "Fire" and "Ice" and whatnot), and mods can easily supply their own damagetype->color mappings via LANGUAGE (see the mod itself for examples).
  • Font & color choice are now user options. Multiplayer-safe!
Changes in v0.2.0:
  • Added an option for number "physics," with two options at present ("Toss", the gravity-affected default, and "Float", a simple float-upwards style).
  • Added an option to allow all shootable objects (e.g. barrels) to toss numbers, not just monsters.
  • Revamped codebase, w/D4D gib-death compatibility -- thanks to Major Cooke and ZZYZX for hashing out a better way to do things.
Changes in v0.1.1:
  • MENUDEF no longer modifies the root Options menu, making it compatible with mods that include their own MENUDEF monkeying.
Thanks to Bodhisattva for randomly posting the inspiration for this mod, Mikk- for getting a head start on the event handler code, and (presumably) Kyle873 for sowing the seeds in the first place in DRPG. Also shoutouts to Major Cooke for lending a coding hand, and Zombie & Marrub for letting me bug them with ZScript questions and helping me avoid losing more brain cells than usual. ;)

Give it a whirl and let me know what you think -- and certainly report bugs if it happens.

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Wed Feb 01, 2017 6:32 pm
by Sleepyhead
Signed on here so I could express my gratitude for your making this. I've been waiting for a mod like this for awhile and this functions exactly how I hoped it would. Keep up the awesome work and I can't wait to see what you add onto this in the future!

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Thu Feb 02, 2017 3:06 am
by Nevander
Epic work. I might suggest for higher damage amounts to be red or flash up a CRITICAL like how Borderlands does it. Just a thought.

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Thu Feb 02, 2017 5:30 am
by Gez
The size of the damage could scale (probably a logarithmic scale to avoid crazy high damage from taking up all the screen) with the amount of damage inflicted.

Also perhaps the numbers could move up and disappear instead of falling down like blood droplets?

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Fri Feb 03, 2017 12:13 am
by Xaser
Heh, was afraid for a bit that the mod fell outside folks' interest. :P

Good thoughts there re: criticals, size scaling, and number movement. I do want to be careful about colorization since at some point i plan on adding damage type colorization, but it's worth a sneak-in. The movement style is worth a user-option; I kept it Borderlands-y, but the no-gravity move-upwards style ain't a bad thing either.

Probably the next thing on my list for this, though, is a Classic Doom-style font choice, so you can see good ol' Doom-style digits rather than the Doom4-ish ones that are currently present. Will fit a bit more in the end.

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Fri Feb 03, 2017 3:18 am
by Triple S
This is definitely gonna be something I load all the time.

I'd love if there was a toggle between "flood of numbers" and "one solid number" for multi-hit (and maybe impact+radius explosive) weapons. Another nice feature would be how Team Fortress 2 allows you to set it so that all damage within an adjustable timeframe is continuously added up into one number, instead of a series of small numbers flying out. It's not something I tend to use (I like seeing a number per hit), but it's very nice to have.

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Fri Feb 03, 2017 10:01 am
by Xaser
One weird quirk about the old "flood of numbers" approach (i.e. one number for every damage source) was that hitting someone with a rocket would spawn two numbers, because the projectile impact and the explosion are two distinct sources of damage. Between that and the unreadable (but fun) SSG shower, I figured a change was appropriate. But options are appropriate too...

Speaking of, I should probably put together some preview screenshots that aren't an unreadable number shower. The video thumbnail isn't exactly selling the mod well. :P

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Sat Feb 04, 2017 4:52 am
by Sleepyhead
I actually have a few things I'd like to add on. First off, in terms of making this more "universal"; what are your thoughts/ideas on that end? I can see this mod being excellent for gameplay mods if that's what you have in mind. Being able to know the exact damage of modded weapons in-game would be fucking awesome.

Also, you mentioned something about enemy health bars. I don't know what you have planned specifically but I use that JP Hud health bar and if you haven't, the way it works is that it reveals the enemy's health and name when you mouse over it. The only problem with this is that you can abuse that fact to take advantage of hitboxes (seeing/shooting enemies around corners), trivialize stealth monsters and dark sections, and even discover certain fake wall secrets that have monsters hiding behind them (one in Doom 2's "The Spirit World" with some Pinkies/Spectres behind a fake wall comes to mind). If I may make a suggestion, perhaps enemy health bars could only appear near injured monsters so that you or another monster would have to already be attacking it (might be useful for picking out particularly injured demons in big messy crowd fights).

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Sat Feb 04, 2017 10:52 am
by Xaser
I was planning on having health bars only appear once an actor gets below 100% health, then stick around until dead. No monster names since I haven't thought of a good way of printing strings in the world while offsetting things properly (on that note, not uber-happy with my current solution for numbers, but it's all I can think of at the moment).

Regarding universal-ness, there's a new event system coming soon to ZScript, and there's a "WorldThingDamaged" damage hook this mod ought to be able to take advantage of.

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Mon Feb 06, 2017 5:26 pm
by Shadow Hog
I don't suppose there's any way the numbers can forcibly render in front of the monsters in question?

Then again, if the numbers float up instead of being affected by gravity, it'd probably be a moot point.

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Thu Mar 02, 2017 8:01 am
by Mikk-
Xaser wrote: Regarding universal-ness, there's a new event system coming soon to ZScript, and there's a "WorldThingDamaged" damage hook this mod ought to be able to take advantage of.
That there is! I'm only new to ZScript so this might not be the most graceful solution...

Code: Select all

class DamnumHandler : StaticEventHandler
    override void WorldThingDamaged(WorldEvent e)
            String src = "null";
            if (e.DamageSource) src = e.DamageSource.GetClassName();
            DamNum.spawnDamageNumbers(e.DamageSource, e.Thing, e.Damage, e.DamageType);
While it works (without modifying monsters, too!), it reverts to the old spray of numbers featured in the video posted. Perhaps there's a way to remedy that, but it's beyond my grasp.

Re: [v0.0.1] DamNums - a damage numbers mod

Posted: Mon Mar 13, 2017 12:48 pm
by Xaser
Thanks for the sample! That indeed looks like the right starting point.

I'll noodle the damage accumulation a bit when I dedicate some time back to this. My current working idea is to give monsters a "DamageAccumulator" inventory item which tracks all damage dealt during a tic, then triggers the number spawn at the beginning of next tic. Yeah, we're back to inventory item shenanigans, but it's better than doing the other thing I had in mind (shoving "actors that got damaged this tic" into a dynamic array somewhere -- yuck). :P

I figure it's "okay" in this since because all Actors have inventory, and it's better than hijacking an existing Actor pointer (like Poisoner or something) and working around that. Shouldn't be much of a performance sink if I exclude Massacre damage; at least not more than spawning a zillion numbers would in case there's a map out there that mass kills a bunch of things via ACS.

Alternative ideas welcome, of course.

Re: [v0.1.0] DamNums - Universal Damage Numbers

Posted: Sat Apr 08, 2017 10:29 pm
by Xaser
Bumpdate! v0.1.0 is released, which (in theory) is universal -- i.e. it works with any IWAD, mod, or whatever! Thanks to ZZYZX's magic event system for enabling it.

Not much else to say about it, aside from mentioning that text colors are customizable too. Otherwise, load this and have some fun with it! And let me know if there's any wacko bugs or incompatibilities or shenanigans.

Re: [v0.1.0] DamNums - Universal Damage Numbers

Posted: Sun Apr 09, 2017 1:53 pm
by unRyker
This update was just what I was waiting for! Excellent work, and to be honest I only have two other things to suggest: Show the damage number somewhere on the HUD as well in customizable locations would be useful, and an option to accumulate numbers in a certain time-frame which would make chainguns better to use. Other than that, it's complete to me and I'll be using this from now on!

Re: [v0.1.0] DamNums - Universal Damage Numbers

Posted: Sun Apr 09, 2017 3:18 pm
by jpalomo
Nice stuff. I'll be sticking this in my autoloads. The only suggestion I have is with the menu. Picking a specific color for the font is a little annoying. Perhaps when you select the option it brings up another menu with the list of colors?