Author Topic: Developing FF4kster: a comprehensive editor for FF4  (Read 223609 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #300 on: March 14, 2013, 08:58:56 PM »
It seems like things are moving around in a grand fashion! We're almost finished. Just a little bit more and we will have the means to reinvent the game as we see fit! Thank you for all of your hard work and devotion to this project PinkPuff!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #301 on: March 14, 2013, 11:51:13 PM »
OK, enemy formations are located in a table beginning at 70200 (ROM with header), and each entry is eight bytes long.
I haven't figured the whole thing out yet, but the most obvious bits:
-Each enemy formation can have up to 3 different kinds of monster.
monster type 1: Byte 01
monster type 2: Byte 02
monster type 3: Byte 03
-there can be 0-3 of each monster type (max 8 altogether, I think). This is all encoded in byte 04:
monster 1 0/1/2/3: 00/40/80/C0
monster 2 0/1/2/3: 00/10/20/30
monster 3 0/1/2/3: 00/04/08/0C
-there are 146 different possible formations (not all allow up to 8 monsters, btw). Which formation used is determined by byte 05 (value 00-91)
-bytes 00 and 06-07 control all other possibilities in a battle, including back attack, inescapable, monsters begin in eggs, monsters die as bosses, which battle music is used, etc. obviously these three bytes each include several of these options. I haven't worked it all out yet, but will have most likely by tomorrow.
« Last Edit: March 15, 2013, 01:44:43 AM by chillyfeez »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #302 on: March 15, 2013, 05:08:50 AM »
ff4.txt that comes with FF4Ed, in the Docs folder. It does't look like weapon/spell palette data is documented there, though. Zyrthofar's docs might've had it, but I seem to have misplaced those (again :blush:). Yousei actually also wrote a palette editor, snespal, if you want to search for them yourself. (GBA utils should work too since they use the same palette format, hence why there are so many color restoration GBA hacks.)

Thanks! I'll go digging for it when the time comes.

It seems like things are moving around in a grand fashion! We're almost finished. Just a little bit more and we will have the means to reinvent the game as we see fit! Thank you for all of your hard work and devotion to this project PinkPuff!

No problem, thanks for your feedback! And yeah, the vision of a world where we can (more easily) make FF4 bow to our whims is what keeps me motivated to work on it!

OK, enemy formations are located in a table beginning at 70200 (ROM with header), and each entry is eight bytes long.
I haven't figured the whole thing out yet, but the most obvious bits:
... etc ...
I haven't worked it all out yet, but will have most likely by tomorrow.

Wow, nice work! Thanks to this I might be able to squeeze the formation editor into 1.0 after all.
Let's dance!

Zozma

  • FF4 Hacker
  • *
  • Posts: 120
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #303 on: March 15, 2013, 06:25:17 AM »
snes pal is great for use on ff4, i know exactly where the overworld palettes start as well as battle character sprites palettes and portrait palettes. pretty sure these are specifically used for their one purpose. course ff4 reference book lists where these are too....

my favorite thing to do is play with the sprites but i doubt that helps much here
eh, what do I care...

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #304 on: March 15, 2013, 09:36:32 AM »
Here we go:
Code: [Select]
Enemy Formation Table (70200-711FF)
Each formation is represented by 8 bytes:

Byte 0:
 Bit 0: ?
 Bit 1: ?
 Bit 2: ?
 Bit 3: Forced Back Attack
 Bit 4: Enemies Have Boss Death
 Bit 5: Monster(s) 3 Begin In Eggs
 Bit 6: Monster(s) 2 Begin In Eggs
 Bit 7: Monster(s) 1 Begin In Eggs

Byte 1: Monster(s) 1 Type

Byte 2: Monster(s) 2 Type

Byte 3: Monster(s) 3 Type

Byte 4: Qty. of Each Monster Type (max 8 altogether)
 Bit 0-1: ?
 Bit 2-3: Monster(s) 3 Qty.
 Bit 4-5: Monster(s) 2 Qty.
 Bit 6-7: Monster(s) 1 Qty.

Byte 5: Preset Monster Arrangement
 -Values 00-91
 -Total qty. of monsters is limited by arrangement

Byte 6:
 Bit 0: Can't Run
 Bit 1: No Game Over (think impossible Dark Elf battle)
 Bits 2-3: Battle Music (Regular/Boss/Fiend/No Change)
 Bit 4: Character Battle (Edward v. Tellah, etc.)
 Bit 5: Auto Battle (not sure where the AI is for these?)
 Bit 6: Floating
 Bit 7: Transparent (Breath, Mind)

Byte 7: ?
The unknown bits and byte seem to be insignificant, or at least not worth changing.

In case anyone's interested, the so-smart-it's-stupid way I traced this: Took two identical files, changed the monster type of group 1 from imp to basilisk (using zyrthofar's editor), created an .ips patch, read the patch with my hex editor to determine the altered location. Voila!

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #305 on: March 15, 2013, 10:37:21 AM »
Ha, that is a pretty smart technique actually! Thanks so much for the data! Monster formations are now definitely on the list.

I encountered something odd though... at some point along the line my editor seems to have begun causing arrows to be better in the off hand!! Not sure how this happened, or when it happened, as I only noticed it now...

Maybe someone can confirm that this is also happening for them?

Load up a fresh rom and get a bow and arrows and put it on someone correctly and compare the stats to if you swap hands... then load the rom in FF4kster, change nothing, and save, then load up the emulator again and see the difference!
Never mind, found the problem and fixed it.
« Last Edit: March 15, 2013, 11:42:07 AM by Pinkpuff »
Let's dance!

vivify93

  • Liquid Flame
  • *
  • Posts: 302
  • Gender: Male
  • White Wizard
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #306 on: March 15, 2013, 07:04:19 PM »
Hello, me again! Just wondering, was the arrow problem ever in any of the released editors? Like, it isn't in the newest version of ff4kster, is it?
Hacking is hard. :sad:

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #307 on: March 16, 2013, 07:55:17 AM »
I just uploaded the fixed version to the time cave. There are also a couple of new surprises in the "Features" editor (I renamed the "Item Ranges" so that it can include ranges for things other than items).

 :edit:
To answer your question more directly Vivify, that bug has probably been in every version of FF4kster released so far, but saving with the current version will fix it.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #308 on: March 16, 2013, 10:00:18 AM »
Wow! This is some Really good stuff! I'm glad to see that you managed to figure out many of the ranges! But I curiously do not see Shields (Which I had thought I completely figured out). Nor Black (which I would presume, but I have no idea proceeds right after the White range?)

And it automatically recalculates it when you change it! Great work on this little extra Pinkpuff! It makes editing the ranges such a simple matter!

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #309 on: March 16, 2013, 10:52:57 AM »
Wow! This is some Really good stuff! I'm glad to see that you managed to figure out many of the ranges! But I curiously do not see Shields (Which I had thought I completely figured out). Nor Black (which I would presume, but I have no idea proceeds right after the White range?)

Thanks! Still working on shields, they're a little more complicated for some reason.  :edit: Fixed and uploaded. Shields now work correctly as far as I can tell.

Black spells are all those spells that are not White or Summons. Changing a spell to White just changes its casting animation (gives it white orbs instead of a green ring), but changing a spell to become a Summon changes more than just the casting animation (the summoner flames), it messes up the actual execution of the spell. Your party disappears and never reappears, and renders them incapable of acting, and it casts a spell from somewhere down in the spell list. Thus, even though I know what to change to modify that range, I'm hesitant to put it into the editor.
« Last Edit: March 16, 2013, 12:01:24 PM by Pinkpuff »
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #310 on: March 16, 2013, 02:25:14 PM »
Quote
… changing a spell to become a Summon changes more than just the casting animation (the summoner flames), it messes up the actual execution of the spell. Your party disappears and never reappears, and renders them incapable of acting, and it casts a spell from somewhere down in the spell list. Thus, even though I know what to change to modify that range, I'm hesitant to put it into the editor.
Huh... I didn't know that that was known info about summons. I'd like to play around with that. Can someone tell me where the data to adjust that range is? I'm hoping to someday crack the "which monster is summoned" mystery, and this is certainly a key piece of the puzzle I've missed thus far.

(Hey look, I just shapeshifted into a siren!)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #311 on: March 16, 2013, 03:14:31 PM »
1CF28: Index of first summon spell
1CF2C: Index of first spell after the summon range (so, last summon's index + 1)
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #312 on: March 16, 2013, 08:51:25 PM »
hmm... making spells 40+ into summons seems to invariably summon Asura (completely effectively - party comes back afterwards). Not useful at all, really, but different than the game-ruining effect of setting spells before 31 to be summons.
(sorry, I'll stop talking non-ff4kster now)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #313 on: March 16, 2013, 10:52:55 PM »
OK, I think I just discovered a pretty serious glitch (fortunately, I keep backups of everything, including previous versions of ff4kster)...

It seems that, in all versions of ff4kster since editing map properties became available (that is, the version I downloaded on 3/11), the game freezes when you try to change your overworld map character. In other words, if I have Cecil and anyone else in my party, and I'm walking around, and I hit R, the game freezes.

I tested this with a completely clean FF2 v1.1 ROM.  All I did was open the ROM in ff4kster, save it without making any changes, and play from the beginning. Once I had Kain in the party, I hit R - Game Freezes.

Tried also loading a saved game with several characters.  It's fine until you hit R, then freezes.

As a matter of fact, even when there's nobody else in the party, hit R and the game freezes.

Can anyone else confirm that this is happening?
Seems when I fall back to the version of ff4kster I downloaded on 2/9 (the pre- map properties editing version), this problem no longer exists.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #314 on: March 17, 2013, 02:56:54 AM »
Good catch! I think it would have taken me a long time to find that one, I almost never change map characters...

Anyway it's fixed now as far as I can tell.
Let's dance!