18 Mar

More generated game content

Shmup Pixel Craft Generator

Shmup Pixel Craft Generator is another random sprite generator that is quite similar to Richard’s Evolving Sprite Tool from the last installment. SPCG too gives a sheet of sprites that you can pick from. The sprites make me think of Xevious, they have the feel of ancient space ships.

The author mentions Dave Bollinger’s Pixel Space Ships as his inspiration. Bollinger’s Pixel Robots was featured in the last installment as well.

Explosion generators

There are very many products for generating various effects by using a particle system. However, many of those products are very expensive as they are aimed at film and game industry instead of a hobbyist. Here are some alternatives.

ExGen is a commercial product but with a much nicer price (less than your average game). It is very feature rich, has a nice GUI and even exports as AVI.

The Explosion Graphics Generator or EGG is a very customizable particle system that uses a scripting language. It is free.

Explogen is similar to ExGen only that it is not as feature rich. It’s still worth checking out as it is free.

Positech Games has a free, unnamed generator as well. The page includes sheets of sprites so you don’t even have to download the software.

This blog writes about lhfire, a tool for generating particle effects for a Quake mod. I haven’t tested this myself but it should be good and also free.

09 Mar

Dev Stories from the Past

A bit of nostalgy can never hurt anyone. To me, weird tales about old software are a source of inspiration — they are essentially war stories for nerds. Here are some cool software stories from the past told by the developers themselves.

Donkey Kong and Me

The aptly named DadHacker writes about his past at Atari Corp. and more specifically about his experiences on porting the Donkey Kong coin-op on Atari. Includes gory descriptions of 8-bit graphics modes.

… most of the game sources I saw in the consumer division were crap, just absolute garbage: almost no comments, no insight as to what was going on, just pages of LDA/STA/ADD and alphabet soup, and maybe the occasional label that was meaningful. But otherwise, totally unmaintainable code.

Sounds familiar…

Tim Follin Interview about Video Game Music

Here is a great video interview with Tim Follin, a composer of game music on the Commodore 64, Atari ST and many other platforms. Wikipedia has a surprisingly extensive biography but the below video has the same information told much better.

Be sure to watch the second part as well.

Macintosh Stories

The development of the Apple Macintosh is the source of many mythical stories. This site dedicated to Macintosh folklore contains probably most of them. I like the fact there is a lot of stories about both the people and the inner workings of the Mac.

Llamasoft

Jeff Minter is a legendary character with the distinctive style of his games. Personally, Minter is in my all time Top 5. One of my first memories about computers is not understanding Colourspace at all back when I was about 8. Below is a really interesting and funny presentation by the man itself including game footage from his old games (I think the presentation is promotion for his latest effort, Space Giraffe). He has written an extensive history of his company Llamasoft.

An Interview with Rob Northen

Rob Northen was responsible for copy protecting many games on the Amiga and Atari ST platforms. Considering publisher giants like Ocean, Microprose and US Gold used his services, I’d say a majority of games used a version of his protection. This interview gives some insight into how he came up with his software Copylock and how it worked.

22 Feb

Generating game content

Part 2 of this series »

If you can’t draw graphics or create sounds for your games, here are a few interesting tools I came across recently that can help you.

sfxr

sfxr generates random sound effects such as explosions, sounds for jumping and so on. The sounds are nice and crisp and you can easily tweak a randomly generated sound to suit your needs better. A nice feature is that you can click on sound types to generate a sound for common actions in games.

Pixel Robots & Invader Fractal

Pixel Robots generates random sprites that resemble robots (well, duh). It’s a Java applet (made with Processing) so you can (or, have to) run it in your web browser. Hence, it is not too convenient to use for pure sprite generation purposes – but it is quite nice eye candy.

The author mentions the Invader Fractal as his inspiration. It is a quite similar thing, in that it generates a sheet of tiny sprites and runs in browser (it’s a Flash applet).

Both generators are quite nice in that their authors give good insight how the programs generate the sprites.

