Developer Blog: Making the AI Work
Posted on 11th Aug 2010 at 10:31 by Mode 7 with 10 comments
I'm pleased with myself today.
The pathfinding in FS has always been atrocious – experienced players pretty much have to use shift all the time to bypass it. It’s a pain in the ass. Here’s a great example of it going wrong, below.
The reason pathfinding sucks so much is that my algorithm for it is terrible – it splits the levels up into a grid, each square about the size of a unit. It then checks each square for obstacles. It’s a really innaccurate representation of the level.
This weekend I was reading up on advanced pathfinding stuff, and considering using some kind of Navmesh with movement polygons. Then I was hit by a flash of inspiration – the only thing that matters in FS is corners. If you ever want to make a path in FS, you only ever use the corners to get there – the only points I need in my nav-graph are the corners! Here’s my code for identifying the corners in action...
As you’ll know if you’ve written A* before, the algorithm needs to know how all the navigation nodes are connected. Here’s the same level with that info included...
The nav-graph for that level is pretty simple though – here’s a more normal one, just so you know how complex things can be for the AI in Frozen Synapse...
Yikes. Lucky computers are fast at this sort of thing! Here’s the same level that the initial algorithm got wrong, but with the new algo I knocked up this morning...
Perfect. I am now a happy developer.
Now, back to the Q&A - if you have any questions you'd like to pit to us then just drop them in the comments and we'll address them next week!
Q: As a frothing fan of Frozen Synapse who, unfortunately, has almost no friends who play PC games, what can I do to help promote this game? - Wazzle
A: Thanks very much for offering to help! And we're glad about the frothing.
There are three major things fans can do to help us spread the word, the first of which is simply to recommend the game to friends We know a lot of people have done this and we greatly appreciate it!
Second, you can blog, tweet, post or talk about the game on the internet. Make sure all of your internet friends and acquaintances know about the game. Even just one personal blog post can make a huge difference in terms of spreading the word about the game.
After that, why not mail major sites and blogs about it? If you can see that your favourite site hasn't covered the game yet, please do send them a short polite email asking them to check it out. We still haven't managed to get any coverage on some of the big US sites, like Kotaku and Destructoid, so if you're active in those communities that could be a big help.
Q: [Regarding Mode7's post about testing] Would computer science students really be classed as 'newbies'? They're all likely to be gamers. I suppose it's easier because you don't have to explain basics, and they'll have more ideas of what to expect units to do, but surely you'd garner more from actual non-gamers? - delriogw
A: By newbies, I simply meant, "people who have never played the game before".
We always show our games to non-gamers during development and see how they react, but the information you get from people who are actually likely to be buying your game versus people way outside your intended demographic is always much more practically useful. A few testers happened to be big strategy game fans, and that was completely invaluable; equally some other people weren't really into the genre, but were still "gamers", so that provided another different slant.
Having said all that, taking our game to Nottingham Gamecity and showing it to the general public (people who, literally, wandered in off the street) was another completely different experience and also very handy.
Paul Taylor is the Joint Managing Director of Mode 7 Games, makers of Frozen Synapse, an upcoming PC strategy game.