Actions

SCHG

Sonic Jam/Models

From Sonic Retro

Revision as of 10:15, 22 November 2022 by Starman (talk | contribs) (Changed references to 3D Vectors to fixed point vectors)
SCHG: Sonic Jam
Main Article
Sonic World

Models
Animations
Textures
Sounds
RAM Editing

Model data starts at $3F908 in MUSEUM.MUS.

Model Format

Models generally consist of the following parts. There are some exceptions, but the general order stays the same.

Vertices

The first part are vertices, each being a fixed point vector.

Indexing Table

The second part is the indexing table for quads, using the vertices given. Indices are words, and jump by $08. The first vertex would be $0000; the second would be $0008. There's a set of 4 indices for each quad. Triangles are degenerate quads; they have four indices, but one of them is a repeat.

Triangles can be a bit odd. Sometimes, triangles will have the first two indices the same, with the third being a seemingly negative number, and the fourth being normal and unique. While I'm not entirely sure as to why this happens, the negative value for the third index is almost an alias. It follows the progression $FFF8 == $0000, $FFF0 == $0008, $FFE8 = $0010, and so on. However, the triangle doesn't draw if you replace the alias with its corresponding value, so it must happen for a reason.

Vertex Normals

The third, for objects that use Dynamic Gouraud Shading, are the vertex normals. These are normalized fixed point vectors. As you'd expect, there's one for each vertex.

Draw Settings

After the above is the draw settings. There's one list of settings for each quad. Each list is 16 bytes long. Here's its format:

Description Length
Unknown. Highest bit seems to turn off backface culling. Byte
Unknown. Bits $1 and $2 affect depth testing in certain instances. Byte
Texture index. $1-$1DB. Word
CMDPMOD command for VDP1. Bit flags. Word
Polygon color. Only applies for non-textured quads. Word
Static/Dynamic Gouraud Shading Table Index. Word
CMDCTRL command for VDP1. Bit flags. Word
Unknown. Word
Unknown. Word

Footer

This can vary from model to model, depending on which parts are present. All pointers are set up for High Work RAM. To convert them to pointers for MUSEUM.MUS, subtract by $06040000.

Sonic's sub-model footers are arranged like such:

  1. Pointer to start of vertices (long), number of vertices (long)
  2. Pointer to start of indexing table (long), number of quads (long)
  3. Pointer to draw command (long)
  4. Pointer to vertex normals (long)

Model Groups

Some models, such as Sonic and Tails, consist of multiple sub-models in a group. After the last sub-model in the group, there's a footer.

The first part of the footer is a list of addresses pointing to each sub-model's footer. Replacing one of these with another sub-model footer's High Work RAM address will result in that model being drawn instead.

The second part is a list of fixed point vectors, relative positions for each sub-model. They correspond to the addresses given in the previous section. Of note is that the vectors here seem to be 1/16 the scale of typical vectors; an offset of $10 will move a sub-model as much as an offset of $01 will move a vertex.

Certain model groups have some seemingly unused data that appears before the footer. This data seems to correlate with how the model group parenting hierarchy is set up.

Model List

Here's the list of models in the game that are currently known, in order of appearance in the file. Addresses given are pointers to footers.

Sonic

Normal

Description Address
Body $40058
Head $40C58
Right Thigh $40DA8
Right Calf $41048
Right Foot $412A0
Left Thigh $413F0
Left Calf $41690
Left Shoe $418E8
Right Bicep $41A50
Right Wrist $41CF0
Right Hand $41F18
Left Bicep $42080
Left Wrist $42320
Left Hand $42548
Tail $42608
Group Footer $42620

Jumping

This looks to be used for the effect on Sonic's spines during/immediately after a jump.

Description Address
Body $42E60
Head $43A60
Right Thigh $43BB0
Right Calf $43E50
Right Foot $440A8
Left Thigh $441F8
Left Calf $44498
Left Shoe $446F0
Right Bicep $44858
Right Wrist $44AF8
Right Hand $44D20
Left Bicep $44E88
Left Wrist $45128
Left Hand $45350
Tail $45410
Group Footer $45428

Running

This looks to be used for the effect on Sonic's spines while he's running.

