øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1905.msg20108e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index0016.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1905.30e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index0016.html.zx”.g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0P.’‡OKtext/htmlISO-8859-1gzip8:Ö’‡ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 06:23:38 GMT0ó°° ®0®P®€§²ð®“.g^ÿÿÿÿÿÿÿÿÔK’‡ Apropos of nothing (except of course FFIV)

Author Topic: Apropos of nothing (except of course FFIV)  (Read 17056 times)

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #30 on: January 04, 2014, 10:57:19 PM »
Ideally I would love our system to be able to calculate from Level 1-70 for every character. That way we could have characters join whenever the modder would like rather than "when their level fits them".

It should be no problem - no reason we shouldn't be able to unless there's some weird sneak pointer somewhere that says 'Cecil starts at 10 - live with it' - and if there is such a pointer I say to you go get him! :banonsmash:

Phew, now this... this is complicated to wrap my head around

Boy you said it...in a way I'm kinda kicking myself for not holding off on posting, clearly my ducks were wandering aimlessly...on the other hand I think I've got it.

I'm going to get right to it now and then I'm sure after not too long after posting and the itch will start to formalize it - I just can't seem to help myself.

Anyway the punchline is:


(New TNL) = (Old TNL) + D + (N - 1) x (T - S + 3N/2)

D = 1st Difference, so for Rosa it is 220,

T = 2nd Difference, so in this case 39,

S = Step Size, what is approximated between the bottom moment, 3 in this case

N =  Current Level - Starting Level, so for Rosa:  Current Level - 10



- I'm not quite happy with it, but it's really not that bad either...



- A little explaination:


This is what that triangle should have been:

Lv 10
  to       815
Lv 11              220           <---F'ed up here - I had 200 in the picture...ouch...
  to      1035             39
Lv 12              259
  to      1294                     <---Wrote 1292 originally - clearly I flunked out of proofreader school
Lv 13

Anyway because there's only one difference between what we need and where things are assumed constant you can pull that formula out recursively. Here's a bit more of that table (copied from excel, no hand typing :P)


LV            TNL                     D                            T
---------------------------------------------------------------------------------------                  
10      815 (815,0)                              S = 3
11      1035 (1035,0)      220 (220,0)      
12      1294 (1294,0)      259 (259,0)      39 (39,0)
13      1595 (1594,-1)      301 (300,-1)      42 (41,-1)
14      1941 (1938,-3)      346 (344,-2)      45 (44,-1)
15      2335 (2330,-5)      394 (392,-2)      48 (48,0)
16      2780 (2773,-7)      445 (443,-2)      51 (51,0)
17      3279 (3270,-9)      499 (497,-2)      54 (54,0)
18      3835 (3825,-10)      556 (555,-1)      57 (58,1)
19      4451 (4440,-11)      616 (615,-1)      60 (60,0)
20      5130 (5118,-12)      679 (678,-1)      63 (63,0)


The numbers on the outside are what I calculated and in the parentheses are the actual values and error

Well I'm convinced  :childish:

Not bad for just saying "eh, let's go with 3"  :wink:


you do end up with an N^2 term in it...I'm working on a way to split that up...that's why it took me so long to come back - I stubbornly had to have my copy of the book can't use the internet...oh no...

http://atsol.fis.ucv.cl/dariop/sites/atsol.fis.ucv.cl.dariop/files/Table_of_Integrals_Series_and_Products_Tablicy_Integralov_Summ_Rjadov_I_Proizvedennij_Engl._2.pdf

I do actually suggest keeping a copy of it - it's only 7MBs and it's free - who knows what the future will bring...two months ago I wouldn't have expected to be here with you fine people and combating the Ghost of Square-past.

As for the N^2 term, I can offer the following suggestions:


A) Live with it - I don't know what kind of delay that would cause

B) Try implementing the Square recursion:  Sq(N+1) = Sq(N)+ (2 x N) + 1

          Basically saying (1+3) = 4 = 2^2, (1+3+5) = 9 = 3^2, (1+3+5+7) =16 = 4^2, etc.
                     
               Seems like a good route, there may already be some code out there


C) Store some of the higher Squares as reference data...that could work well with that last one, say if you
    want 14^2 start with 10^2 having "defined" it as 100

D) It's also possible I my be able to break this down further into a few easier terms, not sure, but so far 
no good

