• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
June 01, 2024, 07:30:55 am

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed! Find out how you can help in the Recruitment section or our Discord!


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - gomtuu

201
Hacking/Patching Tools / Screenshots
February 07, 2008, 12:31:46 am
P.S. - Here are some screenshots of my map viewer, in case you think I'm just full of it. :) Notice that it can do perspective projection as well as isometric, so there's no way these were taken in an emulator.

-Don
202
Hacking/Patching Tools / Map Viewer
February 06, 2008, 11:52:34 pm
Attached is a map viewer I wrote in Python. I never finished it, but it might be useful as a place to start. To run it, you'll need:

    * Windows only: glut32.dll (included) in your WINDOWS\system32 directory
    * Video card with OpenGL support and 16MB onboard RAM :roll:
    * Python 2.5.1 or greater
    * setuptools 0.6c6 or greater, which you can use to install:
      * PIL 1.1.6 or greater
      * pyopengl 3.0.0a6 or greater
      * numpy 1.0.3.1 or greater

To run it from a regular command prompt, type:

python map2gl.py <path_to_map_directory> <map_number>
So, for example:

python map2gl.py D:\MAP\ 25
This is assuming D: is the FFT CD. It should also work in Linux, where it would look something like:

python map2gl.py /mnt/cdrom/MAP/ 25
Maps on the CD are numbered 0-125. (Look at the .GNS files.) There are a few maps that cause the program to crash when they load, so if the first one you try doesn't work, try a few more. While it's running, you can drag the mouse around to rotate the camera, or press these keys:

ijkl (to rotate the camera)
JL (to rotate the camera to the previous or next 45-degree angle and stop its rotation)
o (to toggle between orthographic (isometric) and perspective projection)
x (to toggle display of axes: R=x G=y B=z)
0 (to stop the camera's rotation and zero its position)
-= (to dolly the camera out or in)
_+ (to decrease or increase the camera's focal length in perspective projection mode)
[] (to go to the previous or next map)
Esc (to quit)

Feel free to use it any way you like, and let me know if you have any questions.
203
Hacking/Patching Tools / Weather and GNS files
February 06, 2008, 11:46:09 pm
Cheetah,

I'm fairly certain that the GNS files in the MAP directory would be the place to start if you want to load maps in different weather conditions. I don't understand the GNS files very well, but I do know that they contain pointers to LBA addresses of the other files in the MAP directory. A single GNS file usually has many entries in it, so it points at several files. It was my feeling that these entries were probably grouped by weather condition, but I never determined that for sure.

The non-GNS files in the MAP directory can be one of two things, as I understand it:

1. Texture files, which are always 131072 bytes
2. "Everything else" files

In viewing the texture files, I've found that a map like Mandalia Plains, for instance, will have several sets of textures: One with very harsh shadows "baked" onto the texture, one with not-quite-as-harsh shadows, one with no shadows, etc. It stands to reason that the first is used if the weather is sunny, the second if it's rainy, and the third if it's night.

Some of the things that I've found in the "everything else" files include the map's background gradient colors, positions and colors for three (I think?) light sources, vertex data, texture palette data, animated vertex data (for the windmill, etc.), and I think the height/terrain-type data as well.

Since weather affects the background gradient and the lighting (it does, right?), that suggest that the GNS files contain instructions for how to load a map with a given weather condition. It would also mean that you probably can't easily have the weather change mid-event, since all that info (especially the texture data) is probably just determined once when the map is first loaded. Can anyone think of a counterexample within the game? A map that starts sunny and turns rainy, or something?

This message is getting long, so I'll post my map viewer in a separate message below with instructions.

-Don
204
Hacking/Patching Tools / Map data
February 05, 2008, 09:49:52 pm
A while ago, I worked on deciphering the map data. I used an emulator and edited the save states to reverse-engineer the data. I don't remember how or where I found the data, but based on my old notes, here's what I found. Each square of the map has 8 bytes, and each byte's meaning was as follows:

byte 0, bits 0-1: unknown
byte 0, bits 2-7: terrain type
byte 1, unknown
byte 2, height, whole part
  (00-1E display a number)
  (1F-FF work, but display no number)
byte 3, bits 0-2: water depth
byte 3, bits 3-7: height, fractional part
byte 4, unknown
byte 5, unknown
byte 6, bit 7: can't move cursor to this spot
byte 6,  bit 6: cursor turns red on this spot
byte 7, unknown

Here's a list of the terrain types from my notes:

00 Natural Surface
01 Sand area
02 Stalactite
03 Grassland
04 Thicket
05 Snow
06 Rocky cliff
07 Gravel
08 Wasteland
09 Swamp
0A Marsh
0B Poisoned marsh
0C Lava rocks
0D Ice
0E Waterway
0F River
10 Lake
11 Sea
12 Lava
13 Road
14 Wooden floor
15 Stone floor
16 Roof
17 Stone wall
18 Sky
19 Darkness
1A Salt
1B Book
1C Obstacle
1D Rug
1E Tree
1F Box
20 Brick
21 Chimney
22 Mud wall
23 Bridge
24 Water plant
25 Stairs
26 Furniture
27 Ivy
28 Deck
29 Machine
2A Iron plate
2B Moss
2C Tombstone
2D Waterfall
2E Coffin
2F ""
30 ""
3F Cross section
C0 Natural Surface
C1 Sand area
D1 Sea
FF Cross section

The appearance of the map is unrelated to this and stored elsewhere in the map files as vector data. Not all of the files in the map directory contain vector data, but the ones that do have blocks that go something like this, if memory serves:

3-point polygons' XYZ coordinates
4-point polygons' XYZ coordinates
untextured (black "skirt") 3-point polygons' XYZ coordinates
untextured (black "skirt") 4-point polygons' XYZ coordinates
3-point polygons' texture UV coordinates + palette index
4-point polygons' texture UV coordinates + palette index
3-point polygons' normal vectors
4-point polygons' normal vectors

I have a map viewer that wrote in Python. It's unfinished, but I'll post it here later.