Tuesday, 17 December 2013

A Belated Pre-Christmas Update

This will be my last update for December and 2013, after which I must go forth and deal with some other affairs and life commitments. By that I mean, my friends and family will undoubtedly be dragging me away from the laptop next week so that I can fully focus on the upcoming Christmas festivities. After all, it is the time to be jolly, and the dungeon is no place for that! (or is it?)
I know that the majority of my fans are game developers/programmers themselves so I thought I'd start with mentioning an amazing event I participated in last weekend: The Ludum Dare Game Jam. Sorry if you are expecting TinyKeep specific info, if so please skip to the next section!

48 Hours of Stress and Toil

I've mentioned Game Jams before, but the Ludum Dare in particular is something really special. Once every few months, participants all over the world try to create a game based on a random theme in exactly 48 hours (or 72 for the more relaxed team jam). They then spend 3 weeks playing and rating each others games, and the highest rated entry is the winner. There are no prizes for winning, except the warm fuzzy feeling that you've made something truly awesome that everyone can enjoy.
During the 48 hour period, I had around 6 hours sleep and spent the rest of the time hacking away at my poor excuse for a game (a Wing Commander clone). I think I was a little too ambitious, I tried to do my own low poly 3D modelling as well as getting some voice actor friends to help. Here's what I ended up with:

You can actually have a go on the Ludum Dare website. If you have an account, please rate and comment! If I somehow make it as a finalist, that will hopefully get some exposure for my work and TinyKeep, which would be amazing!
I also wrote a blog post on my top 6 favourite entries in the competition. These are really amazing games and I wish them all the luck in the coming weeks. If you have the time, you should definitely give them a go!
For those programmers considering getting into game development, why not give the next Ludum Dare a try? I promise you won't regret it!
Now that the Ludum Dare is over and done with, I've found some new motivation to work on TinyKeep, and my focus over the next month or so is AI. This is the work that you've all been patiently waiting for, and I really want to do justice to it! This is also the time where I'll be bringing more of Ben's skills and talent in, after all many of the behaviours for TinyKeep were based on his initial ideas all those years ago. Will 2014 be the year of the dungeon?

A Brief Look at TinyKeep's Collider System

Coming off the back of the Ludum Dare, I'm in an especially technical mood so today I want to talk about the techniques I'm using to enable TinyKeep's monsters to sense the surrounding environment. This is very important to build complex behaviours later on. Remember, TinyKeep is all about emergent behaviour, so rather than planning every single move at the programming stage, I want the monsters to be affected by the environment in new and surprising ways. Well, that's the theory anyway!
In a conventional game, you'd use a pathfinding algorithm to allow the monsters to intelligently navigate around the level. For TinyKeep, we found that lead to unnatural behaviour, it was almost as if the monsters memorized the dungeon and would be able to perfectly find its way around. Also, this technique falls down when in a dynamic environment. For example, all our furniture is moveable by physics, so we'd have to update the path every time this occurs. Instead, we decided to use a combination of line of sight, attractors and deflectors, flocking, smells, sound and light sensors to build a picture of the local area and let the monster make a decision based on these observations. You can see a tiny bit of this in action in our Monster AI series I did a long time ago.
Since then, we've moved from raycasting to collision boxes, as we've found it's more efficient to use Unity's physics system to do all the hard work for us when it comes to detecting nearby objects.
Take this Skeleton for example:


For AI, the most important colliders are the Strafe and Targeting sensors. Strafe sensors allow the monster to detect objects to its side, like a wall, a doorway arch or another monster. It can then use this information to strafe away from an obstacle. Similarly, the Targeting sensor allows the monster to see what exactly is directly in front of them, so that it can jump over, attack or block it for example. These may seem like really simple concepts, but combine them with smell, light, line of sight and the different types of objects and obstacles available, as well as introduce a few more monsters into the mix, you end up with something looking totally realistic and fun to play against.
Imagine this situation, you are in a hall with barrels and columns everywhere and you see a roast chicken you'd like to eat. You wouldn't exactly stop and calculate the shortest most optimal path would you? Instead, you'd try to run directly towards it, while dodging and weaving between objects in your way. If you happen to come across a trap or some other dangerous thing, you'd deal with it there and then. AI should be reactive, and that is what we're trying to do with TinyKeep.

Have a Great Christmas!

That's all that I can muster for now, need to continue working hard on the game! Promises must be fulfilled :)


Huh? What are these?

No comments:

Post a Comment