Challenge: exponential formulas

We implemented formulas that produce small numbers. Let’s say that this is boring and we want big numbers as in Final Fantasy.

You’re going to implement a new damage formula that produces exponentially growing numbers.

For example, with a base attack of around 10, a character should inflict up to several hundred damages. With a base attack of 100, you should be in the tens of thousands even if the opponent has a high defense.

Here are some constraints to spice things up:

  1. Use any polynomial of degree 3, that is to say, that has at least a power of 3.
  2. The maximum damage should be 99999.
  3. The maximum for any stat should be around 100.
  4. You should take defense into account to reduce damage.

I invite you to search for related games’ formulas with your favorite search engine to get a sense of expressions that work well. Players reverse-engineered the calculations used in many popular RPGs out there. If you don’t know any, try with Final Fantasy and Disgaea.

To preview the values your formula will produce before implementing it, you can use a spreadsheet if you are comfortable with that. Alternatively, you can use the free online calculator Desmos.