@Joe_Stead:

Looking forward to a day it nothing tomorrow

Joe Stead
Monthly Archives: January 2012
Random Map Generation

I’ve done my exam for this winter on Languages and their Compilers (which was surprisingly not bad), I’ve wrote a report on my Wireless Game controller project and I’ve applied for an internship in San Francisco! Now that I don’t have much to do (until lectures start tomorrow), I thought it’d be nice to work on something fun (rather than my project which desperately needs work, but I can finish that quite quickly now). I read a few posts about RPG games and how dungeons can be procedurally generated on the fly to offer a unique user experience, something you may find in roguelikes. That was pretty interesting, but I thought how simple it was, so I wondered how random maps are generated for RTS games, and games like Minecraft.

Initially I wanted to start off simple, so generate one fixed size map and leave it at that – no joining of parts or anything like that. I began to do a bit of research and found a nice page on noise generation, well, it was nice once I applied a nicer stylesheet to the page to remove that god awful background and make it easier to read.

After reading the article, I had a rough idea of how I could implement a simple 2D random map generator, so I began working on it. So far I’m using two textures (Grass and Water) and lighting them slightly differently to show a “random map”. It’s in its infancy at the moment and I do intend on adding things such as trees and what not as I generate the random generation algorithm more.

Creating an IRC bot in C#

Creating an IRC bot with some basic functionality may seem like a scary thought, you have to connect to connect to the server, join channels, and respond to commands. It isn’t as bad as you may think, once you learn the basics of the IRC protocol and some the basics of socket programming in C#, in fact it actually becomes extremely simple.

In this tutorial it will be a fairly static bot which responds to commands such as “!say message”, “!join #channel”, “!part”, and “!quit”. Anybody will be able to send these commands and the bot will respond regardless of who sends them. If you wish to add aditional security it is up to you to add that functionality in.

I will be using Visual Studio 2008 in this tutorial to complete the code, if you are a student you can receive a copy free from Microsoft Dreamspark or you can download Microsoft Visual C# Express Edition for free, both of which will work fine for this task.