Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,693,370
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 05-30-24 12:21 PM
Guest: Register | Login

Main - Posts by GlitchCog


GlitchCog
Posted on 04-04-07 04:22 PM, in Super Mario Kart AI Link | Quote | ID: 23220


Micro-Goomba
Level: 9

Posts: 1/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
Offsets: (Including a 0x200 byte header)
0x6083F - 0x608B6 Mario Circuit 3 AI
0x609C7 - 0x60A4D Ghost Valley 2 AI
0x60B0B - 0x60B79 Donut Plains 2 AI
0x60CBE - 0x60D83 Bowser Castle 2 AI
0x60E16 - 0x60E6C Vanilla Lake 2 AI
0x60F48 - 0x60FD1 Rainbow Road AI
0x6106E - 0x610B8 Koopa Beach 2 AI
0x6115A - 0x611B3 Mario Circuit 1 AI
0x61293 - 0x6131C Ghost Valley 3 AI
0x6141D - 0x614B5 Bowser Castle 3 AI
0x61548 - 0x6159E Choco Island 2 AI
0x61647 - 0x616AF Donut Plains 3 AI
0x61728 - 0x6176C Vanilla Lake 1 AI
0x61826 - 0x61891 Koopa Beach 1 AI
0x6195E - 0x619D8 Mario Circuit 4 AI
0x61A83 - 0x61AEB Mario Circuit 2 AI
0x61B8E - 0x61BF0 Ghost Valley 1 AI
0x61CA1 - 0x61D09 Bowser Castle 1 AI
0x61D96 - 0x61DDD Choco Island 1 AI
0x61EA9 - 0x61F17 Donut Plains 1 AI

Format:
The data represent a series of points on the track that the computer tries to drive through like a connect the dots game. Sometimes there will be two paths and the computer just takes whichever path is closer. The points form a closed loop around a track.

Every three bytes is a point: XX YY SS

XX - X coordinate, where 0x00 is the left of the track and 0x80 is the far right
YY - Y coordinate, where 0x00 is the top of the track and 0x80 is the bottom
SS - Speed - 00, 01, 02 or 03. Zero is the slowest, 03 is the fastest.

These points also serve as Lakitu drop-off spots.

AI Maps:
Mushroom Cup: Mario Circuit 1, Donut Plains 1, Ghost Valley 1, Bowser Castle 1, Mario Circuit 2
Flower Cup: Choco Island 1, Ghost Valley 2, Donut Plains 2, Bowser Castle 2, Mario Circuit 3
Star Cup: Koopa Beach 1, Choco Island 2, Vanilla Lake 1, Bowser Castle 3, Mario Circuit 4
Special Cup: Donut Plains 3, Koopa Beach 2, Ghost Valley 3, Vanilla Lake 2, Rainbow Road

These points are really sensitive. I've had lots of success modifying the already existing AI tracks to slightly alter the paths, but entirely new tracks are impossibly difficult to fine tune enough to avoid orbiting one spot or splitting the drivers between turning either the right way or the wrong way on a corner. When that happens they usually ending up orbiting a couple different points in groups.

I think the orbiting effect is often created by the slight variation in the side the point is approached on. If the computer goes slightly to the inside of a point on a turn, it'll be spun off the track with a slingshot effect, but if it is aimed to the outside of the point, it has a much better chance of being swung in the right direction. However, if there isn't another point close enough- and only one block too far seems to make a serious difference- it'll get stuck circling the turn point rather than being snagged by the next point and continuing on. It's seriously like fucking Apollo 13 rocket science crap, only with an unknown physics system. I'm also not sure how items or crashes affect things. You never see a computerized driver winding up orbiting during the game, but they are constantly being pushed slightly off the track by collisions and hitting items. Maybe there's a special type of AI to get them back on the track after being force off of it.

It seems like the order of the points is important also. You can't jump all around the AI track, even if the final track looks complete. The computer will consider the next attractor point in the order they're listed, even if a different one is closer. This seems especially important for the race's start. I think that putting the first point behind the starting line messes everything up, as the first attractor point is no longer drawing the computer out into the AI track. They usually get turned around right away and start orbiting as soon as the race begins.

At other times, all the points seem to affect the computerized carts at once. If you put a bunch of attractor points in one spot, the computer will go for them even if there are a few lined up directing it somewhere else before the bunch is listed. There might be some balance between the two where if one point is close enough it takes precedence or, if it's a little too far, the computer goes for the stronger source. Or there may be some other undiscovered data that somehow aims the carts to the next point, although that would seem unnecessarily redundant since the order is at least somewhat important already and it wouldn't take up extra space in the ROM to just use that.

Building half an AI track for testing purposes doesn't work very well. The completed loop seems to be important somehow. I've tried to swap in one track's AI into a similarly sized AI tracks on a different track to see how it reacts, and I made a blank grid track for testing Mario Circuit tracks. (Compressed blank track binary)
But there are issues with having different starting locations that don't match up, so I haven't had a successful AI track swap yet.

Next I think I'm going to try to slowly modify an existing AI track to find the point when it stops functioning.

After trying to figure this stuff out, I understand why Super Mario Kart AI has a remained a mystery for so long.

GlitchCog
Posted on 04-05-07 09:41 PM, in Super Mario Kart AI Link | Quote | ID: 23732


Micro-Goomba
Level: 9

Posts: 2/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
Those smaller maps are a lot nicer for getting a look at the whole AI track at once. I considered doing my AI maps like that, but I don't know enough about PNG drawing in PHP and I already had my HTML table maps.

I'm searching around in the ROM for other data that affect the AI. I haven't found anything promising yet. Does anyone have any ideas on what it might look like? Would it be safe to assume it uses the same coordinate format as the Lakitu drop-off data, or is it more likely to be something entirely different like angles or something?

It just seems like anything more than the points we already have would be overkill since the computer could make its way around the track well enough without anything more. What's the purpose for these extra data, other than to make the AI incredibly difficult to decipher and hack?

GlitchCog
Posted on 04-05-07 10:45 PM, in Super Mario Kart AI (rev. 2 of 04-05-07 10:46 PM) Link | Quote | ID: 23762


Micro-Goomba
Level: 9

Posts: 3/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
Posted by Ninetales
IIRC, the computer only goes on the left (bottom) of that island.


By default the computer always takes the one side (edit: it is the top side by default for Koopa Beach 1), but if you knock one of them away from it with an item or by bumping into them, you can easilly get them to take the other route. It's like that on Rainbow Road and Bowser Castle 2 and 3 too.

Posted by dirtbag
I still think there is something that tells the game what angle the karters leave the points at. If you edit that track so that you can drive on the grass, so you are placed back on the track, you will be facing the angle of the next point. However if you change where the next point is you are still facing where the next point would have been.


I've been trying to think of how this angle data might be stored. Is the direction they aim you really percise, or are they divided into eighths or something? I always come back to wondering if they couldn't program the AI to just calculate the angle on the fly based on the next point, rather than keep it stored somewhere else.

GlitchCog
Posted on 04-16-07 03:58 PM, in Super Mario Kart AI (rev. 2 of 04-16-07 04:00 PM) Link | Quote | ID: 27259


Micro-Goomba
Level: 9

Posts: 4/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
I think this is all the AI data now. Before each AI track map is dirtbag's angle (?) data with an unknown format. It's touchy, so you can crash the game when it tries to load the track if you modify it incorrectly. Filling the data with zeros seems to crash it more than with FFs. (For example, change the 06 06 at 0x610CF to FF FF and the AI will mess up after leaving the first AI track point on Mario Circuit 1, but replace the 06 06 with 00 00 and it'll crash. 02, 04, and 08 seem to work well as replacements too.)

Offsets: (Including a 0x200 byte header)
0x60726 - 0x6083E Mario Circuit 3 Angle Data
0x6083F - 0x608F2 Mario Circuit 3 AI Track
0x608F3 - 0x609C6 Ghost Valley 2 Angle Data
0x609C7 - 0x60A4D Ghost Valley 2 AI Track
0x60A4E - 0x60B0A Donut Plains 2 Angle Data
0x60B0B - 0x60B7C Donut Plains 2 AI Track
0x60B7D - 0x60CBD Bowser Castle 2 Angle Data
0x60CBE - 0x60D83 Bowser Castle 2 AI Track
0x60D84 - 0x60E15 Vanilla Lake 2 Angle Data
0x60E16 - 0x60E6C Vanilla Lake 2 AI Track
0x60E6D - 0x60F47 Rainbow Road Angle Data
0x60F48 - 0x60FD1 Rainbow Road AI Track
0x60FD2 - 0x6106D Koopa Beach 2 Angle Data
0x6106E - 0x610CA Koopa Beach 2 AI Track
0x610CB - 0x61159 Mario Circuit 1 Angle Data
0x6115A - 0x611B3 Mario Circuit 1 AI Track
0x611B4 - 0x61292 Ghost Valley 3 Angle Data
0x61293 - 0x6131C Ghost Valley 3 AI Track
0x6131D - 0x6141C Bowser Castle 3 Angle Data
0x6141D - 0x614B5 Bowser Castle 3 AI Track
0x614B6 - 0x61547 Choco Island 2 Angle Data
0x61548 - 0x6159E Choco Island 2 AI Track
0x6159F - 0x61646 Donut Plains 3 Angle Data
0x61647 - 0x616AF Donut Plains 3 AI Track
0x616B0 - 0x61727 Vanilla Lake 1 Angle Data
0x61728 - 0x61772 Vanilla Lake 1 AI Track
0x61773 - 0x61825 Koopa Beach 1 Angle Data
0x61826 - 0x61891 Koopa Beach 1 AI Track
0x61892 - 0x6195D Mario Circuit 4 Angle Data
0x6195E - 0x619D8 Mario Circuit 4 AI Track
0x619D9 - 0x61A82 Mario Circuit 2 Angle Data
0x61A83 - 0x61AEB Mario Circuit 2 AI Track
0x61AEC - 0x61B8D Ghost Valley 1 Angle Data
0x61B8E - 0x61BF0 Ghost Valley 1 AI Track
0x61BF1 - 0x61CA0 Bowser Castle 1 Angle Data
0x61CA1 - 0x61D09 Bowser Castle 1 AI Track
0x61D0A - 0x61D95 Choco Island 1 Angle Data
0x61D96 - 0x61DEC Choco Island 1 AI Track
0x61DED - 0x61EA8 Donut Plains 1 Angle Data
0x61EA9 - 0x61F1D Donut Plains 1 AI Track

Sometimes the angle data fills with FFs at the end until the ai track data begins. I also expanded the area of some of the AI track offsets here to include the "FF FF 03" filler at the end of the data like Mario Circuit 3 does from 0x608B7 to 0x608F2.

As for trying to figure out the formatting...

These angle data seem to correspond with the AI track map points in order. You can divide it up to match the points using the patterns (it usually starts with a 00 and is about five bytes long), and when you mess with it, the AI will glitch out when it hits the corresponding point.

Here's how I have the angle data divided up for Mario Circuit 1 so far along with the relevant AI track points and some descriptions/angles/etc, but I still can't figure out how it works. I added some extra spaces into the data which creates some interesting vertical columns of increasing or decreasing values. Maybe it's tendencies to go left, right, up and down increasing and decreasing to create a circular track?

Anyone have any other ideas?

On a side note, there are some acceleration data for the 50cc AI controlled characters located at 0x200DB - 0x20160.

GlitchCog
Posted on 04-17-07 04:14 PM, in Super Mario Kart AI Link | Quote | ID: 27617


Micro-Goomba
Level: 9

Posts: 5/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
The southern island track split on Koopa Beach 1 has some interesting stuff in it. I added the Koopa Beach 1 data to http://matt.yanos.com/smk_ai_data.html.

This is the order it's in, both on the AI track map and this unknown data, where it alternates between the top track and the bottom track.

00 2C 2B 05 10 - Last point before the split

00 24 2A 08 06 - Top track
00 24 30 08 09 - Bottom track

00 1F 26 05 0B - Top track
00 1F 31 05 0D - Bottom track

00 1B 25 04 0C - Top track
00 1B 34 04 0B - Bottom track

00 16 25 05 0E - Top track
00 16 35 05 0B - Bottom track

00 10 29 06 0B - Top track
00 10 34 06 0B - Bottom track

00 0C 2D 04 07 - Top track
00 0C 34 04 09 - Bottom track

00 08 2D 04 10 - Point that joins the split tracks back together

So for the split tracks the same data is used for the second and fourth bytes for coupled points.
Here's a picture of the split with the unknown AI data next to the points it goes with.

Also, I've noticed that messing with the last byte of each of these points tends to mess with the graphics for on-track items. Would sprite pointers for bananas and shells be hidden in the AI data?

GlitchCog
Posted on 05-24-07 03:24 PM, in The NEW General Project Screenshot / Video Thread EX Omega Supreme++ Link | Quote | ID: 38009


Micro-Goomba
Level: 9

Posts: 6/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
Earthbound Kart:




GlitchCog
Posted on 05-24-07 07:09 PM, in The NEW General Project Screenshot / Video Thread EX Omega Supreme++ Link | Quote | ID: 38041


Micro-Goomba
Level: 9

Posts: 7/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
I noticed those extra colors you posted, dirtbag. Thanks for those. And I think drawing all those character sprites is the most tedious thing I've ever tried to do.

Stifu, I'm looking forward to seeing your track editor. And, yeah, I've got tons of work left to do on my hack. It's taking forever.

I never figured anything more out on the AI angle data, but I'll probably get back into that pretty soon. That's the last piece of the puzzle.

GlitchCog
Posted on 05-29-07 02:20 PM, in Looking for Super Mario Kart data Link | Quote | ID: 39378


Micro-Goomba
Level: 9

Posts: 8/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
I can confirm that I don't know where any of this information is located.

It might look like my hack has more than the default four border blocks since I have eight different corners tiles too, but I just used drivable-blocks for those. You can actually get through my borders via those corners if you drive at just the right angle and jump. Also, I didn't move any of the pipe pencil statues.

All this assembly stuff is way, way, way over my head. I'll just try to manually map out the pipe/thwomp/etc coordinates for the pipes and search through the ROM for any data that look similar.

GlitchCog
Posted on 05-29-07 04:17 PM, in Looking for Super Mario Kart data (rev. 2 of 05-29-07 04:21 PM) Link | Quote | ID: 39390


Micro-Goomba
Level: 9

Posts: 9/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
Map with all the Mario Circuit 1 pipe locations

With the upper left most corner being (1,1):
(0xXX, 0xYY)
(18, 07)
(22, 0C)
(20, 10)
(15, 11)
(21, 5D)
(1F, 5E)
(13, 55)
(40, 4F)

If these data actually start at (0,0) these might all be x+1, or if they're from a different corner, all the Xs could all be 0x80-x or the Ys could be 0x80-y. I'm going to start looking around in the unknown parts of the ROM for these.

Edit: Stifu, I'd very much like to check out your track editor beta. Thanks.

GlitchCog
Posted on 05-29-07 07:40 PM, in Looking for Super Mario Kart data Link | Quote | ID: 39403


Micro-Goomba
Level: 9

Posts: 10/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
My site's on a server in Chicago, I think. Do you get an error message or does it just never load? If it's the latter, it probably just needs more time. I've found that IE tends to not display much until the server is done calculating, and Firefox will display it as it loads.

GlitchCog
Posted on 06-04-07 02:45 AM, in Looking for Super Mario Kart data Link | Quote | ID: 42035


Micro-Goomba
Level: 9

Posts: 11/11
EXP: 2888
Next: 274

Since: 04-03-07

Last post: 6205 days
Last view: 6183 days
Stifu, I think I have some palettes that don't compress well enough to fit back into their allotted space. One palette probably overlaps and corrupts the data in an adjacent palette, which then wouldn't decompress correctly.

If that's not it, then I have no idea what it could be.

Main - Posts by GlitchCog

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.231 seconds. (335KB of memory used)
MySQL - queries: 83, rows: 106/106, time: 0.224 seconds.