Philosophy, Bugs, and Red Magic


Lots of little bug fixes overnight, only one of which was really troubling from a game-busting standpoint, which is good news.  This was a nasty bug that made the game unwinnable if you ran from battle against a monster in a dungeon (Monster Holes were okay).  There were also some minor (although purely cosmetic) problems with the HUD that SHOULD be worked out.  There were also little problems here and there involving the claw, one of which is really funny.  Thanks to a complete brain-fart, any claw would be recognized as the Dragon Claw.  There aren't too many places this would have caused issues, but it is still funny to see such a silly error in logic.

The real bulk of my overnight efforts went into the figuring out just what the heck is going on with the "red magic."  (Yes, I obviously know the original term.  I'm keeping things quiet.)


Philosophy:

The philosophy behind this project has, from the first day, been "1-to-1" whenever possible.  Rebalancing and remastering are not something I've ever been interested in doing.  I'm a literary guy, so dialog interests me, but I'm not a good "try-hard" drama writer.  My professional training in terms of story structure is actually in ancient literary narrative analysis, more than anything else.

There are some exceptions with the 1-to-1 philosophy in terms of puzzles, but only when I couldn't figure out a good way to replicate a puzzle without making things awkward.  This can be seen in the "Really Bigloo" and the aptly named "The Dev's Regret" respectively.  But, the thing I wanted to make sure I got as close to vanilla as possible was the combat algorithms.  And, almost all of them have been a source of non-stop grief.  The latest overnight release has my latest attempts at getting the damage calculations correct, and I'm closer than ever on some fronts, but it's still not entirely right.


Red Magic:

The posted formula for "red magic" goes like this, and for reference, SP is spell power, MAT is cast'er magic attack, and DEF is the target's defense: 
      (((SP x 6) + (MAT x 9) - (DEF x 2)) x Elemental Weakness) / number of bad guys

So, for example, a level 31 hero with 45 MAT casting White against one Garuda with 61 DEF should have a mathematical outcome of 1,123 damage.  Here's the problem - that's not the way the math works out in my comparisons.  To compare against a semi-popular but ripped on published game, White does 1,553 damage.  That's a difference of 430.

But that's only the first part of the problem.  If casted on TWO Garuda's, there are two possibilities.  First, is that the SP is static.  I doubt this, but not entirely, as I'll explain.  The second is that the spell should increase in SP to match the number of targets linearly, which it might.  But, this also has some troubles.  Our above algorithm against two opponents yields 982 damage when rounded.  Less against one enemy, but more against two, because the comparison game instead deals 720 to each target.  

So, we're still wrong, but that's not the real thing that concerns me.  720 x 2 damage does not equal 1,553.  That is a loss of 113 damage before the division that is unaccounted for.  That means that something in the algorithm is not static with multiple targets, so the posted algorithm everywhere is flat wrong.  Mathematically, it's hard to even call it close.

Here's the real kicker, though.  When tested with Thunder, Meteor, and Flare, that same 113 damage loss exists across the board.  So, this tells me that the adjusting variable is probably the MAT of the caster or the DEF of the target, and that the adjustment is consistent for the spells.  But there is some variable factor in the red magic that is unaccounted for in the current calculations.  I have a feeling this is the thing that is going to plague me throughout the development, and as I am not a software developer nor a coder, I don't have the ability to rip the information myself.

A Note About Attack, White Magic, and Black Magic:

The other formulas seem to be correct, with one exception.  Boss attacks do not appear to take the user's defense into account, and this does seem consistent throughout.  For example, the first enemy is considered a boss (which reminds me, I should flag them as such).  When giving myself 99 DEF from the beginning, the main character still takes 6 damage (which may be due to a floor calculation rather than a rounding one, I'm still not sure), although I first noticed the discrepancy against the Flamerus Rex.

There also appears to be a handful of enemy attacks that also buck the system.  We'll see how many I can find, or for that matter, am really worried about.  In terms of defense, it means more at the beginning of the game.

In terms of White Magic and Black Magic, thankfully, they are pretty straight forward.  That's all I have to say about it.  The algorithms are MOSTLY correct.  There is some variation in Black Magic, which may be a result of floor, ceiling, rounding differences in different parts of the calculation as it happens, but not enough for me to say that the calculations are far off.  I may need to play around with it, but even if I never figure it out, I'm happy with this outcome.


Get Memeal Mantasy: Fystic Quest

Leave a comment

Log in with itch.io to leave a comment.