Author Topic: Decoding World Map Triggers  (Read 5702 times)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Decoding World Map Triggers
« on: October 17, 2012, 11:10:37 AM »
I've been working on figuring out the Overworld/Underworld/Moon map triggers.
Most of what follows is interpreted from Yousei's document.  Hopefully this will clarify a bit what took me some experimenting and time to figure out:

The World Map trigger data is located from D0066-D01FF (headered US ROM).  Each trigger is five bytes long.
Byte 0: X-Position
Byte 1: Y-Position
Byte 2: Call to load a new map (or play an event - more on this later)
Byte 3: New map X-Pos
Byte 4: New Map Y-Pos

So, at D0066, we have:
65 9C 24 10 1E
"At 65/9C (NW Corner of Baron Castle), load map 24 (Baron Castle) at position 10/1E."

If Byte 2 = FF, this is an event call.  The game, as programmed, has seven of these - two in the Overworld and five in the Underworld:
Quote
Event Call ID  X-Pos  Y-Pos  Event ID  Description
-------------  -----  -----  --------  -----------
(Overworld)
           10     77     3E        42  Redwings Bombing Damcyan
           2B     DD     38        83  Boarding the ship in Fabul
(Underworld)
           58     30     0F        06  Entering the Tower of Bab-il from the Underworld
           ""     31     0F        ""  ""
           36     37     14        FE  Dwarf tanks shooting tower of Bab-il
           ""     36     11        ""  ""
           ""     33     10        ""  ""

I don't quite understand why the event call IDs do not match the actual event IDs.  Also, I've played around with inserting other values besides the four used, and have not found any others that work (but have not exhausted all 252 possibilities by any stretch).

It's also worth mentioning that, as with location maps, if the position of a trigger is moved, the target location must contain a trigger-friendly tile in order for the trigger to function (such as a town tile, cave, castle, etc.). You can use Yousei's FF4ed to do this (if you change the data first, the editor will blue-in the new trigger location).

Also - I think D0060-D0065 contains the data related to which triggers belong in which World Map, but have not yet experimented with this.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Decoding World Map Triggers
« Reply #1 on: October 17, 2012, 03:39:25 PM »
Great work there! This will be helpful. But I have to wonder why they would include two of the same event for entering the Tower of Babil (Underworld) that seems an odd choice.

As for their events...


http://slickproductions.org/forum/index.php?topic=1734.0

This topic should explain that all better. Tiles use a separate index for events, not entirely sure why but they do. The event calls listed here match up with normal tile events.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Decoding World Map Triggers
« Reply #2 on: October 17, 2012, 04:08:52 PM »
"Entering the Tower of bab-il" is not an event like we tend to think of it, it simply puts you in the entrance of the tower.  There are two tiles because the tower is two tiles wide. I'm guessing they had a finite number of "Entrance" trigger tiles to work with, and ran out before programming the tower... or something like that...

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Decoding World Map Triggers
« Reply #3 on: October 17, 2012, 04:46:29 PM »
You know, now that you mention it, I've seen that post of yours before. Guess I haven't played enough with tile event calls to have remembered it.

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Decoding World Map Triggers
« Reply #4 on: October 17, 2012, 06:37:16 PM »
All I can say is that the tower is "two spaces wide" like many other things - usually towns are that many spots wide.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Decoding World Map Triggers
« Reply #5 on: October 17, 2012, 07:05:52 PM »
Ah, my memory was playing tricks on me and I thought that the tower itself was three tiles wide with only one being accessible. My mistake. Now that I think on it though you cannot enter the Tower of Babil once Golbez destroys the stairs. Likely the purpose of that designation is to put a "Requires Event Flag XX" to make it accessible/unaccessible.

Ah found it, it's in the notes in that topic. Requires Event Flag 3B to kill the event.

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Decoding World Map Triggers
« Reply #6 on: October 17, 2012, 09:06:12 PM »
You can reenter the Tower of Babil underground route at any time until you possess/lose the Dark Crystal.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Decoding World Map Triggers
« Reply #7 on: October 17, 2012, 09:54:51 PM »
My mistake. I guess I was thinking too... logically? I never realized you could go back after Golbez destroys the stairs.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Decoding World Map Triggers
« Reply #8 on: October 18, 2012, 11:38:18 AM »
Confirmed- the six bytes preceding this table are pointers. Overworld triggers start at byte 0000, underworld at 0122, moon at 0177. So it is possible to redistribute triggers. That's not ground breaking news, but I wanted to make sire that info was also on this thread...

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Decoding World Map Triggers
« Reply #9 on: October 18, 2012, 11:40:36 AM »
On a more philosophical note... since world map triggers seem to work exactly the same as location map triggers, I wonder if it's possible to hide treasure in the world maps...

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Decoding World Map Triggers
« Reply #10 on: October 19, 2012, 06:29:48 AM »
You mean like, "Hey why can't I step on this forest tile?" *Hits A* "Found cool item!"
Let's dance!

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Decoding World Map Triggers
« Reply #11 on: October 19, 2012, 05:31:36 PM »
My only guess is that the dialogue screen never comes up ever on the overworld. It probably won't work the way you expect.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Decoding World Map Triggers
« Reply #12 on: October 19, 2012, 08:13:36 PM »
You mean like, "Hey why can't I step on this forest tile?" *Hits A* "Found cool item!"
Exactly! Wouldn't that be cool?
My only guess is that the dialogue screen never comes up ever on the overworld. It probably won't work the way you expect.
I Didn't even think of that... My concern was that there are no chest-type tiles used in the world maps. If you try to assign a treasure to, say, a staircase in a location map, it doesn't work... In theory there would have to be a way to change the ASM of tiles so that a world map tile functions as a chest.
Is the world map any different from the field?  Is the world map basically a stripped down version of the field, where you can only access the menu, get into random battles, and go to field events (where almost all of the story happens)?
One thing that is definitely true about the Overworld map is that it is 64 times the size of any location map.  Given the hardware limitations of the SNES, I'd wonder if the game had enough RAM to load a world map that had all the interactivity of a location map...

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Decoding World Map Triggers
« Reply #13 on: October 19, 2012, 09:16:43 PM »
One thing that is definitely true about the Overworld map is that it is 64 times the size of any location map.  Given the hardware limitations of the SNES, I'd wonder if the game had enough RAM to load a world map that had all the interactivity of a location map...

I doubt it would be anything like that. You are very likely loading portions of that map into memory. Consider the long distance traversing you do on that map. The longest IIRC is the trip from Mysidia to Mt. Ordeals... and even that is linked to the "peninsula of power" with the different monster location borders... this is unlike FF6 (I'm not sure where FF5 goes, but it's probably close to FF4 in terms of overworld design).
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Decoding World Map Triggers
« Reply #14 on: October 19, 2012, 10:41:21 PM »
I don't know about that, Deathlike2.  Using Yousei's editor, I once created a land bridge from Baron to Mysidia, thereby enabling one to walk from the Mist Cave all the way to Mt. Ordeals.  It worked just fine - bridge even crossed into Eblan's territory, so the same walking trip involved monsters from all three regions.