Richard’s Evolving Sprite Tool

I saved the best for last. Richard’s Evolving Sprite Tool, as the name implies, evolves sprites. The main idea is that the program generates a grid of mutated sprites and you can choose the one that looks good. The selected sprite then spawns mutated offspring. This continues until you decide the sprite is good enough. On the left, there’s an example of an evolved and hand-colored sprite (grabbed from the Retro Remakes forum thread).

It is also much more of a tool than the two previous generators, the user can edit the sprites inside the program. After the user has edited a sprite, it can be evolved further. Very nice if you’re short on inspiration.

Next thing Richard needs to do is to add a way to colorize and animate the lovely sprites.

kometbombNote: Since this tool has gone AWOL, here’s something similar: Retro Avatar generator. For example, the avatar created from my name looks like what you see on the left (cute!).

21 Feb

Awesome games that are also free

Here is yet another list of free games considered awesome by the majority of this blog’s writers (me). As you can see, my taste in games is quite retro.

Cave Story (D?kutsu monogatari, ????)

Note: The author of Cave Story has requested people to stop distributing the game, this is because is is to be expected to be available on WiiWare (I hope the game will not be exclusive to Wii gamers). Here’s one such rumor.

Try if you like: Megaman 2, Metroid – any good NES game that defined your childhood

Here is a game that is on every free games list and for a reason. Cave Story feels and looks like a NES game that was updated for a SNES release. The graphics are simple and sometimes blocky – but intentionally so. Similarly, the music is something you would hear in a NES game. In a good NES game. I still find myself humming the catchy tunes even though I finished the game a while ago.

The basic game is about making a little guy run, jump and shoot. There are a variety of weapons, some weapon choices even alter the game story. There even is simple leveling up, some enemies drop crystals that make your current weapon more powerful.

Best of all, there clearly has been huge effort in making the game more than a retro run-and-gun game. There actually is a good, long story about cute creatures that need your help. The levels are huge and varied: there even is a side-scrolling level. Another level twists the standard game mechanics as you need to negotiate a flooded area with vortices that usually pull you into unsurprisingly lethal spikes.

There also are memorable boss fights including one with a boss larger than the screen. Now that I mentioned it, the game is simply memorable. There are too many things to tell about this game. Too bad the game is free because it clearly is worth money.

The game is available at least for PC, Mac and GP2X.

Rated: Awesome+

OpenTTD

Try if you like: SimCity and other building games, trains in general

Transport Tycoon probably is the game that I have spent the most time with, ever. It’s basically about tiny trains hauling things from A to B, then hauling things from B to C.

Sounds boring. Why is it so awesome?

Because there is a ton of things to try to make your transport empire make more money. You could build a simple track from place A to B and then another track from C to D. But if you’re smart, you’ll build a whole railway system and connect satellite stations to it – just like it is done in the real world. Then, to make trains smarter, you’ll add signals, build more efficient stations and update your old routes to monorails and so on.

I think the defining factor that makes OpenTTD so fun is that it is actually you who builds all these things. For example, in some other simple game you could select between a few station types – each with their own cost and efficiency. In OpenTTD, you have exactly one station type. What makes a station efficient is how you connect the rails to it, how many platforms it has and do slower trains clog up the whole system. To give some perspective, here is the game manual on stations.

There also are airplanes, ships and trucks but they’re rubbish.

OpenTTD is ported on many systems as it is open source. There even is a Nintendo DS port.

Rated: TOOT TOOT

The Ur-Quan Masters (aka. Star Control 2)

Try if you like: Any scifi game

Star Control 2 is probably one of the most loved games from the early 1990s. It combines exactly right amounts of adventure, action, exploration and humor. The game is about you, the spaceship captain, trying to free Earth and the known universe from the Ur-Quan (tentacled slavemasters).

The gameplay consists of a top-down view of your ship. The ship is controlled by rotating and thrusting – nothing new since Spacewar or Asteroids. The controls remain the same whether the ship was in hyperspace, traveling for hundreds of light years, and during close encounters with enemies, i.e. dogfighting to death while orbiting a planet.

