Allegro.cc - Online Community

Allegro.cc Forums » The Depot » ---== Sonic Engine To End All Sonic Engines ==---

This thread is locked; no one can reply to it. rss feed Print
---== Sonic Engine To End All Sonic Engines ==---
Damian Grove
Member #6,758
January 2006

Today marks 3 months since I started working on my secret project. I have kept it a secret for a long time now, but I am reveiling details of what I've been doing.

http://dgrove.blogspot.com/ -- I have written an article about it there (March 15).

Basically, this engine will be programmable by programmers, and designable by non-programmers. It's an engine for EVERYONE. All written in C and will emulate the original engine 100% perfectly.

http://www.shadowsoft-games.com/saxman/dump1.gif

http://www.shadowsoft-games.com/saxman/dump2.gif

UPDATE: New screen shots added! Check out the March 18th post on my blog -- http://dgrove.blogspot.com/

Get into awesome with Saxman!

Mark Oates
Member #1,146
March 2001
avatar

a sonic emulator and level editor, that sounds hard.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

deps
Member #3,858
September 2003
avatar

Reminds me of the Zelda classic project. This looks interesting.

---
Layers are good, all good things have layers, like onions. Good things also stink. - Trezker
I now have a page and a blog!

Simon Parzer
Member #3,330
March 2003
avatar

Sonic clones... I've seen so many of them ;D
Why did you say is your Sonic Engine better than any of the others??

GullRaDriel
Member #3,861
September 2003
avatar

I had the luck seeing his engine in action when he was having problem with some y value which won't wanna decrease in some particular cases.

I think the thread could be easily found.

I'm ok with the "Why will it beat all other engines" for now, but i wanna see what it looks now before saying more.

Waitting And Seeing.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Damian Grove
Member #6,758
January 2006

Well one thing is my engine is the only one to use the exact same algorithms as the original engine used to create Sonic 1, 2, and 3(&K). So will be accurate to the point where if you were to play a demo in the original games, and play the demo in this engine using the exact same level, it would play exactly the same without any issues. That's the goal. For example, he speeds up going down hill, and he slows down going up hill, and this change in speed is identical to the original games.

My engine will also use scripting to allow users to write objects and various other things for it. And if they don't understand the scripting language, I will also likely create a program that will be basically like the "event editor" in Click & Create / Multimedia Fusion (don't know if you guys know what those programs are or not). It'll basically cover up the code and give you easy point-and-click style interaction so that any dummy can write objects for their game.

Another point -- my engine will be backwards compatible with the levels and other data used in the original games. As seen in my screen shots, you have Emerald Hill which is the first level of Sonic 2. My utility "LIMP" reads the Sonic 2 ROM image and exports the level data and formats it so that it can be read by my engine. All the slope data, solidity, art, tiles, and layout is all there and fully playable through my engine. But this isn't just to play original Sonic levels. My engine allows you to design your own, up to 256 levels (unlike the 17 limit imposed on Sonic 2).

So I think it'll be very much advanced. It's basically n enhanced replica of the original engine, with more features and fewer limits (e.g. 256 colors instead of 16*4). I am also thinking of adding YM2612 (that's the Yamaha DX synthesis chip used in the Genesis/Mega-Drive) emulation to be able to reproduce Genesis music, though I'd probably only do it if there were enough people willing to use that. Either way, it'll still support MIDI, and it'll still support OGG files.

Get into awesome with Saxman!

kentl
Member #2,905
November 2002

Sounds really impressive. How did you get to know the original algorithms used for control of Sonic etc? If they were available on the web I would think that they would be really educational.

nonnus29
Member #2,606
August 2002
avatar

It shouldn't be to hard to get ahold of the source; I found the disassembled Metroid 1 source one time.

edit; Oops here it is...

LennyLen
Member #5,313
December 2004
avatar

Quote:

How did you get to know the original algorithms used for control of Sonic etc?

From his blog:

Quote:

Project Build is the codename I've been giving my Sonic the Hedgehog enhanced replicated game engine. It uses the same algorithms that make up the original Sonic games. You don't do Sonic ROM hacking for more than 6 years and not learn how things work.

Chris Katko
Member #1,881
January 2002
avatar

Quote:

edit; Oops here it is... [mdb.classicgaming.gamespy.com]

Metriod 1 is a bit less complex than Sonic the Hedgehog. :P

Take at look at his blog pictures, they're pretty impressive.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Pedro Avelar Gontijo
Member #5,372
January 2005
avatar

His blog said:

You don't do Sonic ROM hacking for more than 6 years and not learn how things work.

:o:o:o

----------
兩隻老虎,兩隻老虎,跑得快!

Damian Grove
Member #6,758
January 2006

Well, certainly a lot of it has to do with my ROM hacking experience, but coming up with the exact formulas was actually the result of me simply testing and looking to see how the variables change. I studied the changes, and I was able to create algorithms that did exactly what the original engine did. Whenever I come across inaccuracies, I adjust my algorithms so make them as perfect as possible.

I am more than willing to give out any of the algorithms I have figured out. For example, you have a slope value of 'n' which is 8-bits. 0 is 0 degrees, 0x40 is 270 degrees, 0x80 is 180 degrees, and so on, all the way around. So to calculate the player's X velocity, you do this:

float_value = Sin(90 / 64 * ((n + 0x40) & 0xFF))

Then round float_value to the nearest one-thousandth. Then...

float_value *= player->Speed / 6

Then truncate float_value to get rid of the decimals (or simply cast it to an integer). We'll do this by...

int_value = (int)float_value

Then simply multiply the integer by 6...

int_value *= 6

And that gives you the player's X velocity!

Oh, and I have an FAQ up on my blog now if anyone is interested. It answers some questions I've had by various people.

Get into awesome with Saxman!

Trezker
Member #1,739
December 2001
avatar

Do you have much free time?
Impressive stuff.

rabbi1337
Member #6,875
February 2006

Looks pretty sick there. Nice framerate too.

Go to: