deemen
|
|
« on: June 13, 2010, 03:59:29 PM » |
|
I've always wondered how the Sega people got Sonic to move so smoothly along loop-de-loops and various other terrain. I think it's pretty clear the engine is tile based, but it seems to me like all the momentum and forces which affect sonic would need to be calculated on a "vector" basis, not just pixels in a tile system.
I dunno if anyone has any insight into this? I'm currently building a platformer using a modern 2D physics engine (Box2D), so I've asked myself the question a few times. It just amazes me how much all these old games managed to do on the hardware of the day.
|
|
|
Logged
|
|
|
|
BorisTheBrave
|
|
« Reply #1 on: June 14, 2010, 01:14:42 AM » |
|
Even if Sonic uses tiles for storage and display, it doesn't use them for the physics, like few games outside turn based strategies and rougelikes. Instead, each tile becomes a solid, and these add together to form a continuous level. Perhaps there is also some surface mechanics so each tile can point the the ones it connects smoothly with in each direction.
But by and large, the old school games are a mass of physics hacks that only reveal themselves in odd circumstances, or specific level design patterns which can be avoided. Sonic has position and acceleration, inertia, but nothing else in the game does, all colisions are either against solid objects, enemies, or special cases. So basically all the hard work of a physics engine is non-existent (box2d bottlenecks on the "solver" for piles of objects, or networks of joints). Heck, I doubt the game is performing collision detection between anything other than sonic.
|
|
|
Logged
|
|
|
|
nikki
|
|
« Reply #2 on: June 14, 2010, 01:48:56 AM » |
|
i doubt the physics are much more complex then say in mario it just has a 'highspeed' variable that triggers this fast rolling animation . and allows custom behaviours (following a loop for example, or adjust speed) your box2d method would roughly be a million times heavier on the cpu i guess
|
|
|
Logged
|
|
|
|
Don Andy
|
|
« Reply #3 on: June 14, 2010, 02:44:53 AM » |
|
You could always take a look at Open Sonic and see how they are doing it. I think they emulated the original Sonic engine pretty well.
|
|
|
Logged
|
|
|
|
gimymblert
|
|
« Reply #4 on: June 14, 2010, 07:24:19 AM » |
|
|
|
|
Logged
|
|
|
|
BorisTheBrave
|
|
« Reply #5 on: June 14, 2010, 08:30:38 AM » |
|
Yep, Solid Tiles - Slopes and Curves shows exactly what I mean by "hacks". The level designers simply avoid designs that highlight the problems.
|
|
|
Logged
|
|
|
|
deemen
|
|
« Reply #6 on: June 14, 2010, 04:03:46 PM » |
|
Wow that's awesome. I love this kind of stuff. Maybe it is a bunch of hacks but it's truly ingenious programming to get around the problem. I'll look into it more, some of this stuff could be useful to get that old school feel. BorisTheBrave I recognize you from the Box2DX forums. That happens to be the engine we're using. I've made some pretty heavy modifications to it (conveyor belts, one-way platforms etc.). Really solid physics engine. I could probably scrounge together a patch with the changes if you'd like.
|
|
|
Logged
|
|
|
|
Dacke
|
|
« Reply #7 on: June 14, 2010, 04:11:51 PM » |
|
Sonic 3 still has the best platformer movement I have ever seen. (Though Nikujin is fantastic, too).
If the hacks were easy to get right, I think we would have seen more games like that. Not even later Sonic games have been close.
|
|
|
Logged
|
programming • free software animal liberation • veganism anarcho-communism • intersectionality • feminism
|
|
|
deemen
|
|
« Reply #8 on: June 14, 2010, 04:16:50 PM » |
|
Agreed. I love the movement in Sonic games.
|
|
|
Logged
|
|
|
|
Dacke
|
|
« Reply #9 on: June 14, 2010, 04:20:16 PM » |
|
What I meant to say was: Yes, do this! Awesome! Physics + Sonic movement that would be ace
|
|
|
Logged
|
programming • free software animal liberation • veganism anarcho-communism • intersectionality • feminism
|
|
|
deemen
|
|
« Reply #10 on: June 14, 2010, 04:21:44 PM » |
|
I'm checking it out. I'll see what I can do
|
|
|
Logged
|
|
|
|
Alistair Aitcheson
|
|
« Reply #11 on: June 14, 2010, 04:28:14 PM » |
|
Thanks for posting that link, neoshaman - it's really interesting!
|
|
|
Logged
|
|
|
|
Craig Stern
|
|
« Reply #12 on: June 14, 2010, 05:14:58 PM » |
|
Jinroh posted a tutorial about how to make an engine like this over in RPGDX a few months ago. It's a bit over my head, but you might find it useful.
|
|
|
Logged
|
|
|
|
Skofo
|
|
« Reply #13 on: June 14, 2010, 05:40:07 PM » |
|
You could always take a look at Open Sonic and see how they are doing it. I think they emulated the original Sonic engine pretty well. They did not. Within 10 seconds of playing I was able to get stuck at a top corner of a rectangular roof where Sonic cycled between walking up it and falling.
|
|
|
Logged
|
If you wish to make a video game from scratch, you must first invent the universe.
|
|
|
Trevor Dunbar
|
|
« Reply #14 on: June 14, 2010, 05:53:02 PM » |
|
Yah, don't use a physics engine for platformer stuff. Dood. It'll end up slower and all floaty like LittleBigPlanet.
|
|
|
Logged
|
Toucantastic.
|
|
|
deemen
|
|
« Reply #15 on: June 14, 2010, 06:43:11 PM » |
|
I think with enough hacking you can get a physics engine to behave properly. That's what we've been doing with Party of Sin. Gotta increase gravity to make it less floaty. Overall it works really well, you just have to know what to tweak. You can have realistic physics without sacrificing gameplay.
|
|
|
Logged
|
|
|
|
BorisTheBrave
|
|
« Reply #16 on: June 15, 2010, 02:12:10 AM » |
|
BorisTheBrave I recognize you from the Box2DX forums. That happens to be the engine we're using. I've made some pretty heavy modifications to it (conveyor belts, one-way platforms etc.). Really solid physics engine. I could probably scrounge together a patch with the changes if you'd like.
Yeah, I actually got started trying to create a Sonic-style game. It was why I made concave arcs for v1.4.3 - to do loop-de-loops. Now that was a heavy modification. However, I got bored. You know one-way platforms are a feature of v2.1?
|
|
|
Logged
|
|
|
|
raigan
|
|
« Reply #17 on: June 15, 2010, 04:43:00 AM » |
|
Wow, that was an awesome read -- thanks!
|
|
|
Logged
|
|
|
|
gimymblert
|
|
« Reply #18 on: June 15, 2010, 06:39:39 AM » |
|
Sonic was a step up from regular platform game.
The momentum gameplay (exemplified by the loop) was a great addition to "gravity". Speed as momentum was a mean to pass certain obstacle, reach new area or get to new place with the "sticky" run.
Too bad the know how and the lesson was lost and did not translate into future games (where plain speed replace momentum) and most other game did not pick up the gameplay lesson about momentum.
Funnily the closest game to play greatly with momentum was mario 64 (a reason where i prefer it over galaxy where it is less nuance).
Sonic physics = lesson not learn
|
|
|
Logged
|
|
|
|
deemen
|
|
« Reply #19 on: June 15, 2010, 07:23:30 AM » |
|
BorisTheBrave I recognize you from the Box2DX forums. That happens to be the engine we're using. I've made some pretty heavy modifications to it (conveyor belts, one-way platforms etc.). Really solid physics engine. I could probably scrounge together a patch with the changes if you'd like.
Yeah, I actually got started trying to create a Sonic-style game. It was why I made concave arcs for v1.4.3 - to do loop-de-loops. Now that was a heavy modification. However, I got bored. You know one-way platforms are a feature of v2.1? I don't think there is a C# port of that version yet :/. I've been working off 2.0.1.3 from 2008. Would be a lot of work to upgrade to the next version. Wouldn't you need somekind of layers setup to make loops work properly? Loops aren't strictly 2D because you end up behind the point where you started and you go through geometry that was previously solid. I think sonic does this with the collision modes mentionned in neoshaman's link. How did you manage to do that in Box2D?
|
|
|
Logged
|
|
|
|
|