Aslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1911.msg21005e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexfa09.htmldelayedslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1911.75e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexfa09.html.zx*g^0U OKtext/htmlISO-8859-1gzip8: HTue, 10 Mar 2020 06:04:14 GMT0 0P*g^tO  The Drawing Board

Author Topic: The Drawing Board  (Read 17974 times)

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #75 on: July 26, 2014, 12:53:07 AM »
Thank you for the warm welcome back! I was thinking about something similar to your 255 approach. Of course in my head it is 1024; and not 1024 -1  :finger:

I actually looked around for a while when I first started getting back into the project and one of the things I found was this from romhacking.net:


Source:    http://www.romhacking.net/documents/641/
-------------------------------------------------------------------------------------------------------------------------------------------
From:     vic@physci.psu.edu (Vic Ricker)
To:       "Super Famicom Development Group" <famidev@busop.cit.wayne.edu>
Subject:  Re: Multiplying/Dividing?
Date:     Sun, 26 Dec 93 16:29:09 EST

Take a look at this:


    Address: $4202/$4203
       Name: WRMPYA/WRMPYB
Description: Multiplier and multiplicand


  D7   D6   D5   D4   D3   D2   D1   D0

|           MULTIPLICAND-A              |       $4202
|_______________________________________|

  D7   D6   D5   D4   D3   D2   D1   D0

|            MULTIPLIER-B               |       $4203
|_______________________________________|


These registers perform absolute multiplication by multiplying
multiplicand A by multiplier B and return product C which can be read
from $4216/$4217 RDMPY.

Set register A, then B.  After the B register is set, it will take 8
machine cycles for the multiplication to be completed.

* The A register will not be destroyed by the multiplication process.
^^^ does not refer to the accumulator. it means the multiplicand

Also, there is 8/16 multiply that shares the mode 7 matrix registers:
set 16 bit multiplier to $211b and 8 bit multiplicand to $211c the 24
bit product will be placed in $2134-$2136.

The shift-add routine is a great way to multiply.  I'm suprised that
so many so-called assembly programmers don't know how to do it.
Regardless of how fast it is, the hardware stuff blows it away.

There is also a hardware divide:

$4204/4205 is the 16 bit dividend, $4206 is the 8bit divisor, the
quotient will be put in $4214, and the remainder in $4216/4217.
-------------------------------------------------------------------------------------------------------------------------------------------

I think I saw at one point that FF6 made use of this...if I was understanding it correctly it almost seemed like if you put two numbers in the right place and then wait (4 cycles I think?) then you will have the product. So truly a black box operation - but it's not something I can quite get my head around. I was also curious about his mention of possibly making use of the mode 7 registers. What you you guys think?

Here's a few more posts I made note of along the way; they may help.

http://www.romhacking.net/forum/index.php?topic=17957.0

http://forums.nesdev.com/viewtopic.php?t=6117



http://wiki.superfamicom.org/snes/show/Registers

WRMPYA - Multiplicand A

WRMPYB - Multiplicand B

4202  wb++++
4203  wb++++
        mmmmmmmm

Write $4202, then $4203. 8 “machine cycles” (probably 48 master cycles) after $4203 is set, the product may be read from $4216/7. $4202 will not be altered by this process, thus a new value may be written to $4203 to perform another multiplication without resetting $4202. The multiplication is unsigned. $4202 holds the value $ff on power on and is unchanged on reset.

- OK 8 cycles, not 4. I'll see what I can do with the numbers; the inner workings I leave to the experts  :wink:

 :edit: Just thought of something: Could we work something in as a conditional. I just looked at my calculated table and for Lv 45 and below everything calculated is under 65k. What if I modified my algorithm to be segmented?  :hmm:

 :edit: I ran the numbers again - We can get away with two decimal precision.
« Last Edit: July 26, 2014, 02:05:19 AM by LordGarmonde »
"Now I know; and knowing makes it even more confusing..."

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #76 on: July 26, 2014, 02:46:02 AM »
I think this could work: My formula is the sum of three elements:

     TNL(Lv+1)   =   TNL(Lv)   +   D   +   Floor[P x Q x R]

TNL(Lv) is pulled from the RAM, D is pulled from the ROM, and the last element is what we need to calculate:     Floor[P x Q x R]

      P = (Lv - F),  Q = (Lv + F + 3) &  R is pulled from the ROM

