News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: FF6Tools (v0.1) - Final Fantasy VI Utility  (Read 1282 times)

Everything

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
FF6Tools (v0.1) - Final Fantasy VI Utility
« on: July 14, 2018, 12:15:10 am »
FF6Tools is a browser-based ROM editor for Final Fantasy VI. It's written primarily in javascript and it's been tested on Chrome, Firefox, and Safari. This project started as an app for Mac OS X, but I decided to rewrite it in javascript so that it will work on any operating system. This project is still in an early stage, so expect to find a few bugs here and there. I appreciate any feedback, either here or on the FF6Hacking forums!

Links

FF6Tools
GitHub Repository

Features

The main tools are the map editor and the battle editor. With the map editor you can edit map backgrounds, create and edit triggers and NPCs, and edit the event script. When editing map backgrounds, select a layer and left click on the map to change the tiles. Right click and drag to select tiles. With the battle editor you can drag monsters around and edit their stats.

There are lots of great FF6 utilities out there already (Yousei's FF3ed, LordJ's FF3usME, ZoneDoctor, and FF6LE to name a few), but I wanted to make something with a stable and user-friendly map and event editor. I think I've made a pretty good start, and I have plans to implement more features later on. If there are any other features you would like to see, please let me know! FF6 has been pretty well hacked to death, so there's not much that can't be done.

Supported ROMs

You can open any of the supported ROMs listed below. SNES ROMs with a 512-byte header will work, though the header will be deleted. FF6Tools checks the CRC32 of your file to determine which ROM you are trying to open, so you won't be able to open a ROM if you've previously made changes to it using another utility. When you save your ROM, it will save a zip file that contains the edited ROM and a json file that can be used to re-open the ROM if you want to make additional changes.

FF6 has a lot in common with the other SNES Final Fantasy games, so I decided to also add support for them too (some more so than others). Currently supported ROMs:

  • Final Fantasy 3 (US) v1.0 and v1.1
  • Final Fantasy 6 (J)
  • Final Fantasy 6 Advance (US)
  • Final Fantasy 2 (US) v1.0 and v1.1
  • Final Fantasy 4 (J) v1.0 and v1.1
  • Final Fantasy 4 EasyType (J)
  • Final Fantasy 5 (RPGe Translation) v1.10
  • Final Fantasy 5 (J)

When you save your ROM, FF6Tools doesn't do any checks to make sure you don't overwrite adjacent data in the ROM, so expect gameplay glitches if you make major changes. This affects some things more than others. I'm eventually going to keep track of empty space and relocate data as needed to fix this issue but I haven't gotten around to it yet.

In case you're worried about uploading your ROM file in a browser, keep in mind that there's no server-side code involved. Everything is happening right on your computer. If you want an offline version you can download it from GitHub.

Screenshots

FF3u/FF6j
Spoiler:

FF6 Advance
Spoiler:

FF2u/FF4j
Spoiler:

FF5
Spoiler:

Acknowledgements

Special thanks to all the folks at FF6Hacking.com for their help! And to the makers of the other FF6 utilities for giving me a place to start.

Squall_FF8

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #1 on: July 18, 2018, 05:29:36 am »
Woah, excellent work!

I'm surprised that with so many FF fans around nobody responded ... but I guess in summer time, so its normal.

I'm mainly interested in FF5 so everything I will say will be for FF5.
I was able to open only the J-version. The tool refuses to load:
 - Final Fantasy V (J) [h1].smc
 - Final Fantasy V (J) [T+Eng1.1_RPGe].smc
 - Final Fantasy V (J) [T+Eng1.1_RPGe][h1].smc
My suggestion is to remove the restriction to load only 'CRC - known' ROMs, or at least give a choice the user to open desired ROM regardless.
It seems to me that many of the mentioned features like event/battle edit are absent (for FF5 at least).

If you are interested in improving the FF5 part, I will suggest to get noisecross's 'FF5e_Map_Editor'. It parse pretty much everything. Events are still gray area, but we have a research project going on for that so hopefully in the end we will have full understanding and format of that.
If you have any question about FF5 feel free to ask  :thumbsup:

BTW how did you render the animated tiles? I remember an year back, when I was experimenting with maps, animated tiles contained a garbage, because they were updated trough DMA/HDMA

acediez

  • Full Member
  • ***
  • Posts: 221
    • View Profile
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #2 on: July 18, 2018, 09:11:58 pm »
This is looking good!   :woot!:
Quick question, is it possible to edit the random
battles encounter rate? Either for the whole game or by map?

Everything

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #3 on: July 18, 2018, 10:58:26 pm »
Thanks for the feedback. I didn't realize there was more than one version of the FF5 RPGe translation out there. The CRC32 for the version I have is 0x892E44BE. If yours is different, you can download ff5u-sfc.json from GitHub and load that when it asks for a definition file. Let me know if that doesn't work.

By any chance, can you tell me the CRC32 for the FF5 versions that you mentioned? I'd like to add them so that they will open automatically. I like the idea of being able to choose from a list of ROMs if the CRC32 doesn't match. I'll add that to my to do list.

You're right that many features are absent for FF5. This is simply because I don't know the data format as well. I'll check out noisecross' editor and hopefully be able to add more features when I understand them better. There used to be some info on Slick Productions website, but I haven't been able to access it recently. Is there some other good repository that you know of?

Animation graphics for FF5 were a little tricky. It's still a bit of a work in progress. There is a data structure (one per tileset) at 0xC09D9B-0xC0A18B (28 items, 36 bytes each) that has pointers to each animated tile. The graphics start at 0xDF9B00, but some pointers use an offset of 0xDF9B00 while others use 0xDF0000. The subroutine that loads them is at C0/9A96.

The battle encounter rate in FF6 can be changed. The world maps are divided up into 64 square sectors, each with a different encounter rate and different random battles (imagine slicing up the entire world map into a giant 8x8 grid). Select triggers in the top right and then click anywhere on the map where there are no triggers and you should see a drop down to change the encounter rate in the properties pane on the right side of the screen. On normal maps, do the same thing, except the entire map uses the same encounter rate and you'll need to scroll all the way to the bottom of the properties pane to where it says "Battle Probability". I haven't tested these out very well, so let me know if anything doesn't work correctly.

Keep in mind that this only adjusts the relative encounter rate (Low, Normal, High, ...). The actual rate numbers are hardcoded into the ROM and can't be edited by FF6Tools (not yet anyway), but if you have a hex editor and a little knowledge of binary data you can edit them manually. In the US version they are stored as follows:

Code: [Select]
; world map random battle rates (4 items [normal, charm bangle, moogle charm, unused], 8 bytes each [normal, low, high, none])
C0/C29F:              .DW $00C0, $0060, $0180, $0000, $0060, $0030, $00C0, $0000
C0/C2AF:              .DW $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000

; normal map random battle rates (4 items [normal, charm bangle, moogle charm, unused], 8 bytes each [normal, low, high, very high])
C0/C2BF:              .DW $0070, $0040, $0160, $0200, $0038, $0020, $00B0, $0100
C0/C2CF:              .DW $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000

acediez

  • Full Member
  • ***
  • Posts: 221
    • View Profile
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #4 on: July 19, 2018, 02:37:18 am »
Man, thank you SO much for that! I've actually been meaning to play this and other JRPGs I didn't get to play back in the day but the high random battle encounter rates always make me drop them at some point.

I'm probably not the inteded audience for this tool, as I've never played the game completely before and I'm mostly looking for small QoL tweaks like this, while spoiling as little of the game as possible. Regardless, just looking at the screenshots reminds me of my RPG Maker 2003 days, I really appreciate this kind of projects.

Squall_FF8

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #5 on: July 19, 2018, 04:16:01 am »
By any chance, can you tell me the CRC32 for the FF5 versions that you mentioned? I'd like to add them so that they will open automatically. I like the idea of being able to choose from a list of ROMs if the CRC32 doesn't match. I'll add that to my to do list.
- Final Fantasy V (J) [T+Eng1.1_RPGe] - 331F2B60 1059a0b7
 - Final Fantasy V (J) [T+Eng1.1_RPGe][h1].smc - 9DA0C0EB d19f6cb5
 - Final Fantasy V (J) [h1].smc - 9E878F15 84cc8dbe
These came from goodrom conventions (h1 - mean no header) and should be the 'cannon' :)
I used 2 tools and they gave me 2 different checksums. I'm pasting both, but in general - working with checksums is painful - for you to keep track of 'variations' and for the user.

Quote
You're right that many features are absent for FF5. This is simply because I don't know the data format as well. I'll check out noisecross' editor and hopefully be able to add more features when I understand them better. There used to be some info on Slick Productions website, but I haven't been able to access it recently. Is there some other good repository that you know of?
Unfortunately - no. On slick we've managed to gather and research the biggest 'wiki' for FF5 on the web. Now all that buried offline. I wanted to make a copy here on the DataCrystal, but that doesn't work too. I will try to help you as much as I can. If you have discord you can PM trough slick server or trough RNHD server. I'm no proficient in map things that was noisecross area, but for the rest (battles, monster stats,...) you can rely on me for info  :thumbsup:
Meanwhile FF5 Viewer might be helpful resource for info or to check your parsing.

BTW thank you for the info on Animated tiles! Do you have description on what is the meaning of all 36 bytes in C09D9B?

Everything

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #6 on: July 19, 2018, 10:10:28 pm »
Interesting, I thought the [h1] meant that the ROM had been hacked somehow. I had been using a ROM that comes up as "Final Fantasy V (J) [T-EngX.X_RPGe].smc". I guess maybe that's not the best one. I added the other 3 versions to my list, so they should open automatically next time I commit to GitHub. After a bit of searching, I realized that there are a large number of ROM variations floating around out there. And FYI, the second checksum in your list is the one I use (I adapted the algorithm from NSRT).

I'm sure I'll have some questions for you when I get around to adding a battle editor for FF5.

For the animation properties I have the following format:

Code: [Select]
$00-$07 f??????? flags for bg1/bg2 tiles (8 items, 1 byte each)
$08-$0B f??????? flags for 4 bg3 tiles (4 items, 1 byte each)
        f: pointer offset is 0xDF9B00 if set, 0xDF0000 if clear
        ?: probably animation speed or something
$0C-$1B pointers for 8 bg1/bg2 tiles (8 items, 2 bytes each)
$1C-$23 pointers for 4 bg3 tiles (4 items, 2 bytes each)

Squall_FF8

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #7 on: July 23, 2018, 09:49:18 am »
Code: [Select]
$00-$07 f??????? flags for bg1/bg2 tiles (8 items, 1 byte each)
$08-$0B f??????? flags for 4 bg3 tiles (4 items, 1 byte each)
        f: pointer offset is 0xDF9B00 if set, 0xDF0000 if clear
        ?: probably animation speed or something
$0C-$1B pointers for 8 bg1/bg2 tiles (8 items, 2 bytes each)
$1C-$23 pointers for 4 bg3 tiles (4 items, 2 bytes each)

- Is it safe to assume that 4 of them are for BG1 and the other 4 are for BG2, so we have: 4 pointers for BG1/BG2/BG3 for total of 12?
- when we say tile (in this context) are we talking about 8x8 one or the blocks of 16x16?
- 4 tiles ... is this a clue that we have 4 frames of animation? Or frames are defined elsewhere?

Since obviously you have implemented it:
- how do you recognize that you have animated tile instead of regular?
- Do you display the first frame of animation or ...? What is the relationship of what you display and that info?

Sorry many questions, but I don't know java so I couldn't pinpoint the implementation of the above questions ...

Everything

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #8 on: July 23, 2018, 11:40:43 am »
Good questions. Now that you mention it, I'll bet that the "f" flag determines whether a tile is animated. I just draw the first tile, so I hadn't thought about it. These are 16x16 tiles. If you look at 0xDF9B00 using a graphics viewer you'll see all the animated graphics. It looks like tiles can have either 1, 2 or 4 frames. I'm guessing that it's determined by some of the unknown flag bits.

BG1 and BG2 always share the same graphics, so you can always use the first 8 tiles on either of these layers. BG3 is separate because it's 2bpp instead of 4bpp. I load the animated graphics after loading the regular graphics, sort of simulating the SNES PPU. The blocks of graphics go to the following locations in VRAM:

Code: [Select]
$0000-$1000 bg1/bg2 graphics 1
$1000-$2000 bg1/bg2 graphics 2
$2000-$2E00 bg1/bg2 graphics 3
$2E00-$3000 bg1/bg2 animation graphics
$3000-$3700 bg3 graphics
$3700-$3800 bg3 animation graphics

Each map's properties specifies which normal graphics to use, and the tileset specifies which animation graphics to use. Here's what I have for the map properties format. Maybe you can help me fill in some of the blanks.

Code: [Select]
Map Properties (0xCE9C00-0xCED000, 512 items, 26 bytes each)
--------------
$00
$01
$02
$03
$04 ??mmmmmm
    m: color math
$05 tile properties
$06
$07
$08 tileset
$09 bbaaaaaa
$0A ccccbbbb
$0B ddddddcc
    a: bg1/bg2 graphics 1
    b: bg1/bg2 graphics 2
    c: bg1/bg2 graphics 3
    d: bg3 graphics
$0C eeeeeeee
$0D ffffffee
$0E ggggffff
$0F ??gggggg
    e: bg1 layout
    f: bg2 layout
    g: bg3 layout
$10
$11
$12
$13
$14
$15
$16 palette
$17
$18
$19

samurai goroh

  • Jr. Member
  • **
  • Posts: 30
    • View Profile
    • My page
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #9 on: July 23, 2018, 10:15:17 pm »
We have some of this info in Slick's Wiki, but is been a long since the site was up. Anyway, I can fill some of the gaps:

$00 & $01 - Map ID (e.g. 0x0000=world 1, 0x0020=Tule, 0x00A4=Ancient Library, etc.)
$02 - Pointer to the map's Name Location
$06 - Enemy Encounter Flag in Dungeon?! (Used in Karnak Castle to have or not encounters, not sure if used anywhere else...)
$19 - BGM ID (0x00=Ahead on Our way, ..., 47=Meteor landing FX)

For $19, you can check my RAM map (section 1.16)
http://erick.guillen.com.mx/Codes/SNES%20Final%20Fantasy%20V.txt
I'm the best in the universe, remember that [F-zero X]

Everything

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: FF6Tools (v0.1) - Final Fantasy VI Utility
« Reply #10 on: July 27, 2018, 10:01:11 pm »
For $19, you can check my RAM map (section 1.16)
http://erick.guillen.com.mx/Codes/SNES%20Final%20Fantasy%20V.txt

Cool, this is super helpful!

By the way, I copied your list of FF5 map names into the master branch of FF6Tools on GitHub. Thanks for adding those!