View Full Version : FF3 Layer3 info, figured out
sleepydude
02-19-2007, 05:54 AM
After way too many hours spent trying to figure this stuff out. I finally did it. And in the end it was so simple, but of course it always is. As it turns out there is no tile assembly data for the layer 3 tiles, which is why I could never find it. They are actaully just decompressed, stored to the WRAM where they're sent directly to the VRAM. The reason I could never figure out how they're arranged is because they aren't 4-bit graphics, they're 2-bit graphics. When you decompress them as 2-bit graphics, they're already arranged. Apparently all layer 3 graphics as 2-bit because that's just how the SNES did it. That would have been nice to know a few months ago, but oh well, you live you learn. Anyway, I should be able to put this into the Map Editor pretty simply and I'll try to get another release of that out.
<P ID="signature"></P>
Lenophis
02-19-2007, 06:04 AM
<img src=http://www.zophar.net/wwwthreads/smilies/eek5.gif> Holy shit, way to go sleepydude. <img src=http://www.zophar.net/wwwthreads/smilies/thumb.gif> Will the next version run at the speed your first version runs at?
<P ID="signature"><img src=http://dragonsbrethren.elazulspad.net/images/lenorhdnsignature.png></P>
sleepydude
02-20-2007, 04:43 AM
> Holy shit, way to go sleepydude. Will the next version run
> at the speed your first version runs at?
>
Yeah, it's about the same speed. I rewrote the tile creation so it was a little faster, but now there's another whole tileset to create so it's about the same. It's not lightning fast, (at least on my old machine), but it's not bad. So here's another much easier question. I need to find all the layer 3 graphics locations, and that's actually really easy, they're the first thing that decompressed when you enter a town, so with a debugger it's no problem, but I just need to know where they all are. So far I've got, the steam in Narshe (WoB), the fog in Narshe (WoR), The rain in Zozo, the water in the Lete River, the fire in all the burning building (figaro castle and such), the lamplight in caves, the water near Cid's house, the South Figaro style water, the Kohlingen style water, and the Phantom Forest trees. What'd I miss?
<P ID="signature"></P>
Lenophis
02-20-2007, 05:31 AM
Let's see, the cloud's in kefka's tower, the searchlight in kefka's tower, cyan's dream? Ummm, I dunno. There's probably a bunch.
<P ID="signature"><img src=http://dragonsbrethren.elazulspad.net/images/lenorhdnsignature.png></P>
sleepydude
02-20-2007, 08:11 PM
> Let's see, the cloud's in kefka's tower, the searchlight in
> kefka's tower, cyan's dream? Ummm, I dunno. There's probably
> a bunch.
>
Thanks, I was being stupid. I just found the pointer table instead. Anyway, here's the word on displaying the layer 3 graphics, at least one frame of them. The pointer table to the graphics is located at 26CF60, and the graphics themselves are located at 268980. The six set of graphics located at 26CFA0 are only used for animating the tiles. If you use them to draw the maps (as I originally was) things don't look right. Anyway, there are 17 sets of 2-bit graphics, each containing 256 8x8 tiles. The way these are set up is interesting. Every four tiles makes one 16x16 tiles, with the first tile being the top left, the second being the top right, and third and fourth being the bottom left and right respectively. In addition to this the first 16x16 tile gets skipped, and possibly moved to the end, (I don't think so, but something is filled in at the end) so the final tileset actually ends up being set up like 01, 02, 03... 3E, 3F, 00. I don't know why, but I suspect, since that first tile never looks right anyway, that the first 16 bytes of data, instead of being a tile are might be data like palette info, transparency, layer priorities, ect.
Now, that only creates a 64 tile set, but if you look at the map data there's all 256 used. This is the interesting part. The horizontal and vertical flip is set not by tile formation data as with layer 1 and 2 graphics, but by the map data. Only the last 6 bits of each byte of map data points to the the tile. The first two control the horizonal and vertical flip. The 1st (MSB) being the vertical and the second being the horizontal. Essencially then the 64 16x16 tiles get repeated 4 times and each time they're flipped a different way. This I imagine was a way for programmers to save room in the VRAM. And that's about it really. Once it's all figured out, it's really pretty simple.
<P ID="signature"></P>
Evil Peer
02-21-2007, 04:54 AM
Have you figured out how the animated tiles work? That was the only thing that really gave me pause back when I was putting FFVI maps together.
---T.Geiger
<P ID="signature"></P>
sleepydude
02-21-2007, 02:08 PM
> Have you figured out how the animated tiles work? That was
> the only thing that really gave me pause back when I was
> putting FFVI maps together.
>
> ---T.Geiger
>
Not really, there's still a couple things that just stubbornly refuse to display correctly. Mostly those damn flag in Vector and the torchlights in the returner's hideout. I don't know exactly why those are different than other torches, but apparently they are. I finally got the bridges to look right though. Do you know anything about the layer priority data? That's another thing I've only got half right.
<P ID="signature"></P>
Evil Peer
02-21-2007, 02:56 PM
Offhand, no. But it is probably in my source at my site (http://geigercount.net/crypt/index.html). FFVI Extract should produce accurate Location maps for the most part, minus L3 and animated tiles. There were a few maps that did not extract properly though.
I released the source last year "as is" since its a pretty old project I have not touched in years. I would look myself, but I do not have a C++ editor on this machine, and I am not keen on hunting for some random code without any color-coding.
There is a lot of similarity to how Chrono Trigger stores its maps (which is what I have been working on for the last three years), so I may be able to assist you with other issues. In Chrono Trigger, the Tile Priority bit is bitmask 0x2000. Presumably, you already know how Screen Mode 1 works.
---T.Geiger
<P ID="signature"></P>
sleepydude
04-08-2007, 08:06 PM
I've been without internet for a while and actually still am, but I wanted to post a quick update on the FF3 map editor. A simple quest to figure out how to make layer 3 display transparently turned into a complete rewrite of the graphics display, so now you can display and edit all three layers, and it's much faster (on my 900 MHz computer all 3 tilesets are built in about 2-3 seconds as opposed to just 2 in 7-8 with the last version and maps are build in less than a second) than it was, so huzzah. Also you can display where all the entrances, treasure chests, NPC's and event triggers are on maps and you can edit them, this includes editing the events themselves. Basically if it's in a map, you can edit it. However, there are limitations. You currently can't add or subtract anything to a map. Meaning if there is only one treasure chest in a map, you can't do anything about that. There is also no text editor, so you're stuck with whatever dialog is already in your ROM. I should be able to release that whenever I get internet back on my computer which will probably be sometime around the end of the month. In the future, my plan is to add in a memory management system so instead of having to find places for expanded events, maps, ect... the editor will just find a suitable place automatically. I'm open to suggestions though. Anyway, that's that.
<P ID="signature"></P>
sweetkool_ind93
04-09-2007, 08:02 PM
I like it, are there any releases out yet?
<P ID="signature">"Now serving number 67." ~Sam Fisher</P>
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.