Sunday, July 19, 2009

Emergent AI in Fleets


Kind of skimming the top of the Curated Internet today, but I saw this article on how the AI in the game AI War: Fleet Command. works. The title of the game is apparently to make up for the game's weird graphics, but the article from one of the game's designers may be very interesting to those of you currently developing games; looking at fleet command from a bottom-up approach rather than an entirely top-down command path.

Article here.

13 comments:

Ruby Tenneco said...

Woah! That sounds amazing.

Litcube said...

If I had sex for everytime I heard a developer boast about a developing feature and how it was so different from other dude's features, and how it was going to change gameplay, and in the end, once the game was released, really, you would have never known that this revolutionary feature was ever implemented had this dude not bragged his shit off, because it plays just like any other game in its genre, I'd have like 100 fucking babies, dudes.

Litcube said...

Chris Taylor, Warren Spector. Two examples of these types of dudes.

Litcube said...

Also Microsoft.

Litcube said...

And I will probably play this game when it's released. It looks neat. I enjoyed the link. Thank you, Mr. Pony. I enjoyed it. <3

Mr. Pony said...

I know what you mean, dude. The breaking plywood aspect of Force Unleashed was kind of neat, but never did a thing for gameplay.

This thing reminded me of something, though--I read this article (that I can't find now) about a software company called Massive that developed a system for managing huge groups of animated characters for the battle scenes in LOTR: The Two Towers. We've talked about this before, I think--how a bottom-up approach can lead to realistic and useful emergent behavior (which, in the case of LOTR, was characters running away when they were in too much danger). (This is what Massive is doing now with their software.)

There's also this.

Forgive me if we've covered all this before. The blog search blows, and the internet has destroyed my memory.

Galspanic said...

Turns out those dudes weren't (wisely) running away, but going around the other side of the map, because the AI calculated it was faster to run around back and under the map to get to the bad guys, as opposed to running directly toward them. You see, those dudes were in the tail end of the group.

Mr. Pony said...

That's not useful behavior!

Christopher M. Park said...

Skepticism is healthy, but bear in mind that this is a game that is already out (has been for two months). So you can play the demo for yourself and see whether you think it stacks up or not. Thanks for taking a look at the game, anyway. :)

Litcube said...

Christopher M. Park, I will do so, and will report back here.

Christopher M. Park said...

Awesome, hope you enjoy it. Our reviews so far have called the AI some of the best around, but I'm always interested to hear what players (or potential players) think. Unlike some of the other examples you cite, I try not to make idle boasts. That has a way of coming back to bite one in the ass. ;)

Litcube said...

So true. I'm installing now. Mr. Pony posted your article on here because I'm developing a little strategy game myself (http://piecesofthings.blogspot.com/2009/05/this-is-game-i-am-making.html), and thought I might find your stuff an insightful read. However, you can tell I'm a jaded customer. That said, I should lend a more sensitive ear to indie devs.

Christopher M. Park said...

I checked out your video, that's quite cool. I really like the attention to detail you already have with things like the fighters landing in the bays and disappearing, and even the destruction animations with all the little explosions for the buildings you destroy. I had a bit of trouble following some of the formations(?) stuff in the larger black view, but that's just a factor of it being beta and me coming to it blind.

It looks like you've got a lot of promising ideas, there -- and hey, at the very end there I see you are coding in C# (possibly XNA?), so that's very cool. Nice to meet another C#-based indie game developer. I wrote another article a while back on my blog (it's under the programming category) about optimizing huge numbers of ships in C#. You might find it helpful, or maybe you've already figured all that out, anyway. It's just observations I had after coding AI War.

With the style of AI that I coded, I really think it's the sort of thing you can try easily and then discard if you don't like it. I'd really love to see other RTS developers take those sorts of ideas and run with them in a bit of a different direction. One of the key benefits to the sort of AI I was working on is how quick it was for me to code (just days to have an early working version that was almost as good as a lot of other RTS games' end states), and how easy it is to maintain and extend (thus resulting in a better end AI). You might not like the asymmetrical nature of the AI in my game in the context of a (presumably) pvp RTS game like yours, but that's not inherent to the tactical AI I developed.

If you like the look of my methods and think they might have relevance for your project, I'm always happy to discuss anything and everything, so just feel free to shoot me an email. If not, that's cool too, I don't think there's one right answer.

The tricky thing with gauging the quality of any AI in an RTS game is that all AI looks basically the same when you are first starting out. Usually it seems pretty good to me, just because I don't know what I'm doing in that game. Then when I get good at the game, suddenly it becomes apparent just how much the AI sucks. The reviewers and players who had praised the AI in AI War had spent weeks evaluating it before passing judgment, playing a couple of full campaigns (12+ hours each), but I don't expect everyone to sink that kind of time into trying it out.

The tutorials are a good place to start just so that you know how to play the game, but the AI is severely crippled and sometimes nonexistent during that so that you can learn the basics of the game. The best way to see the AI in play during the demo is to fire up a campaign on difficulty 7 or so. It will let you play an hour in that mode during the demo, and that's plenty of time to see some of the tactics the AI uses when you attack them or they attack you. A lot of the cleverness of the AI still won't be apparent, there's just no way around that in any RTS, but you should be able to get the general idea and at least see that it's better than average.

If you want to see how the AI attacks with large numbers of ships, you can crank up the handicap on the AI to 300% to give it 3x larger waves, or use the Double Waves AI modifier or something. Normally those sorts of larger waves don't appear until later in the game, when you are more established, but if you crank up certain settings like that you can see it in practice earlier on in.

Like you, I was pretty disappointed with most of the Force Unleashed game. I was really pleased with the recent Red Faction, though, so that was nice. I knew that people would think I was just giving empty hype when I talked about my game, so that's why I didn't write any articles or do any marketing whatsoever until the game was already out and playable. The proof is invariably in the pudding. :)

Good talking to you!