Actions

SCHG

Difference between revisions of "Sonic Adventure 2/Object Editing"

From Sonic Retro

(Listing of Levels)
(File Name Layout)
Line 8: Line 8:
 
== File Name Layout ==
 
== File Name Layout ==
 
Level object files for levels 59 and under are always in the same format:
 
Level object files for levels 59 and under are always in the same format:
  SET{{red|LLLL}}(_{{blue|SS}})(_{{green|C}}).BIN
+
  SET{{red|LLLL}}(_{{blue|SS}})(_{{green|D}}).BIN
Where <tt>{{red|LLLL}}</tt> is the level number, <tt>{{blue|SS}}</tt> (optional) is the mode, and <tt>{{green|C}}</tt> (optional) is unknown. See below for usable values.
+
Where <tt>{{red|LLLL}}</tt> is the level number, <tt>{{blue|SS}}</tt> (optional) is the mode, and <tt>{{green|D}}</tt> is the definition type. See below for usable values.
 
=== Listing of Levels ===
 
=== Listing of Levels ===
 
*<tt>{{red|0000}}</tt> - Test Level
 
*<tt>{{red|0000}}</tt> - Test Level
Line 50: Line 50:
 
*<tt>{{blue|2P}}</tt> - 2 Player
 
*<tt>{{blue|2P}}</tt> - 2 Player
 
*<tt>{{blue|HD}}</tt> - Hard Mode
 
*<tt>{{blue|HD}}</tt> - Hard Mode
 +
 +
=== Definitions ===
 +
*<tt>{{green|S}}</tt> - Substantive Objects? (most of the objects important to the level layout are defined here)
 +
*<tt>{{green|U}}</tt> - Unsubstantive Objects? (objects defined here are usually decorative, but functional objects can be defined here all the same)
 +
 +
There is no clear-cut evidence yet about what the <tt>{{green|S}}</tt> and <tt>{{green|U}}</tt> stand for; this is the spot in the filename that was used in SA1 and SADX to disambiguate between multiple characters that play the same levels. Since that isn't an issue in this game, you could make the case that only one object file is needed for each mode, but they made two, so we're stuck with two, both of which get loaded.
 +
 +
One notable difference that holds without exception is that every object definition in the S files has a <tt>0x00</tt> in its second byte, while every object definition in the U files has a <tt>0x80</tt> in that byte.
  
 
=== Examples ===
 
=== Examples ===

Revision as of 06:14, 18 September 2011

SCHG: Sonic Adventure 2
Dreamcast
GameCube
PC


Level layouts are stored as .bin files.
For the Dreamcast version, they are in the /SONIC2 directory of the disc.
For the GameCube version, they are in the root of the disc.
Note: In the Gamecube version, these files are in big endian byte order! You'll need to convert them with SETswitch if you want to edit them with a program other than a hex editor, then convert them again before putting them back in the game.

File Name Layout

Level object files for levels 59 and under are always in the same format:

SETLLLL(_SS)(_D).BIN

Where LLLL is the level number, SS (optional) is the mode, and D is the definition type. See below for usable values.

Listing of Levels

  • 0000 - Test Level
  • 0003 - Green Forest
  • 0004 - White Jungle
  • 0005 - Pumpkin Hill
  • 0006 - Sky Rail
  • 0007 - Aquatic Mine
  • 0008 - Security Hall
  • 0009 - Prison Lane
  • 0010 - Metal Harbor
  • 0011 - Iron Gate
  • 0012 - Weapons Bed
  • 0013 - City Escape
  • 0014 - Radical Highway
  • 0016 - Wild Canyon
  • 0017 - Mission Street
  • 0018 - Dry Lagoon
  • 0021 - Sand Ocean
  • 0022 - Crazy Gadget
  • 0023 - Hidden Base
  • 0024 - Eternal Engine
  • 0025 - Death Chamber
  • 0026 - Egg Quarters
  • 0027 - Lost Colony
  • 0028 - Pyramid Cave
  • 0030 - Final Rush
  • 0031 - Green Hill
  • 0032 - Meteor Herd
  • 0034 - Cannon's Core part 5 (Sonic)
  • 0035 - Cannon's Core part 2 (Eggman)
  • 0036 - Cannon's Core part 1 (Tails)
  • 0037 - Cannon's Core part 3 (Rouge)
  • 0038 - Cannon's Core part 4 (Knuckles)
  • 0040 - Final Chase
  • 0043 - Cosmic Wall
  • 0044 - Mad Space

