1
\$\begingroup\$

This will be my first discussion on the gamedev stack exchange, so thanks for reading. My question pertains specifically to the special/bonus stages in Sonic 3 where the game gives you a convincing effect of running around a checkerboard sphere, collecting orbs as you go, jumping to try and avoid obstacles. Have you played it? Probably not the most enjoyable of the Sonic bonus stages, but fun nonetheless.

https://www.youtube.com/watch?v=_QCmIbYm5Rg

So I was wondering how to go about reproducing this in a modern 3D environment like Unity. I came up with this (very high level):

  1. Produce a tilemap (however one likes) to store the data about what is on the map
  2. On init, layout this tilemap in the world along the x-z plane
  3. Player moves through the world on this x-z plane. This simplifies movement a bit as opposed to having to plot the spherically around a sphere
  4. UVs could be animated to give the impression of moving along the board
  5. Curvature of the world could be simulated using a curved shader or the like.

Alternatively, the tilemap could be mapped to a sphere of R radius and then simply animated the UVs on the sphere. Though, this has its own problems such as the poles of the sphere. In this approach you could move the player or the world around the player.

Maybe I am overcomplicating this entire thing? ;)

Thoughts?

\$\endgroup\$
4
  • 2
    \$\begingroup\$ This site is not fit for broad discussion like you seem to be wanting here. Is there a specific question you want to ask? \$\endgroup\$
    – user35344
    Jan 22, 2019 at 15:27
  • \$\begingroup\$ Maybe it is! I figured I was being pretty specific in terms of discussion. I want to know if someone has already implemented a similar game and how they did it. \$\endgroup\$ Jan 22, 2019 at 16:00
  • \$\begingroup\$ Yeah in that case you are on the wrong site. \$\endgroup\$
    – user35344
    Jan 22, 2019 at 17:57
  • \$\begingroup\$ I think you can bring this question squarely on-topic by editing it to change from an open-ended discussion/solicitation for "Thoughts?" to a concrete question: "How can I implement this?" - it sounds like you have a workable strategy already, so show us how you've tried to put this strategy into practice, and where you've gotten stuck or encountered a problem you need help solving. \$\endgroup\$
    – DMGregory
    Jan 22, 2019 at 19:18

2 Answers 2

0
\$\begingroup\$

i think a simple handle on the matter would be to have the player(sonic) not moving on the space and create a big sphere that you can control the rotation. So think of it as an endless runner, where the environment is moving, not the player.

\$\endgroup\$
2
  • \$\begingroup\$ You could do that, and in the levels are design as a mesh and imported that would be pretty simple. Other possible technique is designing the level as a tilemap and then mapping to the sphere, but this has some gotchas, such as dealing with the poles of the sphere. \$\endgroup\$ Jan 22, 2019 at 16:02
  • 1
    \$\begingroup\$ Hint: there are no poles in the Sonic bonus stage because it's not really a sphere but a doughnut. It's drawn like a sphere on screen, but the underlying topology is toroidal. \$\endgroup\$
    – DMGregory
    Jan 23, 2019 at 13:23
0
\$\begingroup\$

A couple of years late, but I was looking for the answer to this myself, so will share my progress.

Sonic is actually running along the lines of a 32x32 grid in which opposite edges are identified, i.e. a toroidal grid. The camera angle only ever shows a section of this grid, so you can render this section as if it is flat in the plane.

Task 1) Code the game with Sonic running on a flat grid, rather than drawing the squares using polygons I would recommend using a custom shader and drawing objects as sprites or meshes on top.

Once you have that you can change the rendering, there are two remaining tasks:

Task 2) Calculate the position of each object so they now lie on the sphere. You could probably just cast a ray in a fixed direction from each and take the intersection with a sphere, if there is no intersection then discard it.

Task 3) Fix the rendering of the sphere itself, with a custom shader this involves taking a point on the sphere and then casting in back to a fixed plane.

I would really like to know how they did this on the original Megadrive/Genesis!

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .