Sonic and Sega Retro Message Board: Sonic Adventure 2 Kart track editor? - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

Sonic Adventure 2 Kart track editor?

#1 User is offline flarn2006 

  Posted 16 August 2010 - 02:02 PM

  • Posts: 264
  • Joined: 01-October 05
  • Gender:Not Telling
  • Project:SA2 Cheat Table
  • Wiki edits:19
You know how you can download Kart tracks from Sega in Sonic Adventure 2? Is there any information on how to make custom tracks? I know the Kart tracks aren't already stored on the game disc, as the VMU files have different sizes (if they just enabled what was already there, odds are they would have the same size) and I remember Sega doing some contest or something where you can submit track designs and the winners would be made into playable tracks. I even remember reading the person who sent in the Eggrobo track design also sent in a clay model of the Eggrobo car.

#2 User is offline MainMemory 

Posted 16 August 2010 - 02:04 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4061
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I would imagine that they use the same format as levels (a collection of models and other information for solidity etc), so you would need a whole level editor for that.

#3 User is offline sonicblur 

Posted 16 August 2010 - 08:14 PM

  • Posts: 1125
  • Joined: 18-February 08
  • Gender:Male
  • Wiki edits:6
QUOTE (MainMemory @ Aug 16 2010, 02:04 PM)
I would imagine that they use the same format as levels (a collection of models and other information for solidity etc), so you would need a whole level editor for that.

I'm reasonably convinced that they don't.
It has been several years since I've looked at the files, but I recall that they appeared to be much too small to contain anything more than a layout for pre-existing level chunks and small models for single objects such as the downloadable Opa Opa kart.

They're actually fairly easy to mess around with if anyone plans to experiment with them. Unlike all of the SA1 downloads, the SA2 Kart race downloads are not encrypted and the only signature on them is the standard VMS checksum. You can easily change the title and description of a track download with nothing more than a hex editor and VMS checksum fixer.

On another note, I've probably mentioned this before but the menu to load downloaded kart race files was never removed from the GCN port of the game. I never bothered to determine if it actually tries reading from the memory card since DC files would never be compatible anyway due to the endian difference between the GCN and the DC, but it may be worth looking into if anyone ever documents how they work on the DC.

#4 User is offline flarn2006 

Posted 17 August 2010 - 01:56 AM

  • Posts: 264
  • Joined: 01-October 05
  • Gender:Not Telling
  • Project:SA2 Cheat Table
  • Wiki edits:19
Why would the SA1 downloads be encrypted? And what was there besides just files that unlock stuff that's already there? (the Christmas thing for instance.) Wasn't there something that put up ads for some cell phone company all over Speed Highway? Was that already in the game? (If not, it would be cool if you could reverse engineer the format it used -- maybe you could make your own objects and place them in levels!)

Oh, and it would be really cool if you could somehow enable the download extra menu on the GC using an Action Replay code, then use a Gameshark GameSaves card to install the tracks. Was that Download Extra menu ever used for anything other than Kart tracks?

EDIT: It was AT&T. I forgot it actually had a whole time attack challenge. It said the top scorers would win a prize...what's to stop them from using a GameShark to hack it? And the extra time attack HUD added (in the lower-right corner) looks like the same font as the debug text in Sonic Adventure DX: Preview, btw. (YouTube)
This post has been edited by flarn2006: 17 August 2010 - 02:02 AM

#5 User is offline Diablohead 

Posted 18 August 2010 - 01:39 PM

  • Indie dev
  • Posts: 1648
  • Joined: 19-October 08
  • Gender:Male
  • Location:Near London
  • Project:games
  • Wiki edits:16
I thought all 8 or so tracks were already in the game and the download file just unlocks it? first-gen DLC style.

Same for voice samples in sonic adventure 1 and 2, already on the disc.

#6 User is offline sonicblur 

Posted 18 August 2010 - 08:10 PM

  • Posts: 1125
  • Joined: 18-February 08
  • Gender:Male
  • Wiki edits:6
QUOTE (Diablohead @ Aug 18 2010, 01:39 PM)
I thought all 8 or so tracks were already in the game and the download file just unlocks it? first-gen DLC style.

Same for voice samples in sonic adventure 1 and 2, already on the disc.

Voice samples, yes for both. In SA1 there were 6 or so Twinkle Cart courses on the disc.

But no evidence has been discovered to the contrary for SA2. It seems likely and feasible to me that the courses were actually part of the downloads. I don't think we're going to get an answer either way though unless someone feels like putting a few hours into investigating. If you wait a few years, I might get some time to look.

#7 User is offline flarn2006 

Posted 18 August 2010 - 08:14 PM

  • Posts: 264
  • Joined: 01-October 05
  • Gender:Not Telling
  • Project:SA2 Cheat Table
  • Wiki edits:19
QUOTE (sonicblur @ Aug 18 2010, 06:10 PM)
It seems likely and feasible to me that the courses were actually part of the downloads.


It's more than just likely. How else could they have done that contest after the game was already released?
This post has been edited by flarn2006: 18 August 2010 - 09:03 PM

#8 User is offline Diablohead 

Posted 19 August 2010 - 06:57 PM

  • Indie dev
  • Posts: 1648
  • Joined: 19-October 08
  • Gender:Male
  • Location:Near London
  • Project:games
  • Wiki edits:16
QUOTE (flarn2006 @ Aug 19 2010, 02:14 AM)
QUOTE (sonicblur @ Aug 18 2010, 06:10 PM)
It seems likely and feasible to me that the courses were actually part of the downloads.


It's more than just likely. How else could they have done that contest after the game was already released?

I forgot all about that contest, more or less confirms that the dlc itself is the layout, then.

Someone get to work v.png

#9 User is offline sonicblur 

Posted 21 August 2010 - 02:55 PM

  • Posts: 1125
  • Joined: 18-February 08
  • Gender:Male
  • Wiki edits:6
Okay, so I started documenting the format of the Kart Race data.

After all of the header information, the actual data portion of the file is PRS compressed. Once you decompress that, you will find a container that contains several additional files. Among those is a PVM file with several PVR textures. It also appears to contain model data. This confirms what we already knew, that the models are located inside of the downloads. In addition, there is a SET file in there which follows the standard format for the object layouts for the level. I'm not sure what the actual course data might look like, but I believe it might be the file right after the SET file. It contains a bunch of 16-bit values, most with the structure 0x00?? but some with 0xFF?? scattered in there. There's no obvious pattern but some of the 0x00?? values repeat, which makes me think it could be a layout stored in a grid, similar to how the 2D levels were stored. I could be completely wrong, but this is just taking a stab in the dark until it can be further investigated.

I'm done looking for now, but with this information you should have enough details to decompress one of the downloads, try to modify some stuff, then re-compress the PRS and see what you did. I don't have time to go any further with this for now, so I really hope someone else does something with this before I get a chance to continue.

Here are my notes so far:
CODE
Sonic Adventure 2 Kart Race VMS file format
Note: All multi-byte numbers are little endian unless otherwise noted.

The usual VMS header information begins at 0000.
0x0000+0x00F: Download title. End padded with 00's.
0x0010+0x200: Always "SONIC ADVENTURE 2 / Download", end padded with 00's.
0x0030+0x100: Application that generated file. Always 00's in official dl.
0x0040+0x002: Number of file icons (Always 01. Can be larger for animation)
0x0042+0x002: Icon animation speed. (Always 01. Not animated)
0x0046+0x002: VMS CRC16 checksum (Unused, set to 00)
0x0048+0x002: Size of data following the icon
0x0060+0x020: Icon color palette
0x0080+0x200: Icon frame

Actual file data begins at 0x0280. Remember, Little Endian!
0x0280+0x004: Always 0x04
0x0284+0x014: A set of 32 bit memory addresses, in increasing order. Each subsequent address increases by 0x14.
These memory addresses correspond to System RAM in Privileged mode with caching enabled.
These are never the same between the 3 released tracks, which implies that all of them may get loaded into memory
at the same time.
0x0298+0x004: Always 0x46.
0x029C+0x02C: Filled with 0xFF.
0x02B8+0x004: A 32-bit memory address.
0-02BC+0x???: What appears to be a series of 16-bit values with no predefined size. I assume the high byte of them
corresponds to a command, while the low byte may be the value. 0x0000 appears to be a null because in a later
download it's omitted. 0x83 appears to be the most common command, although there are several other 0x8_ commands.
The 0x6A command followed by 0x81 appears to denote the end of these commands, which is followed by 00.

After these commands, the Kart text begins. Kart text is formatted as follows.  All strings are padded with 00's at the end,
and the next string begins at the next 32-bit boundary after that point. Thus the locations and sizes are not static.
=============
Course Title (Prefixed with a Tab character, 0x09)
Kart Name
Course name
Course description
=============
This is repeated 4 times, each for English, French, Spanish, German.

After this point, the data section of the file begins. This file makes up the remainder of the VMS file. It is PRS compressed data.
Here is what's known of the compressed data:

0x0000+0x004: 32-bit value. Not sure yet?
0x0004+0x004: 32-bit value. Location of the SET file.
0x0008+0x004: 32-bit value. Size of SET file.
0x000C+0x004: 32-bit value. Not sure yet….

This post has been edited by sonicblur: 21 August 2010 - 02:56 PM

#10 User is offline flarn2006 

Posted 21 August 2010 - 09:38 PM

  • Posts: 264
  • Joined: 01-October 05
  • Gender:Not Telling
  • Project:SA2 Cheat Table
  • Wiki edits:19
Is this the same on the Gamecube version? (except for the endianness) I don't have a Nexus memory card, but I do have a GameShark USB memory card for the Gamecube.
Oh, and thanks for starting to decode the format! thumbsup.png +1 Internet
This post has been edited by flarn2006: 21 August 2010 - 09:43 PM

#11 User is offline MainMemory 

Posted 21 August 2010 - 09:41 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4061
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
The GameCube version didn't have VMS files as far as I'm aware.

#12 User is offline sonicblur 

Posted 21 August 2010 - 11:49 PM

  • Posts: 1125
  • Joined: 18-February 08
  • Gender:Male
  • Wiki edits:6
QUOTE (flarn2006 @ Aug 21 2010, 09:38 PM)
Is this the same on the Gamecube version? (except for the endianness) I don't have a Nexus memory card, but I do have a GameShark USB memory card for the Gamecube.
Oh, and thanks for starting to decode the format! thumbsup.png +1 Internet

The only thing I know about the Gamecube version right now is that it would be looking at the memory card for files with names following the structure SONIC2B__D##. (I believe I found references to that in the string table) Since the internet features were cut from the GCN version, there's no sample data to look at to see how those files would be structured. I also have no idea if the game actually has logic still there to load them. Given that there are references to actual memory addresses in the DC version, converting the current downloads to work on GCN would not be as simple as flipping the endian-ness everywhere. While I think it would be really neat to try and restore download tracks for the GCN version, I don't think it's going to be realistically feasible for a long time. Either way you'd need an Action Replay and some method of getting files onto your memory card, making anything for the GCN version relatively inaccessible to the majority of people.

Back on topic, I have to wonder if the container inside of the decompressed PRS is an existing format that we already know. It's not AFS, but I would have to guess that they wouldn't put effort into making a new container format just for the VMU downloads. When I realized the data was compressed, PRS was the first thing I tried but I'm not too familiar with some of their container formats other than AFS.
This post has been edited by sonicblur: 21 August 2010 - 11:50 PM

#13 User is offline flarn2006 

Posted 22 August 2010 - 01:53 AM

  • Posts: 264
  • Joined: 01-October 05
  • Gender:Not Telling
  • Project:SA2 Cheat Table
  • Wiki edits:19
QUOTE (sonicblur @ Aug 21 2010, 08:49 PM)
Since the internet features were cut from the GCN version...

Ah yes; forgot about that...
QUOTE (sonicblur @ Aug 21 2010, 08:49 PM)
Either way you'd need an Action Replay and some method of getting files onto your memory card...

I do have both of those, by the way, in case you're wondering.
This post has been edited by flarn2006: 22 August 2010 - 01:55 AM

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users