But, there limits imposed on each of the above:
     
      -51    <   P   <     70

         4    <   Q   <    132

   1.379    <   R   <    1.861

So the theoretical maximum tri-product is 17196 - but checking the table I saw that in actuality it runs from -4929 (FuSoYa @ Lv 1) and 8705 (DkC @ Lv 69)

Calculating  DkC's level up at 68 -> 69 the calculation for the last element becomes:

P x Q x R = 58 x 81 x 1.853 = 8705.394

Could we use shifting knowing that we have these constraints on our values; at least that's my current thought since we know the limits and (P x Q x R)  is the only multiplication required, could we get by somehow with that? Another idea may be to split the calculation further:

R  =  1.853  =  2  -  0.147   Then do:     2 x Q x R   -  0.147 x Q x R   =   (Q x R  + Q x R)  -  0.147 x Q x R

Something to sleep on.  :sleep: 
« Last Edit: July 26, 2014, 02:47:59 PM by LordGarmonde »
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: The Drawing Board
« Reply #77 on: July 26, 2014, 09:07:42 AM »
Yeah, when I was developing my Monster Levelup patch, Assassin popped in and pointed me to the multiplication and division registers, though what you've posted here is a much clearer explanation of how to use them.
The good news is, it doesn't really matter whether you know how they work. They just kinda... do.
Now, you're by far the most gifted mathematical mind among us, so you tell me: is it possible to express the largest TNL value in the game as itself * 100(dec, or something at least close enough to 100, perhaps 128) yet still no more than three bytes long? Since the math registers aren't equipped to handle decimals or values over three bytes, this would be the only way I can think of to represent two decimal places. Alternatively, if that's not possible, can you think of a reliable algorithm for taking your starting TNL, splitting it up temporarily, performing the necessary functions, then combining the results back to get your final product?
Like... let's say TNL starts at (arbitrarily) 5D473F; then AND 000003 and store the result somewhere; then pull back your 5D473F and AND FFFFFC; then divide by 4; then perform all necessary functions on both (5D473C/4) and on 000003; then combine the results to get the final TNL.
Anyway, that's just a thought. What I'm saying is, if you can come up with an algorithm that doesn't require decimals (but working with values *100 is ok) and never requires representing values in more than three bytes (therefore never anything higher than 16,777,215), then I think I can assemble the code to perform it.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #78 on: July 26, 2014, 11:38:43 AM »
Now, you're by far the most gifted mathematical mind among us...
Thanks chillyfeez  :blush:   -   I'm just glad I can bring something ("other than amorality") to the team  :childish:  - You're definitely no slouch yourself:

Like... let's say TNL starts at (arbitrarily) 5D473F; then AND 000003 and store the result somewhere; then pull back your 5D473F and AND FFFFFC; then divide by 4; then perform all necessary functions on both (5D473C/4) and on 000003; then combine the results to get the final TNL.
After going through it a few time I'm actually pretty sure I get it - it was just a kinda Matrixesque "Whoa..." when I first read it. But that's why:   you + ASM =>  :yabin: FTW

To answer, though: Yes; I'd think it can! Even if I'm wrong my immediate thought was "Oh it will! Those numbers aren't pushing me around." If I'm following this right (please correct me if otherwise) looking at what I was sketching out last night I think we have it:

Same example as the last post, the largest multiplicative product ever required is 8705 (DkC @ Lv 69)

As calculated from:  P x Q x R = 58 x 81 x 1.853 = 8705.394

It's after this point the rest comes into play:  TNL(68) and D (for DkC) - but that's all addition

So if we multiply R x 1000 we'd end up at 8,705,394 - then drop the last three and proceed with addition. The highest number in the ROM table is 212,660 so if we do the multiplication separately we can scale up to keep precision - then drop what isn't needed before going on. It also seems we could even keep the 3rd decimal - but if omitting it would speed things up I'd live with it: most characters have a 3rd place of zero anyway - the exceptions being:  DkC = 1.853, Edward = 1.472, Rosa = 1.591, and Cecil = 1.435

So laying it out this is what I've got in mind:

    As before DkC is at Lv 68, and advances to Lv 69 => We need to end up at TNL(69) = 212,504

    TNL currently stored in RAM:  TNL(68) = 203,544

1) Pull Lv from RAM & F from ROM
2) Calculate P & Q - Using  P = (Lv - F)  &   Q = (Lv + F + 3)  (Here Lv = 68 & F = 10)
3) Multiply P x Q and store (I'll call it M_1)
4) Load R From the ROM & Shift out of decimal range:
            R = R * (100 or 128) or, if possible, R = R * (1000 or 1024)
5) Recall M_1 and multiply by R
            Largest Possible Value:   P x Q x R = 58 x 81 x (1.853 x 1000) = 8,705,394
6) Shift back yielding:  8,705,394 --->  8,705
7) Load D for DkC  (D = 255)
8) Add to the above:  8,705 + 255 = 8,960
9) Load TNL(68) (From RAM) and add last result:
             203,544 + 8,960 = 212,504  :childish:

I didn't cheat, right? Because if not I think we got it! Three-decimal precision and all. I can also easily redefine the R values so that they scale in binary:

   R -->  R * 1024 so 1.853 x 1024 = 1897.472  =>  1897

   Which then when carried through and ends up as:

    P x Q x R = 58 x 81 x (1897) =  8,912,106 --> 8703.229  => 8,703

             8,703 (for 1024) vs 8,705 (for 1000) - I'd accept that for the sake of faster, easier computation:

    Overall how it looks at the end is:

             212,486 (for 1024) vs 212,504 (for 1000) => Error = 212,504 - 212,486 = 18

             The ROM table lists 212,468 so the binary shift result is closer anyway!

OK! (Phew...) I'm going to pause here and let you have a look; but I think we've got it! I'm going to start another post with some more math info I collected.  :terrydia:
"Now I know; and knowing makes it even more confusing..."

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #79 on: July 26, 2014, 11:58:19 AM »
Here are a few FF6 links I collected in my attempts to understand ASM and what it can do.

http://www.ff6hacking.com/forums/showthread.php?tid=1929    - A set of links to many docs

http://www.rpglegion.com/ff6/algs/algs.htm

http://www.angelfire.com/al2/imzogelmo/patches.html

http://datacrystal.romhacking.net/wiki/Final_Fantasy_VI:ROM_map#Disassembly  -   Specifically:
     http://datacrystal.romhacking.net/wiki/Final_Fantasy_VI:ROM_map/Assembly_C00#C0.2F062E_random_number_generator
     http://datacrystal.romhacking.net/wiki/Final_Fantasy_VI:ROM_map/Assembly_C00#C0.2F0B7F_division_function

Also here is the code corresponding to the different multiplication & division functions: Very interesting to read

Code: [Select]
Multiplication & Division - FF6 Style
=======================================================================


Multiplication Function
Multiplies low bit of A * high bit of A.  Stores result in 16-bit A.
-----------------------------------------------------------------------
C2/4781: 08           PHP
C2/4782: C2 20        REP #$20
C2/4784: 8F 02 42 00  STA $004202
C2/4788: EA           NOP
C2/4789: EA           NOP
C2/478A: EA           NOP
C2/478B: EA           NOP
C2/478C: AF 16 42 00  LDA $004216
C2/4790: 28           PLP
C2/4791: 60           RTS
***********************************************************************

Division Function
Divides 16-bit A / 8-bit X
Stores answer in 16-bit A.  Stores remainder in 8-bit X.
------------------------------------------------------------
C2/4792: 5A           PHY
C2/4793: 08           PHP
C2/4794: C2 20        REP #$20
C2/4796: 8F 04 42 00  STA $004204
C2/479A: E2 30        SEP #$30
C2/479C: 8A           TXA
C2/479D: 8F 06 42 00  STA $004206
C2/47A1: EA           NOP
C2/47A2: EA           NOP
C2/47A3: EA           NOP
C2/47A4: EA           NOP
C2/47A5: EA           NOP
C2/47A6: EA           NOP
C2/47A7: EA           NOP
C2/47A8: EA           NOP
C2/47A9: AF 16 42 00  LDA $004216
C2/47AD: AA           TAX
C2/47AE: C2 20        REP #$20
C2/47B0: AF 14 42 00  LDA $004214
C2/47B4: 28           PLP
C2/47B5: 7A           PLY
C2/47B6: 60           RTS
***********************************************************************
Multiplication Function 2
Results:
16-bit A = (8-bit $E8 * 16-bit A) / 256
24-bit $E8 = 3 byte (8-bit $E8 * 16-bit A)
16-bit $EC = 8-bit $E8 * high byte of A
--------------------------------------------
C2/47B7: 08           PHP
C2/47B8: E2 20        SEP #$20
C2/47BA: 64 EA        STZ $EA
C2/47BC: 85 E9        STA $E9
C2/47BE: A5 E8        LDA $E8
C2/47C0: 20 81 47     JSR $4781
C2/47C3: C2 21        REP #$21
C2/47C5: 85 EC        STA $EC
C2/47C7: A5 E8        LDA $E8
C2/47C9: 20 81 47     JSR $4781
C2/47CC: 85 E8        STA $E8
C2/47CE: A5 EC        LDA $EC
C2/47D0: 65 E9        ADC $E9
C2/47D2: 85 E9        STA $E9
C2/47D4: 28           PLP
C2/47D5: 60           RTS
***********************************************************************
Multiplies A (1 byte) by * 1.5
------------------------------
C2/47D6: 48           PHA
C2/47D7: 4A           LSR
C2/47D8: 18           CLC
C2/47D9: 63 01        ADC $01,S
C2/47DB: 90 02        BCC $47DF
C2/47DD: A9 FF        LDA #$FF
C2/47DF: 83 01        STA $01,S
C2/47E1: 68           PLA
C2/47E2: 60           RTS

Interesting stuff! It's obvious that FF6 has quite the following and while I enjoy it I still say FF4-EVER!!   :cycle:

Also...this is in fact the best explanation ever:

The good news is, it doesn't really matter whether you know how they work. They just kinda... do.

So simply stated: so very-very true!  :wink:          :cookie: for you, sir!  :happy:
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: The Drawing Board
« Reply #80 on: July 26, 2014, 01:17:24 PM »
Sorry, I can't fully wrap my mind around all this right now, because I'm also trying to accomplish the shadow party mod...
I've been operating the past 24 hours under the (false) assumption that TNLs had their own table, when in fact they are included in the level up data table... so... is the plan also to figure out an algorithm for stat bonuses?

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #81 on: July 26, 2014, 01:48:23 PM »
so... is the plan also to figure out an algorithm for stat bonuses?

Absolutely! That was always my intention. If we can get past the TNL hang-ups it should be smooth sailing - the rest of the information associated with level-up is far-far more predictable (like MP+ = 4 x( Lv % 10) - or similar). I have all that data on hand as well, I'm currently mapping how best to define the algorithms - for example (I'm making this up) should MP+ = HP+ / 10 + (Character Adjustment Parameter) - or something to this effect

At the end I dream of a base where you need to carry around as little information as possible, and with the ability to add anyone, anytime, at any level.

:edit:  OK I wasn't quite making that up - I did see that somewhere before:  FuSoYa's Initial HP/MP:  1900/190       - Also his stat gains (until 70) are all zero: so he's done! :tongue:
« Last Edit: July 26, 2014, 02:06:45 PM by LordGarmonde »
"Now I know; and knowing makes it even more confusing..."

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #82 on: July 26, 2014, 02:47:28 PM »
Looking through my notes on stat gain here are some things I've observed. DkC (Good old DkC!) Has the following patterning:

Code: [Select]
DkC - Starting Level:  10

I V L Ex
Str 13 +1 1 5
Agl 10 +1 2
Vit 11 +1 2
Wis 06 +1 3
Will 03 -1 5

I  = Initial Value
V  = Value to Increment Stat
L  = Level Rate
Ex = Exception

So these are read as:

Strength:  Start @ 13 and Add 1 every level except every 5th level (+0)
  Wisdom:  Start @ 06 and Add 1 every 3 levels and zero otherwise

As for HP/MP

MP Gain = 0   For All Levels  - While regarding HP Gain:

 Level     HP +
10 - 19   20 - 22
20 - 29   30 - 33
30 - 39   40 - 45
40 - 49   50 - 56
50 - 59   60 - 67
60 - 99   70 - 78


I can definitely write out an algorithm for those - much more patterned than the experience. I just can't believe that there are entries of 0 for MP gain for every level 10 - 69 for DkC. From 70 on it just uses whatever was there for 60-69.

Just like in the experience table there are a few screwball levels that break pattern, but I will work that out over the entire data span. One question I have is just how sensitive are the stats. For example, if DkC starts at Str = 13 normally - would it be really noticeable if I curved things so that we were at say Str = 10? I would think it would be dependent partially on what you are fighting: I say that thinking that it's nothing to lose a damage point at the beginning: It would seem to scale as a percentage of the total damage (more or less) - but would it be noticed.

That question is more from the gut: if playing and you were missing a bit of strength - would you be fighting thinking: "Something is wrong here...?"  - I can look at all the math, but for that answer I turn to you.
« Last Edit: July 26, 2014, 02:57:35 PM by LordGarmonde »
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: The Drawing Board
« Reply #83 on: July 26, 2014, 04:50:57 PM »
I probably wouldn't notice. I think strength really only makes a difference inasmuch as it affects attack multiplier, which it only does every [insert number I don't know] points. So I say, "meh" about starting at 10 instead of 13, but does anybody else want to weigh in on this one?

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #84 on: July 26, 2014, 05:12:26 PM »
I'm hoping such changes, if any, will indeed go by unnoticed. If so then I can use the flexibility to guarantee a formula that can be used for stat gain. HP/MP function similarly for each other character as it does for DkC. Rosa, for example gains 8-9 MP/Lv for the entire game. HP always falls into segments where several levels in a range all use the same value.

The other reason I ask is that I need to figure out how to best extrapolate to Lv 1 for the characters with no data. For TNL I more or less averaged the TNL data that was in the ROM and then manually adjusted each character based on their growth rate (given the data they do have) and that average TNL value. DkC was easy enough: he should have Str = 13 at Lv 10, and normally gains at 1/Lv (except when hit with Lv 5 Doom) - So working back I just set his Str = 4 for Lv 1.

Another idea I had (but never quite worked out) was trying to create a base line Exp curve and then having parameters to adjust it: say maybe require magic users to get more Exp before advancing. It's a step towards making a totally new character, but not something I plan to actively pursue. (unless asked)
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: The Drawing Board
« Reply #85 on: July 26, 2014, 07:17:46 PM »
Yes, the stats are really only noticeable when they're effecting something plainly. For instance... Every 8 Strength is an Attack Multiplier. Every 16 Agility is an Attack+Defense Multiplier. Stamina... does something, with defense multipliers, but I'm confident it only works for Shield Bearers. 16 Wisdom is a Magic Attack Multiplier, 16 Will is... something. (Not really sure what or how Magic Defense Multipliers are calculated off the top of my head I know they're in the algorithm guide)

Though why would Magic Users have a larger curve before advancing?

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #86 on: July 26, 2014, 08:04:24 PM »
Thanks guys for your thoughts regarding stats.

Stamina... does something, with defense multipliers, but I'm confident it only works for Shield Bearers.

Does it play into HP when revived via Life 1? I've seen that in other games; but I've also seen it as just a % of max HP.

Quote
Though why would Magic Users have a larger curve before advancing?

Just an idea for adding more challenge - keeps you from getting magic too early (which obviously could be changed via FF4kster - keep it up PinkPuff!) but also keeps the a bit weaker so you have to be on your guard. What I really had in mind, as far as stat growth was something akin to FFV where jobs play into it.

One idea I have regarding the individual curving would be slow gain to start for mages, but faster levels later and the opposite for fighters - that way you see the people you want to advance level up more often. I'm excited when Rydia advances in level mid-end game: good spells are on the way; but Cecil going up is just kinda 'meh' - more HP. At the same time one could design a character (:cybez:??) that is slow to grow overall, but has the benefit of both fighter & mage attributes: Golbez would kick ass, but you have to work up to it.

Lots of possibilities open up if we can get away from the reference tables.   :happy:

 :offtopic: I've played so many FF1 hacks so many times that I actually forgot that Magic Defense was a hidden stat in the original release -  :laugh:
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: The Drawing Board
« Reply #87 on: July 26, 2014, 08:16:32 PM »
Yes, Stamina (why do I keep on calling it Stamina?) Vitality does refer to how much HP you revive with also every 2 (4?) points of Stamina adds a +1 to your Defense Base.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: The Drawing Board
« Reply #88 on: July 26, 2014, 08:31:09 PM »
Also your idea to make the Magic Users start out slow and then pick up speed is quite a good one and here's why from a character perspective, barring Tellah and Rosa the other mages you get are young children so it would stand to reason that being in a couple of battles they couldn't grasp the severity of battle as others but because they're youthful they would adapt to this lifestyle and excel at it, whereas the older party members could become "world weary" (as I suspect that they were trying to show with Tellah and FuSoYa's level ups taking much longer than the other characters) and thus their rate of growth begins to stymie. Rosa is the closest thing the normal comes to a Warrior-Mage. She has the capacity to deal damage and use her magic to help. Rydia, though she has Whips never really gets the Strength (or accuracy) to use them effectively where as Rosa can deal real damage with her Artemis Arrows and has a good chance to inflict statuses with the Status Arrows.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #89 on: July 28, 2014, 05:57:27 AM »
Also your idea to make the Magic Users start out slow and then pick up speed is quite a good one and here's why from a character perspective...

