Arduino Asteroids

[nootropic] has a new game out for hackvision, “Asteroids”! We covered the hackvision back when it first started appearing in October of 2010, and hardware wise it has not changed. It is still an Arduino (software) compatible system sporting a atmega328, video and audio out connections (uses the TV-out library), all on a nice printed circuit board that, with the buttons, resembles a game controller.

While its impressive enough to run arcade inspired games like space invaders, pong, and tetris while using Arduino and a library, Asteroids takes the game up a notch.

Features that make Asteroids well, Asteroids include a mod of the TV-out library so that bitmaps can fly over each other without erasing the pixels under them to give that old time vector arcade feel, and “point in polygon” style collision detection, which is a fantastic / efficient way of collision detection against irregular shapes, limited platform or not.

Last but not least, [nootropic] used the set_vbi_hook() function of the tv out library in sound design, going from simple “beeps” and “boops”, to “beeps” and “boops” on a constant 60Hz refresh (in the case of NTSC) that allows him to build more complex sound effects that give a nice arcade sound of explosions and laser blasts.

Join us after the break for a quick video, and remember, this is Arduino based so if you already have an Arduino, you can add the supporting hardware (buttons, resistors, and RCA jacks) and run any of the games currently offered, or make your own.

Comments

  1. nootropic says:

    one quick clarification – I didn’t mod the TVout library to provide the bitmap overlay. Standard TVout is used.

  2. nes says:

    That’s absolutely lovely. Top work!

  3. nickstewartroc says:

    Anyway to port over to a TI launchpad? Thanks,
    Nick

  4. nootropic says:

    The TI LaunchPad has far to little memory. The ATmega328 has 2K of SRAM (frame buffer requires over 1.5K) and 32K of flash to store the program (Asteroids is over 28K). It looks like the TI mcu on the LaunchPad only has 2K of flash and 128 bytes of RAM.

  5. Gdogg says:

    Cool stuff. I need to work on my gamedev, and I’m really interested in the restrictions impossed by these little chips. OpenGL is too easy.

    For those of you who needs an asteroids fix. paste this code in your address bar and hit enter.

    http://pastebin.com/ZAHNuU7n

    Of course, you don’t have to trust me (it is technically possible to steal cookies this way) but of course the link to the js file is right there, so you can read the code if you’re wary. It’s worth it though.

  6. Wonderful job fitting that on an arduino! As a Propeller user, I would like to welcome you to 2006.

  7. Finger says:

    @nickstewartroc and nootropic,

    I’m fairly confident that Asteroids could be ported over to the Launchpad despite the SRAM and Flash limitations. The graphics pipeline would have to be reworked (no framebuffer, probably a line-buffer based approach) and you would probably have just use the vertexes or other primitives for the polygons instead of bitmaps, but it’s definitely possible. If I get some time I’ll mess around with writing it up for the Launchpad.

  8. strider_mt2k says:

    The project is valid.

    No need for douchery.

  9. Ben Foote says:

    This is a pretty cool use of the Arduino platform. However, lets not forget the Uzebox/Fuzebox. It’s based on the 644P (which means 64k of space instead of 32k) and has a few other neat features tucked in as well.

    Check it out here: http://www.belogic.com/uzebox/

    There are plenty of full games, with source, available for anyone to get started. And there is a very tight-knit user community around the project.

  10. Mikey says:

    It’s lovely to see people hacking around the limitations of a platform to add a better gaming experience to it… but it’s still got a ways to go to catch up to the Atari 800 port (which sported color, and up to 4 players on much slower hardware…)

    Also what’s with the velocity? It seems like there is either too much friction, or he was too afraid to show us that it wasn’t working right (he didn’t move much during the replay.) Nothing worse than a bad asteroids clone without REAL 2D velocity tracking…

  11. delta says:

    Didn’t the “real” Asteroids have more than 8 possible angles for the ship? It’s probably because of the bitmap-approach, but it seems to disturb the gameplay…

  12. 8051 says:

    @Mikey

    The Atari 400/800 had custom graphics hardware.

  13. tomas says:

    all of you people bitching about how limited the atmega platform is, take a deep breath. feel better now?

  14. RadBrad says:

    Great project – thanks for sharing!

    Brad

  15. macona says:

    I got my hackvision last week, i think. Need to find a serial cable now…

  16. Agent420 says:

    I’m an avr guy at heart. As such, I think these projects are great how they push the video capabilities of the platform.

    That said, the Propeller is certainly the architecture to use for uc based video projects.

  17. Ford says:

    I hate to be the one to do this, but I just spent way too long trying to figure out the sentence, “Features that make Asteroids well, Asteroids include…”

    A comma before ‘well’ and another comma after the second ‘Asteroids’ would make it more clear what you’re going for there.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93,959 other followers