Raven Deathmatch

I've had a particular AI book sitting on my shelves for a few years now, and whilst I made use of the chapters on steering behaviours before, I never got around to tackling the later chapters which covers things like goal driven behaviour, fuzzy logic & perceptual modelling. The book puts them together together into a death match game called Raven, and I thought that it was about time I gave making my own version of this a go.

Download Raven Deathmatch v0.1 for Windows

What you get if you do download is you'll see a few coloured bots navigating around a basic arena looking for better weapons, seeking health and armour as they need it, and shooting anything they can see (with the weapon they deem most appropriate). Here are the sprites for those weapons, you may notice I might have taken inspiration from a rather classic death match game for some of them.

So You can sit and watch the bots kill each other and see who RNJesus favours best or you can click on a bot and take control of them to enter the fight yourself!

There's nothing particularly new or innovative in the design aspects of this experiment, it's more of a test-bed of AI techniques, which is why it's not really been polished beyond the proof of concept stage, at least not yet. The main aspects of said AI is a goal based behaviour system; including evaluation of the value of each potential goal, arbitration between them, as well as a basic navigation graph, path planning and steering behaviours to fulfil those goals. There is also some perceptual modelling and short term memory for each of the agents which feeds into the goal based behaviour.

Shifting from the very explicitly coded example C++ - most of the logic was hard coded into particular files - to a more data driven / configurable system for Unity was an interesting extra consideration, although less tricky than when porting the steering behaviour code to JavaScript! I found that using Scriptable Objects saved as asset files worked well as configuration system and is a technique I'll probably be continuing to use for personal projects. It allows you to easily configure things - like curves for projectile speed over lifetime using AnimationCurves - which would be a bit more tricky if you were using something like JSON for your config. If you're feeling fancy you can also do some pretty funky stuff with editor scripting in conjunction with scriptable objects should you feel so inclined!

The book used Fuzzy Logic system for weapon selection, however having reviewed the sections on Fuzzy Logic, and then examined how one has to simplify the full blooded approach to get a well performing implementation, I came to the conclusion the AI would be better off using desirability functions taking the various considerations as inputs instead, and that the author probably used Fuzzy Logic for this so he had an example to demostrate the technique, rather than it being the best choice for that particular task.

Now that I've dug it up what I did manage in the couple of months I used my spare time to on work on it, I may go back and polish it a little more. Perhaps do some optimisation work so that I can export to WebGL and put it up on the site rather than offering a zip download.