Hi,

Noticed in my project that there seemed to be multiple damage/hit calculations happening when a combatant attacks.
Was thinking it was something that i might have added myself so did a fresh project in unity 2019.4.9f1 and imported demo project and latest ORK version (from unity store), to test.

Added a debug step to the end of the hit chance formula, damage formula, damage 5 formula and two in the attack animation event (one to signal the start and one to signal the end). Start the game, go out of town in the field, get into the first battle and use the basic attack.

This is what shows up in console for the one single attack:

Hit Chance formula result is 127.94
UnityEngine.Debug:Log(Object)
Physical Damage formula final total is 69.14
UnityEngine.Debug:Log(Object)
Physical Damage formula final total is 69.14
UnityEngine.Debug:Log(Object)
Physical Damage formula final total is 69.14
UnityEngine.Debug:Log(Object)
Physical damage 5 formula total result is 345.68
UnityEngine.Debug:Log(Object)
Physical Damage formula final total is 69.14
UnityEngine.Debug:Log(Object)
Physical damage 5 formula total result is 345.68
UnityEngine.Debug:Log(Object)
Starting Attack Animation Event
UnityEngine.Debug:Log(Object)
Hit Chance formula result is 127.94
UnityEngine.Debug:Log(Object)
Physical Damage formula final total is 69.14
UnityEngine.Debug:Log(Object)
Physical damage 5 formula total result is 345.68
UnityEngine.Debug:Log(Object)
Ending Attack Animation Event
UnityEngine.Debug:Log(Object)


You can see that there are hit and physical damage calculations before the attack animation step and then the calculation within that animation (which i am guessing is the calculate step in that event).

Do you know why it would be making all these calculations prior to the animation attack?
In my project i use random values to simulate dice rolls for hit and in the debug all these calculations have different results so its hard to know which applied.

Thanks in advance
  • It's most likely the preview system working in the background :)

    While selecting an action or target, the selected ability/item will preview status changes on user and target. This information can be used by HUDs to display status changes that will (likely) happen, as well as display hit chance, etc.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.