please discuss armour, defense, and attack ideas here

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Message
Author
tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

please discuss armour, defense, and attack ideas here

#1 Post by tiger_eye »

Minions of DarkGod! There have been many whispers recently regarding the effectiveness and behavior of armour and defense; for example, here, here, and here. For every voice out in the open, there are always ten more whispers in the shadows. Come out now and let us aspire to be the cogs of DarkGod's decision making processes! What else are you aspiring for :P ? Come discuss armour and defense, and think not only of what you wish to see, but of what you believe DarkGod wishes to see, as that is the only way we may make any progress...

By the way, here's a preview of the most radical thing I propose at the end of this post. It's also perhaps the simplest :wink:

Code: Select all

proposed = damage * (1 - 0.01*resistance*(1 + armour/damage) )
On to business...

The main issue with defense and attack, it seems, is that the large majority of situations occur in the tails (5% hit chance or 95% hit chance for melee). This means that small differences in defense or attack in these situations have no effect whatsoever! This probably isn't the desired behavior. To illustrate, a typical high defense (for both players and NPCs) is 30, and the highest defense is around 50 or 60. Attack is usually much larger than this. Even an attack of 80 has the maximum chance of hitting (95%) against a defense of 55 if the target is seen. If the target is invisible, however, then an attack of 80 has the minimum chance of hitting (5%) against a defense of 55. Does this seem right to you? With this in mind, I think my next character will focus on invisibility and defense :-P

Susramanian offered an approach to deal with this issue here. The main idea is to keep what ToME already uses, just soften the tails in a reasonable way. Here is one method using Susramanian's approach:

Code: Select all

current(atk,def) = 1 / (1 + exp(-(atk-def)/7) )   // this is 99% equivalent to the current method, and simpler
softener(atk,def) = atk / (atk + def)
hit(atk,def) = 50*( current(atk,def) + softener(atk,def) )   // in percentage, [0,100]
Using this method, hit chances that were formerly between 25%-75% remain basically the same. The tails, however, are better behaved (i.e., "Keep it the same... just better!"). A useful rule of thumb for the tails is that if an attack is four times the defense (atk = 4*def), then there is a 10% chance the attack will miss. Moreover, the tails behave linearly such that if you double the attack, there would be a 5% chance of missing, and if you doubled the defense, there would be a 20% chance of missing. It's worth noting that the converse is also true: if defense is four times the attack (def = 4*atk), there is still a 10% chance of being hit. Also, early game dynamics aren't really affected by this, because there are no tails when both attack and defense are small.

Here is a comparison of the methods when the target is seen (contours every 5%):
atk_def-both.png
atk_def-both.png (150.16 KiB) Viewed 8858 times
and here is a comparison of the methods against invisible targets (contours every 5%):
atk_def_inv-both.png
atk_def_inv-both.png (163.49 KiB) Viewed 8858 times
Hence, the new method using Susramanian's approach is mostly the same... just better!

Armour is a different beast altogether. It has recently undergone major changes, and it is likely to undergo more major changes in future releases. Thus, the most salient questions at this point are "What should armour do? How should it behave?" It was formerly a flat reduction of physical damage, and it is currently a percentage reduction of physical damage. It may be best to have a combination of these two in some way.

I'll illustrate how I think armour should work (and others please chime in how you think armour should work). If you throw a small rock at a person wearing a leather jerkin, they'll certainly feel it and may get bruised. If you throw several small rocks at the same person, they'll probably get seriously injured :twisted: . On the other hand, if a person is wearing voratun plate armour, they probably wouldn't even know a rock was thrown at them but for hearing the *clink* against their armour. This argues for a degree of flat damage reduction from armour. In other words, an attack damage of 9 shouldn't do 3 damage against 100 armour (as currently happens); it should do zero or near zero.

Let's consider the other extreme: an uber-powerful voratun greatmaul versus a leather jerkin and, say, steel plate armour. There may not be a large difference against such a powerful weapon, but there should still be a difference between the two armours. This argues, perhaps, for a percentage reduction of damage when incoming damage is larger or much larger than the armour. Again, this is what is currently implemented.

Current damage taken with armour:

Code: Select all

current = damage * 0.99^armour
And here is a method that behaves as I described above, and it remains similar to what is currently done (i.e., "the same... just better!"):

Code: Select all

proposed = damage * (0.99 - 0.01*armour/damage)^armour
Let's compare by looking at percent damage taken, [ouptut damage]/[input damage], (contours every 10%):
armour-both.png
armour-both.png (72.53 KiB) Viewed 8858 times
This is what I think. What do you think? Love the old system? Love the new system? Think it should be completely different? Let us know!
Last edited by tiger_eye on Mon Mar 07, 2011 8:49 pm, edited 1 time in total.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: please discuss armour, defense, and attack ideas here

#2 Post by tiger_eye »

This is a somewhat tangential idea, but I think it could make a lot of sense to tie together armour and resistances in some way. Think about the consequences! If you tie in armour with elemental resistances, then you could also have armour-peircing for elemental and other damage types. This allows more ego abilities for equipment. Can't seem to kill something with your flame spells? Pump up the APR of your wildfire, and incinerate them with Hellfire :twisted: .

I think the basic behavior of how armour and resistances should interact is pretty clear:

(1) If 0 resistance, take all damage.
(2) If 0 armour, reduce damage according to resistance.
(3) If amor > 0 and resistance > 0, take less damage.

One issue that should be addressed is whether resistances should be (a) used like armour with "0.99^resistance" as the base form, or (b) used as they are now as a straight percentage with "1 - 0.01*resistance" as the base form. I think the latter make sense from a player usability standpoint and for allowing NPCs to have 100% resistances, which makes sense for things like Faeros from volcanoes.

First, let's try adding resistance to the armour method I proposed above:

Code: Select all

proposed = damage * (0.99 - 0.01*armour/damage)^resistance
Easy enough. Let's look at the percent damage taken with incoming damage of 20 (left) and 100 (right) (contours every 10%):
resist_exponential.png
resist_exponential.png (123.39 KiB) Viewed 8857 times
Now let's linearize the previous equation such that 100% resistance means 100% resistance:

Code: Select all

proposed = damage * (1 - 0.01*resistance*(1 + armour/damage) )
(Sweet, that last equation has a nice, easy form :-)). Let's look how it behaves (contours every 10%):
resist_percentage.png
resist_percentage.png (100.17 KiB) Viewed 8857 times
Gravy.

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: please discuss armour, defense, and attack ideas here

#3 Post by Grey »

Gravy indeed - very nice results. I support all of your suggestions.

They're not easy to explain to players in a transparent way, but then neither is the current system. What you propose has the advantage of making sense, being more intuitive for the player to understand without having to see equations, and also producing a more balanced system for both player and enemies.

Also more elemental resistance piercing would be nice, though it should still be rare.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Postman
Archmage
Posts: 335
Joined: Fri Dec 03, 2010 5:34 pm

Re: please discuss armour, defense, and attack ideas here

#4 Post by Postman »

IMHO hit chance is good enough now and shouldn't be changed. Changing it would make TOME completely different game and would require rebalance of all equipment, monsters and talents. Would be more logical just to start different mod if someone don't like it.

Current armor is not so consistent though - that the linear damage increase don't cause armor to crumble definitely is not good, armor should have structural break threshold. Proposal looks good for me, but with huge superhuman damage we are having there should be some rare super-armor in the game.

Nevuk
Thalore
Posts: 189
Joined: Thu Jul 27, 2006 2:50 am

Re: please discuss armour, defense, and attack ideas here

#5 Post by Nevuk »

The idea behind the current armor system is merely that it is the easiest to balance game-wise. A more specific example, you can balance all armor skills around the health skill utilizing the effective hp method. I've simplified the numbers a bit to make math easier when talking about icy skin.

I do think that 1% is probably too low, however past 2% may be a bit excessive (discussing .99 vs .98). Icy Skin is probably the talent with the highest armor in an easily calculable fashion - at level 5, it offers around 25 armor depending on Willpower. So each point will offer about 5% increase in the damage it takes to physically kills someone. Health offers 40 hp per level - 200 at level 5. I'm going to say the average character in tome has between 300-500 hp. For a point of icy skin to be worth the amount of hp offered by health requires 800 hp - 5% of 400 is 20. 5 points of it with 400 hp is worth a 100 hp increase.

Now, it does extend that icy skin is far better than health because it also does cold damage. However, I would think that it should extend that it should offer more of an advantage being a class ability unique to Wyrmics. Icy skin is also low enough on the skill tree to imply it being an early game talent, which the damage indicates but the damage reduction does not. Wyrmics may not need this sort of a buff, as they already have crazy amounts of survivability with large hp pools and low failure rates.

If each point of armor were to be worth 2% (.98 instead of .99) it would balance Icy Skin with health, but it's up to people as to whether or not that's good. Individual armor skills probably need buffed aside from that (heavy/massive training).

Postman
Archmage
Posts: 335
Joined: Fri Dec 03, 2010 5:34 pm

Re: please discuss armour, defense, and attack ideas here

#6 Post by Postman »

@Nevuk I don't completely agree. Armour should be more a lot more effective then health. Think about it - full plate male knight is definitely better protected then naked professional athlete.

