Author Topic: The Drawing Board  (Read 17962 times)

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #120 on: August 11, 2014, 08:15:51 PM »
It's Done!  :childish:

I can't go too much into detail at the moment - but hopefully the Excel file I put together will be self-contained enough for everyone to see what's going on. I have in it all of my work-arounds (TNL, Stats and HP/MP Gain) as well as the original data for quick reference.

Here's a link for the file - let me know if you've a more preferred filehost and I'll re-upload it there.

Enjoy!   :wink:       http://www.filedropper.com/ff4stats081114v1_1
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: The Drawing Board
« Reply #121 on: August 11, 2014, 08:30:19 PM »
If only I could read formulas I would try to help you here, but alas, this is far beyond my meager understanding. From what I've seen of the file though it looks pretty good to have a sequential set-up for all of the PC's, without a doubt!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: The Drawing Board
« Reply #122 on: August 11, 2014, 09:00:25 PM »
I might need you to explain it a bit before we can go any further here.

Specifically, examples that explain where each of the variables come from within a given example.
For instance: let's say I want to calculate Rydia's Agi at Lv. 42.
I assume that the necessary info would be her starting level (1) and her starting Agi score (4). Then all of your fancy maths come into play... I think I kind of need you to, now that you've figured all of this out, teach me how to use it.
I definitely want to eventually implement all of this, but you'll have to guide me for a bit (with the math, I can handle the ASM part).

A couple of other things I should put out there. Even once I do understand it all enough to start coding, I have a couple of other things on my agenda it will have to contend with.
I promised myself I would work on finishing the next chapter in my hack once I was done with the Shadow Mod (as in, the chapter I was talking about finishing before I started working on the Shadow Mod) I'm very close (relatively), and I don't want to leave it hanging.
Also, I just discovered that TAY is available in the Play Store, meaning I finally own a device that will enable me to play it, so I do intend on spending some of my free time with that as well.

Please don't interpret all this as me brushing you aside, though. I don't want to understate the importance (at least to the world of FFIVhacking) of the potential that is unlocked by what you've done here, and I'm just the kind of nerd to take the next step with it. But I am a bit exhausted, too.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #123 on: August 11, 2014, 09:40:20 PM »
It's ok - I'm a bit flattered you guys jumped on it so quick  :tongue:

Rydia's Agi at Lv. 42. - OK if you're asking in the event that she just joined for the 1st time you would indeed need the starting stat. The table I have in the middle of "Stats_Both" is preadjusted so that everyone's stats correspond to Lv 1. Current level is what is important, as is her growth Stat (82 in this case). 82 = 64 + 16 + 2 which means she gains Agi on every 1st, 3rd, & 6th level gains. Then take the starting Stat value of 4 and run a loop up to 42 adding 1 on every 1st, 3rd, & 6th pass. That's it! Just remember the loop starts at 2, the ROM was originally set up so that gains at Lv 1 are always 0, so they intend Lv 2 entries to correspond to when you reach Lv 2. Doing so give should 24.

If it is just a single gain it is easier since you just run once and if the current level matches the growth distribution you gain, if not then zippo. Hopefully this helps - if not I'll try and work a better example.

As for the rest I appreciate your letting me know your battle plan. After that Shadow patch you definitely earned as long a break as you wish, and I'm very much in support of finishing personal hacks - that's why we are all here, to retell the story our own way so we can all enjoy it anew.

I don't expect it to be an easy project - neither to code nor in hammering out the details. So I totally get backing off for a while; such a task can be overly-consuming. So when you are ready I'll be here; just let me know what else I can do to help.

Also...you haven't played TAY yet?? You sir, in my mind at least, now have a pass for any gripe that might pop into anyone's mind...go, play, enjoy!  :wink:
"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 #124 on: December 14, 2014, 05:18:06 PM »
Well, it seems now more than ever what I'd been using as a signature is more true now than ever:

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

I just glanced over the above discussion and my question is:

 :wtf: - what is this "LordGarmonde" guy going on about?? - Oh wait, that's me  :hmm: I might need to think a bit to get back in the swing  :wink:
"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 #125 on: December 14, 2014, 09:49:45 PM »
Quote
Ha! 7th Saga! I used to love that game until I discovered how disappointing and seemingly slapdash the end is.

Very true; however, I have seen worse. GTA V, for example, the writing gives up after about 25% of the game - at least 7th Saga only craps out towards the end. It's kinda like a show/book/movie that you like and then turns out to be all a dream...I hate that! :bah:

I have played through every hack (I think) - one interesting idea was from Nati:     7th Saga: The New Class      http://www.romhacking.net/hacks/1541/

