Live data from Hacker News

Pushing Polygons on the Mega Drive

jix.one

21–30 of 47 posts

Re: Pushing Polygons on the Mega Drive

#21
post #9

The imprecise overruns because you'll draw over it is a clever optimization. It's interesting to compare and contrast these techniques from other excellent sources, like Michael Abrash's Graphics Programming Black Book, Special Edition [1]. Thought my technical knowledge topped out somewhere in the middle of the 'Quickly Drawing Tiles' section, the prose and algorithmic detail is lovely, the rationales and code is we…

Quickly drawing tiles is one of those sections that's really only going to make sense if you've ever done development work on a tile-mapped videogame console, as the mode is quite rare in other applications. A "tile" is nothing more than an index into a collection of 8x8 graphics squares. If you've played any retro-styled games you've seen the effects of this. They were a great way to deal with memory constraints bac…

Hey now, your average IBM PC has a tile-mapped display mode, too: we just usually call it "text", and the tiles "characters". :)

But the text-mode 'font' (i.e. the tileset) was often able to be written to, to achieve fast arbitrary-tile drawing results exactly like those of your average game console.

https://en.wikipedia.org/wiki/Text_mode#User-defined_charact...

Re: Pushing Polygons on the Mega Drive

#22
post #20
post #2

Author here, happy to answer any questions you might have.

I had a couple of games on Mega Drive that did basic 3D, or seemed to. One was F1, where a few objects seemed to be true 3D. See the overbridge at 59s and then the long tunnel at 1:01 here for instance: https://youtu.be/qofonsN3Nwc?t=57 The long tunnel is made of several short tunnels. The other was Gunstar Heroes, where the first boss is made of 3D cubes. See here at 4:00: https://youtu.be/9v3B1hzMwnQ?t=240 I'm just…

I don't know about the F1 game but I can take a guess on Gunstar Heroes.

I noticed the cubes are always aligned perfectly to the axis. And they have an isomorphic projection so the cube is always the same height (although that shouldn't be strictly necessary) as it's rotating. I also noticed the cubes never seem to get smaller if they are closer to the background.

Because of this you could just have a series of sprites each showing the cube in a different angle of rotation.

Now all you need to do is properly position a bunch of sprite (16 cubes + head) and it looks like a bunch of cubes that are actually drawn in 3-D. It wouldn't surprise me if they have some small table of the X/Y positions of the cubes precomputed so they don't have to do that in real time.

In fact since every cube is always rotated at the same angle you could just have one sprite in the system table and update it every frame.

That's my guess anyway. Clever sprite trickery.

It wouldn't surprise me if F1 uses something closer to what is described in the article (although much less capable).

Re: Pushing Polygons on the Mega Drive

#23
The use of vector graphics instead of 3d rendering or bitmap video seems reminiscent of the techniques which allowed Another World to achieve the fidelity it did on the consoles of that era: https://www.youtube.com/watch?v=X7GVubkh4TE

Tech overview: http://fabiensanglard.net/anotherWorld_code_review/

Re: Pushing Polygons on the Mega Drive

#24
post #22
post #20

Earlier quoted context omitted.

I had a couple of games on Mega Drive that did basic 3D, or seemed to. One was F1, where a few objects seemed to be true 3D. See the overbridge at 59s and then the long tunnel at 1:01 here for instance: https://youtu.be/qofonsN3Nwc?t=57 The long tunnel is made of several short tunnels. The other was Gunstar Heroes, where the first boss is made of 3D cubes. See here at 4:00: https://youtu.be/9v3B1hzMwnQ?t=240 I'm just…

I don't know about the F1 game but I can take a guess on Gunstar Heroes. I noticed the cubes are always aligned perfectly to the axis. And they have an isomorphic projection so the cube is always the same height (although that shouldn't be strictly necessary) as it's rotating. I also noticed the cubes never seem to get smaller if they are closer to the background. Because of this you could just have a series of sprit…

Your analysis appears correct, as several sources write that Gunstar Heroes uses multi-sprite bosses [1][2].

F1 on the Mega Drive owes its existence to an earlier game for the Atari ST, Vroom [5]. The brainchild behind that game, "Dan McRae", talks in a video interview [3] about how he arrived at that particular version of the game from his earlier revisions on older platforms -- where techniques shown in Lou's Pseudo 3d Page [4] apply, to more advanced techniques [6] similar to the ones presented in this submission.

F1 on the Mega Drive was done by the same dev studio that collaborated with McRae on Vroom, and at least one of the same programmers, but presumably had to do some advanced tilemap trickery specific to the console. Unfortunately, compared to other games in this series, there is very little information on the technical aspects of the Mega Drive version.

[1] http://www.hardcoregaming101.net/gunstarheroes/gunstarheroes... [2] http://www.racketboy.com/retro/sega/genesis/best-sega-genesi... [3] https://youtu.be/ZTd-fFScLGA [4] http://www.extentofthejam.com/pseudo/ [5] https://youtu.be/ZTd-fFScLGA?t=7m33s [6] https://youtu.be/ZTd-fFScLGA?t=10m28s

Re: Pushing Polygons on the Mega Drive

#25

The use of vector graphics instead of 3d rendering or bitmap video seems reminiscent of the techniques which allowed Another World to achieve the fidelity it did on the consoles of that era: https://www.youtube.com/watch?v=X7GVubkh4TE Tech overview: http://fabiensanglard.net/anotherWorld_code_review/

Hahaha. I came here to post this. The intro to Flashback (same team) uses a similar strategy and I think is maybe even a little more impressive.

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

Re: Pushing Polygons on the Mega Drive

#26
post #20
post #2

Author here, happy to answer any questions you might have.

I had a couple of games on Mega Drive that did basic 3D, or seemed to. One was F1, where a few objects seemed to be true 3D. See the overbridge at 59s and then the long tunnel at 1:01 here for instance: https://youtu.be/qofonsN3Nwc?t=57 The long tunnel is made of several short tunnels. The other was Gunstar Heroes, where the first boss is made of 3D cubes. See here at 4:00: https://youtu.be/9v3B1hzMwnQ?t=240 I'm just…

sonic 2 https://youtu.be/9Q0NCY-zhGg?t=1540

The rotation of the character is just made of different sprites.

Re: Pushing Polygons on the Mega Drive

#28
post #2

Author here, happy to answer any questions you might have.

Not a question. But I just wanted to say that this sort of thing is amazing to me.

I literally:

1. Saw this article headline about a polygon rendering engine on the Mega Drive

2. Thought, oh this is going to be good

3. Made some tea

4. Settled in to enjoy it.

Not only did I love the demo and your article, you cleared up a longstanding mystery to me. I know that Another World (aka Out of This World) and Flashback (intro only) used similar techniques to render "canned" or "pre-baked" polygon animations on the Mega Drive, but I knew literally nothing about how that was possible. Thanks to you, now I have some kind of idea. Were you inspired by those games, to pull off this awesome effect in your demo? (BTW, you achieved a much better frame rate AND did it without borders... totally badass)

Last but not least, thank you for the inspiration. I'm not a graphics programmer but I am a programmer and I have always been inspired by demos ever since the days of Future Crew. Coders like you inspire coders like me to better ourselves and be unafraid of challenges.

Re: Pushing Polygons on the Mega Drive

#29
post #24
post #22

Earlier quoted context omitted.

I don't know about the F1 game but I can take a guess on Gunstar Heroes. I noticed the cubes are always aligned perfectly to the axis. And they have an isomorphic projection so the cube is always the same height (although that shouldn't be strictly necessary) as it's rotating. I also noticed the cubes never seem to get smaller if they are closer to the background. Because of this you could just have a series of sprit…

Your analysis appears correct, as several sources write that Gunstar Heroes uses multi-sprite bosses [1][2]. F1 on the Mega Drive owes its existence to an earlier game for the Atari ST, Vroom [5]. The brainchild behind that game, "Dan McRae", talks in a video interview [3] about how he arrived at that particular version of the game from his earlier revisions on older platforms -- where techniques shown in Lou's Pseud…

Thanks for that information, that's still really interesting. And wow, Vroom looks exactly like F1: I even see many of the exact same track assets.

Re: Pushing Polygons on the Mega Drive

#30
post #9

The imprecise overruns because you'll draw over it is a clever optimization. It's interesting to compare and contrast these techniques from other excellent sources, like Michael Abrash's Graphics Programming Black Book, Special Edition [1]. Thought my technical knowledge topped out somewhere in the middle of the 'Quickly Drawing Tiles' section, the prose and algorithmic detail is lovely, the rationales and code is we…

Quickly drawing tiles is one of those sections that's really only going to make sense if you've ever done development work on a tile-mapped videogame console, as the mode is quite rare in other applications. A "tile" is nothing more than an index into a collection of 8x8 graphics squares. If you've played any retro-styled games you've seen the effects of this. They were a great way to deal with memory constraints bac…

This is extremely well-written. Kudos!

Basically all 8/16-bit console graphics tricks take advantage of one (or both) of the following two facts:

1. 8-bit and (particularly) 16-bit consoles are built to draw and move 2D tiles crazy fast. If the effect you want can be achieved (or faked) by a series of animated tiles, you can do it. The most obvious example is "segmented" characters (usually bosses, but also the protagonist in Vectorman) that are made up of multiple sprites (tiles) that are animated in such a way as to fake smooth 3D animation

2. The screen is drawn one row at a time. Left to right, top to bottom. Like a typewriter. You get a little bit of processing time after each row, and a little extra time after the last row. You can use this time to tweak things (like, the position of the background, or the position of a sprite) in between rows. This is how you can achieve "line scrolling"

"Simple" line scrolling where you change the background scrolling rate on each horizontal line, for a very smooth effect: https://youtu.be/hIiMz_NUDEw?t=97

More advanced line scrolling where you manipulate both horizontal and vertical scroll in between lines: https://www.youtube.com/watch?v=QN2Yoz0INrI

I am not sure, but I think many of the abstract effects (not the polygon animations, which use tile rendering) in the Over Drive 2 demo that this article discusses are achieved by extremely precise manipulation of sprite positioning and/or scroll registers as in #2 above.

Post reply on HN