• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
July 01, 2025, 08:53:18 am

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


Maps

Started by Zenko, September 29, 2007, 10:23:24 am

gomtuu

May 31, 2008, 11:01:15 am #160 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Hey! I see the site's been updated and has a download link for map2gl. Cool!

But you only posted the source version, which is harder to get working. You might also want to post the EXE version so people don't have to install Python and all that other junk. I linked to the EXE version in this post.

What's new, by the way? I haven't been checking the boards much. Has any new and interesting data been uncovered?

Zenko

May 31, 2008, 12:11:35 pm #161 Last Edit: December 31, 1969, 07:00:00 pm by Xifanie
Well, as you see I'm currently working a lot on the site, and I'm not really doing anything else. As soon as I finish the beta, I'll go back to the events scripts.  :D

Oh, in regards to that, can you tell me everything about the structure of TEST.EVT and of an event? there's not much to say, I just don't get how the game determines it has to load which block and how the pointer for text is working (although I haven't even check that ;o).

Because in the end, if I want to make an event editor that can edit ATTACK.OUT and TEST.EVT I'll need that.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

LastingDawn

May 31, 2008, 01:48:35 pm #162 Last Edit: December 31, 1969, 07:00:00 pm by LastingDawn
Ah, gomtuu! Well, I've tried my best to record all the music, events, and maps according to Attack.out and the info. has been sent to Melonhead, though one thing that's odd... you said Snow and Rain weren't involved with the Weather tag? Also it seems that if the event had always gone back to the map screen, there's no way to stop it from doing so, but you can force events that normally did not go back to the map screen to go of course, though I wonder what problems that could cause...
"Moment's anger can revert to joy,
sadness can be turned to delight.
A nation destroyed cannot be restored,
the dead brought back to life."

Art of War

Beta & Gretchen Forever!!!!

Cheetah

June 01, 2008, 05:24:04 am #163 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
Good to see you are still poking around Gomtuu. You even got credit as a staff member on the new site.

I know you aren't working on this stuff much. But do you have any advice on how I might go about changing the textures for the maps? I know where at least parts of them are located and importing and exporting them shouldn't be a problem. I'm just confused about where the palette information is stored more than anything.
Current Projects:

gomtuu

June 01, 2008, 10:28:42 pm #164 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Cheetah,

I'll answer your question first:

Quote from: "Cheetah"do you have any advice on how I might go about changing the textures for the maps? I know where at least parts of them are located and importing and exporting them shouldn't be a problem. I'm just confused about where the palette information is stored more than anything.

As you may know, there are three basic types of files in the MAP directory:

  • GNS files, which are indexes that point at the other two kinds of files so the game knows which set of files to load for each weather condition / room arrangement,
  • Texture files, which are always 131072 bytes because they're just 256x1024x4-bits-per-pixel bitmaps, and
  • Mesh/terrain files, which store vertex XYZ, UV, and normal vector data; texture palette data; and data about terrain heights and surface types.
The easiest way to identify the third type of file is by exclusion: They're not named .GNS and they don't happen to be 131072 bytes. There's also a way to identify them using the GNS files, but that's a little more complicated.

If you look in these mesh/terrain files, the first thing you'll see (the first 0xc4 bytes) is a table of contents made up of 32-bit pointers to other locations in the same file. These pointers are as follows:

0x0040: Vertex data
0x0044: Color palette data
0x004C: [only occurs in map000] ?
0x0064: Lighting + background color data
0x0068: Terrain data
0x006C: Texture animation data, including water and event-driven animations
0x0070: Animated palette data
0x007C: Grayscale palette data
0x008C: Extended polygon placement and animation data
0x0090: Extended polygon data 1
0x0094: Extended polygon data 2
0x0098: Extended polygon data 3
0x009C: Extended polygon data 4
0x00A0: Extended polygon data 5
0x00A4: Extended polygon data 6
0x00A8: Extended polygon data 7
0x00AC: Extended polygon data 8
0x00B0: 0x380 unknown bytes, then polygon visibility angle data

The above list skips some entries in the TOC. That's because those entries are zero in all the map files. They don't point to anything.

To find the data you're looking for, seek to the location of the appropriate pointer and read a 32-bit little-endian integer. So, for the palettes in map085.7, you'd seek to 0x44:

0000044: 2c6d0000
This tells you that the color palettes start at 0x00006d2c (in the same file, map085.7). Seek there, and you'll find a block that contains 16 palettes, each of which is 16 colors (32 bytes) long. They don't always use all 16 palettes, but the block will always be 512 bytes long. It just might be padded with zeros (totally transparent palettes).

In map085.7, this block looks like this:

0006d2c: 0000 480d 2709 0605 c400 a300 8200 6100 6905 1022 cd19 8b11 2809 e604 c500 e500
0006d4c: 0000 480d 0605 c400 a300 8200 313a ce31 8c29 4a21 2919 0719 e610 c510 a40c 830c
0006d6c: 0000 690d 2709 0605 c400 a300 6905 480d 313a ce31 6b21 2919 0719 e610 a40c e500
(And then 13 transparent palettes.)

Each color is 16 bits, little-endian. The highest bit controls transparency; if the color is black and this bit is 0, then the color is 100% transparent. Otherwise, the color is 100% opaque. After the highest bit come 5 bits of blue, then 5 bits of green, then 5 bits of red.

Hope this helps!

By the way, to determine which file you need to look at to get the palettes you want, just pay attention to map2gl while it's loading a map. It'll say something like "Reading color palettes from /cdrom/map/MAP085.7"

Cheetah

June 02, 2008, 09:59:18 am #165 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
Haha this is great information. Now it will just take a few weeks for me to absorb the information. But basically what I'm getting is that the palette for the textures is with a different part of the map information, which makes sense. Then with the information you gave me I should be able to find the palettes and adjust them in a hex editor. Does this sound about right? Also is there different palette information for the different weather conditions, or is it a prerecorded blanket adjustment to the colors (hope that makes sense)?

Amazing information as usual Gomtuu.
Current Projects:

gomtuu

June 02, 2008, 12:48:25 pm #166 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Quote from: "Cheetah"But basically what I'm getting is that the palette for the textures is with a different part of the map information, which makes sense. Then with the information you gave me I should be able to find the palettes and adjust them in a hex editor. Does this sound about right?

Yep, and remember, you should be able to preview your changes easily in map2gl. :)