Among its many flaws, one weakness of The 7th Saga was that the characters were almost carbon copies of each other, limiting replay value. In this hack, based on the improvements already made in my 7th Saga Redux hack, the characters have been given familiar classes based on Final Fantasy 1, with different stats and spells. Because this version can be played with minimal grinding, it?s a lot easier to try out each class and learn its unique playing style. The classes:

RedMage (Kamil): Well-rounded in all areas Fighter (Olvan): Tough physical warrior with healing magic Bl.Mage (Esuna): Powerful offensive mage Bl.Belt (Wilme): Expert in unarmed combat Robot (Lux): The ultimate defensive tank Wh.Mage (Valsu): Healing and support mage Thief (Lejes): Master of stealth and sabotage


There was an earlier release called 7th Fantasy - which I preferred, but either way. The thing about 7th Saga that I like, other than it being a personal childhood throwback, is the apprentice mechanic. It obviously could have been developed further, much like the rest of the game, but it was different compared to the games I had been used to playing.


That brings up a point about FF IV, and why I love it so! There's a good story base, and it is told through the characters in both when they come and go and then who they & the role they fill. Choice is nice, but it hurts the core of a story that can be told. There are ways to try and balance that but I personally prefer something more self-contained.

As far as things go for my personal hack my "master plan" is to try and retell the same core story but to try and alter things around to better flow. At the same time - I'm putting Golbez in the party so who knows how it will really end up looking. I want the game to feel right when you're playing it - and I don't even know if that will be possible.

To that end - I'm curious to hear thoughts about an idea I have to make Cid an NPC. I'd have him "join" your party like the characters seen in FF III. I'd use his slot for Golbez rather than try and expand the roster. I don't know...I feel like I'd end up missing that double-hammer sound effect.  :wink:
"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 #126 on: December 18, 2014, 08:16:46 PM »
"OK Fighter...this is the most complicated technique I've taught you thus far..."  -- "Complicated technique, got it..."  I love 8-Bit Theatre  :happy:

Please note this post is still a work in progress - I know I'm going to have to tweak a few things but I want to write it out on the board so I can see it laid out.

I'm back to thinking about how to get rid of all the Level-Up tables in the ROM. Please correct me if I'm wrong, but the way I'm seeing it the information needed for each character is the following:

       Initial Values for:                       HP, MP, Level, and Stats: (Str, Agl, Vit, Wis, Wil)
       Growth Data (Per Level) for:     HP, MP,  and Stats: (Str, Agl, Vit, Wis, Wil)
       & Finally TNL Data

With the formulas I've derived I can get away with a total of 18 values stored in the ROM - The attachment has the actual values; except for MP gain, I'm still perfecting that. As discussed previously this is gonna be a bi***  :finger: to code but I wanted to make sure my logic is sound.

With the calculations for each character it will eliminate the problems with levels: Edge could calculate TNL data for levels below 25 - so you could add him to the party whenever. The other big advantage is that changing a character's data should be no trouble. You could really just mix and match the numbers from different characters to make a new one: Golbez, for example, in my hack will probably be a mix of Cid & Palom:    Cid's HP, Str, Vit  and  Palom's MP, Agl, Wis, Wil        -- or something like this.

It's actually the math I question - I'm positive that once laid out you guys will be able to code it (when time and fortitude allow)  :wink:
"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 #127 on: December 19, 2014, 12:33:09 AM »
The big advantage, in my mind, is the possibility this would open up for a full shadow party. Granted, I made a patch for full shadow party, but it isn't perfect. I think I could make it perfect once you have this all worked out - though it will require rewriting the entire level up routine, which will take a veritable ton of work. I'm thinking it would be another summer project.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #128 on: December 19, 2014, 04:42:00 PM »
The big advantage, in my mind, is the possibility this would open up for a full shadow party. Granted, I made a patch for full shadow party, but it isn't perfect. I think I could make it perfect once you have this all worked out - though it will require rewriting the entire level up routine, which will take a veritable ton of work. I'm thinking it would be another summer project.

Maybe not. I built that computation algorithm on the premise that putting into effect the results of leveling would be too difficult to be worth it. I would instead hook in right when it looks for the TNL number from the ROM (for example) - only instead of getting the number from the ROM run the code to calculate the value and then return that. Same with the stats, etc. As I recall the actual routine execution was pretty fast if there was no message displayed for every level - that might be a good place to tweak the code and just have it display once - maybe just: "Cecil Leveled Up" - that works for any amount of levels

