Although my posts have been sparse lately, I've been very busy on the game development end. It's not development for my game, but I certainly don't mind. As I mentioned in my earlier post, I volunteered/was-inducted to rewrite the collision detection system for the game creation system, Stencyl. I've been working on it on a here-and-there basis for the last couple of months, but now that Membrane Massacre is completed, I decided to focus entirely on this task and get it finished.
I keep a development blog on the Stencyl website to detail my Stencyl-related developments. I figured the details I discussed there were a little too nitty-gritty for you folks to want to digest; however the blog is publicly-accessible if you'd like to give it a look-see. [smile]
For kicks, and since I haven't posted a screenshot in a while, here's my latest accomplishment:
This looks simple enough, but the collision detection system is flexible enough to work for platformers, RPGs, racing games, or God knows what else future users will be able to think up. It's been both a challenge and a fascinating experience to need to write a system in such a manner that it needs to cover so many bases. Bounding shapes seem to work just fine now, so it's a matter of testing the pixel-based detection before I get to call it a day. Eliwood is trying to sucker me into writing the entire AI/logic for a Koopas while I'm here, too. [grin]
For years now I'd hear the term "perlin noise" tossed around, and I've always been curious about what it was, and how it worked. However, I had always avoided looking into it since I figured it'd be somesort of heavily math intensive algorithm that would be over my head. Like my previous thoughts about A* pathfinding, I was pleasantly wrong. [smile]
After looking over the obligatory Wikipedia entry, I came across this helpful page about Perlin Noise. I used this to toss together a small application that generates images/textures using Perlin noise, and allows for the tweaking of several settings. I know I'll definitely be using this to generate some heightmaps when I delve further into 3D graphics programming.
Download "Perlin Noise Image Generator" (~6kb) (requires .NET Framework 2.0)
Perlin noise is excessively cool. The idea is simple enough, but its implications in game development are virtually unlimited. I really wish I had learned about this while I was still writing Membrane Massacre -- I could have generated some really interesting levels with it. Still, I can't think of any future project of mine that won't be able to benefit from the inclusion (in some manner) of Perlin noise.
Perlin Noise 101
For those who aren't familiar with Perlin noise: the idea is to create several 'layers' of randomized data (be it in 1D, 2D, or nD), starting with one of low resolution and high amplitude (fluctuation between random values) down to one of high resolution and low amplitude. For example:
This image is of very low resolution, but the values of colour range all the way from 0 to 255 (black to full brightness). We keep on moving up, making bigger images with lower amplitude until we do the last one:
The last image is one of high resolution and low amplitude (ie. the values don't vary much from medium-brightness).
Combining these, we essentially making layers of randomness. The first image was the overall 'grand scheme' of the image, but if one was to zoom in, the last image provides the really-close low-level detail. Using a mountain as an example, we'd make the first image be the shape of that mountain's ridge-line if we were looking at it from very far away, yet the last image would be one were we are standing on the slopes of the mountain itself: the height variations are less blatant, but they are still there at that micro-level. And thus we have the end result:
In this, hopefully you see why this is so darn cool: nature uses this sort macro/micro randomization all over the place. And if nature uses it, then we sure as heck have a good excuse to use it in our games. [grin]