I am following the 2D tutorial and having no trouble thanks to the clear writing, getting up to this point:
https://orkframework.com/guide/tutorials/2d-rpg-quickstart/09-first-abilities/As I am not experienced with this, I've assumed there's a good reason for everything and just try to understand the systems. This step, however, baffles me. As it says at the top, damage is calculated like this:
User.ATK / ((50 + Target.DEF) / 50)
Great, lovely. But to implement this simple formula in the game, we need to create
six different nodes? The result is unwieldy, hard to read, and seems like it would be a pain to change, especially if you have nested subcalculations and ever change your mind about their balance.
I recognize my ignorance here, but I don't get this at all. Damages formulas are a huge part an RPG, so what is gained by handling them like this? I presume that there must be a reason that I'd see later in development that makes this better than typing a formula.
relative to all the things you'll be doing to make a game, I think formula's will take up a very small amount of time.
That's a lot to pack in, and then also can be pretty unwieldly because now you have multiple keywords to account for, and various math symbols as well. You've also got to now account for different languages and string + system cultures too.
I'm not saying nodes are perfect, but 'it works' largely because of the complexity that can be achieved and everything that you can look at. You're not just limited to user and target status values in your formulas.
Something that might help, is to have a generic formula that remains consistent, and then instead move the knobs onto ability variables instead.
For example, you'd have a formula like damage = Damage = ((((2 * Level / 5 + 2) * AttackStat * AttackPower / DefenseStat) / 50) + 2)
(Pokemon base damage formula).
Pulling from the Combatant, we have Level, Attack Stat and Defense Stat. Those are tweaked on the combatant themselves.
Attack Power is the power of the move, and this is something we'd set on an ability variable.
Rather than creating a variation of this formula for every move that has a different power, we can instead just use a single formula on all of them, and tweak the value on each ability as necessary.
Then you only need to make a new formula when said ability is actually different in how it will calculate damage. You can open up the source Zip files (from purchased version) and just find a formula node, then copy it into a new script file but put your calculations in place of the node you copied. ORK will automatically pick up your new node after compiling (make sure to name it something else). Same concept with Schematic nodes too actually.
Or another option is that you can create a Static function in a script, and use the Function Value node that can call into that Static function where you do your calculation that returns a number.
Edit: Also just want to throw it out there that I'm not the dev (that's GiL/ gamingislove), I don't know the actual design intentions, this is just my thoughts on it and I know how much of a pain string parsing can be lol.
I.e. the usual mathematical order of operations is not used.
This might be a bit counterintuitive at first, as you'll need to use sub calculations or split a formula into multiple formulas to achieve the same thing. However, it allows for a lot more flexibility and create very complex formulas, taking all features into account (just like in schematics or battle AIs).
Since every node does it's own thing, you can e.g. at any point in a formula just set the current value to whatever value you want and exit the formula at that point.
Ultimately, this was a design decision made 15 years ago in ORK 1 and just has been kept that way ever since ...
Also, see here for writing custom formula nodes.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Thank you both for your assistance. ^-^