Jump to content

zombie, animal, player tags in DamageModifier


JDStrawesome

Recommended Posts

I've been handling the modding for my gaming group, compiling and authoring mods to satisfy their whims.

 

One thing I've been having a hard time with is modding zombie damage models to be more like what my group feels is the classic zombie: zombies that soak tons of damage, can be dismembered and battered, but don't die until you brain them.

 

So, I went about building out a mod trying some different strategies.

 

The first easy success was to append a passive_effect DamageModifier, and scale down the player damage vs upperbody and lowerbody.

 

This worked great in testing, except that now animals are uber. A deer is unkillable except for a well aimed headshot.

 

Looking around, I couldn't find a definitive list of tags that will work in the DamageModifier effect. But I could see that armor targets a variety of things; body parts, armor slots, weapon type, block material... I also noticed that entities are assigned tags like player, animal, zombie.

 

These entity tags do not seem to be valid for DamageModifer. But I'm wondering, does anyone know of valid tags that could differentiate between player, animal, and zombie?

 

[...]

 

While troubleshooting, I tried some other strategies, but didn't like the results.

 

I tried setting zombie physical damage resistance on all zombie types. But it seems physical damage is an absolute value that simple subtracts from incoming damage. This isn't what my players are looking for, unfortunately. Also, when you shoot an armored zombie, they audibly plink like sheet metal.

 

I tried scaling all zombie health up by large factor, and then scaling up headshot damage by even more. Kinda works, except that scaling damage also scales the physics impulse. So a headshot will send a zombie cartwheeling through the air.

 

My next idea is to investigate whether I can assign one of the tags that do work in DamageModifier that would be relatively safe to assign to zombies, or declare my own valid tag, to assign to zombies.

 

[...]

 

That's where I'm at, currently. I'm looking for those tags that differentiate entity type... or any other outside the box thinking to accomplish zombies that can soak a ton of damage to their bodies, but go down easily with a headshot without imparting massive physics impulses.

 

Thanks for any help!

Link to comment
Share on other sites

Try <requirement name="EntityTagCompare" target="other" tags="zombie"/>. Maybe something like this added to the base player template in entityclasses.

 

Edit: revised code

 

<effect_group>
<requirement name="EntityTagCompare" target="other" tags="zombie"/>
	<passive_effect name="DamageModifier" operation="perc_set" value="0.1"/>
	<passive_effect name="DamageModifier" operation="perc_add" value="2" tags="head"/>
</effect_group>

 

Edit 2: Ah I missed where you said upper/lowerbody was already working. Yea, adding the requirement in should work. From what I've seen you can either place it first in a list of effects in their own effect_group to apply to all, or you can enclose one/multiple requirements within passive_effect/triggered_effect tags. eg.

 

 

<passive_effect name="DamageModifier" operation="perc_set" value="0.1">

<requirement name="EntityTagCompare" target="other" tags="zombie"/>

</passive_effect>

Link to comment
Share on other sites

Try <requirement name="EntityTagCompare" target="other" tags="zombie"/>. Maybe something like this added to the base player template in entityclasses.

 

[...]

 

Hey! This was great advice.

 

It didn't work as written. So I did a find in file over all the xmls to see <requirement> tag syntax.

 

This formatting works:

<passive_effect name="DamageModifier" operation="perc_set" value="0.01" tags="upperbody, lowerbody">
<requirement name="EntityTagCompare" target="other" tags="zombie"/>
</passive_effect>

 

I'm a step closer! Now to tweak the dismemberment mechanics!

Link to comment
Share on other sites

It should be that if you have a requirement in an effect_group not nested within a triggered/passive_effect it will apply to the whole group, it may have been an issue with using perc_set=0.1 then stacking the perc_add "head" ontop. But yea, just using upper/lowerbody is probably the more correct way to do it. Edit: Ah, also I should've specified to add a whole new effect_group this way, not add it to an existing one. You can have multiple effect_groups on items etc.

 

The only issue with using target="other" I've found in messing with effects myself is that it only considers an "other" a target once you've done damage to it (also perhaps received damage), and effects are applied after the damage is done. What this means is the first shot on a target won't have the modifier applied to the damage. This shouldn't be a big issue except with weapons powerful/almost powerful enough to kill zombies with a single body shot. This will mainly only happen once they have higher perception levels and mods on guns like a magnum or shotgun with slugs.

 

This also has the weird effect where once you have killed a zombie, it still considers its corpse your "target" until you damage a different entity, and any effects will stay applied until that happens.

Link to comment
Share on other sites

So this may be a better way to do this. Instead of making the requirement only zombies, you could set the base DamageModifier at 0.01 with no requirement to be in effect at all times, then create another DamageModifier and invert the requirement to non-zombies. This should avoid the target="other" first shot issue. The resulting effect of this means instead of zombies taking a lot of damage on the first shot, animals will take very little damage on the first shot. Maybe a better tradeoff? Here is what I mean.

 

<passive_effect name="DamageModifier" operation="perc_set" value="0.01" tags="upperbody, lowerbody"/> --- No requirement, always active
<passive_effect name="DamageModifier" operation="perc_set" value="1" tags="upperbody, lowerbody">
<requirement name="EntityTagCompare" target="other" tags="zombie" invert="true"/>
</passive_effect>

Link to comment
Share on other sites

Ok, with your advice, here is the end result of the zombie damage model portion of the mod...

 

<append xpath="/entity_classes/entity_class[@name='playerMale']/effect_group">
	<passive_effect name="DamageModifier" operation="perc_set" value="0.01" tags="upperbody, lowerbody"/>
	<passive_effect name="DismemberChance" operation="base_set" value="0.05"/>
	<passive_effect name="DamageModifier" operation="perc_set" value="1" tags="upperbody, lowerbody">
		<requirement name="EntityTagCompare" target="other" tags="zombie" invert="true"/>
	</passive_effect>
	<passive_effect name="DismemberChance" operation="base_subtract" value="0.05">
		<requirement name="EntityTagCompare" target="other" tags="zombie" invert="true"/>
	</passive_effect>
</append>

 

As you suggested, this sets the damage modifier and dismemberment crit, then reverts it for anything non-zombie. Works well! This makes it so you can knock a zombie around all you like, and it will take quite a bit of hits to finally kill them with body shots, but a headshots behave like vanilla 7d2d. You can also focus on limbs and knock them off.

 

To preserve dismemberment I set the relevant perks from base_set to base_add so they stack with the new default dismemberment.

 

All zombies now have scaled and adjusted knockdown and knockprone values:

<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='KnockdownProneDamageThreshold'][@value='0.5']/@value">0.02</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='KnockdownProneDamageThreshold'][@value='0.45']/@value">0.018</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='KnockdownKneelDamageThreshold'][@value='0.4']/@value">0.016</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='KnockdownKneelDamageThreshold'][@value='0.38']/@value">0.0152</set>

 

^^Has a nice feel to it. It takes about 2-3 power attacks for a low level player to knock down typical lightweight zombies. Spray and pray moments have a nice energy to them where you knock down zombies and sometimes you pop their heads, and sometimes it seems like they just keep getting up. >:D

 

And finally, most players might not approve of this, but we halved the movement of all zombies across the board and set our spawn count way up... so we get a mix of shambling hordes and relentless power walking hordes. Nights are scary, but you can be out in them and usually survive without lighting if you concentrate on running and hiding.

 

We're going to give this mod a play for a week and see how it feels.

 

Thanks for the help, Deceptive Pastry.

Link to comment
Share on other sites

@JDStrawesome, Do you have a finished modlet for this?

 

We are still testing and tweaking this. It is largely a mod specifically geared toward our group's desires.

 

But here is the relevant code, which would be added to an entityclasses.xml mod:

 

<?xml version="1.0" encoding="utf-8"?>
<configs>

<!-- the default headshot passive effect is +0.5 or a
	total of 150% We find that passive effect by its
	tag and set it to +1.0 or a total of 200% -->
<set xpath="/entity_classes/entity_class[@name='playerMale']/effect_group/passive_effect[@name='DamageModifier'][@tags='head']/@value">1</set>
<!--zombie vultures and dogs become way to 
	overpowered if they share the same 
	characteristics as human zombies, so we added a
	new tag 'vulture' for zombie animals (except
	bears. They have big heads anyway. -->			
<set xpath="/entity_classes/entity_class[@name='animalZombieVulture']/property[@name='Tags']/@value">animal,zombie,hostile,vulture</set>
<set xpath="/entity_classes/entity_class[@name='animalZombieVultureRadiated']/property[@name='Tags']/@value">animal,zombie,hostile,vulture</set>
<set xpath="/entity_classes/entity_class[@name='animalZombieDog']/property[@name='Tags']/@value">animal,zombie,hostile,vulture</set>

<append xpath="/entity_classes/entity_class[@name='playerMale']/effect_group">
	<!--step 1: scale damage to tags upperbody and
		lowerbody to 50% (we've been tweaking this
		to suit our tastes.) We've also set
		dismemeberment to 20%. -->
	<passive_effect name="DamageModifier" operation="perc_set" value="0.5" tags="upperbody, lowerbody"/>
	<passive_effect name="DismemberChance" operation="base_set" value="0.2"/>
	<!--here we reset damage modifier, but put a
		requisite that it only apply to anything other
		than zombies. Also reset dismember chance. -->
	<passive_effect name="DamageModifier" operation="perc_set" value="1" tags="upperbody, lowerbody">
		<requirement name="EntityTagCompare" target="other" tags="zombie" invert="true"/>
	</passive_effect>
	<passive_effect name="DismemberChance" operation="base_subtract" value="0.2">
		<requirement name="EntityTagCompare" target="other" tags="zombie" invert="true"/>
	</passive_effect>
	<!--here we additionally reset damage modifier
		for vulture tagged entities (includes dogs) 
		because vultures and dogs still qualify as 
		zombies and end up excluded from our previous
		reset.-->
	<passive_effect name="DamageModifier" operation="perc_set" value="1" tags="upperbody, lowerbody">
		<requirement name="EntityTagCompare" target="other" tags="vulture"/>
	</passive_effect>
</append>


<!-- reduce all zombie speeds -->
<!-- 'Romero Zombies' -->
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='ApproachSpeed'][@value='0.2']/@value">0.1</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='ApproachSpeed'][@value='1.35']/@value">0.45</set>

<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='NightApproachSpeed'][@value='1.0']/@value">0.33</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='NightApproachSpeed'][@value='1.1']/@value">0.36</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='NightApproachSpeed'][@value='1.35']/@value">0.45</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='NightApproachSpeed'][@value='1.5']/@value">0.5</set>

<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='PanicSpeed'][@value='1.2']/@value">0.4</set>

<!-- scale and adjust knockdown/knockprone values to roughly 4x expected difficulty. 50% feels right. -->
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='KnockdownProneDamageThreshold'][@value='0.5']/@value">0.25</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='KnockdownProneDamageThreshold'][@value='0.45']/@value">0.225</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='KnockdownKneelDamageThreshold'][@value='0.4']/@value">0.2</set>
<set xpath="/entity_classes/entity_class[starts-with(@name, 'zombie')]/property[@name='KnockdownKneelDamageThreshold'][@value='0.38']/@value">0.19</set>

</configs>

 

Originally we had the damage scaling at 1% vs zombies, but we have since tried different values and settled on 50%. I personally like the 1% damage scaling. It makes dismemberment and headshots feel like the sole method of damaging and killing zombies.

 

We also set these values in buffs.xml to make dismemberment perks more appropriate for our changes:

 

<configs>
<!-- change dismember perk to add to base rather than set -->
<set xpath="//perk[@name='perkDeepCuts']/effect_group[1]/passive_effect[1]/@operation">base_add</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[1]/passive_effect[2]/@operation">base_add</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[1]/passive_effect[3]/@operation">base_add</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[1]/passive_effect[1]/@value">0.1</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[1]/passive_effect[2]/@value">0.2</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[1]/passive_effect[3]/@value">0.3</set>

<!-- same with chainsaw exception -->
<set xpath="//perk[@name='perkDeepCuts']/effect_group[2]/passive_effect[1]/@operation">base_add</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[2]/passive_effect[2]/@operation">base_add</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[2]/passive_effect[3]/@operation">base_add</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[2]/passive_effect[1]/@value">0.1</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[2]/passive_effect[2]/@value">0.2</set>
<set xpath="//perk[@name='perkDeepCuts']/effect_group[2]/passive_effect[3]/@value">0.3</set>
</configs>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...