Combined Damage Types

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Doctornull
Sher'Tul Godslayer
Posts: 2402
Joined: Tue Jun 18, 2013 10:46 pm
Location: Ambush!

Combined Damage Types

#1 Post by Doctornull »

How would I go about making a damage type which combines two existing types?

Currently there are damage types like Dreamforge and Void which take the damage total and split it in half, but that's not what I'm looking for. Splitting the damage into two or more parts has some unintended consequences which I'd like to avoid.

Basically, for a combined damage type, I want:

- Attacker uses BEST boosts for any constituent elements.

- Defender uses WORST resistance against the attack.

- Specialized defenses like mental save to reduce Mind damage are calculated BEFORE choosing worst damage.

- All perks for inflicting that damage apply: if you inflict a 301 point critical of combined type "Darkness and Fire", that could trigger both Endless Woes and Elemental Surge. Prodigies should probably only apply once per round, so if you used a combined damage type Thunderburn ("Fire and Lightning") you'd at most get either the Fire or the Lightning perk from Elemental Surge.

- All perks apply for suffering the damage: if you have 70% fire resist and 0% mind resist, you will very likely use your Mind resistance when you suffer Dreamforge ("Fire and Mind") damage, but you will also get the Elemental Harmony perk for Fire. If you suffered Thunderburn damage, you'd get either the Fire or the Lightning perk, determined randomly.

-----

My design goals are:

Interesting effects aren't inherently suboptimal. Right now mono-focus on a single damage type is generally better than using split damage effects, except when you need split-damage effects to punch through a Bone Shield.

High-level effects can expand their average utility without raising max damage. With this sort of combined-damage effect, higher level spells could deal higher average damage without dealing higher max damage. This would mean resistance penetration would be less necessary on the whole, and allow other types of builds than mono-focus on a single damage type.

Damage flavor talents can become purely beneficial. Say you're a Wyrmic going big in the Venom Drake tree. It makes sense that Acid Spit would barely tickle a Venom Wyrm, but what about Dissolve? Why does your big sharp sword suddenly fail its sharpness check? With a combined damage type ("Acid and Physical"), the talent can ensure that the attacks it grants you are no worse than your regular physical attack would have been.

Obviously in the previous example, if your melee attack base damage type was Fire because you're using a magestaff or whatever, your combined damage type would be "Acid and Fire" rather than "Acid and Physical". This could allow a lot of awesome melee spells which I look forward to writing.

-----

Is something like this possible for the engine?
How much of an overhaul would be needed?

Thanks!
Check out my addons: Nullpack (classes), Null Tweaks (items & talents), and New Gems fork.

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: Combined Damage Types

#2 Post by lukep »

So if a character with +55% fire damage shoots fire/acid damage at a red crystal (100% fire resist, 0% acid resist), it would do 155% damage?

This should be possible, but might require a significant rework of the damage projection code in order to have it work.

Here's how I would try to do it:

Add a parameter to the damage projector that says that it is a check for calculation purposes, and not a real projection (fakeprojection = true?). This will be used in several places later.

Next, make sure that the order that boosts and defenses are applied in is correct, and add breaks so that you can calculate things at the correct places.

Next, run the attacker's part of the code (+damage% etc...) for each constituent damage type. Save the largest number.

Using the number from the previous step, run the defender's code (resistances, blocking, AM shield etc...). You may want to run it through each step, and save after each, I'm not sure. Save the largest result.

Something would have to be done here for damage to health, shields, breaking blocking etc, but I'm not sure how.

I can't think of a way to get it to work with Prodigies or other effects based on damage type, though.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

Castler
Thalore
Posts: 153
Joined: Mon Mar 25, 2013 10:09 pm

Re: Combined Damage Types

#3 Post by Castler »

This could open a lot of interesting possibilities, but it seems like a lot of rework for damage_types.lua. Shields, psionic shields, single-type talents (Born into Magic, Antimagic Shield, etc.), everything-but-single-type talents (Damage Smearing, Stone Fortress), and probably more would all need updating.

As lukep suggests, some of the combinations could also get weird, especially once you start considering the various talents and equipment. Would a fire slash be simultaneously physical enough to bypass a mindslayer's thermal psionic shield and fiery enough to bypass the mindslayer's iron shield?

As a compromise, how about keeping the split-damage-in-two behavior but split the damage proportional to damage boost - (resist - resist penetration)? A fire slash could do 50% fire / 50% physical by default; when used against an enemy with resist fire 50%, it would do 33% fire / 66% physical; when used with +100% fire damage it would do 66% fire / 33% physical.
Qi Daozei (QDZ) - an Oriental-themed fantasy game for T-Engine. ToME Tips - auto-generated spoilers for ToME.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Combined Damage Types

#4 Post by HousePet »

Its an interesting idea, but it looks like it would be a lot of work, be overpowered and add confusion.
My feedback meter decays into coding. Give me feedback and I make mods.

Doctornull
Sher'Tul Godslayer
Posts: 2402
Joined: Tue Jun 18, 2013 10:46 pm
Location: Ambush!

Re: Combined Damage Types

#5 Post by Doctornull »

lukep wrote:So if a character with +55% fire damage shoots fire/acid damage at a red crystal (100% fire resist, 0% acid resist), it would do 155% damage?

This should be possible, but might require a significant rework of the damage projection code in order to have it work.
Yeah, that's exactly right.

I don't think running the existing projector multiple times is a viable solution, though. There's just too many moving parts -- unclean parts, too, with side effects.

Undoing the side effects, like if the defender gets a Mindpower crit on AM shield, looks kind of horrible to me.

Castler wrote:This could open a lot of interesting possibilities, but it seems like a lot of rework for damage_types.lua. Shields, psionic shields, single-type talents (Born into Magic, Antimagic Shield, etc.), everything-but-single-type talents (Damage Smearing, Stone Fortress), and probably more would all need updating.
Damage Smearing should work fine. Until the corner-cases are hammered out, it's not hard to just avoid making problematic combos: like there's hardly anything which uses the Void type, and not much else mixes with Temporal outside of Physical+Temporal in Matter spells.
Castler wrote:As lukep suggests, some of the combinations could also get weird, especially once you start considering the various talents and equipment. Would a fire slash be simultaneously physical enough to bypass a mindslayer's thermal psionic shield and fiery enough to bypass the mindslayer's iron shield?
Off the top of my head, I think attacks which are subject to Armor should be blockable by a shield, mostly because the alternative makes shields a bit too weak, but that's certainly subject to discussion.

So in this case, you'd compare resistances, drop the results into thermal shield vs. the Block value, and pick the bigger number.

Note that you'd ALWAYS give the defender his +2 Psi since you DID touch the thermal shield even if it wasn't used in the final damage calculation, and you'd ALWAYS gain Counterattack debuff if you used any component damage type which could have been blocked by the shield.

-----

As an aside, some kind of "what-if" projector could also be used by the AI to evaluate talent choices. Let the AI pick 5 random usable talents, run them through the test projector as a fitness metric, and then actually go with the expected best attack.
Check out my addons: Nullpack (classes), Null Tweaks (items & talents), and New Gems fork.

Post Reply