• Welcome to Final Fantasy Hacktics. Please login or sign up.
 

Maps

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

Cheetah

February 09, 2008, 02:52:21 pm #40 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
Gomtuu are you saying that the Deep Dungeon does have textures applied and that you can make it look normal? You get some screenshots of that and the internet would love you.
Current Projects:

Xifanie

February 09, 2008, 03:49:05 pm #41 Last Edit: December 31, 1969, 07:00:00 pm by Xifanie
Dunno why I said X & Y, what I meant is to put a +2˚/-2˚ hotkey for the X axis too.

Well, I can wait before taking screenshots. Thanks for telling.

I remember pressing b in many DD maps and everything stayed black.

As for resizing, I can't: pressing minimize/expand/quit all result in GL closing.
  • 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

gomtuu

February 09, 2008, 04:38:30 pm #42 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Zodiac,

Quotewhat I meant is to put a +2˚/-2˚ hotkey for the X axis too.

Ah, I see. Yeah, I can do that... Hmm, I'm running out of keys. Hehe.

QuoteI remember pressing b in many DD maps and everything stayed black.

Sorry, I didn't mean to imply that toggling "bright" mode would make the Deep Dungeon maps visible. I was just explaining its purpose and clarifying that it wasn't related to day/night or weather conditions. Getting the Deep Dungeon maps to display requires an extra feature. I've just added this feature, and I'll release the new version soon.

QuoteAs for resizing, I can't: pressing minimize/expand/quit all result in GL closing.

Do you see an error message when this happens? It's definitely not supposed to quit when you resize the window... :(

Cheetah,

Yes, the next release of map2gl will allow viewing Deep Dungeon levels by toggling ambient light on/off. Here's a preview!

Cheetah

February 09, 2008, 04:48:22 pm #43 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
Oh my gosh that is so sweet. You just layed the smack down on the DD Gomtuu. I need to get this thing working on my computer.
Current Projects:

gomtuu

February 09, 2008, 05:29:44 pm #44 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Here's a new version of map2gl. It includes several new features, including an intermediate fallback mode when full textures fail to load (should work on your 8MB card, Zodiac), and a handy-dandy README file with installation instructions, controls, a changelog, etc.

Note: I'm no longer including GLUT for Win32 because it's a third-party thing, it's not required by all environments, and it's easily found on Google.

Xifanie

February 09, 2008, 06:13:10 pm #45 Last Edit: December 31, 1969, 07:00:00 pm by Xifanie
Cool!

I'll try it in a few minutes.

Traceback (most recent call last):
  File "D:\Python25\Lib\site-packages\OpenGL\GLUT\special.py", line 111, in safe
Call
    return function( *args, **named )
  File "D:\Documents and Settings\Lucile Boisvert\Bureau\Python\map2gl.py", line 241, in ReSizeGLScene
    InitPerspective()
  File "D:\Documents and Settings\Lucile Boisvert\Bureau\Python\map2gl.py", line 193, in InitPerspective
    glOrtho(-orthobase, orthobase, -orthobase / aspect,
ZeroDivisionError: float division
GLUT callback forcing low-level exit on error: float division

OpenGL does try to resize but in the end it just closes. And this is the first time I remember getting an error, well whatever.
  • 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

Xifanie

February 09, 2008, 06:50:46 pm #46 Last Edit: December 31, 1969, 07:00:00 pm by Xifanie
:(
  • 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

gomtuu

February 09, 2008, 10:33:39 pm #47 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Zodiac,

Well, it looks like "limited textures" mode is working. Unfortunately, as the name suggests, it's... well... limited. It's really only there so that the program doesn't completely give up when it can't get as much texture space as it wants. See my earlier explanation about the 16 palettes.

There are a few more things I can try in order to get the textures working on that card... I'll take another stab at it. For now, it should look okay on your other computer.

That ZeroDivisionError you're getting is odd... I've put some error-detection code in so we can catch that and see what's in the relevant variables when it occurs. That'll be in the next release.

-Don

karsten

February 10, 2008, 06:55:46 am #48 Last Edit: December 31, 1969, 07:00:00 pm by karsten
zodiac, i think we should use the map viewer and everything else for a good webpge overhaul, that might be useful for advertising the page more and sending other helpful people here :)

Xifanie

February 10, 2008, 07:38:51 am #49 Last Edit: December 31, 1969, 07:00:00 pm by Xifanie
I want to make a complete new PHP design first though. ;o

The ripped maps (from a later version of this program) will be used in the walkthrough and a section designed for event editing (so one can know where is the good coordinates to send a character walking) or even the unit's starting place/facing position.

For anyone that wants to modify battles, it will be EXTREMELY handy.
  • 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

gomtuu

February 10, 2008, 11:44:37 pm #50 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Yet another release! This version adds a simple terrain height viewer (press t), a new texture fallback mode, and new camera controls. It also includes the error detection I talked about for window resizing. Please let me know what it says when you resize now, Zodiac.

The textures now behave as follows:

  • Try to use full textures.
  • If full textures fail, try to use half-size textures. This takes the 2048x2048 texture image and scales it down to 1024x1024, so really it's a quarter of the memory and should only require about 4MB of video RAM. Half-size textures will look chunkier than the full textures, of course, but I still haven't found a way to get full-size textures working in 8MB. I still think it's possible, but it'll take more work.
  • If half-size textures fail, try to use limited textures. This is the same limited mode that Zodiac was using when he took that END screenshot. Instead of using 16 copies (one for each palette) of a 256x1024 texture, it uses a single copy and applies a false grayscale palette.
  • If limited textures fail, continue with untextured polygons.

-Don

Cheetah

February 13, 2008, 12:16:29 am #51 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
I'm glad you are making so much progress on this project Gomtuu. I still haven't been able to devote enough time to getting this working yet, but I'm still really excited about this. Do we know enough about maps to have one of the ones that wasn't used in the game for a battle used for one for one (aka having a battle on the boat)? Oh and were are the textures for the tiles stored?
Current Projects:

gomtuu

February 13, 2008, 01:42:12 am #52 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Cheetah,

If you read the enclosed README file and everything goes well, it shouldn't be too much of a hassle to install. (I hope!) Let me know if you need help, of course.

The textures themselves are easy. Every 131072-byte file in the CD's MAP directory is a 4-bits-per-pixel 256x1024 texture image. The problem is the palettes. Maps contain up to sixteen 16-color palettes, and each polygon tells the game to render it with one of those 16 palettes. So to dump a texture and have it look good, you'd have to make a program that read the palette choices and UV coordinates for each polygon from the mesh files and used them to apply the right palettes to the right areas of the texture image. And hopefully the UV polygons wouldn't overlap... I do understand enough about the data to do this, it'd just be a matter of implementing it and making sure it was foolproof... Another approach is to output the whole texture once for each palette and hand-pick the good areas from each image. This would be easy to code (in fact, it's what map2gl already does internally), but its output would be less convenient.

As far as using non-battle maps for battles, there's nothing I know of yet that would stop us from doing that. Non-battle maps even seem to have terrain info (i.e., the heights of panels, whether you can stand there, etc.) built in.

Just for fun, I tried something really quick: I edited the GNS file for Orbonne Monastery so that it pointed at the texture and mesh files for Port of Warjilis, then started a new game. I've attached a screenshot of the result. :lol: I'm kind of surprised it worked at all, but it's not quite there yet... It got stuck a few lines of dialog after this, probably because it couldn't figure out how to make Gafgarion enter. Not bad for only editing 8 bytes, but I don't think this is the ideal way to accomplish what you're talking about. I think it would have more to do with events than maps. I don't know anything at all about events, though.

Zodiac,

Can you shed any light on Cheetah's map replacement question? Have you found an event instruction that means "load map X"? By the way, where are all the event instruction scripts stored? I see your list of event instructions in the Data section of the website, but I don't know where to look for the scripts on the CD. I looked around the website and the forum but couldn't find any mention of it.

Cheetah

February 13, 2008, 01:16:17 pm #53 Last Edit: December 31, 1969, 07:00:00 pm by Cheetah
That is actually quite the result, especially for a complex event like the opening. I believe that FFTPatcher or one of the other programs has some power around unit placement and event scripts such as having all the characters on the map from the beginning and not walk in, so the problem encountered here might be really easily fixed. So the map looks a little garbled, is that just the angle?
Current Projects:

Xifanie

February 13, 2008, 04:15:46 pm #54 Last Edit: December 31, 1969, 07:00:00 pm by Xifanie
Events have no influence of map loaded, neither music. Although there are instructions to stop playing a music and switch to the next one (no control of which it will be either).
  • 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

gomtuu

February 16, 2008, 11:59:04 am #55 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Here's a preview of what I've been working on lately. For the past few days, I've been trying to learn more about some parts of the map file format that I didn't/don't know much about. The result is:

  • Much better terrain mode. I now understand where the information about the appearance of the terrain cursor (the blue or red square that hovers just over the selected terrain tile) is stored, and can overlay this information on top of the map.
  • Better support for cutaway mode. The game stores information about whether or not each polygon is visible from different azimuth angle ranges. For example, it can make the south wall of a building disappear when the map is viewed from the south so you can see inside. I was supporting this behavior, but only with textured polygons. I've now implemented support for cutting away the untextured black "skirt" polygons, so you can see inside maps 11 and 33 now. Many of the other interior maps also benefit from this.

I also found some interesting information in the Orbonne Monastery map file that controls how the door texture animates when Gafgarion opens the door to exit the building. What I don't know is how the game knows that the data I've found is an instruction to animate a texture. There's nothing that looks like an instruction; it's basically just a few texture coordinates and a duration, so there must be something (in an event script?) that tells the game how to use that data. Something like "Now animate textures using animation data chunk #5." Zodiac, do you know where the event script is for the beginning of the Orbonne Monastery battle? I'd like to look over that.

I've attached some screenshots of the improved terrain mode and skirt cutaway support.

-Don

Xifanie

February 16, 2008, 02:30:50 pm #56 Last Edit: December 31, 1969, 07:00:00 pm by Xifanie
There is one and I named that instruction use field object.

IIRC that door's ID is 0x02.
  • 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

Xifanie

February 16, 2008, 02:46:03 pm #57 Last Edit: February 16, 2008, 04:38:02 pm by Xifanie
[F2] Start(xF2, xF2, xF2);
[19] Camera(-320, -1744, 1168, -114, 528, -32, 992, 1);
[6B] PlayBgSound(x01, 0, 24,x00,xFF);
[3C] Unknown(x02,x01);
[11] UnitAnim(x34,x00,x0002,x00);
[11] UnitAnim(x86,x00,x0002,x00);
[3B] UnitSprAnim(x34,x00, 0, 0, 13,x01,x01, -114);
[11] UnitAnim(x00,x00,x0002,x00);
[2E] BgColor(48, 56, 48, 48, 56, 96, 0,x00);
[33] FieldColor(x04,xFD,xFF,x03,x00);
[F1] Wait(2);
[66]
[4D] Unknown(x60);
[1D]
[19] Camera(608, -768, 1168, -178, 656, -32, 3072, 286);
[19] Camera(608, -672, 1136, 142, 1344, -32, 3296, 128);
[19] Camera(1024, -400, 720, 334, 2432, 0, 3808, 80);
[19] Camera(960, -288, 800, 382, 3008, 0, 4064, 88);
[19] Camera(927, -128, 816, 413, 3582, 0, 4096, 100);
[1E]
[F1] Wait(20);
[F1] Wait(200);
[1A]
[04]
[1E]
[1E]
[1E]
[04]
[E5] WaitForInstr(x06,x00);
[2E] BgColor(184, 188, 119, 16, 29, 61, 1,x01);
[33] FieldColor(x04,xF8,x00,x04,x01);
[F1] Wait(10);
[2E] BgColor(48, 56, 48, 48, 56, 96, 4,x00);
[33] FieldColor(x08,x00,x00,x00,x04);
[F1] Wait(45);
[6B] PlayBgSound(x12, 127, 127,x01,xC8);
[F1] Wait(170);
[2E] BgColor(113, 124, 106, 16, 16, 24, 1,x01);
[33] FieldColor(x00,xFF,x00,x02,x01);
[F1] Wait(10);
[2E] BgColor(48, 56, 48, 48, 56, 96, 4,x00);
[33] FieldColor(x08,x00,x00,x00,x04);
[F1] Wait(30);
[6B] PlayBgSound(x12, 127, 127,x01,xC8);
[E5] WaitForInstr(x04,x00);
[19] Camera(927, -128, 816, 413, 3582, 0, 4096, 2);
[63] Unknown(x89);
[49] Unknown();
[45] Shadow?(x83,x00,x01);
[4A] Unknown();
[10] DisplayMessage(x10,x11,x01,x00,x34,x00,x00, 0, 0, 0,x01);
[E5] WaitForInstr(x01,x00);
[19] Camera(728, -188, 504, 366, 3584, 0, 4096, 64);
[F1] Wait(50);
[10] DisplayMessage(x10,x12,x02,x00,x86,x00,x00, 1, 0, 0,x01);
[E5] WaitForInstr(x01,x00);
[19] Camera(728, -412, 504, 302, 3584, 0, 4096, 64);
[F1] Wait(30);
[21] PlaySound(x004C);
[55] UseFieldObj(x02,x00);
[57] Unknown();
[5F] MoveUnit(x17,x00, 6, 8,x00,x00);
[3B] UnitSprAnim(x17,x00, 0, 0, 13,x00,x01, 302);
[32] UnitColor(x17,x00,x01, 0, 0, 0, 0);
[F1] Wait(2);
[44] Materialize(x17,x00);
[32] UnitColor(x17,x00,x08, 0, 0, 0, 1);
[3B] UnitSprAnim(x17,x00, 0, 0, 0,x00,x01, 302);
[6F] Unknown(x17,x00);
[28] OrderMovement(x17,x00, 6, 6,x00,x00, 8,x01);
[29] StopWalking(x17,x00);
[11] UnitAnim(x17,x00,x0002,x00);
[4B] Unknown();
[5F] MoveUnit(x83,x00, 6, 8,x00,x00);
[3B] UnitSprAnim(x83,x00, 0, 0, 13,x00,x01, 302);
[32] UnitColor(x83,x00,x01, 0, 0, 0, 0);
[F1] Wait(2);
[44] Materialize(x83,x00);
[11] UnitAnim(x83,x00,x0003,x00);
[32] UnitColor(x83,x00,x08, 0, 0, 0, 1);
[3B] UnitSprAnim(x83,x00, 0, 0, 0,x00,x01, 302);
[6F] Unknown(x83,x00);
[28] OrderMovement(x83,x00, 5, 8,x00,x00, 8,x01);
[29] StopWalking(x83,x00);
[11] UnitAnim(x83,x00,x0002,x00);
[2D] Face(x83,x00,x00,x00,x00,x00);
[5F] MoveUnit(x02,x00, 6, 8,x00,x00);
[32] UnitColor(x02,x00,x01, 0, 0, 0, 0);
[F1] Wait(2);
[3B] UnitSprAnim(x02,x00, 0, 0, 13,x00,x01, 302);
[6F] Unknown(x02,x00);
[44] Materialize(x02,x00);
[11] UnitAnim(x02,x00,x0003,x00);
[32] UnitColor(x02,x00,x08, 0, 0, 0, 1);
[3B] UnitSprAnim(x02,x00, 0, 0, 0,x00,x01, 302);
[6F] Unknown(x02,x00);
[11] UnitAnim(x02,x00,x0002,x00);
[F1] Wait(12);
[21] PlaySound(x004C);
[55] UseFieldObj(x01,x00);
[57] Unknown();
[10] DisplayMessage(x10,x11,x03,x00,x17,x00,x00, 0, 0, 8,x01);
[E5] WaitForInstr(x01,x00);
[F1] Wait(30);
[11] UnitAnim(x34,x00,x0003,x00);
[F1] Wait(12);
[3B] UnitSprAnim(x34,x00, 0, 0, 0,x00,x01, 302);
[F1] Wait(12);
[11] UnitAnim(x34,x00,x0002,x00);
[F1] Wait(12);
[10] DisplayMessage(x10,x11,x04,x00,x34,x00,x00, 0, 0, 4,x00);
[E5] WaitForInstr(x01,x00);
[F1] Wait(8);
[10] DisplayMessage(x10,x11,x05,x00,x17,x00,x00, 0, 0, 8,x01);
[E5] WaitForInstr(x01,x00);
[F1] Wait(25);
[60] Unknown(x00,x3C);
[F1] Wait(25);
[11] UnitAnim(x83,x00,x0003,x00);
[F1] Wait(10);
[11] UnitAnim(x02,x00,x0003,x00);
[F1] Wait(30);
[11] UnitAnim(x86,x00,x0003,x00);
[F1] Wait(10);
[11] UnitAnim(x17,x00,x0003,x00);
[F1] Wait(10);
[11] UnitAnim(x34,x00,x0003,x00);
[F1] Wait(10);
[11] UnitAnim(x00,x00,x0003,x00);
[F1] Wait(10);
[22] NextSong(x01,x60,x00);
[1C] Unknown(x02);
[76] DarkScreen(x00,x01,x0C, 64,x00, 4);
[E5] WaitForInstr(x36,x00);
[78] DisplayCond(x08, 60);
[E5] WaitForInstr(x38,x00);
[78] DisplayCond(x00, 60);
[E5] WaitForInstr(x38,x00);
[77] RmvDarkScreen();
[E5] WaitForInstr(x36,x00);
[1C] Unknown(x01);
[DB] TextStart?();
  • 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

gomtuu

February 16, 2008, 04:16:51 pm #58 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Very interesting! This fits well with what I found in the map file for Orbonne. Here's a hex dump from MAP056.48:

0008028: 5500 e001 1000 0100 0000 0000 0000 0403 000f 0000
000803c: 0203 b200 0500 2800 0c03 b200 0000 0501 0001 0000
0008050: 0203 b200 0500 2800 0703 b200 0000 0601 0001 0000
0008064: 1603 5800 0500 2800 2503 5800 0000 0701 0001 0000
0008078: 1603 5800 0500 2800 2003 5800 0000 0801 0001 0000

Line 2 (counting from zero) reads something like this:

Words 0-1: Destination texture coordinates (words*, lines)
Words 2-3: Width and height of area to copy to these coordinates (words, lines)
Words 4-5: Source texture coordinates (words*, lines)
Word 6: ?
Word 7: Low byte: ?
Word 7: High byte: Number of frames in the animation
Word 8: Low byte: ?
Word 8: High byte: Delay (in screen frames?) between frames of animation
Word 9: ?

* I don't understand what the 03 in the high byte is for yet.

By experimenting, I've found that line 2 (counting from zero) plays when the door opens, and line 1 (counting from zero) plays when the door closes, which matches your UseFieldObj call parameters. I'm betting the script that plays when Delita steals Ovelia references the last two lines to open and close the back door. I haven't tested that, but the texture coordinates match an area of the texture that looks like the back door.

The first line (line 0) seems to be related to palette animation for the water texture, but I haven't figured it out yet.

You can tell if a map file has a block like this by looking up the pointer at location 0x006c in the map file's header. Then seek to that address in the file.

gomtuu

February 16, 2008, 07:34:43 pm #59 Last Edit: December 31, 1969, 07:00:00 pm by gomtuu
Here's another release. Along with the features I mentioned above, here are the changes:

  • Added magenta background mode for chroma keying.
  • Made default window size 800x600.
  • Instead of the half-texture and limited-texture fallbacks, map2gl will now use a fallback mode that splits the 16 different palette-renderings of the texture up and stores them in separate texture objects instead of putting them all into one big texture object.

This new separate-texture fallback mode should decrease the video RAM requirement without decreasing the quality of the image. The tradeoff is that, while map2gl is in this fallback mode, it will run more slowly than it otherwise would because some overhead is required to switch to the right texture before drawing each polygon. In this mode, map2gl runs at about half or a third of the normal speed on my computer, but it's still quite fast. With limted video RAM, there may be even more of a speed impact because the textures will have to be copied into video RAM frequently. But it'll look good!

Try it out, Zodiac. If it's really, really slow, some optimization is still possible, so let me know.

-Don