[v1.0.2] DamNums - Universal Damage Numbers

For high-res texture/sprite projects, sprite-fix patches, music add-ons, music randomizers, and other graphic/sound-only projects.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

[v1.0.2] DamNums - Universal Damage Numbers

Post by Xaser »


Image
Image
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:

Image

More giffy previews (click 'em):
https://i.imgur.com/Z6Ry4H7.gifv -- Works on any IWAD!
https://i.imgur.com/xLCi5Zu.gifv -- 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.
Last edited by Xaser on Sun Jan 06, 2019 7:27 pm, edited 8 times in total.
Sleepyhead
Posts: 9
Joined: Tue Jan 31, 2017 7:31 pm

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

Post 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!
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

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

Post 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.
Gez
 
 
Posts: 17831
Joined: Fri Jul 06, 2007 3:22 pm

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

Post 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?
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

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

Post 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.
User avatar
Triple S
Posts: 330
Joined: Sun Nov 02, 2008 11:52 am

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

Post 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.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

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

Post 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
Sleepyhead
Posts: 9
Joined: Tue Jan 31, 2017 7:31 pm

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

Post 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).
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

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

Post 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.
User avatar
Shadow Hog
Posts: 173
Joined: Fri Aug 14, 2015 8:56 pm

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

Post 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.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm
Location: Somewhere off Kanagawa

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

Post 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)
    {
        if(e.Thing.bISMONSTER)
            {
            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.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

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

Post 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.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

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

Post 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.
User avatar
unRyker
Posts: 170
Joined: Tue Jul 28, 2015 6:30 am
Location: United States
Contact:

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

Post 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!
User avatar
jpalomo
Posts: 771
Joined: Mon May 17, 2010 9:45 am

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

Post 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?
Post Reply

Return to “Graphic/Audio Patches”