Modes

  • 2P - 2 Player
  • HD - Hard Mode

Definitions

  • S - Substantive Objects? (most of the objects important to the level layout are defined here)
  • U - Unsubstantive Objects? (objects defined here are usually decorative, but functional objects can be defined here all the same)

There is no clear-cut evidence yet about what the S and U stand for; this is the spot in the filename that was used in SA1 and SADX to disambiguate between multiple characters that play the same levels. Since that isn't an issue in this game, you could make the case that only one object file is needed for each mode, but they made two, so we're stuck with two, both of which get loaded.

One notable difference that holds without exception is that every object definition in the S files has a 0x00 in its second byte, while every object definition in the U files has a 0x80 in that byte.

Examples

  • SET0013_HD_S.BIN - City Escape Hard Mode

NOTE: If there is no file for a certain character in a level, it will load Sonic's file by default. If there is no file for Sonic, then no objects will be loaded. This can be corrected, though. Simply copy the appropriate file and rename it accordingly and the objects will appear in the level with that character.

The Object Format

Header

Every file starts with a 32 byte (20 in hex) header in the following format, where red is an unsigned integer containing the total amount of objects in the level.

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

(If you ever forget the amount of objects, take the offset of the very last object, divide in hex by 20, and convert to decimal.)

Body

Objects are defined after the header in the following format:

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
  • The first byte, and part of the next byte are an unsigned short for the object type. You can find what value corresponds to each object here.
  • This determines the lowest clipping level the object can appear on. 0 = Low (always), 1 = Normal, 2 = High
  • This unsigned short is the X rotation of the object in BAMS (Binary Angle Measurement System).
  • This unsigned short is the Y rotation of the object in BAMS.
  • This unsigned short is the Z rotation of the object in BAMS.
    • Note: To convert from degrees to BAMS: (degrees * 182) = BAMS.
  • This float is the X position of the object.
  • This float is the Y position of the object.
  • This float is the Z position of the object.
  • This float is the object's first property.
  • This float is the object's second property.
  • This float is the object's third property.

Special Objects

Object Lists

The following are a listing of objects available to be used in levels. The number following the level name is the level number (for example, 0013 is City Escape).

Each object is given by its ID, codename (the verbatim text string from the level file that corresponds to that slot), and where it's known, a readable description of just what that object is. Apart from the first few stages that were created (Green Forest, White Jungle, Pumpkin Hill, Sky Rail, and Aquatic Mine), the team settled into a common scheme for shared objects, so the first 50 or so object IDs will usually be the same across levels.

Note: These lists may be incomplete or inaccurate. If you notice a possible improvement, edit it in!

City Escape (0013)

  • 00 - RING: single ring
  • 01 - RING_LINEAR: line of rings
  • 02 - RING_CIRCLE: circle of rings
  • 03 - SPRA: spring
  • 04 - SPRB: another spring
  • 05 - 3SPRING: set of three springs
  • 06 - BIGJUMP: blast ramp
  • 07 - KASOKU: dash panel
  • 08 - SAVEPOINT: checkpoint
  • 09 - SWITCH: ball switch
  • 0A - ITEMBOX: anchored item box
  • 0B - ITEMBOXAIR: floating item box
  • 0C - ITEMBOXBALLOON: item balloon
  • 0D - LEVUPDAI: upgrade item (Magic Hands)
  • 0E - GOALRING: goal ring, back ring, lost Chao, or 1-up (depending on mission)
  • 0F - EMERALD: hunting item
  • 10 - UDREEL: pulley
  • 11 - ORI: cage
  • 12 - DYNAMITE: dynamite pack
  • 13 - CONTWOOD: wooden box
  • 14 - CONTIRON: metal box
  • 15 - ROCKET: rocket
  • 16 - ROCKETMISSSILE: missile launch pad
  • 17 - SCHBOX: hint monitor
  • 18 - HINTBOX: ?
  • 19 - MSGER: Omochao
  • 1A - SSS: ?
  • 1B - SOLIDBOX: black box
  • 1C - DMYOBJ: ?
  • 1D - SOAP SW: ?
  • 1E - SKULL: skull pickup
  • 1F - PSKULL: immovable skull
  • 20 - CHAOPIPE: pipe with small animal
  • 21 - MINIMAL: small animal
  • 22 - WSMMLS: ?
  • 23 - CONTCHAO: Chao box
  • 24 - STOPLSD: ?
  • 25 - KNUDAI: mystic shrine
  • 26 - KDASIBA: shrine-activated mystic platform
  • 27 - KDWARPHOLE: shrine-activated mystic warp
  • 28 - KDDOOR: shrine-activated mystic door
  • 29 - KDITEMBOX: shrine-activated item box
  • 2A - KDDRNGL: shrine-activated line of rings
  • 2B - KDDRNGC: shrine-activated circle of rings
  • 2C - KDSPRING: shrine-activated spring
  • 2D - KDSPRINGB: another shrine-activated spring
  • 2E - SPHERE: spherical repulsive collision sector
  • 2F - CCYL: cylindrical repulsive collision sector
  • 30 - CCUBE: orthogonal repulsive collision sector
  • 31 - CWALL: orthogonal repulsive collision polygon
  • 32 - CCIRCLE: circular repulsive collision polygon
  • 33 - MODMOD: ?
  • 34 - EFFOBJ0: ?
  • 35 - EFFLENSF: lens flare
  • 36 - BUNCHIN: moving weight
  • 37 - IRONBALL2: rotating spike balls
  • 38 - E KUMI: beetle enemy
  • 39 - E AI: hunter enemy
  • 3A - LIGHT SW: ?
  • 3B - BOARDCOL: board on/off trigger
  • 3C - CARMAN: moving car
  • 3D - CARKAZ: stationary car
  • 3E - TJUMPDAI: trick ramp
  • 3F - HAMMER: bobbing hexagon pillar
  • 40 - TRUCK: truck appearance trigger
  • 41 - IRONBAR: pole swing
  • 42 - TREEST: tree
  • 43 - SWDRNGL: switch-activated line of rings
  • 44 - SWDRNGC: switch-activated circle of rings
  • 45 - TREESHADOWS:
  • 46 - LAMP: decorative lamp
  • 47 - CARMANC: moving car
  • 48 - SIGNS: ?
  • 49 - SIGNS_F: ?
  • 4A - SBLG: ?
  • 4B - ROADOBJ: ?
  • 4C - PALM: palm tree
  • 4D - BOARD: board initial position
  • 4E - CARKAZ_S: stationary car
  • 4F - SLIDER: somersault barrier
  • 50 - GREEN_B: green bush
  • 51 - ADXCHG: music change trigger
  • 52 - BAR: ?
  • 53 - FENCES: small fence
  • 54 - FENCEL: large fence
  • 55 - BIG THE CAT: self-explanatory
  • 56 - SIGNBOARD: billboard
  • 57 - POSTER: poster
  • 58 - TREESTNB: tree
  • 59 - POSTER3: poster
  • 5A - LINKLINK: trick point delimiter
  • 5B - E PATH: moving beetle enemy
  • 5C - GUIDANCE: arrow guidance barrier
  • 5D - E GOLD: gold beetle
  • 5E - SARROW: ?
  • 5F - TRBACK: ?
  • 60 - CARMAN_NEAR: moving car
  • 61 - SE_PATCAR: police siren
  • 62 - SE_KAZE: ?
  • 63 - POSTERM: poster
  • 64 - NOINPCOL: input-disabling sector
  • 65 - PIC: stage projectile (tire)

Programs

If all that stuff above confuses you, there are two programs for editing objects.

DXEdit

Main Article: DXEdit

This is a simple tool that allows you to edit objects in a numerical format.

SETedit

Main Article: SETedit

This tool allows you to see names for objects, get position data from a running copy of the game, and has a simple preview window.

Sonic Community Hacking Guide
General
SonED2 Manual | Subroutine Equivalency List
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (Master System) | Sonic 3 | Sonic 3 & Knuckles | Chaotix | Sonic Jam | Sonic Jam 6 | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Forces
Technical information
Sonic Eraser | Sonic 2 (Nick Arcade prototype) | Sonic CD (prototype; 1992-12-04) | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Tails Adventures | Sonic Crackers | Sonic 3D: Flickies' Island | Sonic & Knuckles Collection | Sonic R | Sonic Shuffle | Sonic Advance | Sonic Advance 3 | Sonic Battle | Shadow the Hedgehog | Sonic Rush | Sonic Classic Collection | Sonic Free Riders | Sonic Lost World
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | SMPS Music Hacking Guide | Mega Drive technical information