A question on how the damage is calculated in this game

Generic non-balance topics.
User avatar
Torpid
Moderator
Posts: 3538
Joined: Sat 01 Jun, 2013 12:09 pm
Location: England, Leeds

A question on how the damage is calculated in this game

Postby Torpid » Sat 16 Nov, 2013 5:15 am

So the displayed health for a unit is an integer, but events can occur where a unit is attacking another unit, e.g. a shoota boy is shooting a predator, and the predator isn't losing health, yet eventually the predator does lose 1hp.

So does that then mean that the game records the hp of the unit post-damage and then rounds this to the nearest integer in order to grant us with a 'perceived hp' (basically whatever is on the hp bar for us), but in reality the game keeps the pre-rounded scores to so many decimal places hidden away somewhere and uses that to determine the remaining health of a unit after it receives more damage.

Some people I've spoke to seem sceptical about the latter happening, however this raises two problems which are illustrated by the shoota boy paradox. Firstly if we assume the perceived hp represents the real value of hp for a unit then it makes no sense that when a shoota boy shoots a vehicle it eventually, albeit not after one burst of firing, inflicts 1hp of damage, this is because due to the low damage of the shoota boy's shoota to vehicles and the high amount of times it procs (although proccing for such weapons is almost certainly calculated in bursts rather than single shots fired [remember, animation doesn't necessarily correlate with damage]) is so high it would mean every time it was rounded down it would result in 0 damage+0+0+0+0... and the shoota would never ever kill any vehicle, which is false because they can. Similarly though if it was rounded up to the nearest integer then for evey burst of any weapon any unit fired, included one shoota model to the tank, it would inflict roughly a 1dps minimum, depending on the rate of the weapon, but again we know this not to be the case as it takes a squad of unupgraded shootas a very long time to drop a predator's hp by 1, it is not instantaneous.

So at this point I would like to ask whether my original idea of the game having two values of health - a perceived and a real value - is true. However, if it is then it raises a further confusion:
I once observed a game in which Kvek had a dreadnought that escaped from a battle with only 1hp remaining, and afterwards Kvek discovered he was unable to repair said dreadnought. Could this be due to a bug, the circumstances weren't particularly suspicious, he had various different scouts and a techmarine all of whom couldn't repair it, nor was the dreadnought stuck or deformed in any obvious way. So could it be that the dreadnought had a real hp value of <0.5 and for that reason the game assumed the dreadnought was dead as it was closer to 0hp rather than 1hp hence it couldn't be repaired. If this is the case though then we have the rounding problem again which results in the shoota paradox.

What the hell is going on here?
Lets make Ordo Malleus great again!
FiSH
Level 3
Posts: 335
Joined: Wed 27 Mar, 2013 9:11 pm

Re: A question on how the damage is calculated in this game

Postby FiSH » Sat 16 Nov, 2013 5:39 am

all hp, dmg, dps so forth values are decimal numbers, and the value shown is a rounded up value. so for your shoota example, the pred's health will go something like:
700 (displays 700hp)
699.99 (same)
699.98 (same)
...
699.01 (same)
699 (displays 699hp)
698.99 (displays 699hp)

as for kvek's example, that is bizarre. i can only assume a bug, like you said maybe rounding error in the hp data type - whether it be float, double, etc.

EDIT: as an example, here is a page on how the data type float can act funky:
http://cboard.cprogramming.com/c-progra ... weird.html
><%FiSH((@>
Faultron
Level 3
Posts: 255
Joined: Wed 23 Oct, 2013 1:38 pm
Location: Maiden Worlds

Re: A question on how the damage is calculated in this game

Postby Faultron » Sat 16 Nov, 2013 6:05 am

i had the same problem with Wraithlord in retail few weeks ago
it had 40 hp left couldnt repair and he exploded after like 20 sec in safe zone
it didnt die to enemy i watched the replay 5 times:)
Farseer/Doombringer/Falcon/Mindwar IGN: Ypulse
FiSH
Level 3
Posts: 335
Joined: Wed 27 Mar, 2013 9:11 pm

Re: A question on how the damage is calculated in this game

Postby FiSH » Sat 16 Nov, 2013 6:51 am

rounding error from data type shouldn't account for 40hp, did you check for a delayed hit?
><%FiSH((@>
User avatar
Lulgrim
Admin
Posts: 1311
Joined: Sun 03 Feb, 2013 9:44 pm
Location: Grimdark
Contact:

Re: A question on how the damage is calculated in this game

Postby Lulgrim » Sat 16 Nov, 2013 8:15 am

Of course hp is kept in decimals, I thought everyone knew that since dow2info went up in 2009 or whatever.
User avatar
Nuclear Arbitor
Level 5
Posts: 1106
Joined: Tue 12 Feb, 2013 2:56 am

Re: A question on how the damage is calculated in this game

Postby Nuclear Arbitor » Sat 16 Nov, 2013 9:25 am

out of curiosity, how simple would it be to make it display the full value? can you just tell it to report more digits or is it hard coded? do you know?
User avatar
Kvek
Level 4
Posts: 792
Joined: Mon 01 Apr, 2013 12:26 pm
Location: Czech Republic

Re: A question on how the damage is calculated in this game

Postby Kvek » Sat 16 Nov, 2013 9:33 am

That Torpid Gamer wrote:So at this point I would like to ask whether my original idea of the game having two values of health - a perceived and a real value - is true. However, if it is then it raises a further confusion:
I once observed a game in which Kvek had a dreadnought that escaped from a battle with only 1hp remaining, and afterwards Kvek discovered he was unable to repair said dreadnought. Could this be due to a bug, the circumstances weren't particularly suspicious, he had various different scouts and a techmarine all of whom couldn't repair it, nor was the dreadnought stuck or deformed in any obvious way. So could it be that the dreadnought had a real hp value of <0.5 and for that reason the game assumed the dreadnought was dead as it was closer to 0hp rather than 1hp hence it couldn't be repaired. If this is the case though then we have the rounding problem again which results in the shoota paradox.

What the hell is going on here?


The dread was going to die, but it sync-killed a warrior model.
User avatar
Dark Riku
Level 5
Posts: 3083
Joined: Sun 03 Feb, 2013 10:48 pm
Location: Belgium

Re: A question on how the damage is calculated in this game

Postby Dark Riku » Sat 16 Nov, 2013 5:07 pm

Lulgrim wrote:Of course hp is kept in decimals, I thought everyone knew that since dow2info went up in 2009 or whatever.
I have a lot of these moments too :/
Faultron
Level 3
Posts: 255
Joined: Wed 23 Oct, 2013 1:38 pm
Location: Maiden Worlds

Re: A question on how the damage is calculated in this game

Postby Faultron » Sat 16 Nov, 2013 5:14 pm

FiSH wrote:rounding error from data type shouldn't account for 40hp, did you check for a delayed hit?


what you mean by delayed hit? like dot damage?

i think it was a bug, but i dont rly remember if i tried to repair or not for sure, but i think i tried, and there was no enemy in like 100 range at all and i dont know any dot damage ingame which last 20 sec lol or do hurt after 20 sec


here replay if intereted of the exploded WL

http://www.youtube.com/watch?v=8avWcXCX-Ec



lol i nubcake and i know about the decimals:)
Farseer/Doombringer/Falcon/Mindwar IGN: Ypulse
User avatar
Dark Riku
Level 5
Posts: 3083
Joined: Sun 03 Feb, 2013 10:48 pm
Location: Belgium

Re: A question on how the damage is calculated in this game

Postby Dark Riku » Sat 16 Nov, 2013 5:17 pm

Yes it was a delayed hit from the enemy LC.
Notice how the LC gets revived at the exact moment your wraithlord dies.

He was in swing animation when he died. When he got revived the animation simply continued and the damage was finally registered.

Delayed damage happens quite often in DoW due to enemies getting knocked back etc while swinging their weapons. Reviving commanders is just the easiest case to spot.
User avatar
Forestradio
Level 5
Posts: 1157
Joined: Sun 13 Oct, 2013 5:09 pm

Re: A question on how the damage is calculated in this game

Postby Forestradio » Sat 16 Nov, 2013 5:44 pm

units cannot die while performing sync kills or special attacks, probably because the animations would go all lulzy and mess up.

I've never seen a unit die from a delayed animation from a dead and then revived commander though.

That's the beauty of DOW2, weird stuff happens.
Faultron
Level 3
Posts: 255
Joined: Wed 23 Oct, 2013 1:38 pm
Location: Maiden Worlds

Re: A question on how the damage is calculated in this game

Postby Faultron » Sat 16 Nov, 2013 8:08 pm

Dark Riku wrote:Yes it was a delayed hit from the enemy LC.
Notice how the LC gets revived at the exact moment your wraithlord dies.

He was in swing animation when he died. When he got revived the animation simply continued and the damage was finally registered.

Delayed damage happens quite often in DoW due to enemies getting knocked back etc while swinging their weapons. Reviving commanders is just the easiest case to spot.


man! i am stunned:D
Farseer/Doombringer/Falcon/Mindwar IGN: Ypulse
User avatar
Lulgrim
Admin
Posts: 1311
Joined: Sun 03 Feb, 2013 9:44 pm
Location: Grimdark
Contact:

Re: A question on how the damage is calculated in this game

Postby Lulgrim » Sun 17 Nov, 2013 12:40 am

Nuclear Arbitor wrote:out of curiosity, how simple would it be to make it display the full value? can you just tell it to report more digits or is it hard coded? do you know?

The UI is not quite so easy to tamper with but maybe you could remove a round function from somewhere to change it. It would be super pointless and confusing though.

Return to “Community General Discussion”



Who is online

Users browsing this forum: No registered users and 0 guests