Some very interesting info on the Sonic games and design.

Azureth

Supreme [H]ardness
Joined
Feb 29, 2008
Messages
5,323
Thought this was so awesome wanted to share. Thanks to thesonicretard for the info:

Images are stored - in 8 x 8 art format which recalls which specific palette to draw from (recall 2 pages ago if you're still unclear). I also spoke about how the genesis, and Sonic the hedgehog, uses these base 8x8 tiles to form bigger objects. Now I'll talk about how levels are stored and created as a whole.

LEVEL ART

The first thing to understand about how sonic the hedgehog works is that what you see, and what you're interacting with, are two very different creatures. I'll explain a bit later when I talk about the actual game physics, but for now, just remember that we're talking strictly about the level as you see it.

First up, lets take a look at a sample level... we'll be using Metallic Madness act 2 present from sonic CD to explain how levels are stored. Behold the level in it's full glory:

mmoe5.png


I chose to use this level on purpose because it's one of the most confusing in all of Sonic CD. It's level design is frantic and very sprawling, with no two areas looking the same. Each part of the level looks very distinct and random.

If there is one thing I've learned from studying the way the sonic engine works, it's that Sonic the Hedgehog, as a whole, is not nearly as frantic, confusing, or hectic as it seems. The entire engine is hyper organized, and if you look hard enough, patterns will form. Case in point, if I simply add a grid to the above image, a sort of patter appears...

leveltilestk7.png


Amazingly, the level is stored in an array using repeating, pre-created 64x64 tiles. I've gone through the above image and organized the tiles and labeled them...

and there you have it. From the 61 tiles you see above, the entire level is created. You can accurately represent the level, in fact, as so:

Code:
1 2 3 4 5 6 X Z ! @ & ! * C N C W - 0 0 0 X 4 0 + $ 4 4 : : :

7 8 9 8 0 8 0 R # $ N N N T F G Y R N O O 0 X 3 - { 0 S S + N

A 8 B B C 0 C 0 0 0 K 3 5 7 C J J 3 + + N 4 R C { N ] O . - N

D 7 E F G H U O 0 0 ( N N N T U J N C 0 ] 8 } J C \ / ? O R N

4 I J K L M Y S 0 3 0 ) 5 0 0 0 L F U A - ^ N T U < 7 N N V N

N N J O P Q J C R # ( ) - 0 0 A N 0 0 R B 0 + N 0 \ / > N 7 N

N N J C R S L U # A ^ X 3 0 B 0 7 A 0 D N [ ( 4 X N N ~ " 5 N

N N T U ] W W X ^ Z @ ! Z ! * 3 [ ] O O N N N N N N N N 5 N N

So, let's step back a bit. Below is a 64x64 tile taken from Hydrocity Zone, Sonic 3, that has been blown up two times it's original size:

sampletilemd0.png


Like I explained before, this 64 x 64 tile is made up of several 8 x 8 tiles, as shown below:

tilegridmm8.png



I've already talked about how these 8 x 8 basic tiles are stored (refer to 2 pages ago if you're unclear), but now we see how these larger 64 x 64 tiles are stored - they're made up of arranged 8 x 8 tiles in a similar fashion to the way 8 x 8 tiles are stored. Where as 8 x 8 tiles were made up of character representations of numbers corresponding to palette entries, these larger 64 x 64 tiles are made up of character representations of 8 x 8 tiles. Take, for example, the 8 x 8 tile that makes up the first square in the 64 x 64 tile. That tile is saved as a grid of palette entries, and then labelled as something, say '1' to keep things clear. Th 8 x 8 tile next to it is stored as 2, and so forth.

We see, then, that the 64 x 64 tile can be represented as an 8 x 8 grid, where the top left quadrant storing '1', the one next to it stores '2', and so forth.

Once we've selected the 8 x 8 tiles which make up the art for the 64 x 64 tile, we can then save the 64 x 64 tile as a single level art object, which I call LAOs. LAOs get saved and assigned a label (similar to the labels I gave above).

These LAOs can then be arranged in a grid to make up the level by repeating the same process. You can store a level by simply creating a grid of LAO labels. I'll explain in full how these get drawn to the screen later.

As you should have noticed, the entire system is just a repeated process where you take a small element, arrange them in a grid, save that grid as an object, then use that object as the element for the next object you'll create.

Sonic the hedgehog is one of the most impressive games ever released. At surface value, it looks like a mario game, but when you begin to examine the game engine, it is one of the most complex game engines created. While Yuji Naka is a terrible producer and designer, he coded one hell of a game engine. Sit back for a moment and just look at the physics of sonic the hedgehog. There is a lot in sonic the hedgehog's engine that really goes over looked.

For example, in Mario World, mario always jumps vertically. This is because of how mario's jump routine works. They simply decrease his vertical velocity. Go onto a hill, and jump, and you'll jump straight up.

Sonic's jump routine was far more complex. Sonic jumps perpendicular to whatever piece of ground he's standing on. While this in it's own is pretty impressive, what's more impressive is how the game FINDS the perpendicular ground. It actually reads the angle of the ground you're walking on DEPENDING ON THE IMAGE OF THE GROUND and puts you perpendicular to that angle. Go onto a hill in sonic, and jump, and you'll jump backwards and up.

A good example to demonstrate how complex and neat this is... load up sonic 1. Stand still, don't press left or right, and jump... you'll jump forward a little. When you land, jump again, and you'll jump backwards. You can actually move quite a bit into the level just by jumping. The game is actually reading all those little hills in the ground. They aren't just for decoration.

And this is just from the jump routine. Those hills actually affect your speed, velocity, and weight. Sonic has weight in sonic 1, which is why he speeds up when you roll down a hill.

Really amazing engine.

Someone asked "So you're telling me the engine can determine the slope of the ground just by looking at the ground's image file?", which I said:

Yes.

The engine actually constantly has a pointer infront of sonic and at the center of sonic at all times. The engine uses a standard pixel-perfect collision routine to determine when the pixels first intersect. It then determines the angle sonic is based taking the arc tangent of the pointer he's currently on over the pointer 1 pixel in front of him.

Now, this is a little misleading. The game doesn't actually determine by the art, they determine by the solidity chart of each tile. Let me show a couple of screenshots of SonED, a development tools used to make sonic the hedgehog to explain how it works:

soned5vk7.gif


As you can see, the editor lets you assign 8x8 tiles over a big block of land. This is the art side of the editor.

Below the art, however, the editor lets you choose solidity, which looks like this:

editorfq9.png


What you're looking at is solidity charts. These are essentially binary blocks of 8x8. For every 8x8 block, you assign one of these charts to it. This tells the game engine what parts of each image are solid, and what parts are not. This is why sonic doesn't run jagged over ground with blades of grass showing - the blades aren't solid, it has a flat solidity chart.

Thus, we meet infinite scrolling. Sonic's engine has the unique ability to allow you to warp from the top of the level to the bottom of the level, sort of like how you could move from the right side of the screen in Mario Bros and end up in the left side of the screen. Using creative level design, they could then fool you into thinkin the level was really tall.

So, if we enable infinite scrolling, and move past a certain point on this column, we get to this:

s2protosnap032jo9.gif


That's right, the column continues at the bottom of the level. Since it's moving at an angle, you eventually move over enough so that it doesn't overlap. the end result is sorta like this:

looppe5.png


I just posted a picture of the ascii, too much work. the ___ and the / are supposed to be ground pieces, the periods are air.}

you see? the tube looks longer than it is because it wraps around. What would have happened is we would have (in the final version) hit a trigger to turn off water in the game. That's how Labrynth Zone wraps - if you notice, at points in the game, the water goes down for no reason, then rises back up. It's a trick to make you think you're still going up. When you reach a point, the water goes down below the screen, then turns off. Then, when you get up high enough, they turn it back on and have it raise again to meet you.


Truly excellent games. Most people don't even realize how well made of a platformer they are.
 
They should keep making sonic games, but in 2d HD. That would be such tits. All of the 3d fails could then be forgotten.
 
Sonic really should have died after Sonic 3 & Knuckles. As fun as the Sonic games are they just aren't deep enough to do well in a 3D environment, which is why the Mario games have done much better.
 
Great read, thanks! And yes, why the hell don't they make a 1080p, beautiful, colorful 2D Sonic game instead of all this 3D garbage they've been releasing for the last decade?

Oh and let's make this wonderful 2D game just Sonic... maybe Tails, but none of those other awful characters.
 
Great read, thanks! And yes, why the hell don't they make a 1080p, beautiful, colorful 2D Sonic game instead of all this 3D garbage they've been releasing for the last decade?

Oh and let's make this wonderful 2D game just Sonic... maybe Tails, but none of those other awful characters.

WTF man, you know you want a game with this guy:

chara_big.gif
 
I really liked the ones on Dreamcast. I think they should just keep the levels FOCUSED on Sonic levels like they used to instead of the majority of the game being about other slower paced characters.

On topic: I loved reading about the engine... I'm impressed how advanced it was given the hardware.
 
I don't understand why people say sonic doesn't translate to 3d. These people have obviously never played sonic adventure 1 & 2 on the dreamcast. It seems to be one of those nerd things to hate it just to hate.

Sonic Adventure: http://www.gamespot.com/dreamcast/a...w.html?mode=web&tag=scoresummary;critic-score 87%

Sonic Adventure 2: http://www.metacritic.com/games/platforms/drm/sonicadventure2?q=sonic adventure 89%

Now, a lot of the other 3d ones did infact suck major d, but those did not.

Yeah, anyone who thinks differently than you *must* be a nerd. That's the only explanation.
 
Yeah, anyone who thinks differently than you *must* be a nerd. That's the only explanation.

That's not what I'm saying, it's one of those things that people say they hate because it's cool to hate, when they have actually never even played the damn games
 
I have Sonic Adventure for Dreamcast. I couldn't get past the awful voice acting and cheezy dialogue that made no sense. I just want a Sonic game. I want to run around, have fun, and collect rings. That's what made the originals so much fun. I can pick up any of the original Sonic games and play them start to finish and have a blast. Not so much with anything recent. I tried playing Sonic and the Secret Rings for Wii a few days ago and wanted to vomit.
 
I dont know.
I thought Sonic Rush on DS was a pretty good game, minus the need to memorize exact enemy locations, lest you die.....

But was still better than any sonic game in recent years.....
 
I dont know.
I thought Sonic Rush on DS was a pretty good game, minus the need to memorize exact enemy locations, lest you die.....

But was still better than any sonic game in recent years.....

The DS games are shit compared to the Genesis games.

2zdugar.png
 
srsly the adventure games were actually really well done.

well... at least sonic and shadows levels. if they could literally just replicate that then they would have a solid game.



edit: holy bump by mistake, got this link off a tweet from a dice guy, aha.
 
I didn't even notice it was that old, very interesting read. Thanks for bumping it.
 
N-N-N-N-N-Necromania!!!!!!

But seriously, I never saw this before. Pretty cool stuff.

I was confused why people were angry that there was no new 2-D Sonic game out....and then I saw the date.
 
intresting read. I like the layman term for Sonic Advance 2 "speed speed speed" :p
 
Back
Top