Still though - it would be quite the task to write the routines to do the calculations. I worked them out before - but really it's just pseudocode - I'm still at ASM Lv 1.  :blits:
"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 #129 on: April 14, 2015, 09:21:35 PM »
Update:

I have the recursion formula worked out for TNL. I've written some test code (using the SNES Development Kit) to utilize the Mode-7 registers to calculate the required values with high accuracy. Since the pacing of the leveling in FF4 is one of the things I love most I just couldn't let it go without the calculated values being as close as possible to those tabulated.  :finger:
"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 #130 on: April 14, 2015, 11:35:17 PM »
Wait - do you know how to actually use the mode 7 registers to perform mathematic operations?
I've heard about it being done, but I've never seen the process explained.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #131 on: April 15, 2015, 09:03:21 AM »
Wait - do you know how to actually use the mode 7 registers to perform mathematic operations?
I've heard about it being done, but I've never seen the process explained.

I do; but it took a while to get the hang of the subtleties - like most things  :wink:

The most direct reference is from SNES Development Wiki: http://wiki.superfamicom.org/snes/show/Mode+7+-+Rotation

There are two registers that are used for Mode-7 Multiplication (M7M):
  • $211B: 1st  Multiplicand (P) - 16-Bit (Double-Write)
  • $211C: 2nd Multiplicand (Q) -  8-Bit
Where the 24-bit result (R) can be read from $2134-$2136. I chose the labels since it's easy to remember what's what; specifically P x Q = R.

What I have found to be the limits of use for practical purposes are: P = (0-65535) & Q = (1-128). Q is a signed 8-bit value but for dealing with multiplication I found it best to stick with positive numbers since then there are no overflows which can be a pain to deal with in a 24-bit value without 24-bit operations available. Also the reason I say zero is not allowed for Q is because the multiplication is carried out when Q is written, and if zero is written it seems to not produce a zero result. I'm not sure what causes this specifically, so I've just been avoiding it. Fortunately in my calculations Q is always the current level so it starts at 1 anyway and stays well below 128.

I'll follow up later today/tomorrow with a bit more detail: specifically how to actually work with the registers. For now, however, I have to finish off my taxes...  :blush:
« Last Edit: April 16, 2015, 02:15:08 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 #132 on: April 15, 2015, 02:32:53 PM »
Wow, man, way to wait til the 11th hour...
 :laugh:

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: The Drawing Board
« Reply #133 on: April 16, 2015, 11:39:33 AM »
Wow, man, way to wait til the 11th hour... :laugh:

It's not as bad as it sounds, most of it was done - all old school on paper by me - I just needed to finish it off. The problem I run into is that I tell myself every year "Hire Someone!" and the other half of my brain resists saying "Nah, Dude. You got this!" - But I made it before I had to go to class last night.  :wink:
"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 #134 on: April 16, 2015, 02:47:37 PM »
Hopefully this will be relatively short - relative to me I mean.  :wink:

Using Mode-7 for 24-Bit Multiplication:

If, for example, we need to multiply 60,186 ($EB1A) by 67 ($43) the result should be 4,032,462  ($3D87CE)
To do this with the Mode-7 Registers that would require code similar to this:

Code: [Select]
LDA #$1A
STA $211B
LDA #$EB
STA $211B
LDA #$43
STA $211C

The Multiplication starts when $211C is written and the result is:

Code: [Select]
$2134 = CE
$2135 = 87
$2136 = 3D

That's useful, but not the purpose for which those registers were designed. They were set up specifically to handle the fractionals that show up in rotation and scaling. So a more appropriate example would be this:

     18.29 x 67 = 1225.43 ~ 1,225

The trick needed for this calculation is to upscale the 16-bit multiplicand by 256:

     18.29 x 256 = 4682.24 ~ 4,682

Then use that number to do the multiplication as shown above. The result is:

     4682 x 67 = 313,694

But because we scaled up before we need to scale down to get the real answer:

     313694 / 256 = 1225.37 ~ 1225

So in the end it's 1225.37 vs 1225.43, but since we will just ignore the fractional in the end anyway it doesn't matter. The important thing is that by multiplying by 256 we keep the fractional around for computation and then by dividing by 256 we ignore it for later use. The best part is that the final division doesn't need to be performed: just ignore the value in $2134 and read $2135-$2136 as a 16-Bit value and then that's that!

I do not mind saying that given the hardware this seems a pretty clever method to make games like F-Zero possible; I'd never even have thought that such calculations were taking place. Fortunately there should not be too many conflicts in using these registers for our own purposes since FF4 is not a Mode-7 intensive game.
"Now I know; and knowing makes it even more confusing..."