Crimsonland AI

Our third assignment was a move away from c++ and into lua, which is primarily a scripting language used commonly in games for its ability to be easily changed without compiling the main codebase. The engine we had to use was called Love2d, a 2D open source engine written in lua. The benefits of this particular engine is that it does all the heavy lifting underneath, calling upon OpenGL without the hassles that come with it when youre using it in C++. There is also a thriving community of Love2d game developers, as found in their forum.

The school provided us with a game ready framework and with it all the necessary code to display our hero and zombie sprites on screen. It was then our job to code the lua in amazing ways to simulate AI, which could range from the standard terminator (seek) AI and for most this was the passing grade. I on the other hand really enjoy AI coding in games, so this was a opportunity for me to do a fair bit of research on the topic. What I came up with was the standard terminator AI, an alternate Wander AI which would randomly choose points and then seek towards, an refined wander which would apply a slight push force tangential to the zombies facing direction velocity. A path finding AI and the piece de resistance, a swarm AI, which utilizes function pointers.

As this code is easily viewed and that as I move onto second year, the following first years could potentially search and find this site. I have decided not to post the full source code or the game as download. Instead, I will gather some time to implement the behaviours in video so you can see what actually happens. The path finding and swarm is quite cool to watch.

Heres a few screenies showing the swarm and path finding in action.

crimson ai swarm ingame crimson ai pathfinding ingame


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: