Author Topic: What information is known about the overworld?  (Read 10334 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
What information is known about the overworld?
« on: August 16, 2013, 01:01:57 PM »
In this context, I don't just mean the "upper world" but the overworld maps generally, so I'm including the underworld and the moon surface as part of the same kind of object.

I know there exists an overworld editor of some kind, and I can probably reverse engineer some of this from it, but if anyone has any data handy to speed along the process it would be greatly appreciated:
  • How (and where) are the overworld maps stored?
  • How are the overworld events handled?
  • How are the overworld teleporters/entrances handled?
  • Are the underworld and moon surface indeed handled the same way as the "upper world" overworld?
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What information is known about the overworld?
« Reply #1 on: August 17, 2013, 01:01:12 PM »
  • How (and where) are the overworld maps stored?
World Map row pointers are located at B0200-B067F
World Map row data is located at B0680-B6D53. The Data for each row is terminated with FF.
I assume each World map has its own tileset, though I suppose it's possible the Underworld and Moon use the same tileset with different palettes (doubt it, though). I've done some, but not a lot, playing around with the data of the Overworld map (that is, with a hex editor, independently of Yousei's map editor). It seems when a tile's bit 7 is 0 (so, bytes 00-7F), it is an individual tile; but if bit 7 is 1, then the following byte represents a count of how many of that tile will appear.
Thus, the first row of the Overworld reads:
Code: [Select]
99 FF FFWhich means:
Code: [Select]
99 FF - tile 99 (ocean with no shore) 255 times
FF - end row
The 20th row of the overworld (the first that is not all ocean) reads:
Code: [Select]
99 2F 1C 1B 99 CD FFWhich means:
Code: [Select]
99 2F - tile 99 (ocean with no shore) 47 times
1C - tile 1C (ocean with a tiny speck of shore in the lower-right corner, single because bit 7 is 0)
1B - tile 1B (ocean with a tiny speck of shore in the lower-left corner, single because bit 7 is 0)
99 CD - tile 99 (as above) 205 times
FF - end row
I haven't seen documentation of the order of tiles within the tilesets (like an Overworld version of the map editor in Phoenix's FF Tools), but a person with enough time and the proper motivation could do this pretty easily.

  • How are the overworld events handled?
  • How are the overworld teleporters/entrances handled?
my thread on world map triggers is here:
http://slickproductions.org/forum/index.php?topic=1769.msg17690#msg17690
That covers most of the ground for those questions.
Functionally, World map triggers behave like (non-chest) triggers in location maps. That is, they can be set to teleport or activate events however you want, except events in world maps are limited - evoking text will crash the game, and there are no NPCs.
As with location maps, there are specific world map tiles that can/will trigger events and teleportations. Phoenix explained how to edit location map tile properties here: http://slickproductions.org/forum/index.php?topic=1286.0
I imagine that if we knew the location of World Map tile properties, they could be altered in much the same way.
As it stands, triggers can exist on the following types of tiles:
- (Overworld) Town
- (Overworld) Castle (six or eight different tiles, depending on if broken castles use the same bottom tiles)
- (Overworld) Forest
- (Overworld) Cave
- (Overworld) Mountain Path
- (Overworld) Dark Green Grass (trigger for the bombing of Damcyan)
- (Overworld) Bridge (Fabul Port)
- (Underworld) Castle (four tiles)
- (Underworld) Town
- (Underworld) Cave
- (Underworld) Tower of Bab-il Entrance (two tiles)
- (Underworld) Dark-Colored Ground (tanks shooting tower triggers)
- (Moon) Cave
 :edit: I should probably mention that the Dark Green Grass, Bridge, and Dark-Colored Ground tiles that are triggers are different tiles than the identical ones that are not triggers.
  • Are the underworld and moon surface indeed handled the same way as the "upper world" overworld?
I'm not sure I fully understand the question... I think the answer is yes, with the exceptions of all of the ways the Underworld and Moon typically differ from the Overworld.
« Last Edit: August 17, 2013, 01:11:49 PM by chillyfeez »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What information is known about the overworld?
« Reply #2 on: August 17, 2013, 08:11:51 PM »
Hmm...

There's a curious block of code at A0800-A0AFF.
It's only 50 (hex) lines away from the location map tile properties at A1000, it seems to follow a similar type of structure/pattern as the location map tile properties, and at 30 (hex) lines, it's exactly long enough to represent the properties of three tilesets (Overworld, Underworld, Moon).
Think it may be time for some experimenting!

Also, I have a suspicion that some information about the vehicle travel and landing possibilities of tiles will be contained herein (assuming I'm right about this, which at this point is just a big assumption), so I may learn some things to contribute to the vehicle thread too.

Vehek

  • Siren
  • *
  • Posts: 75
    • View Profile
Re: What information is known about the overworld?
« Reply #3 on: August 17, 2013, 08:58:44 PM »
These are unheadered offsets.
0A0000: Overworld tile assembly data
0A0200: Underworld tile assembly data
0A0400: Lunar tile assembly data

0A0600: Palette assignment data (overworld)
0A0700: Palette assignment data (underworld)
0A0800: Palette assignment data (lunar)

0A0900: Palette Data (Overworld)
0A0980: Palette Data (Underworld)
0A0A00: Palette Data (Lunar)


0E8000: Overworld subtile graphics
0EA000: Underworld subtile graphics
0EC000: Lunar subtile graphics
(4bpp linear reversed, combined with palette assignment data to make 8bpp subtiles)
« Last Edit: August 17, 2013, 09:19:17 PM by Vehek »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What information is known about the overworld?
« Reply #4 on: August 18, 2013, 12:00:39 AM »
Got it. World map tile properties are at (headered) A0C80-A0F7F.
Two bytes per tile, as with location tile properties, but the bit meanings are of course completely different.
I'll figure it out, but again, I expect this to take a while.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What information is known about the overworld?
« Reply #5 on: August 18, 2013, 11:51:31 PM »
Well, that actually went very smoothly, thanks to FF4kster, as a matter of fact!
As previously stated, the properties of individual tiles within a world map tileset are located at
A0C80-A0F7F - 2 bytes per tile, FF bytes per world map. I can and will eventually make an image of the tilesets, but that really will take a while because I'll have to jump back and forth between TLP and Paint.
But anyway, here are the data for each tile:
BYTE 0
------
Bit 0: Walkable, ground level
Bit 1: Chocobo can walk (Can only dismount if also walkable)  :edit: Also, airships can fly over only if event flag 57 is set
Bit 2: Black chocobo can fly over
Bit 3: Black chocobo can land (shadow will be partially obscured during flight, bottom half of chocobo is always obscured when it lands, does not have to be coupled with "walkable," but you won't be able to do anything upon landing)
Bit 4: Hovercraft can travel (Can only land if also walkable)
Bit 5: Airship can fly over
Bit 6: Walkable, plateau level
Bit 7: Lunar Whale can fly over

BYTE 1
------
Bit 0-2: Battle Background
 000: Overworld Field
 001: Beach
 010: Forest
 011: Desert
 100: Underworld Field
 101: Moon Surface
 110: Inside moon cave, instant death
 111: Forest
Bit 3: Obscures lower half of body
Bit 4: Airship/Lunar Whale can land (Does not have to be "walkable," but you won't be able to do anything)
Bit 5: (?) Unused
Bit 6: Encounters possible
Bit 7: Trigger tile

A couple of odd things I discovered in this process...
-Tiles 00, 10, 20, 30 in the Overworld tileset make up the 4x4 block of snow-capped mountains. Whereas every other tile is 1x1, these four "tiles" are 1x4.
-The bridge on the world map does not work like the bridge in locations. Its travel-ability is identical to that of the field tiles. I have not been able to figure out how the game knows to make the chocobo run under or over it appropriately.

Given how much data about travel-ability is editable, I've got some exciting ideas about vehicle possibilities, but I will post that to the proper thread. Also, not tonight, I'm going to bed.
« Last Edit: August 29, 2013, 10:34:47 PM by chillyfeez »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: What information is known about the overworld?
« Reply #6 on: August 19, 2013, 12:55:50 AM »
That is some top notch work there Chillyfeez! It is great to know how all of this works.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What information is known about the overworld?
« Reply #7 on: August 23, 2013, 10:04:07 AM »
Related to this topic, but only tangentially related to any of Pinkpuff's questions:
Does anybody know/have any insight about the Overworld "objects?"
This is how we generally refer to them in event editing - I mean the mountains that close around Mist, the ship, the mountains/hole by Agart, any others I'm forgetting.
I wonder if it's possible to change their locations and/or functional arrangements.
Is it possible to make the ship appear somewhere else?
What if I want disappearing/reappearing mountains between Mysidia and Mt. Ordeals?
Or disappearing/reappearing other kinds of terraformation?
Yousei's document refers to the routine that handles these depending on events, but doesn't say anything else about it. I don't recall ever seeing anything else besides the flag to turn them on and off within events.
 :hmm:

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: What information is known about the overworld?
« Reply #8 on: August 28, 2013, 12:28:48 AM »
This is an interesting question and one that Yousei regarded in his info a very long time ago.


AC8FA-      (15C6FA-      ) Routine that alters overworld map depending on events

I haven't taken a look at it but this seems like it would be a good place to start.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What information is known about the overworld?
« Reply #9 on: August 29, 2013, 10:20:54 PM »
Well, that was tedious, but I've figured out how Underworld lava flight works.
It is in fact event flag 57 (the one set at the end of the heat shield event) that toggles the ability to fly over the lava.
Here's the weird part - it turns out the bit that flags "Yellow Chocobo can walk" also flags "can only fly if event flag 57 is set." Makes sense, since there is no Chocobo riding in the Underworld (although they had an extra bit at Byte 1 bit 5, so why didn't they just use that?).
The "Airship can fly over" bit preempts this property, though, which is why airships can always fly everywhere in the Overworld.
While we're sort of on the topic... I never knew this before, but if you force Yellow Chocobo travel in the Underworld, the chocobo will be invisible. Bummer.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: What information is known about the overworld?
« Reply #10 on: August 29, 2013, 10:33:19 PM »
That is a bit of a shame about the Chocobo in the Underworld. Good work on figuring out how that works. I expected it to be an event flag, but I wasn't sure if it would deal something with the tiles themselves, which it did appear to do, so well done. The Drill I guess works in a similar fashion.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What information is known about the overworld?
« Reply #11 on: August 29, 2013, 10:46:59 PM »
There are a few weird things about the airships that I don't quite understand how they work (yet?).
  • The Falcon's Drill, which is really just cosmetic, its "function" is all event driven
  • The Highwind's Hovercraft crane
  • The first time the Highwind goes underground
    - there's an automatic event in which you are caught in a crossfire between the Red Wings and the Dwarves' tanks
    - it's unusable until the event in which Cid fixes it

Vehek

  • Siren
  • *
  • Posts: 75
    • View Profile
Re: What information is known about the overworld?
« Reply #12 on: August 29, 2013, 10:59:13 PM »
Here are some generated tilesets for the world maps.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What information is known about the overworld?
« Reply #13 on: August 30, 2013, 12:12:32 AM »
Vehek, you beat me to it.
I'm in the middle of making tileset maps like this, except I'm separating the tiles by 1 pixel each and labeling them for easy reference.
Anyway, question for you, since you seem to have some insight on this...
Do you know of a program that is capable of editing world map tiles? Tile Layer doesn't seem to be able to view them properly.
Obviously there are quite a few unused tiles in the Underworld and Moon tilesets (and one in the Overworld). It would be great to be able to change the graphics of these tiles and actually put them to use.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: What information is known about the overworld?
« Reply #14 on: August 30, 2013, 12:13:55 AM »
There are a few weird things about the airships that I don't quite understand how they work (yet?).
  • The Falcon's Drill, which is really just cosmetic, its "function" is all event driven
  • The Highwind's Hovercraft crane
  • The first time the Highwind goes underground
    - there's an automatic event in which you are caught in a crossfire between the Red Wings and the Dwarves' tanks
    - it's unusable until the event in which Cid fixes it

Great work Vehek! That all looks like very malleable parts. It is interesting to see that there are two tops to the Tower of Bab-il which means two of those spaces should be unused.

Now in the Overworld events was there any event for going into the Underground?

The event flag set is 50 after the event completes...

Then when Cid saved the crew with the Airship, Flag 10 is set, but that deals nothing with the Airship, hmm... Can you take the Enterprise (Not Highwind, that's FFVII, heh) into the underground again? I am pretty sure you can't... It may just be that the Enterprise is programmed not to function in the Underworld except in cutscenes where the player has no control.