| |||
Views: 88,314,870 |
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search | 03-29-24 02:13 AM |
|
Guest: Register | Login |
0 users currently in ROM Hacking | 4 guests | 1 bot |
Main - ROM Hacking - Super Mario Kart AI | New thread | New reply |
GlitchCog |
| ||
Micro-Goomba Level: 9 Posts: 1/11 EXP: 2873 Next: 289 Since: 04-03-07 Last post: 6143 days Last view: 6120 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. |
dirtbag |
| ||
Red Koopa Level: 27 Posts: 20/128 EXP: 114418 Next: 1741 Since: 02-24-07 Last post: 3159 days Last view: 3072 days |
Welcome to the board GlichCog!
I tried to send you a mail a few days ago but got a NDR. Anyway here what it said.... ----------- Just read your post on the old Acmlm board (I'm on http://acmlm.no-ip.org/board/ now) I would have posted a reply to your AI thread however I can't be arsed to wait for approval etc. Anyway it looks like there should be some other AI data somewhere else that defines what direction the karters leave a AI map point. This explains why they can go crazy if you move about the AI map points too much. The points you have got to display on your track viewer (awesome work by the way) are also used as the points you will be replaced on the track if you fall off. I'd liked to have spent more time on this myself but have been really busy with work of late. |
Xkeeper |
| ||
Level: 105 Posts: 1200/2846 EXP: 12001074 Next: 261186 Since: 02-19-07 Last post: 6031 days Last view: 2769 days |
Tomorrow or later (depending, I'm going to be very busy tomorrow but mabye tonight if I'm not playing Phantasy Star Universe) I'll try fiddling with this and trying to make a rudimentary AI path map.
I'm making no promises, but I'm always interested in this kind of crap ____________________ I dealt with it. |
Ninetales |
| ||
Panser Level: 42 Posts: 166/338 EXP: 491173 Next: 30189 Since: 02-19-07 Last post: 5482 days Last view: 4880 days |
I haven't touched SMK in sooooooooo long...mainly because of the orbiting points problems you're having. I even unintentionally got half of them following the points in order backwards around the track once, no idea how
But yeah, if the exact limits were known, then I'm guessing we'd definitely be seeing more (and certainly more creative) SMK hacks. Until then I guess it's mainly "Let's see what I can do with this track while hoping I don't break it." |
Stifu |
| ||
Cobrat Level: 56 Posts: 73/666 EXP: 1358216 Next: 39960 Since: 02-22-07 Last post: 657 days Last view: 279 days |
Thanks for your work, GlitchCog.
I'll definitely mess with all that soon enough, but I first want to display tiles, colors and maps etc properly... |
Xkeeper |
| ||
Level: 105 Posts: 1223/2846 EXP: 12001074 Next: 261186 Since: 02-19-07 Last post: 6031 days Last view: 2769 days |
Well, it works ____________________ I dealt with it. |
Stifu |
| ||
Cobrat Level: 56 Posts: 74/666 EXP: 1358216 Next: 39960 Since: 02-22-07 Last post: 657 days Last view: 279 days |
What did you code that with ? And can you modify anything, or just display stuff ? |
Xkeeper |
| ||
Level: 105 Posts: 1224/2846 EXP: 12001074 Next: 261186 Since: 02-19-07 Last post: 6031 days Last view: 2769 days |
It's just a PHP script that uses a background image, pulls the data from the ROM, and then displays it...
Editing it wouldn't be very hard (just like a hex editor, really, but maybe a little simpler). Making the track background was oddly enough the longest part of this (The script to generate the AI path is only 59 lines, for example, and many of those are just whitespace) ____________________ I dealt with it. |
Stifu |
| ||
Cobrat Level: 56 Posts: 75/666 EXP: 1358216 Next: 39960 Since: 02-22-07 Last post: 657 days Last view: 279 days |
But if you make it possible to edit those points, then you still won't know when it breaks the computer behavior (as GlitchCog mentioned) until you try the modified game, I guess...
Still, nice work. |
Xkeeper |
| ||
Level: 105 Posts: 1225/2846 EXP: 12001074 Next: 261186 Since: 02-19-07 Last post: 6031 days Last view: 2769 days |
Depends. There could easily be some formula that determines when it dies.
Of course, without a handy variant to test (preferrably using the same map), it's hard to determine what will make it work and what will throw it off. ____________________ I dealt with it. |
GlitchCog |
| ||
Micro-Goomba Level: 9 Posts: 2/11 EXP: 2873 Next: 289 Since: 04-03-07 Last post: 6143 days Last view: 6120 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? |
Stifu |
| ||
Cobrat Level: 56 Posts: 76/666 EXP: 1358216 Next: 39960 Since: 02-22-07 Last post: 657 days Last view: 279 days |
Hmmm... I know there are some tracks where the computer can take 2 different paths, do your current finds include those multiple paths ? If not, they could be among the missing data... |
dirtbag |
| ||
Red Koopa Level: 27 Posts: 21/128 EXP: 114418 Next: 1741 Since: 02-24-07 Last post: 3159 days Last view: 3072 days |
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. |
Xkeeper |
| ||
Level: 105 Posts: 1228/2846 EXP: 12001074 Next: 261186 Since: 02-19-07 Last post: 6031 days Last view: 2769 days |
Posted by StifuWhat track will the AI branch on? Without this I cannot go on. (I need to make a map for the track, for example) ____________________ I dealt with it. |
Stifu |
| ||
Cobrat Level: 56 Posts: 77/666 EXP: 1358216 Next: 39960 Since: 02-22-07 Last post: 657 days Last view: 279 days |
Posted by Xkeeper Hmm, Koopa Beach 1 (1st track of the Star Cup). At the bottom of the map, there's a piece of ground with options blocks on the left and on the right, and the computer can go on either side. |
Ninetales |
| ||
Panser Level: 42 Posts: 171/338 EXP: 491173 Next: 30189 Since: 02-19-07 Last post: 5482 days Last view: 4880 days |
Posted by StifuIIRC, the computer only goes on the left (bottom) of that island.Posted by Xkeeper |
dirtbag |
| ||
Red Koopa Level: 27 Posts: 22/128 EXP: 114418 Next: 1741 Since: 02-24-07 Last post: 3159 days Last view: 3072 days |
There is also Rainbow Road |
Stifu |
| ||
Cobrat Level: 56 Posts: 78/666 EXP: 1358216 Next: 39960 Since: 02-22-07 Last post: 657 days Last view: 279 days |
Posted by Ninetales You remember incorrectly. |
GlitchCog |
| ||
Micro-Goomba Level: 9 Posts: 3/11 EXP: 2873 Next: 289 Since: 04-03-07 Last post: 6143 days Last view: 6120 days |
Posted by Ninetales 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'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. |
dirtbag |
| ||
Red Koopa Level: 27 Posts: 23/128 EXP: 114418 Next: 1741 Since: 02-24-07 Last post: 3159 days Last view: 3072 days |
Just seem to be 8 angles, N, NE, E etc. and it they drive off and 'lock on' to the next point it gets near.
*edit* it's been a long day |
Main - ROM Hacking - Super Mario Kart AI | New thread | New reply |
© 2005-2023 Acmlm, blackhole89, Xkeeper et al. |
MySQL - queries: 107, rows: 147/147, time: 0.019 seconds. |