Thanks Grimoire! I love how my way of thinking and the thinking here often compliment one another: Good stuff! For this specifically I attacked it (as I do most things) from a more mathematical perspective - and you immediately were there with the logic giving the reason for it all to feel right.  :happy:

I hadn't thought about having come upon so many children - that's a really good point; and very rational. One of the many things I do love about FF4 is that it did provide more logical characters: Cecil/Kain/Yang/Edge & Rosa (in a way) are all in the military - so 1st level noobs wouldn't make sense; but it sure does make sense for 5-year old Rydia. It's interesting to even see that in the stat/level gains - I agree that they were definitely tailoring that to fit each character...

A little too much tailoring... Here's a table of the Average HP gains/level (Zero-Filled)

Code: [Select]
Lv DkC Kain Rydia Tellah Edward Rosa Yang Palom Porom Cecil Edge FuSoYa

Code: [Select]
Lv DkC Kain Rydia Tellah Edward Rosa Yang Palom Porom Cecil Edge FuSoYa
1 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 8 0 0 0 0 0 0 17 0 0
3 0 0 9 0 0 0 0 0 0 17 0 0
4 0 0 8 0 0 0 0 0 0 17 0 0
5 0 0 9 0 0 0 0 0 0 17 0 0
6 0 0 8 0 10 0 0 0 0 17 0 0
7 0 0 9 0 11 0 0 0 0 17 0 0
8 0 0 8 0 10 0 0 0 0 17 0 0
9 0 0 9 0 11 0 0 0 0 17 0 0
10 0 0 17 0 10 0 0 0 0 25 0 0
11 21 25 17 0 16 25 42 17 17 26 0 0
12 21 26 17 0 15 26 43 17 17 25 0 0
13 21 34 17 0 16 25 51 17 17 26 0 0
14 21 34 17 0 15 34 51 25 17 25 0 0
15 21 34 17 0 16 34 59 26 17 26 0 0
16 21 42 25 0 15 34 60 25 25 25 0 0
17 21 43 26 0 16 34 68 26 26 26 0 0
18 21 42 25 0 15 34 68 34 25 25 0 0
19 21 51 26 0 16 34 76 34 26 26 0 0
20 21 51 25 0 21 43 77 34 25 25 0 0
21 31 51 26 25 21 42 76 34 26 34 0 0
22 32 51 25 26 21 43 85 34 25 34 0 0
23 31 51 34 25 21 42 85 34 26 34 0 0
24 32 60 34 26 21 43 85 34 34 34 0 0
25 31 59 34 25 21 51 94 34 34 34 0 0
26 32 60 34 26 21 51 93 34 34 34 53 0
27 31 59 34 25 21 51 94 34 34 34 53 0
28 32 60 34 26 21 51 93 34 34 34 61 0
29 31 68 34 25 21 51 94 34 34 34 62 0
30 32 68 34 26 26 51 93 42 34 34 61 0
31 42 68 43 25 27 51 102 43 34 43 62 0
32 43 68 42 26 26 51 102 42 42 51 61 0
33 42 76 43 25 27 59 111 43 43 59 62 0
34 43 77 42 26 26 60 110 42 42 68 61 0
35 42 76 43 25 27 59 119 51 43 77 62 0
36 43 77 42 26 26 68 119 51 42 76 61 0
37 42 76 43 25 27 68 128 51 43 85 62 0
38 43 77 42 26 26 68 127 51 42 85 61 0
39 42 76 43 25 27 77 136 51 43 94 70 0
40 43 77 42 26 31 76 136 51 51 93 70 0
41 53 102 51 25 32 77 136 51 51 102 70 0
42 53 102 51 26 31 76 145 51 51 102 70 0
43 53 102 51 25 32 77 144 60 51 102 70 0
44 53 102 51 26 31 76 145 59 51 102 70 0
45 53 102 60 25 32 77 153 60 51 102 70 0
46 53 102 59 26 31 76 153 59 51 111 79 0
47 53 110 60 25 32 85 153 60 51 110 78 0
48 53 111 59 26 31 85 153 59 59 111 79 0
49 53 110 60 25 32 85 153 60 60 110 78 0
50 53 111 59 26 37 85 153 59 59 111 79 0
51 63 110 68 25 85 85 153 60 60 110 78 21
52 64 111 68 26 85 85 153 59 59 111 79 21
53 63 110 68 25 85 85 153 60 60 110 78 21
54 64 111 68 26 85 85 153 59 59 111 79 21
55 63 110 68 25 85 85 153 68 60 110 87 21
56 64 111 68 26 85 85 153 68 59 111 87 21
57 63 110 68 25 85 85 153 68 60 110 87 21
58 64 111 68 26 85 85 153 68 59 111 87 21
59 63 110 68 25 85 85 153 68 60 110 87 21
60 64 111 68 26 85 94 161 68 59 111 95 21
61 74 110 77 25 93 93 0 68 60 119 96 21
62 74 111 76 26 94 94 0 68 59 119 95 21
63 74 110 77 25 93 93 0 68 60 119 96 21
64 74 111 76 26 94 94 0 68 59 119 95 21
65 74 110 77 25 93 93 0 68 68 119 96 21
66 74 111 76 26 94 94 0 68 68 119 104 21
67 74 110 77 25 93 93 0 68 68 119 104 21
68 74 111 76 26 94 94 0 68 68 119 104 21
69 74 110 77 25 93 93 0 68 68 119 104 21
70 74 128 85 26 94 102 0 77 68 136 104 21
71 74 127 85 25 93 102 0 76 68 136 104 21
72 74 128 85 26 94 102 0 77 68 136 104 21
73 74 127 85 25 93 102 0 76 68 136 104 21
74 74 128 85 26 94 102 0 77 68 136 104 21
75 74 127 85 25 93 102 0 76 68 136 104 21

- Any time in the above where it flip-flops (59-60-59-60...) it means that the middle of the spread of HP Gain for that set of levels was a half-integer, just forced high and low to even out but remain integral.

It's easy to see how segmented HP gain is - but really only per individual character - there's nothing to go on across the board. The most consistent set of levels where gains remain universally static (for the most part) is in the 20s, but really that's it.

One thing I'm noticing is that each character growth seems more or less shifted from one another. I see (for example) a lot of bands of 34 of varying length and placement. In moving the data so the 34 segments line up I can see more of the bands line up per character. But it seems so random as to how long before they trade up for a higher gain rate. One thing I plan to do is see if there is any correlation with the growth rate.

So I've got shadow storage complete. That's the easy part. I'm sort of tackling things in order, so next up is awarding experience to shadowed party members. This will be a two-part process - rewriting the experience awarding routine to store experience awards in the right places, as well as rewriting the level-up routine to ignore shadow data (TNL is not stored, and leveling up will instead occur when a character is loaded FROM the shadow). I expect this to be a relatively quick process, but the character loading sequence (from the shadow) will be a massive rewrite.

That it will, my friend, but we're behind you!  :cycle:

But from my side of it there is some good news in that regard. As that discussion later lead to the difficulties associated with changing experience awards and how it could alter the flow of the game I remembered one of the reasons I killed myself for accuracy in my derivations. I would argue that the balance between character growth and battle load is one of the biggest keys to the success of a game - and I was very hesitant to change that knowing how hard it could become to rebalance by changing the enemies. But I made it past that bump in the road, so it should be smoother sailing from here:

As stated, the HP gains do follow trends so I can certainly work something out to describe that. MP is almost too easy: especially for Kain, Cid, Edward, and good old DkC. And stats, well, the best I can say at the moment is that "stats are stats" I found the pattern for DkC and I've roughed out most of the others; just need to consolidate and formalize it to really get a good hold.

But the good news is that from other discussions, as well as my insider-trading like perspective on numbers alone I know that I'll be able to give myself some freedom with all of the above - so it should be much easier than the TNL battle turned out to be. For one, there is a much smaller range of numbers to deal with, and with so many levels I can definitely get away with bending the rules a bit.

But that's where I am now. I'm going through what I've collected and like TNL I'll first extrapolate back down to Lv 1 from every character's initial Level and from there I'll work out a general trend. It shouldn't be too bad of a formula in the end either - I expect it won't even be recursive - so that alone will make it way easier to deal with.

Stay tuned for more on this story as it develops  :biggs:


 
"Now I know; and knowing makes it even more confusing..."