Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to FFH, where all your dreams come true!

Terrain/Movement data  (Read 1339 times)
Pages: [1]
pokeytax [Posts: 515] Logged
  • View Profile
  • share
  • [March 13, 2011, 10:30:50 PM]
Terrain/Movement data
« on: March 13, 2011, 10:30:50 PM »
While picking apart the Movement routine to make it possible to disable Movement abilities, I found some interesting data. I am just going to dump the stuff and make sense of it later; hopefully I will be able to update it with more thorough notes.

These are all RAM values, which can be adjusted by editing SCUS_942_21 at RAM minus $F800.

tl;dr
"Elemental" terrain table: 0x5E9D0
Terrain status inflict table: 0x5EA10 (e.g. Poison swamp)
Default movement cost table: 0x5EA50


Offset 0x5ea50 through 0x5ea8F is the default Movement table. These tables have $40 values, one for each of http://www.ffhacktics.com/wiki/Terrain_Surface_Types.
So offset 0x5ea62 corresponds to 0x12, "Lava".

General terrain is "01" (Natural Surface, Roof, Furniture).
Swamp is "00" (Poisoned marsh, Salt, Water plant).
Water is "02" (River, Sea, Waterfall).
Impassable terrain is "FF" (Obstacle, Darkness, Lava).

There are five more Movement tables. Subject to some shuffling, they correspond to the following:

0x5ea90: Fly/Teleport
0x5ead0: Float
0x5eb10: Walk on Water/Move in Water
0x5eb50: Move Underwater
0x5eb90: Move on Lava

All terrain tables have an "FF" byte in spot 3F and a "00" byte for "Salt" terrain (an oversight?).

Fly/Teleport and Float are "01" elsewhere.
Walk on Water/Move in Water and Move Underwater are elsewhere "01", except impassable terrain.
Move on Lava is identical to base movement, but with "Lava" set to "01".

When the table is read, "00" becomes "02" if there is weather and Any Weather is not equipped, "01" otherwise.
Values other than "FF" are converted to "01" if Any Ground is equipped.

So it seems that this determines the movement cost for different terrain. "Cannot enter water" must be covered later. Looks like a great starting point for implementing aquatic/lava monsters, or barriers that keep out demons, or even a sensible terrain system where mud/rock/furniture are harder to walk over. I will let someone who can hex edit but not ASM hack investigate further, since I have about a billion lines more of this movement mess to sift through.

Offset 0x5e9d0 is the Elemental table. Values correspond to the ability numbers of the associated "Elemental" skills. As long as you add the skill to "Elemental" as well, looks like you can use anything. Might be useful for consolidating Elemental, which as fun as it is probably doesn't need twelve abilities.
Offset 0x5ea10 is the poison-on-movement table. All values are "00" except for "80" at Poisoned swamp.
« Last Edit: March 20, 2011, 06:30:24 PM by pokeytax »
pokeytax [Posts: 515] Logged
  • View Profile
  • share
  • [March 15, 2011, 12:29:25 AM]
Re: Terrain/Movement data
« Reply #1 on: March 15, 2011, 12:29:25 AM »
I'm sorely tempted to pause my disabling and rewrite this terrain code, because it's terrible.

- six abilities that solely govern interaction with water, none of which has ever been equipped voluntarily
- four abilities that completely ignore terrain and provide additional benefits, completely obviating any need for terrain abilities
- one ability which interacts with non-water terrain(!!!!) but the terrain is lava and occurs once in the entire game and the ability is a Geomancer innate anyway so why equip it(.)

Unfortunately, not everything is contained in those tables, but I think they serve as the basis for a more interesting terrain system than FFT has, if someone can tie up the loose ends, which are not very fun.
Likes to move it move it.
philsov [Posts: 4599] Logged
  • View Profile
  • share
  • [March 15, 2011, 03:08:11 PM]
Re: Terrain/Movement data
« Reply #2 on: March 15, 2011, 03:08:11 PM »
Awesome notes. 

Quote
- one ability which interacts with non-water terrain(!!!!) but the terrain is lava and occurs once in the entire game and the ability is a Geomancer innate anyway so why equip it(.)

It's not a geomancer innate by default, for what it's worth. 

Just another rebel plotting rebellion.
pokeytax [Posts: 515] Logged
  • View Profile
  • share
  • [March 19, 2011, 07:06:20 PM]
Re: Terrain/Movement data
« Reply #3 on: March 19, 2011, 07:06:20 PM »
Oh, right. I don't even know between 1.3/vanilla/Arena anymore.

Editing the table actually seems to work pretty well. Anything but zero movement cost terrain works fine; I was worried that "02" and "00" were hardcoded as "Water", but all the water movements are coded separately. It also makes your units do these adorable lil' hops and skips around the battlefield to avoid the slow tiles - a terrain system may need to adjust horizontal leap as well.

I'm working this out now, so if anybody has a wish list for movement/terrain, now would be a good time to bring it up!
I'ma Firin Mah Lazorz!
RandMuadDib [Posts: 381] Logged
  • View Profile
  • share
  • [March 20, 2011, 01:20:32 AM]
Re: Terrain/Movement data
« Reply #4 on: March 20, 2011, 01:20:32 AM »
Quicksand! like depth 2 water, only sand.

Seriously though, how crazy are you able to get? What about adding status effects (like the swamp poison) or straight damage/healing? I was thinking like a plant or sacred ground that would heal you every turn you start on it, or spiderwebs that cause slow, or panels that boost certain damage types like weather effects do (snow boosts ice, wood or dry brush boosts fire, etc)

I will show you the power of SARDIIIIINES!!!!
pokeytax [Posts: 515] Logged
  • View Profile
  • share
  • [March 20, 2011, 01:43:11 AM]
Re: Terrain/Movement data
« Reply #5 on: March 20, 2011, 01:43:11 AM »
Seriously though, how crazy are you able to get?

That's what I'm trying to figure out. Right now I'm examining movement, but hijacking the poison swamp code should make terrain effects possible. So, yeah, I don't see why you couldn't do Quicksand: depth 2 water with sand graphic that adds Death Sentence, Don't Move.
pokeytax [Posts: 515] Logged
  • View Profile
  • share
  • [March 20, 2011, 03:34:55 PM]
Re: Terrain/Movement data
« Reply #6 on: March 20, 2011, 03:34:55 PM »
Okay, here is a quick hack for this while I sort out bigger stuff:


That 80 corresponds to poison for terrain 0B, poison swamp. 40 corresponds to Regen, etc.
« Last Edit: March 20, 2011, 06:13:10 PM by pokeytax »
Unreliable as a Mime.
The Damned [Posts: 2014] Logged
  • View Profile
  • share
  • [March 20, 2011, 05:04:54 PM]
Re: Terrain/Movement data
« Reply #7 on: March 20, 2011, 05:04:54 PM »
Nice find. That might be useful for what I want to do with Wall (especially given that series of videos I just finished watching).

Wouldn't the Stop one be kind of...problematic, though? Then again, I can't recall if poisonous swamp re-Poisons you if you Wait in the same spot. IIRC it does if you move from one poisonous swamp panel to another, though. Obviously, you can see what I'm getting at if it does the former too.
pokeytax [Posts: 515] Logged
  • View Profile
  • share
  • [March 20, 2011, 05:14:24 PM]
Re: Terrain/Movement data
« Reply #8 on: March 20, 2011, 05:14:24 PM »
Then again, I can't recall if poisonous swamp re-Poisons you if you Wait in the same spot.

It does. However, you only get re-Stopped if you get a chance to Wait, which you won't until the first Stop has worn off and given you a chance to move away. Don't Move is the only one presenting problems, if the routine were tweaked to allow that, and if you're some kind of nicenik who doesn't want a snare that has to be cured and immediately escaped.
Unreliable as a Mime.
The Damned [Posts: 2014] Logged
  • View Profile
  • share
  • [March 20, 2011, 05:28:15 PM]
Re: Terrain/Movement data
« Reply #9 on: March 20, 2011, 05:28:15 PM »
I see. Well, it would still be rather problematic if that unit was forcibly surrounded or couldn't go anywhere else, but that's just throwing out situations.

Regardless, these statuses still only come about when you're in contact with the surface, correct? So they're still all avoided by Float, right? Also, these be liquid mediums/terrain like the swamp? Or could they be "solid" terrain like, say, if some wanted the Haste terrain to be an escalator or motorized walkway?

Regardless, thanks for the swift response. I probably won't see you're next one for a bit since I've some things to do and might possibly fall asleep once I return home (after getting rained on).
pokeytax [Posts: 515] Logged
  • View Profile
  • share
  • [March 20, 2011, 05:45:28 PM]
Re: Terrain/Movement data
« Reply #10 on: March 20, 2011, 05:45:28 PM »
Yes, Float status/riding will prevent these, and any terrain type can inflict them.

The Elemental table is also nearby at 0x5E9D0: this might actually be handy, because as much as I love Elemental, 12 ability slots is too many. I don't see any issues consolidating these down - this is where Counter Flood looks too.
« Last Edit: March 20, 2011, 06:58:58 PM by pokeytax »
I'ma Firin Mah Lazorz!
RandMuadDib [Posts: 381] Logged
  • View Profile
  • share
  • [March 20, 2011, 10:07:27 PM]
Re: Terrain/Movement data
« Reply #11 on: March 20, 2011, 10:07:27 PM »
Ooh that's exciting

I will show you the power of SARDIIIIINES!!!!
Unreliable as a Mime.
The Damned [Posts: 2014] Logged
  • View Profile
  • share
  • [March 20, 2011, 11:04:33 PM]
Re: Terrain/Movement data
« Reply #12 on: March 20, 2011, 11:04:33 PM »
Indeed on both parts, though as pesky as Elemental can be, I can't think of much to condense beyond Gusty Wind with Kamaitachi and perhaps Carve Model with Local Quake. Only other things that seem "likely" would maybe be just getting rid of Blizzard (since it doesn't show up in any random battles IIRC) or Lava Ball (since there's only two maps that it works on IIRC) entirely and maybe combining Quicksand and Water Ball.

Good to know all that, though. It also somewhat solves question I had with regards to Geomancy and potentially new terrain. (Actually, are you making new terrain or just replacing it?)

Similarly, another question I realized as soon as I left: Are you limited to only one status per terrain? Or could do something like that Quicksand panel that was mused about above, even though it would ultimately be horrible idea due to the Don't Move & Wait thing you pointed out?
pokeytax [Posts: 515] Logged
  • View Profile
  • share
  • [March 21, 2011, 12:17:19 AM]
Re: Terrain/Movement data
« Reply #13 on: March 21, 2011, 12:17:19 AM »
(Actually, are you making new terrain or just replacing it?)

There's plenty of room, but I'm more interested in playing with how current terrain works.

Quote
Similarly, another question I realized as soon as I left: Are you limited to only one status per terrain?

No, you can toss on as many as you want. Right now they're limited to the same status byte "Poisoned marsh" already uses, but that's only because I didn't want to go to the trouble of using freespace until I figured out what I was doing with possible other stuff (e.g. a Geomancer support ability that forces a read from a different table full of positive status; damage/healing/stat boosts, etc.).

Currently it writes to a character's 0x1AA byte, which is a temporary byte used to inflict status conditions. I know how the inflict status and remove status bytes work (so you could have an Esuna or Dispel tile) but I'll probably have to comb through FDC's formula work to apply other stuff.
« Last Edit: March 21, 2011, 12:31:31 AM by pokeytax »
Pages: [1]