Quote from: "Cheetah"Also is there different palette information for the different weather conditions, or is it a prerecorded blanket adjustment to the colors (hope that makes sense)?

I don't think the palettes themselves are adjusted, but sometimes two weather conditions share the same palette and just have different lighting. Sometimes the different weather conditions do use totally separate palettes, though. For example, map 85 only has palette data in map085.7 which is shared by all weather conditions, but map 56 has palette data in every mesh file except map056.0.

I wrote a program for my own purposes a while ago called lsgns.py that outputs a list of the resources contained in each map file. Let me know if you're interested. You'd need Python to run it, but you wouldn't need all the funky libraries map2gl needs. I guess I could make an EXE version, too, if there's interest.

Quote from: "Cheetah"Amazing information as usual Gomtuu.

Glad I could help!

gomtuu

June 02, 2008, 01:05:23 pm #167 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Quote from: "LastingDawn"you said Snow and Rain weren't involved with the Weather tag?

My hunch is that the weather and day/night info from ATTACK.OUT doesn't influence weather-based spell damage, but I don't think I ever tested it. I'm pretty sure that it also doesn't determine whether the raindrop animations are displayed. I think I remember noticing that the event script number (J in that table) did determine whether raindrop animations were used, but I'm not sure about that. As far as I know, the ATTACK.OUT weather and day/night data only tell the game which map texture and mesh files to load. In other words, they indicate which GNS entry to use.

Quote from: "LastingDawn"Also it seems that if the event had always gone back to the map screen, there's no way to stop it from doing so, but you can force events that normally did not go back to the map screen to go of course, though I wonder what problems that could cause...

Oh, it doesn't work both ways? That's a bummer. :(

To me, probably the most exciting thing left to figure out about the game is how the scenarios themselves interact with the map screen. If we can figure out how to make the map draw different roads and cities after each scenario, and how to control which cities launch which scenarios, then we can do some pretty neat stuff.

Unfortunately, I've already spent a lot of time working on that and I didn't get very far.

LastingDawn

June 02, 2008, 01:14:20 pm #168 Last Edit: December 31, 1969, 07:00:00 pm by LastingDawn
No luck in that department? Any success, any interesting anecdotes to share on the subject?
"Moment's anger can revert to joy,
sadness can be turned to delight.
A nation destroyed cannot be restored,
the dead brought back to life."

Art of War

Beta & Gretchen Forever!!!!

Cheetah

June 02, 2008, 03:38:38 pm #169 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
That is most definitely an interesting subject regarding editing the world map. I'm not sure I have even found which file contains the image of the world map, do you know?

I would definitely be interested in a program showing this information, though it would be easier to run an EXE. If you could some how incorporate a way to quickly edit the palettes that would be amazing.
Current Projects:

gomtuu

June 03, 2008, 09:14:03 am #170 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Quote from: "Zodiac"Oh, in regards to that, can you tell me everything about the structure of TEST.EVT and of an event? there's not much to say, I just don't get how the game determines it has to load which block and how the pointer for text is working (although I haven't even check that ;o).

I don't really know anything about TEST.EVT beyond what we talked about earlier in this thread and the program I posted... :(

As for how the game determines which block to load, that's just letter J in the scenarios in ATTACK.OUT, right?

gomtuu

June 05, 2008, 07:56:05 pm #171 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Quote from: "Cheetah"I'm not sure I have even found which file contains the image of the world map, do you know?

According to George Greer's site, I think that image is in WLDTEX.TM2 in the WORLD directory.

But, obviously, the roads and city dots aren't part of that map. They're drawn on top of it as needed.

Quote from: "LastingDawn"No luck in that department? Any success, any interesting anecdotes to share on the subject?

I did find a block of data that had to do with city locations, but it didn't affect where the dots were drawn, IIRC. I think it only had an affect on where the city's cursor hotspot was. That is, the city looked like it was in the normal spot, but you had to move the cursor to a different part of the map to select it and go there.

That block was in WLDCORE.BIN at 0x2ddfc. There were 43 locations, each one being 64 bits long (two 32-bit signed little-endian integers?) But that doesn't do us much good by itself.

Cheetah

June 06, 2008, 12:19:43 am #172 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
This little quote from the Final Fantasy Investigation Project might be of interest and answer your questions somewhat!

"wldtex.tm2
    Summary: The world map graphic, with the location data embedded in it.
    Format: 256-color palette images of 240x240, 256x240, 240x300, and the rest unknown. Investigation pending."
Current Projects:

gomtuu

June 17, 2008, 08:52:08 am #173 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
FYI: I submitted map2gl as a utility on romhacking.net. It appeared in yesterday's "New Submitted Utilities" announcement on the home page.

Cheetah

June 17, 2008, 12:44:40 pm #174 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
Good to hear, romhacking.net is a pretty awesome community.
Current Projects:

VincentCraven

July 12, 2008, 09:46:34 pm #175 Last Edit: December 31, 1969, 07:00:00 pm by VincentCraven
Hey, I was going to make Treasure chests in my Chocobo Wars patch, but  is there a "Chest" type floor? I was going to make chest-type obstacles that have an item hidden either in front of the chest or on top of the chest.  I don't think putting chests from units will work, since anyone can open them.

Edit: Excuse me, can we even edit maps like that yet?
I changed jobs and that has made all the difference.

Zozma

August 26, 2008, 07:50:23 am #176 Last Edit: December 31, 1969, 07:00:00 pm by Zozma
yay! finally i understand this stuff

is there some sort of list of weather?
and what about weird times of day like sunset with the red sky...?
sorry new to this stuff
  • Modding version: Other/Unknown
Wiegraf: Draw your sword Ramza!
Ramza: But im a monk!!

Zenko

August 26, 2008, 10:07:28 am #177 Last Edit: December 31, 1969, 07:00:00 pm by Xifanie
Maps only have a limited amount of palettes, whoever through event editing it's easy to make a sunset or such, just use ColorBg & ColorField. Well, when I release the event editor. :P
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Zozma

August 26, 2008, 03:24:27 pm #178 Last Edit: December 31, 1969, 07:00:00 pm by Zozma
cant wait to see that event editor :P
  • Modding version: Other/Unknown
Wiegraf: Draw your sword Ramza!
Ramza: But im a monk!!

Zenko

August 27, 2008, 12:22:59 am #179 Last Edit: December 31, 1969, 07:00:00 pm by Xifanie
Uploaded, now we need to make a big sections for the instructions.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful