Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release| Hit Simulator with Defense Calculation
#1
I finished researching the def formula and now there are (almost) no bugs (not that I know, but there are a couple of integers that I still did not understand their purpose). I tested it on many chars on a v60 private server, as well as on my own character in GMS, and it works well (note that due to integer rounding there might be a small mistake of +- 1 damage, but I assumed that doesn't really matter)

Downloads:
Compiled Binary
Source Code (C#)
If anyone feels like mirroring\reuping, no problem.

How to use:
Pretty obvious, just fill the details and press calculate and it will show you the range of damages you can recieve.

Also, the error handling sucks and the program assumes you know what are you doing. So if you try to calculate the damage for a level 5 warrior it will crash.

EDIT: updated, now it supports magical damage too.
Reply
#2
does error no mather what i put O.o
Reply
#3
itzikd Wrote:does error no mather what i put O.o
I know, I fixed it in the edit. Forgot to put the StandardPDD.xml file in the archive.
Reply
#4
Uhhh, what's the actual formula? O_o
Reply
#5
Cyanne Wrote:Uhhh, what's the actual formula? O_o
It's not really a formula, its more like a bunch of complicated calculations. Look at the source code to see what I mean o.o
Reply
#6
There's a lot of obvious fractions in there that you left in decimal form...0.1111111111, 0.2857,... There's also some redundant code where you subtract 0 from a number, which makes no sense.

You can always come up with a formula to describe this, it's just really complicated and drawn out.
Reply
#7
Dusk Wrote:There's a lot of obvious fractions in there that you left in decimal form...0.1111111111, 0.2857,...

You can always come up with a formula to describe this, it's just really complicated and drawn out.
These numbers appear like that in the game client, I copy\pasted them.)

edit: if you mean this:
Code:
int value = 0;
            local8 = local8 - (local8 * value * 0.01);
Its because thats how it is in the game, It's just that I have never seen "value" being anything other than 0.
Reply
#8
Oh, ok. I did a little cleaning up of the calculations and this is formula in pseudocode.

att and def are capped at 1999

mob damage = random(0.8 ~ 0.85) * att^2/100

if job is warrior: modifier = str/7 + dex/4 + int/9 + luk/4
else: modifier = 2*str/5 + dex/7 + int/9 + luk/4

num = 0.28 + modifier/800
if defense>=PDD value: reduction = 0.7*(level/1300 + 8/9*num)*(def-PDD) + (num*def)
else:
-if level < 15: reduction = 1.3*(level/550 + num)*(def-PDD) + (num*def)
-else: (13/(level-2))*(level/550 + num)*(def-PDD) + (num*def)

damage taken = mob damage - reduction

I keep editing this because it's pineappleing confusing with all the variables the same thing D:

Okay I think it's right now.

Oh, and the most relevant StandardPDD values (for people over level 100) are:
494 for warriors
266 for mages
298 for archers
331 for thieves
309 for pirates
if anyone is interested using the formula.
Reply
#9
Dusk Wrote:I keep editing this because it's pineappleing confusing with all the variables the same thing D:
Rolleyes
Thats why I hate ripping ASM code, you get tons of localX and argX variables that you don't know what to call because you don't know what to do with them.

EDIT: the attack is not capped at 1999, only the def.
Reply
#10
Something is not right here...

30000 STR
Level 11
54 DEF
Warrior

returns "1 - 1"

30000 STR
Level 11
53 DEF
Warrior

returns "1431-1556"

???
Reply
#11
Fiel Wrote:Something is not right here...

30000 STR
Level 11
54 DEF
Warrior

returns "1 - 1"

30000 STR
Level 11
53 DEF
Warrior

returns "1431-1556"

???
Lmao. The program's not supposed to deal with such high numbers :f6:

I'll check the issue anyway and see whats going on.

edit- It seems like in both cases it returns 1-1 because the actual result is nearly -5000 damage, but the lowest damage you can take is 1.
Reply
#12
Kortestanov Wrote:edit: if you mean this:
Code:
int value = 0;
            local8 = local8 - (local8 * value * 0.01);
Its because thats how it is in the game, It's just that I have never seen "value" being anything other than 0.


Could Value be a Cleric 'Invincible' Skill? lets say after reduction local8 is 1000, and a Cleric has a maxed 'Invincible' is 30. So Local8 = 1000 - (1000 * 30 * 0.01)
Reply
#13
Paracelsus Wrote:Could Value be a Cleric 'Invincible' Skill? lets say after reduction local8 is 1000, and a Cleric has a maxed 'Invincible' is 30. So Local8 = 1000 - (1000 * 30 * 0.01)

osht, that's pretty good. Probably could be Meso Guard/Achilles while you're at it.
Reply
#14
But the question is, hows does a Mages Resistance skills factor in? do they get put in as a value, or are they a separate part of the formula?, and if they are used as a value, then does a clerics resistance get added into its 'invincible' skill or are they administered separately?
Reply
#15
Paracelsus Wrote:But the question is, hows does a Mages Resistance skills factor in? do they get put in as a value, or are they a separate part of the formula?, and if they are used as a value, then does a clerics resistance get added into its 'invincible' skill or are they administered separately?

What's being calculated here is physical touch damage, not damage received from magic attacks. These other attacks are a whole other enchilada entirely.
Reply
#16
I see in the case of the cleric it nice and fine, but for Fire/Poison, and Ice/Lightning mages is seems they're resistance effects both physical & Magic attacks. Is there a flag that tells the game if the attack has that element and to use said resistance values?
Reply
#17
Paracelsus Wrote:Invincible effects only physical attacks, and physical attacks can have an element, like the Electrophant has an Electric Ground attack thats Physical.

Fiel Wrote:What's being calculated here is physical touch damage, not damage received from magic attacks. These other attacks are a whole other enchilada entirely.

Physical touch damage = the enemy mob touching you, does not have element
Physical attack = the enemy mob using an attack on you, could have an element, sometimes AoE.

These are two completely different things. Also, when I said "magic attacks", I meant those attacks in which magical resistance would apply.
Reply
#18
Fiel Wrote:Physical touch damage = the enemy mob touching you, does not have element
Physical attack = the enemy mob using an attack on you, could have an element, sometimes AoE.

These are two completely different things.

Magic attack and Physical attacks are different yes, but touch damage is calculated the same as the special physical attacks. Like for the Electrophants Lightning attack its W.ATK value is upped to 300 which when put into the calc it give the proper damage range. Which you said in the 'calcualte monster damage on me?' thread.

Fiel Wrote:I just checked. The damage is adjusted in the wz files specifically to 300 for that attack.
Reply
#19
Paracelsus Wrote:Could Value be a Cleric 'Invincible' Skill? lets say after reduction local8 is 1000, and a Cleric has a maxed 'Invincible' is 30. So Local8 = 1000 - (1000 * 30 * 0.01)
hmm... might be the skill modifier.
I'll have to check this out and report with results.
Reply
#20
The beginner job is pretty inaccurate... For most monsters I check, it says XX~XX in the calculator when it deals only 1~1 in game.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)