Jump to content

Question

Posted

I changed my game formula to:

"PhysicalDamage": "Random(((BaseDamage + (ScalingStat * ScaleFactor)) - (A_Attack / 4)) * CritMultiplier, ((BaseDamage + (ScalingStat * ScaleFactor)) - (A_Attack / 7)) * CritMultiplier) - (V_Defense/2)"
I went to run some tests on the game
The player starts with 1 in attack. I gave him a weapon: https://prnt.sc/1hbolu1
The enemy has 0 def

Making the calculation the result should be 11-12 (https://prnt.sc/1hbpqsz, https://prnt.sc/1hbq0r5, https://prnt.sc/1hbrc8n)
But in the intersect the damage is 10 or 12 (https://prnt.sc/1hbs2mw, https://prnt.sc/1hbsjke)

Is there something I'm doing wrong or is it a bug?
All these tests were in version 0.7.0.125/126 clean

5 answers to this question

Recommended Posts

  • 0
Posted

ScaleFactor and CritMultiplier are not integers. Their inclusion likely turns the entire equation into a float or double.

After that I'd likely need to dig into how the library itself works to really give any more useful information.

 

The actual math behind it is a little more than just the equation, for example there's this funky line as well:

return min >= max ? min : Randomization.Next(min, max + 1);

I think your spreadsheet is a decent indication, but not an exact replica of what the system does.

  • 0
Posted
6 hours ago, Cheshire said:

I think intersect always rounds down rather than up.

 

4 hours ago, Beefy Kasplant said:

Pretty sure it's because it's doesn't just round down at the end, but also in every step in the calculation. 

 

But the minimum damage part of the formula, with the data I presented doesn't actually have any non-integer number, (base damage + scaling stat {5+8=13} - attack/4 {8/4=2} = 11} - (v.def/2{0/2=0}.

 

Is it going to round up 11 to 10, with 11 being a int number?

 

And if it's a random between (10, 11, 12), since the engine is considering the value 10 as a minimum, why is 11 never reached?

  • 0
Posted
7 hours ago, Cheshire said:

ScaleFactor and CritMultiplier are not integers. Their inclusion likely turns the entire equation into a float or double.

After that I'd likely need to dig into how the library itself works to really give any more useful information.

 

The actual math behind it is a little more than just the equation, for example there's this funky line as well:

return min >= max ? min : Randomization.Next(min, max + 1);

I think your spreadsheet is a decent indication, but not an exact replica of what the system does.

I believe I have understood, for now I will give the question as answered, I will use the spreadsheet to reach the closest value to continue balancing the game.
A small margin of error will not destroy the balance (I hope haha)

×
×
  • Create New...