When your ship is in hyperspace, you can travel between stars. Every star has planets orbiting it, most of the game features you launching an exploratory ship down on the planets and collecting minerals and biological samples. The things you find act as money: at Earth you can trade minerals and other stuff to fuel, technology, crew and fighters. The biological samples can be traded for new technology when you come across a certain alien race.

Some stars are the homeworlds of alien races – some friendly, some less friendly. When meeting an alien, you will converse with them using different bits of dialogue, similarly to most adventure games in general. You will often get information where to find more alien races and sometimes you’ll get a quest to complete. Sometimes, you’ll be able to avoid battles if you are smart when conversing with the aliens. It is during these encounters you will get the most laughs.

The presentation is nothing short of awesome. Every race you meet has its own theme music, animated graphics, voice acting and even font for the captions.

Rated: AWESOME-666

11 Jul

Hardware-accelerated 2D collision detection in OpenGL

NB: Here is a better post about the below algorithm. Includes source code.

The idea

Did you know you can do pixel accurate collision detection using the OpenGL stencil buffer and occlusion queries? I got this idea while working on a 2D/3D game engine (think of a side-scroller but with 3D objects).

The idea is actually very similar to how you do collision checking on most 8-bit computers and consoles: when drawing the sprites on screen, the graphics chip automatically keeps track if it drew a pixel on something that was already there. OpenGL doesn’t do that by default (especially because this is not a 3D method) but we can fake it. This is how I do it:

  1. Each model has it’s bounding box which is translated and rotated with the object

  2. Each potential collision between two objects is checked:

    1. Project each corner of the bounding box on the screen plane (gluProject()). You can project all the object vertices if you want more accuracy

    2. Get the smallest rectangle that fits around the projected points

    3. Using this rectangle check if the objects are anywhere near each other, i.e. check if the rectangles overlap. If the rectangles do overlap:

      1. Use the first object to draw a stencil shape (i.e. use the same drawing code you use to draw the object on the screen but enable GL_STENCIL_TEST and put the stencil function in the GL_ALWAYS mode). You need to clear the stencil buffer, I do this with the scissor area set so I clear just the needed area.

      2. Use the second object to do an occlusion query using the stencil – draw only if the stencil is set (again, reuse the code for drawing the object in general but enable stencil test and start the occlusion query before drawing).

      3. The objects collide if there are any pixels drawn, i.e. the objects shared some pixels and the query returns a non-zero value

  3. Draw the scene, next frame etc.

(Text on yellow is what I’m talking about here)

Discussion and improvements


Now, this isn’t exactly a fast technique and you probably will have good results with normal multiple bounding box/rectangle checking even if that isn’t as accurate as this method. However, this should work with anything you can draw on the screen with OpenGL, including alpha textures (i.e. 2D sprites) and you don’t need to keep track of any extra bounding boxes.

One thing I like is that you automatically get a bit more sophisticated collision checking: even if this method is inherently 2D, you can use the far and near clipping planes to make the objects not collide if an object is actually behind another object. If you use perspective, you can stop the player colliding with a floor that stretches to infinity (which of course when projected in 2D only goes from the bottom of the screen to the middle of the screen) – just draw the part of the floor that is at the same the depth as the player.

You can also optimize this a lot. In my case, I get more speed using the rectangle check above and limiting collisions (e.g. no check between two enemies, checking only player and landscape collisions, testing only the rectangle if it is a static square tile etc.). I also don’t draw the stencil every time I check an object pair and obviously cache rects if the orientation of the object doesn’t change much.

Not much examples here but you should get this working in a few days by just googling for occlusion queries, stencil buffer and OpenGL (assuming you already do know how to draw stuff on screen and realize how the object translation and rotation works etc.). There are a ton of tutorials on the Net about drawing reflections and whatnot using stencil, which is precisely what we do here, only that we don’t show the reflection and only count the pixels.

Links