Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - f-zero track hack
  
User name:
Password:
Reply:
 

UserPost
Violent J
Posts: 402/749
Supposed to be a link on those heres?
Heian-794
Posts: 696/896
Thanks Wolverine; this is just what we needed!

VL-Tone has made some big discoveries in F-Zero and they won't make sense without the proper background, much of which is stored here. Good thing Acmlm doesn't purge old topics like, say, GameFAQs does!

Anyway, those of you who were wondering what VL-Tone and I were on about in his thread (regarding "row data") can look here; all is explained!
WolverineDK
Posts: 3/6
Heian-794: did you want an old bump here it is and please spank me moderators, since i have been bad at bumping.
Heian-794
Posts: 103/896
Firemaker, I'm guessing that someone with some real talent at using Evil Peer's tracker might be able to dig out the addresses that the game looks up when matching car positions with checkpoints.

Looking at the track layouts for the ever-instructive F-Zero II, Mute City has a similar course and thus probably has the same checkpoint layout, as does Big Blue II and Silence II. But the Sand Storm courses are brand new.

Also, has anyone ever found the byte that triggers the wind that blows on DW I and II, and also Sand Storm?
firemaker
Posts: 44/247
death wind maye be easy to see but i doubt that the checkpoints will be just as easy to find. think about it. almost nothing is gonna have a value of 00 00. its gonna take some massive corrupting
EDIT so if the A.I data is stored in the RAM where does it get the commands to say which point is a checkpoint? it would have to be somewhere in the rom. if we can crack this i reckon we are ready to start building an editor. but i cant seem to find any bytes that relate to the xy point.
Heian-794
Posts: 101/896
Given that boost pads (I'll use this word rather than "panel") only work in certain directions, perhaps the rule for them is not "increase speed a lot", but rather "fling the car at top speed towards the next checkpoint"?

Also, when you do go through a wall and int empty space, the car is definitely being pulled strongly towards something.

I wonder how Fire Field, and its only-one-in-the-game multiple path (towards the end) is handled, checkpoint-wise? One of my ideas for a new track -- the original idea which made me want to hack F-Zero to begin with -- was a grid-like city layout with some roads having boost panels and jumps, and others taking shortcuts but having nothing (or rough).

Once I figured out that boost pads had directions associated with them, I tried putting them right before 90-degree turns, forcing the driver to either intentionally miss them or somehow execute a "bounce off the wall and make a sharp tuen" maneuver.

The "REVERSE" takes a second to kick in sometimes, but other times you get it almost immediately. I'm betting that passing one of the checkpoints in reverse order triggers it.

Wouldn't Death Wind be an ideal track to test for checkpoints? It has a nice smooth layout.
VL-Tone
Posts: 15/200
I tried your DW hack, neat

The problem with the walls you can go through seems to be related to checkpoints.
The rival cars seems to behave the same way (what I described is now even clearer to me).

When you face a checkpoint you can go foward thru walls it seems, which is not a problem
normally because the checkpoints are arranged on the track in a perpendicular way to the sides.
So in the normal game you never have to face a wall and the next checkpoint at the same time.

Without changing the chekpoints paths anyway editing seems to be pretty limited for now.
I'm guessing that the checkpoints are also used by the game to see if you are going reverse.

Edit: also the boost panel direction is probably related to the same checkpoints.
Heian-794
Posts: 100/896
VL-Tone, we'll soon have some more tracks on which to test new AI!

I was editing Death Wind I/II and managed to make a track that will still
run normally whether you select course I or II.

The original DW looks like this:


29880

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
01 02 05 06 05 05 05 05 05 05 05 05 07 05 05 05 05 05 05 08 05 09 05 08 0a 0b 00 00 00 00 00 00
03 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 0d 00 00 00 00 00 00
0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00
0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00
11 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1b 1c 00 00 00 00 00 00
13 14 15 15 15 16 17 18 18 18 18 19 18 18 18 18 18 18 18 19 18 18 1a 18 1d 1e 00 00 00 00 00 00
00 00 00 00 00 00 1f 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 21 22 23 23 24 25 00 00 00 00 00 26 23 23 23 24 28 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 27 00 00 2a 2b 24 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 29 23 23 2c 2d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

And my version looks like this:


29880

13 14 15 15 16 18 18 19 18 19 18 19 18 19 18 18 18 19 18 19 18 19 18 19 18 19 18 18 1d 1e 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
01 02 05 06 05 05 05 05 05 05 05 05 07 05 05 05 05 05 05 08 05 09 05 08 0a 0b 00 00 00 00 00 00
03 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 0d 00 00 00 00 00 00
0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00
0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00
0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1b 1c 00 00 00 00 00 00
0e 00 01 02 15 16 17 18 18 18 18 19 18 18 18 18 18 18 18 19 18 18 1a 18 1d 1e 00 00 00 00 00 00
0e 00 03 04 00 00 1f 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00 00 00 00 00 00
0e 00 0e 00 00 00 21 22 23 23 24 25 00 00 00 00 00 26 23 23 23 24 28 00 00 00 00 00 00 00 00 00
0e 00 0f 00 00 00 00 00 00 00 00 27 00 00 2a 2b 24 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0e 00 11 12 00 00 00 00 00 00 00 29 23 23 2c 2d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0e 00 13 14 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 08 09 08 09 05 05 05 0a 0b 00 00
0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 0d 00 00
0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00
11 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1b 1c 00 00



But since the track loops in all four directions, you might get a better view by
shifting one row upward:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
01 02 05 06 05 05 05 05 05 05 05 05 07 05 05 05 05 05 05 08 05 09 05 08 0a 0b 00 00 00 00 00 00
03 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 0d 00 00 00 00 00 00
0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00
0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00
0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1b 1c 00 00 00 00 00 00
0e 00 01 02 15 16 17 18 18 18 18 19 18 18 18 18 18 18 18 19 18 18 1a 18 1d 1e 00 00 00 00 00 00
0e 00 03 04 00 00 1f 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00 00 00 00 00 00
0e 00 0e 00 00 00 21 22 23 23 24 25 00 00 00 00 00 26 23 23 23 24 28 00 00 00 00 00 00 00 00 00
0e 00 0f 00 00 00 00 00 00 00 00 27 00 00 2a 2b 24 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0e 00 11 12 00 00 00 00 00 00 00 29 23 23 2c 2d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0e 00 13 14 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 08 09 08 09 05 05 05 0a 0b 00 00
0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 0d 00 00
0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00
11 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1b 1c 00 00
13 14 15 15 16 18 18 19 18 19 18 19 18 19 18 18 18 19 18 19 18 19 18 19 18 19 18 18 1d 1e 00 00



This features the regular DW opening, then the fork which leads to DWI (my
greatly expanded course) or DWII (intact). Taking the regular route, we find
that the power strip has been replaced by a turn to the east (on the game map,
that is) and another loop around.

Some things to notice:

I filled the back stretch, both directions, with boost panels, but none of them
function. This is normal when you try to go across a boost panel the wrong way
(as opposed to FZ Maximum Velocity or Falcon Densetsu, where the boost panels will
boost you "forward" no matter where you're facing). Since boost panels are composed
of 8x8 square tiles and half-filled square tiles, I had assumed that the forward
arrow shape was just a design, but now I'm thinking that the game must be keeping
track of which direction these panels "face" in.

Previous hacking with panel layouts resulted in tracks where you'd go right through
the wall if it wasn't one of the predetermined walls. This time, the outer wall
of the new backstretch functions, but the inner wall doesn't, and will pull your
car right into the "infield" and blow you up.

This track looked perfect on paper, but the 02-15 connection isn't seamless -- the
track is off by about three tiles. You can still drive across undamaged, though.
If I can iron out the flaws here, I'll get a patch ready. So far I haven't edited
the background at all.
VL-Tone
Posts: 14/200
The car doesn't obey these rules and will drive in a straight line to it's destination point,
even over empty spaces outside the track. But like I said I'm trying to figure out the details,
if you force the car to drive at a specific angle that is not towards the next checkpoint,
it will bounce of barriers like your car.

As for displaying ram values, I know that for me SNES9x Custom for *cough* mac *cough* can
show a ram value on-screen while you play, in hex or decimal and from 1 to 4 bytes long. I don't
know if SNES9x on other platforms does the same thing, but I'm sure some Windows snes emu
can do the same and probably with more options. Maybe someone here could tell which one(s).
I can run the DOS version of zSNES but I didn't find a way to display ram value in the emu screen.

I'm using different techniques to find these values, to find the checkpoint counter, I ran the cheat
search at various points in the race, looking for values that were higher than the last sample.
Eventually I got down to a dozens of bytes, and by putting them as watch points so they are
showing on the snes screen, I quickly found that one value cycled from 0 to 3A and back to 0
when the car made a complete lap. Since the value was incremented at various time intervals,
it was clear that this counter had to do with checkpoints. Then when I patched the value it
comfirmed that this was it.

I didn't try to find the actual point list since ( I had to go to work until 9:30pm), but I'll start again
after this post. I'm thinking of doing a program that draws paths from a list of 16-bit X and 16-bit Y
values. The program will take the values from the f-zero rom at successive adresses while hoping
to find a track path pattern.

EDIT:
Dang I found the cars A.I. path data in WRAM!!!!!

At $7E11FE in wram the X data is stored in 16-bit chunks.
And at $7E1467 in wram the Y data is stored again in 16-bits chunks.

Look at these pictures (in .png format) of the Mute City I car path.
They were done using a custom tool I made for the occasion.
The map on the background was made with Tyler's set of panels, but half are missing.

http://membres.lycos.fr/nes3d/MuteCityPath_HighByte.png
http://membres.lycos.fr/nes3d/MuteCityPath_16bits.png
http://membres.lycos.fr/nes3d/MuteCityPath_Fixed.png

-->The first one is drawn only using the high bytes of the data.
-->The second one is using the 16-bit value as normal, note the weird zig-zags this introduce.
-->And the last one is using inverted low bytes (FF-xx) and it seems to correct most anomalies.

Now the data can be found and extracted from savestates, but I cannot find it in ROM.
From what I concluded, the data is built when loading the track by adding a series of values
to the starting positions found at around $16200 in ROM. That explains why the path
of other cars is relative to the starting pos value. You can see that the first values at
$7E11FE and $7E1467 are the same as the starting pos in ROM. Just before each starting
pos values after $16200 in ROM are the checkpoint counts, which is 3A for Mute City I.
Heian-794
Posts: 97/896
100 posts in the F-Zero hacking derby! (many made by me as my job has lots of downtime)

VL-Tone, is the car obeying the rules (i. e. not driving over empty space) when you change its next checkpoint?

Is there a way to show all these 7Exxxx values while the emulator is running, or do you have to pause it and look for cheats each time? If so, I admire your patience!

I will mess around with the graphics a little more and try to get the Stonehenge course looking a little better.

Majin, your sound stuff is excellent and far beyond my abilities. If you've got some SPCs, let us hear them!
VL-Tone
Posts: 13/200
Look what I've found... at 7E0D02 in wram is the checkpoint counter for the rival car!

It starts at 00 and increment as the car passes through the check points until 3A
(in Mute City 1) when the car reaches the starting line, then it goes back to 00.
Note that again this apply to the practice mode.

It means there are around 59 ($3A+1) checkpoints in MuteCity 1. Using a cheat you
can patch it to any value in this range and see the car turn around and head towards
this checkpoint. Put 00 in 7E0D02 while the rival car is in the middle of the course,
and you'll see it head for the starting line.

As I predicted, the car won't turn around if it has to do a 180 degree turn, so when it
reaches the check point it start to drive in a straight line, wrapping around the track.
If you then remove the cheat, you'll see that the value was incremented elsewhere
and that it has reached a higher number, and the car will head up to the point it was
supposed to be.

This mechanism is probably used in the grand-prix mode for the cars behind you to catch up.
By incrementing the counter faster than the cars would, it forces them to take short-cuts,
and they catch up with you, maybe it actually fetches them the last checkpoint you activated.


So we're closer than ever to find the actual checkpoint data which must have 59 entries
for Mute City 1.

EDIT: I didn't look for the car abilities values yet, to find them you could make a savestate
for each rival car at the starting line of Mute City 1 in practice mode.
Then you use a cheat finder to see what values are different, if you eliminate things like timers that could be different, you should end up finding data that is specific to each car. Fiddle with
the bytes in ram to see what they do, and then you can try to look for that data in the ROM.
Heian-794
Posts: 92/896
Is that the sunset on the horizon? It would be nice to be able to move that stuff around, or better yet, create additional stuff for the backgrounds. I want to make a course on the moon with stars in the sky, and we'd have to sacrifice one of the existing backgrounds to do that.

Any luck with car speeds, jump distances, or acceleration times? If we could edit that, we could put the FZ2 cars in the game.

VL-Tone, that is another excellent find! At the very least, we should be able to figure out where the rival car AI is stored if we can get which bytes your data correspond to in the ROM. I looked around for the player's speed, and also the player's speed as a percentage of 478, and then as a ratio to 999 with 999 being $FF, but couldn't find it anywhere. Maybe the number of km/h is calculated from some other value.
Nestea
Posts: 18/20
And out of random corrupting, I find...

4719C - Position of Fog in Silence
570E2 - Outerior of Blue Falcon's mini-map icon.
570E3 - Outerior of Blue Falcon's mini-map icon.
570E6 - Interior of Blue Falcon's mini-map icon.
570E7 - Interior of Blue Falcon's mini-map icon.

It actually flashes two colors!
Heian-794
Posts: 87/896
Graphics update!

Those obelisks and lintels and things in Silence made me think of Stonehenge, so I thought I'd make a course in the green fields of England with grey stones behind it. (You can see the updated Big Blue in the top left picture, if you haven't seen it already.) How's this for a course in the hacked game?

http://www.geocities.com/tuffydabubba/shallowBB-stonehenge.png

This still needs some work as it didn't turn out as good as I thought it would, and I definitely need to tweak the original graphics so that the moon looks like our moon.

But the more I look at those new numbers (n the time display), the more I like them.
VL-Tone
Posts: 12/200
Here is some information I found about F-Zero's rival cars A.I.

At 7E0BD3 in wram is the on-track angle of the rival car in practice mode.
It's in 2 degree steps.

If you set this value via a cheat to 00 for example, you'll see that from the start,
the rival car faces left, and when the race start you see it go left and start to bounce
off the green barrier. So other cars do bounce on the barrier in that context,
but alas dont explode.

If you disable the cheat when the car is far away from where it should be,
you'll see that the car turns around and starts to drive toward an imaginary point
farther on the track, and this time it will pass through barriers if it has to.

I don't understand exactly what changes the behavior from bouncing to drive-thru-walls.
But the point it drives to is obviously it's next check point on the track so this pretty
much confirm that F-Zero uses a point-to-point A.I. for cars.

The drive-thru-walls game-genie code (for your car) is very usefull to follow the other car.

Angle values like FF will stop the car, and depending on where it is relative to you it will
either continously rotate on itself or stop rotating. A real speed value is probably near
7E0BD3, I'm looking foward to find it.

Note that the angle value is not exactly absolute, the game will rotate the car until it
reaches the angle stored in 7E0BD3 so turning not instantaneous. Suden 180 degrees
changes may not trigger the rotation.

So here is the way it probably works:
The game calculates the angle between the car and it's next check point.
Then, it stores this angle in 7E0BD3, and the game starts to make the car turn until
it reaches the right angle.

When the car is close enough in distance to the check point, the game steps in so
it aims for the next check point. The checkpoint data probably also includes speed
info for each point so the cars can slow down in some tight turns.

Around 7E0030 in wram there are various position values for the enemy car.
Some 16-bit X and Y pointers for its position on the track and another X and Ys
that seem to be the relative pos between the rival car and your car position.
Also there is 7E0BD3 mirrored near that.
I wasn't able to patch those with cheats, they are probably mirrors too.

Anyway have fun
Keitaro
Posts: 430/1342
Heian, that doc was by me I don't even remember releasing it for the record, it's really old...so I would not suggest going by it. Alot of things are REALLY inaccurate now. I'm going to be posting my extensive sound hacking document tonight, so now you all won't have to fret over the music, and can focus more on getting those maps done

edit: here is the doc
d4s
Posts: 35/325
yeah, thats what i would assume aswell.
sorta like the AI system mario kart uses.
AFAIK the dsp1 handles the interpolation for all NPCs between these
"checkpoints" in mario kart.
fzero obviously has a much simpler AI system cause only
the onscreen NPCs positions have to be calculated and the NPC behind you always catches up, no matter how fast you go.
one thing that always annoyed me was that NPCs cant go off-track and explode,
but changing this is most likely not possible, atleast not for the majority of this boards members, me included
Heian-794
Posts: 81/896
Yeah, that's right; your red-and-beige Mute City hack (the one that's a straight line) is much shorter than a regular course.

Come to think of it, there are probably some special routines related to jumping. Whe I attempted to practice on courses numbered higher than 10, usually the course would be gibberish, but sometimes the game would put me on a regular course but starting at an unusual point. When I reached a jump panel, I would jump normally, but then upon landing, the game would freeze and one of the backgrounds (the one filled with zeros) would fill the screen, with only the sprites in front of it.

The AI can't be taking up much code, but the car movement is still pretty complicated. Maybe it defines a very small number of checkpoints and the cars then gravitate towards them?
Nestea
Posts: 17/20
I know that. I've done the same exact thing with Mute City (see one of my hacks). I'm just saying that there could be points where the A.I. go to in the course. I remember one time when I corrupted things, the rival car started doing strange twists and turns inside, but then move back to the course and proceed the course normally.
Heian-794
Posts: 80/896
Nestea, are these checkpoints related to the ship that comes to grab you when you use the jump panels to take a shortcut (like in Port Town)?

There are no checkpoints on the regular course, other than the end-of-lap marker, that require you to pass them in order to complete the lap. Check out my completion of a hacked Big Blue in 24 seconds:

http://www.geocities.com/tuffydabubba/bigblue.JPG

(This was before we discovered how the panels are defined by rows -- at the time, I hadn't noticed the panel layout and was thinking that the row data was the course.)
This is a long thread. Click here to view it.
Acmlm's Board - I2 Archive - Rom Hacking - f-zero track hack


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.004 seconds.