Description Address
Body $45C68
Head $46868
Right Thigh $469B8
Right Calf $46C58
Right Foot $46EB0
Left Thigh $47000
Left Calf $472A0
Left Shoe $474F8
Right Bicep $47660
Right Wrist $47900
Right Hand $47B28
Left Bicep $47C90
Left Wrist $47F30
Left Hand $48158
Tail $48218
Group Footer $48230

Jumpball

Description Address
Jumpball $49D30
Group Footer $49D48

Drop Shadow

Description Address
Drop Shadow $49D88

Tails

Normal LoD

Description Address
Body $4A204
Head $4B0EC
Right Thigh $4B23C
Right Calf $4B4DC
Right Foot $4B734
Left Thigh $4B884
Left Calf $4BB24
Left Shoe $4BD7C
Right Bicep $4BEE4
Right Wrist $4C184
Right Hand $4C3AC
Left Bicep $4C514
Left Wrist $4C7B4
Left Hand $4C9DC
Tail $4D2C4
Group Footer $4D31C

Low LoD

Description Address
Body $4D4E4
Head $4D874
Right Thigh $4D904
Right Calf $4D994
Right Foot $4DA6C
Left Thigh $4DAFC
Left Calf $4DB8C
Left Shoe $4DC64
Right Bicep $4DCF4
Right Wrist $4DD84
Right Hand $4DE14
Left Bicep $4DEA4
Left Wrist $4DF34
Left Hand $4DFC4
Tail $4E15C
Group Footer $4E1B4

Test Object?

I'm unsure of this object's purpose, if any. Could use more research.

Description Address
Test Object? $4E454

Cyan Pixel?

Not sure if this is what this is supposed to be. Could use more research.

Description Address
Cyan Pixel? $4E468

Black Pixel?

Not sure if this is what this is supposed to be. Could use more research.

Description Address
Black Pixel? $4E47C

Blue Pixel?

Not sure if this is what this is supposed to be. Could use more research.

Description Address
Blue Pixel? $4E490

Stone Arch

Description Address
Stone Arch $4E9FC

Star Balloon

Normal

Description Address
Balloon $4ECBC
Propeller $4EE5C
Group Footer $4EE7C

Exploding

Description Address
Balloon Bits $4EEE4
$4EF40
$4EF9C
$4EFF8
$4F054
$4F0A4
$4F0F4
$4F144
$4F194
$4F1E4
$4F240
$4F29C
$4F2EC
$4F33C
$4F398
$4F3E8
$4F438
$4F494
$4F4E4
$4F540
Propeller $4F6E0
Group Footer $4F754

Checkpoint Post

Description Address
Post $4F928
Shadow $4F96C
Group Footer $4F98C

Exit Building

Building

Description Address
Building $4FDE4
Group Footer $4FE00

Doors

Description Address
Right Door $4FE58
Left Door $4FEB4
Group Footer $4FEC8

Drop Shadow (Ring)

Description Address
Drop Shadow $4FF48

Drop Shadow (Platform)

Description Address
Drop Shadow $4FF5C

Palm Tree

Description Address
Leaves $50294
Trunk $5032C
Group Footer $5034C

Bush

Description Address
Leaves $50690
Trunk $506D4
Group Footer $506F4

Spring

Description Address
Pad $50894
Spring $50B24
Group Footer $50B44

Tall Spinning Post

The short version is grouped, but for some reason, the tall version isn't.

Top

Description Address
Top $50DBC

Post

Description Address
Post $50E30

Short Spinning Post

Description Address
Top $5109C
Post $51110
Group Footer $51130

Grassy Platform

Description Address
Platform $514C8
Group Footer $514E4

Mission Button

Description Address
Button $51788
Star $51868
Group Footer $51888

Character House Monitor

Description Address
Monitor $51B60
Propeller $51BD4
Top/Bottom Stem $51C48
Group Footer $51C6C

Stone Posts

Large

Description Address
Post $51EC4
Group Footer $51EE0

Small

Description Address
Post $52118
Group Footer $52134

Water Ripples

These are all individual models, not in a group.

Description Address
Water Ripple 1 $521C4
Water Ripple 2 $521D8
Water Ripple 3 $521EC
Water Ripple 4 $52200
Water Ripple 5 $52214
Water Ripple 6 $52228

Big Ring

Description Address
Ring $52FBC
Group Footer $52FDC

Seagull

Description Address
Seagull $53208
Group Footer $53224

Flickies

Blue Flicky

Description Address
Body $5327C
Left Leg $532D8
Left Foot $53334
Right Leg $53390
Right Foot $533EC
Left Arm $53448
Left Hand $534A4
Right Arm $53500
Right Hand $5355C
Head $53840
Group Footer $53880

Green Flicky

Description Address
Body $53930
Left Leg $53954
Left Foot $53978
Right Leg $5399C
Right Foot $539C0
Left Arm $539E4
Left Hand $53A08
Right Arm $53A2C
Right Hand $53A50
Head $53B84
Group Footer $53BC4

Purple Flicky

Description Address
Body $53C74
Left Leg $53C98
Left Foot $53CBC
Right Leg $53CE0
Right Foot $53D04
Left Arm $53D28
Left Hand $53D4C
Right Arm $53D70
Right Hand $53D94
Head $53EC8
Group Footer $53F08

Red Flicky

Description Address
Body $53FB8
Left Leg $53FDC
Left Foot $54000
Right Leg $54024
Right Foot $54048
Left Arm $5406C
Left Hand $54090
Right Arm $540B4
Right Hand $540D8
Head $5420C
Group Footer $5424C

Orange Flicky

Description Address
Body $542FC
Left Leg $54320
Left Foot $54344
Right Leg $54368
Right Foot $5438C
Left Arm $543B0
Left Hand $543D4
Right Arm $543F8
Right Hand $5441C
Head $54550
Group Footer $54590

Monkey

The mappings of the sub-models are assumed based on the other character models, since I don't currently know how to place an object in the world. Needs more research!

Description Address
Body $54678
Left Leg $546D4
Left Foot $54730
Right Leg $5478C
Right Foot $547E8
Left Arm $54844
Left Hand $548A0
Right Arm $548FC
Right Hand $54958
Head $54CC0
Group Footer $54D00

Music Shop

Building

Description Address
Building $55B38
Left Door $55B94
Right Door $55BF0
Group Footer $55C14

Interior

Description Address
Interior $55D1C
Group Footer $55D38

Art Gallery

Building

Description Address
Building $56918
Left Door $56974
Right Door $569D0
Right Gem $56A74
Left Gem $56B18
Group Footer $56B44

Interior

Description Address
Interior $56C6C
Group Footer $56C88

Hall of Fame

Building

Description Address
Building $57A54
Right Door $57B0C
Left Door $57AB0
Group Footer $57B30

Interior

Description Address
Interior $57C38
Group Footer $57C54

Character House

Building

This group only includes one set of doors, for the bad guy section.

Description Address
Building $582A0
Ring $58554
Left Door $585B0
Right Door $5860C
Egg Mobile $589EC
Group Footer $58A18

Sonic Section Doors

Description Address
Left Door $58AB0
Right Door $58B0C
Group Footer $58B34

Interiors

Description Address
Robotnik Interior $58C38
Sonic Interior $58D24
Group Footer $58D4C

Movie Theater

Building

Description Address
Building $59A14
Right Door $59A70
Left Door $59ACC
Group Footer $59AF0

Interior

Description Address
Interior $59BF8
Group Footer $59C14

Wall Chunks

This chunk of the wall is behind and right of the Music Shop.

Description Address
Wall Chunk 1 $5A074
Group Footer $5A090

Left of Wall Chunk 1.

Description Address
Wall Chunk 2 $5A484
Group Footer $5A4A0

Left of Wall Chunk 2.

Description Address
Wall Chunk 3 $5AB70
Group Footer $5AB8C

Left of Wall Chunk 3.

Description Address
Wall Chunk 4 $5B1F0
Group Footer $5B20C

Left of Wall Chunk 4.

Description Address
Wall Chunk 5 $5B5E8
Group Footer $5B604

Right of Wall Chunk 1.

Description Address
Wall Chunk 6 $5B9D4
Group Footer $5B9F0

Left of Wall Chunk 5.

Description Address
Wall Chunk 7 $5BE44
Group Footer $5BE60

Right of Wall Chunk 6.

Description Address
Wall Chunk 8 $5C254
Group Footer $5C270

A chunk of the middle plateau without the building. The wall pointing towards the Big Ring.

Description Address
Wall Chunk 9 $5C544
Group Footer $5C560

The other part of Wall Chunk 9's plateau wall.

Description Address
Wall Chunk 10 $5CA2C
Group Footer $5CA48

Left of Wall Chunk 7. The end of the river.

Description Address
Wall Chunk 11 $5CDE8
Group Footer $5CE04

Right of Wall Chunk 8.

Description Address
Wall Chunk 12 $5D468
Group Footer $5D484

Left of Wall Chunk 11.

Description Address
Wall Chunk 13 $5D944
Group Footer $5D960

Right of Wall Chunk 12.

Description Address
Wall Chunk 14 $5DFF4
Group Footer $5E010

A chunk of the middle plateau with the building. The wall facing the Big Ring.

Description Address
Wall Chunk 15 $5E2E4
Group Footer $5E300

The wall of the same middle plateau facing the bridge.

Description Address
Wall Chunk 16 $5E52C
Group Footer $5E548

The wall of the same middle plateau facing away from the Big Ring.

Description Address
Wall Chunk 17 $5E720
Group Footer $5E73C

Left of Wall Chunk 13.

Description Address
Wall Chunk 18 $5EBF0
Group Footer $5EC0C

Right of Wall Chunk 14. Includes the waterfall.

Description Address
Wall Chunk 19 $5F1A4
Group Footer $5F1C0

Right of Wall Chunk 19.

Description Address
Wall Chunk 20 $5F6D4
Group Footer $5F6F0

Right of Wall Chunk 20.

Description Address
Wall Chunk 21 $5FB74
Group Footer $5FB90

Wall Chunk 15's plateau again; The wall facing away from the bridge, left of Wall Chunk 15.

Description Address
Wall Chunk 22 $5FD14
Group Footer $5FD30

Same plateau. Wall facing away from the bridge; left of Wall Chunk 22.

Description Address
Wall Chunk 23 $5FF5C
Group Footer $5FF78

The remaining plateau wall, left of Wall Chunk 23.

Description Address
Wall Chunk 24 $60054
Group Footer $60070

Left of Wall Chunk 18.

Description Address
Wall Chunk 25 $60500
Group Footer $6051C

Right of Wall Chunk 21. Behind the Art Gallery.

Description Address
Wall Chunk 26 $6088C
Group Footer $608A8

Right of Wall Chunk 26.

Description Address
Wall Chunk 27 $60E58
Group Footer $60E74

Right of Wall Chunk 27.

Description Address
Wall Chunk 28 $614F0
Group Footer $6150C

Right of Wall Chunk 28. Left of (and partially behind) the Exit.

Description Address
Wall Chunk 29 $61900
Group Footer $6191C

Right of Wall Chunk 29, Left of Wall Chunk 25. Right of (and partially behind) the Exit.

Description Address
Wall Chunk 30 $61B18
Group Footer $61B34

River Colliders

These are all individual models, not in a group.

Description Address Notes
River Collider 1 $61D3C Immediately downstream of the small bridge.
River Collider 2 $6202C Downstream of Collider 1. Reaches the end of the River.
River Collider 3 $622E0 Just Downstream of the wide area with the Spring.
River Collider 4 $625BC Downstream of Collider 3. Reaches just before the big bridge.
River Collider 5 $6292C Downstream of Collider 4. Reaches just past the big bridge.
River Collider 6 $62C00 Downstream of Collider 5. Reaches just before the small bridge.
River Collider 7 $62E9C Downstream of Collider 6, upstream of Collider 1.
River Collider 8 $632E4 Looking upstream, the top-left of the area with the Spring. Seems to end just before the waterfall.
River Collider 9 $6368C Upstream of Collider 3. The rest of the area with the Spring.
River Collider 10 $638AC Appears to be the collider attached to the waterfall. Only covers a small bit, there's a space between it and Collider 8.
River Collider 11 $63AF8 Upstream of Collider 8, downstream of Collider 10. Covers the last of the river.

Plateau Top Chunks

These double as the visuals and collision for the areas described.

A chunk of the top of the plateau without a building. The side nearest the Big Ring.

Description Address
Plateau Top Chunk 1 $63D58
Group Footer $63D74

The rest of that plateau's top.

Description Address
Plateau Top Chunk 2 $64360
Group Footer $6437C

The top of the tiny river island with the spring on it.

Description Address
Plateau Top Chunk 3 $644D0
Group Footer $644EC

Part of the top of the plateau with the building. Facing the Big ring, it's the forward-left section.

Description Address
Plateau Top Chunk 4 $64880
Group Footer $6489C

Back-left section of the same plateau.

Description Address
Plateau Top Chunk 5 $64DD4
Group Footer $64DF0

Forward-right section of the same plateau.

Description Address
Plateau Top Chunk 6 $64F38
Group Footer $64F54

The rest of that plateau.

Description Address
Plateau Top Chunk 7 $65198
Group Footer $651B4

River Chunks

They correspond 1-to-1 with the River Colliders in terms of positioning.

Description Address
River Chunk 1 $6556C
Group Footer $65588
Description Address
River Chunk 2 $65BC8
Group Footer $65BE4
Description Address
River Chunk 3 $660F8
Group Footer $66114
Description Address
River Chunk 4 $6664C
Group Footer $66668
Description Address
River Chunk 5 $66C24
Group Footer $66C40
Description Address
River Chunk 6 $67268
Group Footer $67284
Description Address
River Chunk 7 $67714
Group Footer $67730
Description Address
River Chunk 8 $67E30
Group Footer $67E4C
Description Address
River Chunk 9 $68348
Group Footer $68364
Description Address
River Chunk 10 $68764
Group Footer $68780
Description Address
River Chunk 11 $68B2C
Group Footer $68B48

River Masks

These are used to make it look like the ground plane actually obscures the river from certain angles. Without them, all of the river's polygons are always drawn over the ground plane. They correspond 1-to-1 with the River Colliders and River Chunks in terms of positioning.

Description Address
River Mask 1 $68DEC
Group Footer $68E08
Description Address
River Mask 2 $6937C
Group Footer $69398
Description Address
River Mask 3 $6978C
Group Footer $697A8
Description Address
River Mask 4 $69BF0
Group Footer $69C0C
Description Address
River Mask 5 $6A054
Group Footer $6A070
Description Address
River Mask 6 $6A5B4
Group Footer $6A5D0
Description Address
River Mask 7 $6A91C
Group Footer $6A938
Description Address
River Mask 8 $6ACD8
Group Footer $6ACF4
Description Address
River Mask 9 $6AF20
Group Footer $6AF3C
Description Address
River Mask 10 $6B2AC
Group Footer $6B2C8
Description Address
River Mask 11 $6B56C
Group Footer $6B588

Sonic Statue

Description Address
Statue $6C990
Group Footer $6C9AC

Robotnik Statue

Description Address
Statue $6D274
Group Footer $6D290

Statue Stand

Description Address
Stand $6D408
Group Footer $6D424

Big Bridge Chunks

Most of the bridge. Excludes a bit attached to the plateau with the building.

Description Address
Big Bridge Chunk 1 $6DB60
Group Footer $6DB7C

The rest of the bridge.

Description Address
Big Bridge Chunk 2 $6DEE0
Group Footer $6DEFC

Little Bridge

Description Address
Bridge $6E4F4
Group Footer $6E510

Big Bridge Collider

Description Address
Collider $6EBEC

Little Bridge Collider

Description Address
Collider $6EC78

Z Camera Triggers

These could use more research, but I think they tell the Z-button camera (the default) when to change vertical angles/height. I don't know off my head where any of them begin or end.

Description Address
Trigger 1 $6F1C0
Description Address
Trigger 2 $6F7D4
Description Address
Trigger 3 $6FDD4
Description Address
Trigger 4 $70394

Hint Monitor

Description Address
Hint Monitor $70648
Group Footer $70664
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