E) Last, similar to C but leave some of the reference level up data in the ROM...which may not be bad overall. I could see maybe every 20 levels or so having it just call the tabulated values and then from there calculating the next set, depending on the spacing we could get around large squares that way

Those are my ideas...feel free to discuss, elaborate, or ignore as you see fit  :tongue:

As for me, I'm going to keep going through the data and and make sure at least this will work universally...it should, just define a set of parameters (D,T,& S) for each character and they're off...or not off and in early, missing level data should not be a problem.

I'll also look at the HP & MP gains some more, but at first glance it seems like it's best to just leave a set of hard coded values and then point...there's still a lot of wasted room in the ROM...like for Cecil's magic gain...from 4 to 4 every level until 70....Square, Square, Square...

I still remember the first time I found out 'the World was Square' - ah memories :kedgar:
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #31 on: January 04, 2014, 11:12:09 PM »
Alright, now this suddenly makes sense to me...

Level. 10 815 is the required Exp. to gain a level. At this point it is working off of TNL and is not using any special coding.
Level. 11 A default reference of 220 is added as the difference between Level 10 and Level 11.
Level. 12 Introduces the 2nd Difference and adds that to the required Level Up from then on, combining that with the Step every level, which continue to goes up by 3 each Level.

And judging by your chart below this matches Almost Identically with the game's sense of progression itself!

This is amazing work! And that you put it in a way that even I could understand it speaks volumes of your talent!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #32 on: January 04, 2014, 11:28:43 PM »
Alright, now this suddenly makes sense to me...

Good - because if you didn't the error would lie with me - there's always a way to explain it to someone - your praise is most kind, internet is my worst - just me, time, and to quote Butter's Stotch "my stupid psychotic brain" - we'll the first two anyway...but I can just go on and on...like right now.  :blush:

But please, with me especially, don't hesitate to come back asking again about anything. My neighbor came by asking me to recommend a good text for her - I end up offering to teach her. I'll never shy from people willing to learn. :)
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #33 on: January 04, 2014, 11:38:58 PM »
I will keep that in mind. If I'm going to be of any help on this project, I'll need to be on the ball when it comes to certain math equations, especially if I plan on actually programming it into the game.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #34 on: January 05, 2014, 05:46:01 PM »
That's a good thing I noticed when it comes to your code: very well commented. I'm sure if we ran into trouble I could check the math following your thorough documentation.

On that front I am currently kicking around two ideas:

One is to keep going with the present approach, but I know it's going to end up more involved than just a set of three numbers for each character, there may need to be an additional parameter, and/or slight modifications to the routines per individual...I sort of had that in mind anyway...a major routine that works for everyone and get's you to 90% accuracy (or so) and then little bits of clean up code, probably split by starting Level: <10, 10, & >10 which divides our heroes into groups of:

{Paladin Cecil(1), Rydia(1), & Edward(5)} < 10

{DK Cecil, Kain, Rosa, Yang, Porom, & Palom} = 10

{Tellah(20), Cid(20), Edge(25), & FuSoYa(50)} > 10


- But all that is in the efforts of accuracy for as little deviation from the original levels as possible. I think what I might end up trying (please comment) will be to have a table like there is now for each character, but only store every 10th level (or 15, or whatever) and then have a single formula that can work for every character where the T,D, & S values used for each character aren't fixed through the whole game but have slight variance depending on the nearest Tier Level:

The hope is to be able to change my formula as-it-is from:

                (New TNL) = (Old TNL) + D + (N - 1) x (T - S + 3N/2)

to something like:

          If New Level is Fixed Then
                          Read TNL from the ROM directly
          Else
                          Read Base Parameters for Character from ROM & Modify as Needed

                           Lv = Current Level

                          Case:  10 < Lv < 20

                              D = D + T
                              T = 2 x T
                              S = S + 1
   
                          Case:  20 < Lv < 30

                              D = 2 x D + T
                              T = 3 x T
                              S = S + 3   
                             
                          Case:  30 < Lv < 40
                              ...   
                          Case:  40 < Lv < 50
                              ...
                          Case:  50 < Lv < 60
                              ...
                          Case:  60 < Lv < 70
                              ...
                          Break

      (New TNL) = (Old TNL) + D + (N - 1) x T  +  S * (3/2) * N       ( Or Something Similar)

      EndIf


The idea being that by changing the parameters along the way I wouldn't need so complicated of a formula - the goal specifically being to eliminate the need for an N*(N-1) term - then it would just be N all the way, never N^2 (or anything worse)

In terms of storage this would require (for experience) would be 18 bytes / character for a total of 216 Bytes of storage for experience. As it is now in the Level Up Storage Bank: 7B528-7C3C8  (3,744 Bytes) over half of it is dedicated to storing the TNL data: 2,112 Bytes as I figure it.

- So with that even if I weren't planning to eventually work out formulas to include Attribute, HP & MP gains (if I get Exp to work, everything else is a cake walk) that's still a bunch of room that, after data rearrangement, could be used to house this algorithm and more.

Let me know if that left anyone confused and I'll try and clarify.

Also, though not the way I think we should go...I did find some info on powers calculated in Assembly; they seemed interesting.  :happy:

http://stackoverflow.com/questions/5969263/assembly-exponent-power-program-help

http://www.dailyfreecode.com/code/calculate-powerab-i-e-ab-1670.aspx
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #35 on: January 05, 2014, 06:07:41 PM »
That system looks workable and it seems that we would save Tons of space by using it. Though I am confused why T (when a level is gained) doubles.  Or are those referring to the changes that will be made to the algorithm when it reaches that new level base?

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #36 on: January 05, 2014, 07:22:31 PM »
B) Changes that will be made - it might be 3 x T after that - whatever fits best for everyone that's what I'll do. As for what the parameters are for each character I don't know yet - except for Rosa. She's going to be my model for how to modify T,D, & S at each level gap.

I have a programming question: the pseudo code I wrote shouldn't be hard to implement, right? I feel like when I was looking at some of your code that a big string of BEQ is not out of the question - in my mind that's what I translated as an equivalent for Case. Also - a good insight into my skills as a programmer is the shockingly small amount of time I've actually used Case/Break - I learned If-ElseIf-Else when I first started and I swear my brain refused to change for no reason other than to be difficult.

As for the proposal at hand what I can tell you is that mathematically it's a lot easier to find a linear equation for a small range of data as opposed to a large one. The experience data seems pretty consistent to follow a cubic trend - which is interesting and I have no idea from a game-design stand point why (Level)^3 is the magic way to scale Exp requirements. I think breaking it up into groups of 10 is going to be the easiest all around; so until otherwise stated the division is per 10 levels if I don't specify it directly in the future...but please feel free to offer your opinion.

- On an unrelated note - I was just play testing a ROM after making some map edits (way to go Pinkpuff!!) and I ran into an odd situation. I'm on the moon in the Lunar Subterrane with my pre-Fabul party as I have been for a while. I ran into two Fatal Eyes (my party is all at Lv99) and Edward decided to go hiding when Fatal was cast on him. This only happened once - I tried to do it again on purpose to see if it really happened - but I couldn't reproduce it. It seemed like his timer screwed up as well because he stayed out way beyond his count - people were dying, and coming back while he was still back there...but when I let everyone else die off he did come back after a bit of delay to die in humorous fashion:

["Show"] ------ "00" ------ Dead....  What a way to go - lol
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #37 on: January 05, 2014, 07:33:04 PM »
I honestly cannot say whether this will be easy or difficult. It will likely revolve around a lot of beq/bcc to reach the proper level. In the end we might need some outside help as this is entirely new to me in an almost frightening manner. If those values are placed in Rom, it's more a point of grabbing those values (LDAx 0XXXXX) for instance, using X as the character identifier to reach the right section of data. Because of this it would be best if the data stayed uniform in some respects.

Hmm, Fatal cast on Edward causing him to use Hide...

 $03/AB4D   29 01   AND #$01   A:0000   X:0000   Y:0012   P:envMxdiZc - Is it Critical?
$03/AB4F   F0 50   BEQ $50    [$ABA1]   A:0000   X:0000   Y:0012   P:envMxdiZc - If not branch to 03ABA1.
------------------------------------------------------------------------------------------------------------------------------------
$03/AB51   BD 00 20   LDA $2000,x[$7E:2080]   A:0001   X:0080   Y:0012   P:envMxdizc - Load Character ID into A.
$03/AB54   29 1F   AND #$1F   A:0085   X:0080   Y:0012   P:eNvMxdizc - -Get rid of negative bits.
$03/AB56   C9 05   CMP #$05   A:0005   X:0080   Y:0012   P:envMxdizc - Is it Edward?
$03/AB58   D0 47   BNE $47    [$ABA1]   A:0005   X:0080   Y:0012   P:envMxdiZC - If not branch to 03ABA1.

Are you sure that he wasn't put in Critical by this in some fashion?  According to the code that's the only thing which activates Auto-Hide.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #38 on: January 06, 2014, 02:24:16 PM »
My only guess is I must have told him to do it without thinking about it - I don't know why, but it only happened once and that's my only explanation because definitely not critical - still had full HP. So, not as weird I thought - but still amusing to see.
"Now I know; and knowing makes it even more confusing..."

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #39 on: January 13, 2014, 02:26:43 AM »
Moving on from Edward miscommunication...  :wink:
I've been looking into experience a lot lately. So many numbers...  :tongue:

Looking at this was very helpful in wrapping my head around what the game is up to:

      http://slickproductions.org/forum/index.php?topic=1883.msg19497#msg19497

Thank you for the link Grimoire LD!  :childish:

Looking at it a few times (and then a little more :P) I think I may have an answer to:

Hmm... Well let's take a closer look at that Level Up Data (After 70) shall we?

Random Level Up Selection.

Code: [Select]
...
$03/EF77 A6 A6 LDX $A6    [$00:00A6] A:0005 X:0003 Y:015C P:envMxdizC - Load X from A6 (I swear the random choice above wasn't even used...)
...

Earlier in the code is:

...
$03/EF4F   20 79 83   JSR $8379  [$03:8379]   A:0007   X:0000   Y:0159   P:envMxdizC
      - Put 00-07 into a Random Number Generator (choosing which of the eight selections to take)
$03/EF52   AA    TAX   A:0003   X:0000   Y:0059   P:eNvMxdizc - Transfer A to X.
$03/EF53   86 AD   STX $AD    [$00:00AD]   A:0003   X:0003   Y:0059   P:envMxdizc - Store X in AD.
...
----------------------------------------------Later at the end with: --------------------------------------------
...
$03/EF77   A6 A6   LDX $A6    [$00:00A6]   A:0005   X:0003   Y:015C   P:envMxdizC - Load X from A6 (I swear the random choice above wasn't even used...)
...
--------------------------------------------------------------------------------------------------------------------

It's looking in A6 instead of AD where it dumped that random number - it was just bad luck that the load instruction was A6 - leading to (I'm speculating) a typo of A6 A6 instead of A6 AD

- But I may have missed something - I'm not all that much when it comes to Assembly - maybe someday  :hmm:

So that's the bulk of the "short post" of these wee morning hours...  :wink:

I've got the pseudo-code for calculating TNL values for any Level (under 70)

The short version of the questions I pose are:

1) How close is close enough to what the game intended to charge you for experience/Level:
     - Is everyone OK with an additional 21,167 added to the 362,228 needed to reach Lv 40 from Lv 39 for Cecil as a Dark Knight? (Ever Level requires a little more than usual - and that does add up...)

2) I have a loop within a loop - does that leave me in bad shape for trying to calculate TNL values?
   - What about if someone gets many levels@ once (I'm looking at you Paladin Cecil...)
   - The most complicated instruction in the code is add a few numbers and multiply by 3
   - I'm hoping that will give me the edge I need to get away with this approach (Thoughts??)


Consider this a fair warning: another long post awaits the brave traveler who scrolls further...

Having watched Alien through Alien3 this weekend while working out the math for Experience Levels I can't help but wonder if the motto of "The Company" isn't fitting for our band of warriors:

"Weyland-Yutani: Building Better Worlds" - That's our goal for FF4 isn't it? (and to have fun of course!)

Also before decending into the depths...I'm starting to think that my ideas of "short" and "long" posts are similar to the smallest size popcorn at the theater being a 'Large'...
"Now I know; and knowing makes it even more confusing..."

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #40 on: January 13, 2014, 02:40:09 AM »
It's kinda a long story...

But I think the pseudo-code is definitely the rug that "really ties the room together"  :wink:

Of course everyone else posting updates (and amazing works!) is the inspiration to press on - that and personal frustration with:

      Level Data for Dark Knight Cecil:  XX XX 00 XX XX | XX XX 00 XX XX | XX XX 00 XX XX | XX XX 00 XX XX …

- Got it - Dark Knight Cecil never, EVER gains magic (though, of course, will be 20 later then 40, ugh...)

Gripes aside the game's approach to calculation TNL values is interesting: In the RAM at any give time (in the last 3 bytes of the 40 byte block for each character) is stored the TNL value from the previous level transition. If you look in FF4kster at DkC, as I've been calling our starting friend for short, the initial data given is TNL = 2403. This value is technically what it would have taken to get from Level 9 to Level 10, where DkC actually starts. So in calculating TNL for DkC to get to Lv 11 the game reads the previous TNL from the RAM and adds to it the difference between that and the next level, which is what is stored in the Level-Up table in the ROM (look at the 1st entry under TNL in FF4kster) - this value is 931. That's where the game comes up with TNL = 3334 (2403 + 931 = 3334) - and when the game starts with an initial EXP load of 3000, that leaves 334 left TNL, as shown on the status screen.

I do actually get this move - storing the differences is easier than the actual amounts, much smaller numbers overall. The fact remains that overall the table-storage route bugs the crap out of me and really limits our ability to mess around with starting levels and swap things around.

To fix this I filled in the gaps in the table, i.e. every character has values for Levels 1 - 69 (not in the ROM - just in my files). I filled in based on averages skewed appropriate given the overall growth rate as exists in the ROM. That done the next step is to settle on an appropriate algorithm to calculate the tabulated values. I've got this worked out more or less now it's a matter of adjusting each character's parameters to minimize the discrepancy between what it calculated and what already exists.

DkC is who I'm looking at for the most part to start and with the parameters chosen I can minimize the calculation error to under 0.9% for any value in the table. This is where opinion comes in:

The highest error for DkC is +0.8%, which means at a given Level if my method is used the game may demand an additional 0.8% experience to advance. To put that in perspective that would mean an additional 2126 exp on top of the 89846 already required (@ Lv 27) or an additional 21,167 added to the 362,228 needed to reach Lv 40 from Lv 39. I always try and skew it so lower levels are most accurate - for DkC he will require no more than an additional 200/Lv from Lv. 10 - Lv. 22 (Even less closer to Lv. 10). I don't think this is going to throw off the gameplay too much, I'm not even sure if I would notice - but I don't know so I'm throwing it out to the experts at large.

Should I live with this kind of discrepancy (as a little added challenge to the game) or work to find an additional algorithm to fix where my base algorithm overshoots. The good part about what I have so far is that it is easy to calculate (in my mind at least) - no crazy squares or cubes of numbers, just some recursion loops. In a nutshell I came up with this:

      New TNL = Old TNL + V + (L - F - 1) x A + Sum (X=1 -> L - F - 1){ Sum (Y=1 -> X - 1)  { 3 x ( L - F + P + FLOOR((L-F)/5))}}

      With V being the 1st entry in the ROM table (931 for DkC)
      A is the 1st difference - determined from the table originally and is constant (DkC: A = 255)
      F = Starting Level - DkC: F = 10
      L = Current Level
      P = Adjustment Parameter (Constant and predetermined - for DkC P = 10)

    Which I admit even looked nuts when I derived it (Sum within a Sum really) - but writing the pseudo-code helps to clear things up:


Temp = 0

For X = 1 to (L - F - 1)

      For Y = 1 to X - 1

            Temp = Temp + 3 x ( L - F + P + FLOOR((L-F)/5))

      Next

      Temp = Temp + A

Next

New TNL = Old TNL + V + Temp


- and though I hate using 'Temp' as a variable name - it's late/early and I don't want to to be creative...

- But that's it. As I figure it each character will need to store five values: (values for DkC shown)

       V (931)  ~  A (255)  ~   P (10)  ~   F (10)  &  1st TNL (seed to get started, 2403 for DkC)


The above formula is general and only depends on the 4 parameters above (F,A,V, & P) as well as:

              Current Level          (in the RAM @ 7E1002)

              Old TNL                  (in the RAM @ 7E103D-F)

     *Addresses are for the character in Slot 1 (center) - add 40 (hex) for Slot 2, 80 for Slot 3, etc.

This should save 1496 (dec.) bytes less the 12 x 5 = 40 (dec.) to store the parameters for each character. This assumes the Twins to share the same experience values - in the table they are identical most of the time and within the error of calculation otherwise.

Next will be to add into the calculation code the ability to handle HP, MP & Stats - which in comparison should be no problem:

DkC for example has entries of:

20 for Lv 10 - 19 then
30 for Lv 20 - 29 then
40 for Lv 30 - 39 then (you guessed it)
50 for Lv 40 - 49 then
60 for Lv 50 - 59 & finally
70 for Lv 60 - 99

With +MP always 0* and stats increasing only by 1 in a cyclic pattern of attributes

* from http://rb.thundaga.com/chars/lvup_data.txt

Quote from: Details
=================================================================
Level Data bytes:
=================================================================
Byte 1: Attribute Bonus:
...
Byte 2: Hit Point Gain
Byte 3: Magic Point Gain; also, around the 50th level gained or
so (varies for each character), the ROM begins adding $20, $40,
or ($20 + $40) for each subsequent entry for this byte.  This
may have something to do with how your HP/MP/Exp needed data is
updated after you pass level 70.
Byte 4: Lower byte for Exp needed to gain a level.
Byte 5: Upper byte for Exp needed to gain a level.
=================================================================


So at the end of this rainbow should be a very doable replacement for the reference table freeing up 3744 bytes of room (minus cost).  (@ 7B528 - 7C3C8 in an unheadered 1.1 ROM)

- Also, if I'm thinking this through correctly (debatable) this should clear up the problems with swapping characters around and not having trouble adapting them to the story - you want a Level 12 Edge that you meet at Kaipo - go for it! Also, the trouble seen with Phoenix's shadow party hack should not be an issue - at the very least when someone comes back just set them to match Cecil's level. (or however seems appropriate)

There's potential - but I'll need help coding it.  :tongue:

...that is if whomever read through all this is still alive to tell the tale - jury is still out on myself :wink:
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #41 on: January 13, 2014, 11:35:40 PM »
This is an incredibly impressive piece of thoughtcraft! Do you have any thoughts on how and where this should be implemented? Finding where the TNL is, appears to already be known, would just need to put your routine in there to get a constant level up without the need for all of the rest, is that right?

I would definitely say that our goal is to build a better (or at least, different). Anything is better than a Peep command, an unused command in "Runs away", and limited functionality on many of the commands ( I still need to do something with Focus and Brace, but I'm not sure what... I'm throwing around the idea of an "Attack Stance" and "Defense Stance" but that is too similar to my Advance command for comfort and Counter seems a near impossibility to set up without knowing where the Actual effects of Statuses are stored. (Some status effects are literally dealt with by accompanying routines (like Fight and Magic) rather than their own.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #42 on: January 14, 2014, 02:28:29 AM »
Thank you Grimoire  :happy:

The table storing the TNL values runs  7B528 to 7C3C8 - so I expect fill up the front of that with the parameters needed for each character - then have calculation code after it - with plenty of room left over for the future. But my question is - does that work, or is that some part of the ROM that is only good to pull values from. (still trying to grasp the SNES architecture)

You never cease to amaze with your command of...commands  :tongue:

Just when I think you must be running out - there's still some left to explore.

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

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #43 on: January 14, 2014, 07:34:46 AM »
Well let's see... there is a way to make ASM jump to any value, anywhere. What we will need to do is see where in RAM/LoRom the game draws the TNL from immediately (Had I only realized this some time ago I might have solved my level up problem I was having, now I suspect that the game puts in Level 69's TNL by default once those levels are reached) The first time it is loaded it is clear it is from default information. After that... I'll have to take a look at that when I get home from work and school.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Apropos of nothing (except of course FFIV)
« Reply #44 on: January 14, 2014, 11:12:22 AM »
Turns out I wasn't scheduled for work today, so maybe i can get to this.

Alright, I've taken a cursory look and the system is a little more complicated than I expected. How it works is that the new TNL pointer does not just Replace the old one at level up, it Adds it onto the currently existing one (may have already been known, new information to me) For instance, when Cecil levels from 10 to 11, his TNL pointer from 63 09 to 63 +(from AD)A3=06 and (From AE)09+03=0D so that makes Cecil's next pointer to be 060D for Level 11. I am baffled as to what or where it is exactly pointing to and from. Though the first one may be so disparate from the other's location, because it is looking from default information.

This is all loaded from 7E289F... 289F was an unknown to me, but it might be some sort of TNL storer.

$03/EF34   B7 80   LDA [$80],y[$0F:B52C]   A:00A3   X:0004   Y:0031   P:eNvMxdizc
$03/EF36   9D 9C 28   STA $289C,x[$7E:28A0]   A:0003   X:0004   Y:0031   P:envMxdiz

This seems to be the big notice. 0FB52C+XX amount, depending on character. But that must have been known otherwise the Exp. system in the Level Up Section of FFIVkster shouldn't have worked.