Author Topic: What is known about vehicles?  (Read 6115 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
What is known about vehicles?
« on: August 16, 2013, 01:09:01 PM »
I don't think I've seen any kind of discussion even remotely covering this topic (though feel free to prove me wrong on that).

Here are some questions that come to mind immediately:
  • How is it determined which vehicles can land where? (e.g. black chocobos can land only in forests, but airships can't land in forests at all)
  • How is it determined what terrains the different vehicles can move over? (e.g. the hovercraft can't move over mountains but the airship can)
  • How is the speed of the vehicle determined?
  • How is it determined whether boarding the vehicle tilts the terrain (like airships do but chocobos don't)
  • Would it be possible to create, say, a sea ship vehicle that can only move on water and dock on land?
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What is known about vehicles?
« Reply #1 on: August 19, 2013, 11:47:28 AM »
So, a lot of this is answered by my data on world map tile properties (http://slickproductions.org/forum/index.php?topic=1866.0)
The ability of each vehicle type to travel on/over a tile and the ability to land/dismount on a tile is determined by the properties of the tile. It's fully customizable.
That being said, it is therefore entirely possible to create a sea ship, but you would have to ax the hovercraft (because the ship will travel anywhere, will land nowhere, and this can't be changed)
- make ocean tiles travelable by hovercraft
- make bridges travelable by hovercraft
- make every other tile not travelable by hovercraft
- swap the graphics of the ship and the hovercraft
You'll now have a sea ship that travels oceans and docks at bridges. You can add bridges to the map at strategic docking points.

I'm still unclear about the rest of the (largely cosmetic) properties of vehicles. I imagine there is a bank of data somewhere that assigns graphical pointers and what kind of vehicle it behaves as to each one.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: What is known about vehicles?
« Reply #2 on: August 20, 2013, 06:46:54 AM »
That's great news, thanks! In that case, it should be easy to incorporate into the tile editor once I get that far.

So will my "ship" appear to float above the sea like a hovercraft? That would look a little silly. Could it maybe be done with a chocobo? Although I guess then you'd have the ship flying off in random directions when you disembark which would probably be worse...  :hmm:
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What is known about vehicles?
« Reply #3 on: August 20, 2013, 08:33:27 AM »
I thought about that, too. I haven't gotten around to actually checking the graphics to see if there are separate sprites for the traveling and stationary hovercraft (and ship).
Also, I'm wondering whether the property of vehicles separates the raising motion from where it can travel. If it was possible to say "travel like the hovercraft but rise like the yellow chocobo," that would solve the issue. Now if we only knew where vehicle properties were stored. I'm gonna try to figure that out, but I'm not holding my breath I'll be able to find it. It's going to be such a small collection of data, so it'll probably be easy to miss...

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What is known about vehicles?
« Reply #4 on: August 21, 2013, 09:52:14 AM »
The byte in RAM that determines what vehicle (if any) you are traveling in is 1704. it's 00 for walking, 01 for Yellow Chocobo, 03 for Hovercraft, 04 for Enterprise, 05 for Falcon, 06 for Lunar Whale (I assume 02 for Black Chocobo, but the game wigs out if you try to change this by hand in Geiger's).
The instruction to change this to 03 in ROM (to "become" the hovercraft) begins at 2149 (I think this is where it begins).
If you change the 03 at 214B to 04, then entering the hovercraft makes you "become" the Enterprise instead, but the screen does not zoom out like if you enter the Enterprise normally. Likewise, you travel at Hovercraft speed, not Enterprise speed. However, you have Enterprise travelability, not Hovercraft travelability. Also, the game bugs out when you land because you land like the Enterprise, but you're not zoomed out on the world map.
There are definitely other instructions going on in this routine, presumably instructions that set the speed and zooming, but as I've said before, I'm not particularly good at interpreting assembly. Anybody else have any input here?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: What is known about vehicles?
« Reply #5 on: August 21, 2013, 02:03:59 PM »
That is very impressive work! I will try and take a look at this and see if I can find anything to help here.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What is known about vehicles?
« Reply #6 on: August 22, 2013, 01:02:18 PM »
I've figured some useful stuff out. I'm not yet at the point where I can say I've cracked vehicle data completely, but I've got the missing necessary information to turn the hovercraft into a ship.
in RAM:
  • 06AC: Travel Speed - For hovercraft, the default value is 01, and the max is 03 before the game gets buggy
  • 06B6: Hovercraft's height off the ground - default value is 04. Shadow becomes visible at 02. Anything higher than 06 or so results in funky landing animation (there may be a way to alter landing animation, too). Anything higher than 7F makes the hovercraft go out of the screen. It will eventually circle back around from the bottom. 00 is the max value, not the min (00 will make the hovercraft circle the entire screen)
The set of instructions that makes the Hovercraft take off is at 2149-2178 in ROM.
To change the height it rises, change 2176 from 04 to whatever you want (01 for best Sea Ship results).
To change the speed it travels, change 2150 from 01 to anything 00 through 03.

Other (potentially) useful information:
06AD in RAM is the Zoom level. it ranges between 10 and 31 without bugging. I have not been able to successfully change the airship takeoff instructions so that the airship flies at a different zoom, though.
06B7 in RAM is the airship's height off the ground. yes, this is separate from the hovercraft's height off the ground, and it is separate from the Zoom level, however, the airship takeoff instructions link the height and the zoom (I believe it says zoom will be height-10). At this point, though, it doesn't really matter, because I can't change the height setting in the takeoff routine.
06FD in RAM is the speed of vehicle sprite animation (propellers spinning) it can be set between 00 and 0F. I don't really care about this, but maybe someone else does.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: What is known about vehicles?
« Reply #7 on: August 22, 2013, 02:37:37 PM »
That is some incredible finds there Chillyfeez! Now the boat can be made into a real vehicle, rather than the, frankly unfitting, Hovercraft.

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: What is known about vehicles?
« Reply #8 on: August 22, 2013, 05:36:04 PM »
Yeah, that's really cool! We're definitely getting to the point where the game's engine can be used to make something entirely different.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What is known about vehicles?
« Reply #9 on: August 23, 2013, 08:13:33 AM »
Hmm... new problem - you can't "no dust" the hovercraft's initial launch  :bah:
 :edit: Figured it out!
Within the takeoff instructions, you have:
Code: [Select]
$00/2162 20 7A 9F    JSR $9F7A  [$00:9F7A]; jump to subroutine at 9F7A
$00/2165 20 3F 8B    JSR $8B3F  [$00:8B3F]; jump to subroutine at 8B3F
the subroutine at 9F7A is the dust animation! so, all we have to do is change the 20 7A 9F at 2162 to a repeat of 20 3F 8B, thereby skipping the dust subroutine without altering the size of the ROM (apparently, it doesn't matter if subroutine 8B3F is doubled - this seems to have no effect).
So instead, you'll have:
Code: [Select]
$00/2162 20 3F 8B    JSR $8B3F  [$00:8B3F]; jump to subroutine at 8B3F
$00/2165 20 3F 8B    JSR $8B3F  [$00:8B3F]; jump to subroutine at 8B3F
And the initial launch will not show the dust!

On the positive side, the hovercraft landing sequence was easy enough to find/fix.
The routine's at 21C6. Change 21D3 from 04 to whatever you've set the hover height to be for a smooth landing from any height.
So, if you've set the height (2176) to 18 (which will be super-high), set 21D3 to 18 as well. Voila!
 :edit: Why is this useful, you might ask? Well, if you wanted to turn the hovercraft into, say, a flying dragon a la FFV instead of a sea ship, you now have the ability to do so.

« Last Edit: August 23, 2013, 11:18:58 AM by chillyfeez »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: What is known about vehicles?
« Reply #10 on: August 23, 2013, 04:04:35 PM »
You have really gotten better with Geiger's Chillyfeez! Keep up the incredible work!

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: What is known about vehicles?
« Reply #11 on: August 23, 2013, 06:05:41 PM »
Amen! This is awesome stuff!

So I guess the next question is: this is all related to just the hovercraft right? I mean suppose someone wanted to keep the hovercraft and change something else into a ship or dragon or whatever. Can we change the properties of say, one of the chocobos or one of the airships? What if you wanted to change the Lunar Whale into the ship so that you can "go aboard"?
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What is known about vehicles?
« Reply #12 on: August 23, 2013, 07:36:06 PM »
The airships and the Whale are much tougher to crack. The height off the ground and the zoom on the overworld are separate values, but they are linked (as previously stated). Unfortunately, I can't find where the value is set for height in the takeoff routine, and believe me I've tried. I spent hours poring through routines and subroutines looking for that one elusive "10" that sets the airship's height... I just can't find it. Furthermore, if you change the "10" that defines the relationship between height and zoom, it just makes funkiness happen.
I wish it were possible - I mean, who needs two different airships anyway? I used to think that was silly even before ROM hacking existed...
I haven't tried chocobos because of their running away. Might be able to make a workaround for the black, but I doubt you could do much with yellow.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What is known about vehicles?
« Reply #13 on: August 24, 2013, 12:37:00 PM »
Some exciting developments on the airship modification front...
Turns out the Enterprise, Falcon and Whale all have different places in RAM that store their height (06B7, 06B8 and 06B9 respectively).
As such, they each have separate takeoff/landing routines.
By taking out all instructions regarding height and zoom from the takeoff/landing routine, I've managed to (almost) successfully modify the Falcon to travel along the ground instead of rising. The only problem is that the ocean turns solid blue (instead of animated and wavy) until you enter a location, enter a battle, or takeoff in the Enterprise (in other words, when the game actually needs to reload the entire Overworld map). Once I get this kink worked out, I'll post a patch for anyone who wants it (what I'm doing is a bit more lengthy than just changing one byte like the hovercraft mod).
Unfortunately, I have to stop for today so I won't get to finishing. In case anybody is feeling industrious about this one, I'm modifying the takeoff routine at 228B (A08B-A0CC if you want to disassemble in Geiger's) and the landing routine at 27B0 (likewise A5B0-A63B). All I'm doing is taking out all commands related to Height (06B8, often just referred to as "B8") and Zoom (06AD, often just referred to as "AD"), then putting a new "60" at the end of the shortened routine and filling the newly voided space with FFs. Doing this will get you to where I am now in the process.
*whew*

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: What is known about vehicles?
« Reply #14 on: August 25, 2013, 07:35:51 PM »
For my next trick...
A Black Chocobo that doesn't fly home!
Here's how:
There is a byte of RAM at 1715 that is set at 00 by default. Every time the Black Chocobo takes off (routine at 202B in ROM), the game checks to see if this is 01, AND the game increases this by 1. If 1715 is 01, then the game executes the fly home routine. If it's any other number, you get control of the Black Chocobo. So, I just took out the part that increases 1715 - it stays at 00, and you never have to fly home!
the ips is attached.
This essentially makes the Black Chocobo like a second Hovercraft. The height can be modified by taking similar steps. The only problem is that when the chocobo lands, the lower half of its body is always cut off, even when not in the forest. I haven't checked TLP to see if this is just programmed-in graphics, or if the game is cutting the graphics off somehow.
« Last Edit: February 17, 2015, 10:28:47 AM by chillyfeez »