Experience Formula

I'm trying to write this formula in Excel, so I can create a table and adjust variables across several classes at once. Basically, I'm trying to visualize each class progression (and compare them to each other all at once), to make it easier to figure out what I want it all to look like. I keep running into a problem, however, and I can't seem to translate the formula from JavaScript to Excel; I also can't find anything online about it.

Does anyone know what I'm talking about? And if yes, do ya know what the answer is?
The core script experience formula is the same in MV and MZ (rmmz_objects.js):
JavaScript:
    return Math.round(
        (basis * Math.pow(level - 1, 0.9 + acc_a / 250) * level * (level + 1)) /
            (6 + Math.pow(level, 2) / 50 / acc_b) +
            (level - 1) * extra
    );
To translate to Excel:
  • Math.round(x) -> ROUND(x, 0);
  • Math.pow(x, y) -> POWER(x, y);
  • basis, extra, acc_a, acc_b are class-dependent constants;
  • level is the independent variable.
The core script experience formula is the same in MV and MZ (rmmz_objects.js):
JavaScript:
    return Math.round(
        (basis * Math.pow(level - 1, 0.9 + acc_a / 250) * level * (level + 1)) /
            (6 + Math.pow(level, 2) / 50 / acc_b) +
            (level - 1) * extra
    );
To translate to Excel:
  • Math.round(x) -> ROUND(x, 0);
  • Math.pow(x, y) -> POWER(x, y);
  • basis, extra, acc_a, acc_b are class-dependent constants;
  • level is the independent variable.
Thank you, I appreciate the help. I'm still struggling though . . .

I'll try to explain with pics (because for some reason, I find it difficult to talk about math). This is how I read the core script formula:

1691623292454.png


Obviously, it can be simplified further, but I wrote it out like this because I'm trying to make sure I translate correctly. Assuming that I haven't botched this formula, when I go to Excel, it should look like this

1691623547720.png


with the entire formula written as: ROUND(numerator/denominator,0)

(to clarify, the full Excel formula looks like this

1691624122740.png
)

Here's the problem: when I put this into a table with a column referencing player level, I get this

1691623731071.png


when I'm expecting it to look like this

1691623822788.png


I think there's a step missing. Either that, or I've misunderstood the formula somehow. My objective is to have a column for the Level and a column for the "To Next Level" experience requirement. When I change the variables (base, extra, acc_a, acc_b), I want the formulas to update themselves. This will let me put multiple experience progression tables side-by-side and create charts based on them, which helps me sort out the progression I'm aiming for.

Any thoughts? Obviously, any help you can give is greatly appreciated.[/code]
The last + (L - 1) * X should be outside the fraction: it is not part of the denominator. I imagine that's why your results are smaller than expected. So:
  • Denominator: SUM(6, PRODUCT(POWER([@level], 2), 1/50, 1/acc_b))
  • Additional: PRODUCT(extra, SUM([@level], -1))
Maybe it's just your preferred style, but it's also possible to use simple + and * signs instead of SUM and PRODUCT.

base, extra, acc_a, and acc_b are named cell references, right? I rarely use those, so I forget how Excel displays them. 😴

Spoiler: layout - personal preference
Personally, for comparing classes, I would consider a setup like this:

\ A B C D E 1 \ fiter rogue magus ... 2 basis 10 10 10 ... 3 extra 0 0 0 ... 4 acc_a 10 10 10 ... 5 acc_b 10 10 10 ... 6 7 level EXP EXP EXP ... 8 1 [*] [*] [*] ... 9 2 ... ... ...
I.e. one column per class, with the exp params lined up above the EXP, so you can see multiple classes side-by-side, and generate level differences from there. (I've used [*] to denote the EXP formula.) In this setup, basis for the first class (column B) could be replaced by B$2, extra by B$3, etc. Making only the row absolute makes it easy to auto-fill the EXP formula for the other columns. Your choice, though!
👋
The last + (L - 1) * X should be outside the fraction: it is not part of the denominator. I imagine that's why your results are smaller than expected. So:
  • Denominator: SUM(6, PRODUCT(POWER([@level], 2), 1/50, 1/acc_b))
  • Additional: PRODUCT(extra, SUM([@level], -1))
Maybe it's just your preferred style, but it's also possible to use simple + and * signs instead of SUM and PRODUCT.

base, extra, acc_a, and acc_b are named cell references, right? I rarely use those, so I forget how Excel displays them. 😴

Spoiler: layout - personal preference
Personally, for comparing classes, I would consider a setup like this:

\ A B C D E 1 \ fiter rogue magus ... 2 basis 10 10 10 ... 3 extra 0 0 0 ... 4 acc_a 10 10 10 ... 5 acc_b 10 10 10 ... 6 7 level EXP EXP EXP ... 8 1 [*] [*] [*] ... 9 2 ... ... ...

I.e. one column per class, with the exp params lined up above the EXP, so you can see multiple classes side-by-side, and generate level differences from there. (I've used [*] to denote the EXP formula.) In this setup, basis for the first class (column 😎 could be replaced by B$2, extra by B$3, etc. Making only the row absolute makes it easy to auto-fill the EXP formula for the other columns. Your choice, though!
👋
Boom! Thank you! I mean, I haven't tested (obviously, responding right away and all) but I'm certain that's the problem. I usually struggle with doing code translation like this.

Your other points are well noted. Yes, I intend to split the variables across multiple cells in a table in Excel (as you laid out above). Should be able to get a good sense for how each variable affects progression.

I'll post again if I'm still having problems but I expect this should take care of it. Once again, thank you for he help!
You're welcome, good luck!

Original thread: https://forums.rpgmakerweb.com/threads/experience-formula.160094/