[v1.7.2] Critical Shots - Headshots, Backstabs and Crits!

Projects that alter game functions but do not include new maps belong here.
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.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

Re: [v1.7] Critical Shots - Headshots, Backstabs and Crits!

Post by Mikk- »

Apologies for the double-post but here's v1.7 of Critical Shots!

Download here!

Changelog:

Code: Select all

mk-crits v1.7 changelog

	- New feature: Critical incoming damage multiplier
		- Enemies in the stunned state can take extra damage. 
		- To revert to old crits, set the "Stunned Damage Multiplier" to 1
		
	- Added new cvars to balance Crits & Headshots
		- Crits:
			- No Fast Crits: spam-firing a fast weapon will render you unable to land critical hits on an enemy
				when they next enter their missile state. You must use timing to achieve a crit.
			- Prevent Damage Stacking: Performing a headshot or backstab on a stunned enemy by default will deal
				the damage for the attack + the stunned damage factor. this switch disabled the stunned damage multiplication
				those attacks.
				
		- Headshots
			- Hitscan & Projectile split: I have decided to split the headshot factor into hitscan and projectile mainly because projectiles
				can deal much more damage than hitscan attacks (1d8 vs 1d3), meaning it is no longer as easy to melt a monster with plasma headshots.
			- Reduce Stacked Headshots: this new slider makes it so the damage of stacked headshots (i.e. from a shotgun) deal reduced damage. 
				The first pellet to hit will deal the full headshot multiplier, but any subsequent pellets will be modified by this cvar.
				The range is a multiplier of 0.0 - 1.0, a value of 0 means that any subsequent pellets will receive no boosted damage, whereas 
				a value of 1.0 means that every pellet will deal full headshot damage (the old behaviour).
	
	- Added 2 cvars that control how often (if at all) headshots & backstabs gib. 
		- Default:
			The damage is not modified in any way, sometimes an attack will gib, sometimes it will not
			depends wholly on the damage dealt
		
		- Always:
			If the shot is enough to kill the monster, it will be forced into its Extreme Death.
			This is acheived by modifying the damage to the monster's SpawnHealth * 2.
			
		- Never:
			If the shot is enough to kill the monster, any excess damage is subtracted so it will never enter 
			it's XDeath state via a headshot/backstab
			This is achieved by modifying the damage to the monster's remaining health.
			
		These only ever apply if the damage dealt is enough to actually kill the monster, so it does not affect gameplay. It will however cause some
		funny business with mods like DamNums, because the damage reported may be much lower, or higher than initially dealt.
		(e.g. if backstabs never gib, and you land a berserk backstab on a zombieman the damage will always be 20 or lower, where it should be like, 200-2000)
	
	- Added Team Fortress 2 Critical Hit visual FX.
				
	- Reworked the entire system from an Event Handler, to an inventory item
		- means little for the end user, but is more flexible in some ways.
		
	- Revamped how the menu system into seperate submenus for Criticals, Headshots & Backstabs.
		- This is mainly to accompany the new balance cvars, it makes the menus look tidier.
		
	- Removed the insta-kill cutoff feature, it seemed kinda useless in retrospect.
User avatar
Lagi
Posts: 679
Joined: Sat Jun 23, 2018 12:51 pm
Location: Thou shalt alter thy beliefs with new evidence

Re: [v1.7] Critical Shots - Headshots, Backstabs and Crits!

Post by Lagi »

there is 9 days between your posts. I deeply hope the admins are not so gestapo-crazy here. :D
User avatar
Enjay
 
 
Posts: 26874
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: [v1.7] Critical Shots - Headshots, Backstabs and Crits!

Post by Enjay »

This is still a very nice mod, with loads of cool customisation options.

The only thing to report at the moment is that there are some warnings on startup with developer mode activated:

Code: Select all

Script warning, "mk-crits[20210212].pk3:csh_classes/core.txt" line 48:
Truncation of floating point value
Script warning, "mk-crits[20210212].pk3:csh_classes/core.txt" line 90:
Truncation of floating point value
Script warning, "mk-crits[20210212].pk3:csh_classes/core.txt" line 151:
Truncation of floating point value
Script warning, "mk-crits[20210212].pk3:csh_classes/core.txt" line 196:
Truncation of floating point value
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

Re: [v1.7] Critical Shots - Headshots, Backstabs and Crits!

Post by Mikk- »

You know, I thought it was strange that I wasn’t getting any truncation errors! Funnily enough this happened last year as well when I first released the mod for the exact same reason, I had a recent .ini wipe so my developer mode was reset to default. Ah well at least it is only a minor issue and nothing gamebreaking.
User avatar
Enjay
 
 
Posts: 26874
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: [v1.7] Critical Shots - Headshots, Backstabs and Crits!

Post by Enjay »

Mikk- wrote:Funnily enough this happened last year as well when I first released the mod...
I remember. ;)
Enjay wrote:Cool mod. I look forward to trying it in anger later on but it seems nice so far. You're probably aware but:

Code: Select all

Script warning, "mk-crits[20200404].pk3:zscript.txt" line 214:
Truncation of floating point value
Script warning, "mk-crits[20200404].pk3:zscript.txt" line 222:
Truncation of floating point value
Script warning, "mk-crits[20200404].pk3:zscript.txt" line 223:
Truncation of floating point value
Script warning, "mk-crits[20200404].pk3:zscript.txt" line 228:
Truncation of floating point value
Script warning, "mk-crits[20200404].pk3:zscript.txt" line 255:
Truncation of floating point value
Console warnings with developer messages enabled.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by Mikk- »

I noticed a small bug in some testing this morning in which headshot damage is always reduced by the Stacked Headshot Reduction factor. It was a simple case of checks and flags being set in the wrong order. I also fixed the truncation errors in the startup log.

Download here
Josko
Posts: 92
Joined: Fri Sep 22, 2017 2:30 am

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by Josko »

Wow TF2 Crit Visual Indicator! Awesome! just want I wanted! Altough I've gotten used to the small red flash visual lol

Any possibility to add some Cvar that makes it random instead and with a slider that controls the percentage chance?

Would be super awesome, usually I hit enemies without them seeing me or attacking and can't score a crit, so I usually aim for the heads.


I think it should be mentioned what GZDoom version 1.7.1 mk-crits needs. I played 1.6 mk-crits on GZDoom 4.4.2 and it worked without any errors, when I attempted to run mk-crits 1.7.1 on GZDoom 4.4.2 it crashed, Used GZDoom 4.5.0 instead and it worked flawlessly again!

I don't know what version is minimum but it seems GZDoom 4.5.0 is needed for latest version to work =)
spectrefps
Posts: 26
Joined: Sat Jun 20, 2020 7:41 pm

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by spectrefps »

I only recently discovered this mod an instantly fell in love with it. Have it added to my roster of other mods I run alongside RLArsenal + RLMonsters, and it definitely adds more to the gameplay. I have noticed a few odd interactions with some of the other mods, though one you have covered and explained previously. Just in case anyone else runs it with RL_Monster (monster pack for Doom Roguelike Arsenal), you will not be able to get 'normal' crits on monsters, as they are handled differently from 'normal' monsters. Mikk posted about this previously on here, and as far as I can tell, this has not yet been possible to fix. The second issue is unique to another mod called "Universal Entropy", which changes the height/width/mass of all monsters and barrels (and modifies monster health/speed/pain threshold based on their new sizes). Due to it altering monster sizes randomly (within -some- reason :P), the headshot 'hitbox' area may be well above or below the head of the final sprite. I'm not sure if it's possible to fix this, or if loading Universal Entropy -before- the mk-crits mod would resolve it (not sure if it'd adjust to the 'new' enemy sizes, as I have no idea how the code-magic works underneath it all XD).
Someone64
Posts: 423
Joined: Tue Feb 23, 2016 11:59 am

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by Someone64 »

I just found an amusing trait of the SSG when playing with crits: it can perma-stun enemies. Basically, since enemies have no 'stun cooldown' (grace period after being stunned where they can't get stunned again), you can perma-stun enemies with the SSG because the SSG's fire rate is almost EXACTLY fast enough to hit enemies you stun with it again after their stun ends. It seems that enemies try to attack immediately after their stun ends so this happens extremely consistently. Might wanna add an adjustable option for giving enemies a grace period to prevent that.
User avatar
ClessxAlghazanth
Posts: 159
Joined: Sun Feb 17, 2019 9:29 am

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by ClessxAlghazanth »

I just discovered this mod and quite impressed , it really deserves more appreciation :D

I've been trying it with CH , SoD , DRLA , Champions etc and seems to be very compatible so far , too :)

How is critical hit damage is calculated ? For example , does a pistol or battle rifle have more critical chance , than a shotgun type weapon ?

And where are the setting of Critical Shots are stored in the gzdoom.ini file ? Couldn't locate them atm (having a huge .ini file doesn't help :roll: )

Best regards ,
Someone64
Posts: 423
Joined: Tue Feb 23, 2016 11:59 am

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by Someone64 »

Crits don't happen by chance. If you hit an enemy as it starts to attack you it will guarantee a crit. Unfortunately this does mean that certain enemies from certain mods will get crit constantly for seemingly no reason because they are constantly in an attacking state or something like that like some monsters from DRLA. The weapon you use doesn't matter as long as you time shots properly. An option was added where if you spam fire a weapon like a chaingun, you can't crit so you have to time your first shot rather than just holding fire until the enemy gets crit.

Also, I recommend making lots of ini files to use for different mod sets and including the name of those different ini files in your launcher/batch file. Big ini files cause the game to lag (I found that out the hard way after playing for a year straight with a 3 year old ini file). It's not so prevalent on mods that aren't heavy at first and later when you play more intensive ones, you might not realize that they can run WAY better on your pc than they currently are if you just start with a fresh ini file. I'll edit this post later to tell you where the crit stuff are in it.

EDIT: They start with the prefix csh. The first one in my config is csh_backstab_effect.
User avatar
ClessxAlghazanth
Posts: 159
Joined: Sun Feb 17, 2019 9:29 am

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by ClessxAlghazanth »

Someone64 wrote:Crits don't happen by chance. If you hit an enemy as it starts to attack you it will guarantee a crit. Unfortunately this does mean that certain enemies from certain mods will get crit constantly for seemingly no reason because they are constantly in an attacking state or something like that like some monsters from DRLA. The weapon you use doesn't matter as long as you time shots properly. An option was added where if you spam fire a weapon like a chaingun, you can't crit so you have to time your first shot rather than just holding fire until the enemy gets crit.

Also, I recommend making lots of ini files to use for different mod sets and including the name of those different ini files in your launcher/batch file. Big ini files cause the game to lag (I found that out the hard way after playing for a year straight with a 3 year old ini file). It's not so prevalent on mods that aren't heavy at first and later when you play more intensive ones, you might not realize that they can run WAY better on your pc than they currently are if you just start with a fresh ini file. I'll edit this post later to tell you where the crit stuff are in it.

EDIT: They start with the prefix csh. The first one in my config is csh_backstab_effect.
Thanks for the info , pal :D

I just cleaned up my .ini file a bit by deleting entries related to mods I rarely play , and was able to reduce it from 70kb to 40 kb

I immediately noticed the difference , the random lags that happen here and there are mostly gone :shock:

I can't believe I didn't know this all these years of ZDooming :roll:

By the way , do you happen to know if critical happen to apply to infighting as well ?

Thanks a ton :P
Someone64
Posts: 423
Joined: Tue Feb 23, 2016 11:59 am

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by Someone64 »

The code seems to check what causes the damage when it checks for critical hits so I can say with 90% confidence that monsters can't crit each other. I've also never experienced it in all my time playing. If it does happen, it's a bug.
User avatar
TurboBabyShakes5000
Posts: 26
Joined: Sun Jul 18, 2021 3:22 pm
Graphics Processor: Intel (Modern GZDoom)
Location: The South :(

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by TurboBabyShakes5000 »

I'm enjoying the hell out of this. It adds a skill based element as well some unpredictability to the combat which is great. It also has a lot of possibilities as far as RPG mods go. I use this this all the time.
User avatar
Deon
Posts: 236
Joined: Thu Oct 08, 2020 10:44 am

Re: [v1.7.1] Critical Shots - Headshots, Backstabs and Crits

Post by Deon »

Hi Mikk. What's your opinion about including your mod in bigger projects with full credit?

I am doing a hobby cyberpunk-ish project where I have player stats, one of them is luck. I was planning to implement very basic crit system, but yours is just STELLAR so I would like to use this one instead.
Obviously I would have to do some changes because all my monsters are custom-made, and some of them get headshots in inappropriate places, and also I want to tie the crit chance to LUCK stat of the player.

Would it be okay if I bundled it in, with your CREDITS information included?

P.S. If you want to learn more before saying yes/no, there are a bunch of videos on one of my youtube channels, for example
Spoiler:

Return to “Gameplay Mods”