Spreadsheet for calculating damage

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Post Reply
Message
Author
UbAh
Yeek
Posts: 10
Joined: Sat Jan 26, 2013 8:05 pm

Spreadsheet for calculating damage

#1 Post by UbAh »

Hi all I got frustrated by trying to eyeball and figure out which weapon is better than the other so I amde this spreadsheet to help. Sharing it to help make the game more accessible and need less time doing math so there is more time playing. :mrgreen:

Let me know if there are any improvements you all would like to see.

Google doc link (Most up to date)
Attachments
ToME damage calc.ods
Open Office Version
(4.88 KiB) Downloaded 113 times
ToME damage calc.xlsx
Micro$oft version
(3.5 KiB) Downloaded 101 times

Aerach
Halfling
Posts: 84
Joined: Thu Dec 13, 2012 10:22 am

Re: Spreadsheet for calculating damage

#2 Post by Aerach »

This ... seems to broadly match ingame experience with teh weapons my slayer can swap between's effectiveness. and a good deal safer than my method of 'hit something a few times and compare numbers'. Math whiz :o

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

Re: Spreadsheet for calculating damage

#3 Post by lukep »

"Base power high" is not a value used in the code. What is showing up in the tooltip is the base damage (which you call "base damage low") multiplied by the damage range of the weapon. That means that "base damage high" should be D18 * (E17 / D17)

H15 should be deleted.

Can you fill in all of the relevant values with a basic sample (eg, lvl 1 character attacking with a longsword)? That would help give some context.

If you want to make the google doc more useful, something similar to this is easier to use. I made multiple copies of the page, locked one for backup, and allowed editing on the rest. That way, people can plug values in right there, but vandalism/carelessness is not an issue, as the locked page can be copy/pasted over the broken one. It wouldn't work with very high traffic, but that shouldn't be a problem here.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

UbAh
Yeek
Posts: 10
Joined: Sat Jan 26, 2013 8:05 pm

Re: Spreadsheet for calculating damage

#4 Post by UbAh »

Thanks lukep,

So your saying your damage stat that shows on the char sheet gets multiplied by the base power of the weapon directly not by ((sqrt(Base power / 10) -1) * .5 +1)?

The equation, (0.3 * (P. Power + (Stat * bonus) ) )* ((sqrt(Base Power / 10) -1) * .5 +1) * (sqrt(Talent / 5) / 2 + 1) ^ 1.04 = damage, is what I got from the wiki. I use that for what I call "Base Damage". Then I add the +damage after hit enchantments with the Changes damage multiplier as to the Base Damage and label it "Total Damage before resists". Let me know if this equation looks wrong.

I want to add Damage conversion and damage resistance to this after I figure em out. Then maybe chance to hit and armor reduction. Finally if I get all that done and the underlying code doesn't change on me I will pretty up the sheet. Lets see if work and the wife leave me enough time for that fun and still time to enjoy the game.

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

Re: Spreadsheet for calculating damage

#5 Post by lukep »

The damage that shows on the char sheet should be equal to D18, and while I haven't checked the formula, it looks right. It's E18 that is wrong. The damage range isn't randomly between one calculation at 4 base power, and another at 6.4 (as you have entered), it is a straight multiplication to the calculated damage from 4 power, between 1.00 and 1.40 (most of the time).


Maybe an example is the best way to show what I mean. A basic axe has a tooltip that looks about like this:

Code: Select all

steel waraxe (10-14 power, 3 apr)
Type: weapon / waraxe ; tier 2

Base power: 10-14
Uses stats: 100% Str
Damage type: Physical
Armour Penetration: +3
Physical crit. chance: +4.0%
Attack speed: 100%
The code looks something like this:

Code: Select all

name = "steel waraxe",
material_level = 2,
combat = {
        dam = 10,
        damrange = 1.4, 
        dammod = {str=1},
        apr = 3,
        physcrit = 4,
        physspeed = 1, 
},
The number "14" in base power above is never used by the code, the only two things used are the "10" as the base power ("dam"), and the damage range of 1.4.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

UbAh
Yeek
Posts: 10
Joined: Sat Jan 26, 2013 8:05 pm

Re: Spreadsheet for calculating damage

#6 Post by UbAh »

OK so to fix it I need to know how damrange comes into play with the calculations?

I can extrapolate damrange by dividing the base power high range of the weapon but its low range as displayed in the tooltip for the weapon. But I don't know where in the equation I should multiply by the range.

Also do you know if that is the only place randomness comes into the damage calc?

I suppose if I can find some more time I could jump into the code and see if I can figure it out, but if you know the code or where to look that could save me the trouble.

Thanks again for your help.

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

Re: Spreadsheet for calculating damage

#7 Post by lukep »

I think that's the only random place (other than critical hits).

Damage range is after all of the other calculations you did, as far as I can tell.

If you're interested, the code is here, lines 385-398 and 1092-1130 are probably the most relevant parts. Damage is calculated on line 366, and damage range is in lines 391-392, so it is after all of that.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

UbAh
Yeek
Posts: 10
Joined: Sat Jan 26, 2013 8:05 pm

Re: Spreadsheet for calculating damage

#8 Post by UbAh »

So damage range is even after the ego +dam on hit calculations?

I will look at the code tomorrow and see if I can figure it out.

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

Re: Spreadsheet for calculating damage

#9 Post by lukep »

ah, no. It's before the +damage on hit bonuses, but after all of the "normal" calculations.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

Post Reply