Nevuk
Thalore
Posts: 189
Joined: Thu Jul 27, 2006 2:50 am

Re: please discuss armour, defense, and attack ideas here

#7 Post by Nevuk »

Postman wrote:@Nevuk I don't completely agree. Armour should be more a lot more effective then health. Think about it - full plate male knight is definitely better protected then naked professional athlete.
That's fine, if you wish to have hp be much more effective than hp you just have to increase the value on it. This makes logical sense to me but it may not make as much balancing sense. Twice as effective as hp is .96, etc. There's no inherent danger to increasing the strength of armor considerably, aside from the difficulty of rebalancing the later parts of the game to account for significantly better armor.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: please discuss armour, defense, and attack ideas here

#8 Post by tiger_eye »

Nevuk, I'm glad you chimed in. I should have referenced your topic "Effective Hp Cursed and Armor" in my first post:

http://forums.te4.org/viewtopic.php?f=39&t=24915

I'm pretty sure that topic is what motivated the change to the new armour system--and for good reason. As discussed in the topic, the former system was too powerful and too easy to abuse. For example, an armour of 50 would completely cancel 50 damage, so it became really hard to get damaged by physical attacks. Using the armour method I proposed above, 50 armour against 50 damage would still receive 36% of the damage, which is 18. Hence, my proposal still deals damage when the incoming damage is less than the armor (so it can't be abused like the former system), it just does less relative damage which is how armour ought to behave imho.

I should note that this isn't the only recent idea for armour. Marcotte proposed a method that does 50% damage if armour and incoming damage are equal:

Code: Select all

marcotte_damage = damage / (1 + armour/damage)
If you're curious, this method and others were discussed (along with many, many plots) here:

http://forums.te4.org/viewtopic.php?f=41&t=25055

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: please discuss armour, defense, and attack ideas here

#9 Post by tiger_eye »

Postman wrote:IMHO hit chance is good enough now and shouldn't be changed. Changing it would make TOME completely different game and would require rebalance of all equipment, monsters and talents.
To be honest, I felt much as you do when I was discussing this with Susramanian here. I was thinking "Attack and defense don't seem broken, so why try to fix it?" I was also afraid of making a radical change to it, because, as you said, the game (equipment, monsters, talents, etc) was designed around the current system. I was also afraid of unintended consequences.

But, as I looked deeper into that matter, I realized Susramanian's objection was valid: much of the game takes place in the tails (95% and 5%). So, while it may not be broken, it doesn't appear to be fully functioning. Susramanian's and my proposal was just one way to keep the current system while making the tails (i.e., the extremes) function properly, so it won't be necessary to completely rebalance the game using the proposal. In fact, I'm trying the new method out in the latest svn (careful, I've heard it may eat your cat ;) ). I'm having it print the old hit chance and the new hit chance, and the results seem nothing but reasonable to me (ymmv, as I may be a little biased :P).
Postman wrote:Current armor is not so consistent though - that the linear damage increase don't cause armor to crumble definitely is not good, armor should have structural break threshold.
Agreed :D

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: please discuss armour, defense, and attack ideas here

#10 Post by tiger_eye »

Postman wrote:Current armor is not so consistent though - that the linear damage increase don't cause armor to crumble definitely is not good, armor should have structural break threshold
Hmm, there is a fine point here. Do you think if the damage is much larger than the armour that 100% damage should be dealt? Or, should the damage dealt converge to a fixed percentage if damage is much larger than armour?

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: please discuss armour, defense, and attack ideas here

#11 Post by tiger_eye »

Okay, I guess the checkHit formula proposed above may not be behaving quite as we would like. In particular, the tails take a really long time to get to the typical maximum hit chance of 95%. For example, for large values of def and atk, you need to double your atk (a.k.a. accuracy) to go from 80% hit chance to 90% hit chance. Furthermore, you also need to double your atk to go from 90% hit chance to 95% hit chance. Hence, you need to quadruple atk to go from 80% to 95%. I don't know, maybe this is the way we want it, or maybe it isn't. Anyway, I'm going to float another idea out there to see what people think of it.

Instead of averaging two differently behaved functions as we did above, I propose a single simple formula to use:

Code: Select all

hit = 100 * (atk+5)^2 / ((atk+5)^2 + (def+5)^2)
or, equivalently,
hit = 100 / (1 + ((def+5)/(atk+5))^2)
This is a Cauchy-like function, and the "+5" constants are to make the function behave reasonably for small def and atk. And by reasonable, I mean this behaves basically the same as the current checkHit when {atk, def} < 20. Please take a look:

(contours every 5%)
cauchy_checkHit.png
cauchy_checkHit.png (104.23 KiB) Viewed 8715 times
So how do the tails behave? Less drastically than before. Listed below are the values atk need to be relative to def to reach a given hit chance percentage:

95%
atk = 4.36*def + 16.8

90%
atk = 3*def + 10

80%
atk = 2*def + 5

69%
atk = 1.5*def + 2.5

59%
atk = 1.2*def + 1

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: please discuss armour, defense, and attack ideas here

#12 Post by tiger_eye »

Since checkHit is used for many things in the game that may not be of the same scale, I figure it makes sense to have a "scale" parameter for whatever checkHit formula is used to give it additional flexibility. I do this below for two formulas:

This is the Cauchy-like formula that I introduced the previous post:

Code: Select all

offset = offset or 5
scale = scale or 1
if atk < def then
        local r = (def + offset) / (atk + offset)
        hit = 50 * (scale + 1) / (scale + r*r)
else
        local r = (atk + offset) / (def + offset)
        hit = 100 - 50 * (scale + 1) / (scale + r*r)
end
and this is a scaled, symmetric logistic-like function that is similar to "one" in how checkHit currently works:

Code: Select all

offset = offset or 4
scale = scale or 5
hit = 100 / (1 + exp(-(atk - def) / (offset + (atk + def)/scale)))

edge2054
Retired Ninja
Posts: 3756
Joined: Fri May 28, 2010 4:38 pm

Re: please discuss armour, defense, and attack ideas here

#13 Post by edge2054 »

I'm not motivated to read all this (because only half of it I'd even understand) but I did want to offer some in game accuracy numbers from the character I built last night.

Level 14 Shalore Zerker.

Relevant talents

Weapon Mastery (2/10)
Precise Strikes (1/5)
Berserker (5/5)
Perfect Strike (1/5)

I won't go into stats or equipment simply because kit is so easy to find right now. I have not pumped dex. Been focusing solely on strength and con but I do plan to pump dex once I can to further increase my accuracy through natural dex leveling and zerker and precise strikes. I'm using a quick weapon to offset the precise strikes speed penalty and plan to continue in that vein (note that I fixed precise strikes on my local copy so it wasn't abusive because it was part of my initial build idea, I reported the bug in another thread).

Now the good stuff. I have 74 accuracy at level 14. 174 if I pop Perfect Strike. As you can see by my 2/10 weapon mastery talent I have not sacrificed generic points to get this. As you can see by my other talents I have not sacrificed class talents either. As I push Dex up and max out precise strikes (as much for the crit bonus as the hit bonus) I expect my accuracy to as much as double.

Long story short, I've liked the hit changes. I really like that they make talents that increase hit more valuable (I wouldn't consider putting points in precise strikes if it wasn't for the changes let alone perfect strike which I may bump up a bit if I have enough class points left). I'd like to see the progression scaled back as we talked about on IRC. Maybe 90% hit at 2 * defense, 95% at 4* defense, and 100% at * 8 (for those that really want to push misses off the board).

I think as things stand you can get away with typical hit numbers. If you really really need to land an attack (say a stun) you can use Perfect Strike first (assuming you have it of course).

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

Re: please discuss armour, defense, and attack ideas here

#14 Post by lukep »

I agree that armour should fully negate small amounts of damage, but none of the current, smooth formulas do that that I saw. An easy way to do that would be to change all damage reduction above 75% (or 90%, or 60% or whatever) to complete nullification. This leads to canceling small amounts or damage, at the cost of some smoothness at the boundary to zero damage.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: please discuss armour, defense, and attack ideas here

#15 Post by tiger_eye »

Alright, I'm going to try to clearly explain with words and examples a new possible armour system, and I'd like to know what you think of it. First, let's define the terms:

Attack : incoming damage of physical attack
Damage : final damage
PhysResist: max % damage reduction
Armour : armour value

Here is the proposal summed up in one sentence: Absorb Armour damage of Attack up to PhysResist percent of Attack.

For example, an Attack of 100 against 30 PhysResist and 30 Armour would do 70 Damage (reduced by 30 points, or 30%). Similarly, an Attack of 150 against 50 PhysResist and 75 Armour would do 75 Damage (reduced by 75 points, or 50%).

In the above examples, if either PhysResist or Armour were increased by any amount, the Damage of the Attack would remain exactly the same. Conversely, if either PhysResist or Armour were decreased, then the Damage of the Attack would also decrease.

Hence, in general, the best strategy would be to maximize both PhysResist and Armour in such a way to keep [Expected Attack] * PhysResist = Armour. Deviating much from this would be... sub-optimal.

This armour system is simple to explain, and it would be difficult to abuse except by having both PhysResist and Armour very high. Thoughts?

Post Reply