Live data from Hacker News

Ask HN: Game devs, what is the hardest part about designing an AI for your game?

news.ycombinator.com

21–30 of 89 posts

Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?

#21
post #7

Game AI is mostly pathfinding (which basically falls down to creating navigation meshes for levels), and very basic decision making skills, which is usually a weighted decision tree (e.g. if they're getting shot at, cover might be weighted at 80%, shooting back at 20%). You don't want to actually create something actually smart to fight, you want something with understandable, predictable logic for the player and som…

Depends on the game. The entire genre of strategy games could probably benefit from smarter AI. More so for 4X style games. Mostly, the current AIs act like players, but make terribly inefficient decisions that get 'balanced' at various difficulty levels by throwing more resources at them or other advantages. So the games vary between being absurdly easy, to being difficult simply because the AI cheats, and even then, it doesn't usually leverage its advantage well. As an alternative, people play against other players, but with long-running strategy games, this adds real life logistical problems. An AI that plays like a human, and can be adjusted for stronger or weaker play would be amazing for the 4X genre. Perhaps difficulty adjustments could even be reverse to giving the player 'cheats' or free resources on lower difficulties if that's easier than throttling the AI.

Outside of those games, I'd say any game with competitive multiplayer could benefit from smart human-like AI. Some people play games for a challenge. The unpredictability of other humans is most of the fun, whereas playing against a typical game AI is just a matter of figuring out how it works, where it fails, and then taking advantage of that failure repeatedly. Considering the market for competitive online games, there's likely a similar market for competitive AI games.

I suspect the real barrier that is that it's a lot cheaper and easier to sick players on one another than to make a challenging human-like AI.

Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?

#23

Making an AI that isn't "perfect", but rather it is fun and challenging to play against. My friend was working on a chess variant for years, and it was very easy for him to make the AI be very, very difficult but that isn't fun at all! It would always win. He then tried adding an element of randomness to it to dumb it down. But then the AI just looked perfect most of the time while occasionally making bizarrely dumb…

I'm curious if your friend's project is open-source at all, would love to see the implementation details of this?

It isn't open source, but you can still play it if you have Flash installed: http://www.kongregate.com/games/thegrandestine/chess-evolved...

Imagine chess but with 100+ different pieces and an element of collecting/upgrading pieces.

Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?

#24
post #7

Game AI is mostly pathfinding (which basically falls down to creating navigation meshes for levels), and very basic decision making skills, which is usually a weighted decision tree (e.g. if they're getting shot at, cover might be weighted at 80%, shooting back at 20%). You don't want to actually create something actually smart to fight, you want something with understandable, predictable logic for the player and som…

Do you think there is a class of players who don't want to feel clever for outsmarting a predictable AI?

Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?

#25
post #24
post #7

Game AI is mostly pathfinding (which basically falls down to creating navigation meshes for levels), and very basic decision making skills, which is usually a weighted decision tree (e.g. if they're getting shot at, cover might be weighted at 80%, shooting back at 20%). You don't want to actually create something actually smart to fight, you want something with understandable, predictable logic for the player and som…

Do you think there is a class of players who don't want to feel clever for outsmarting a predictable AI?

All players want to win. The level of difficulty is equal to the level of accomplishment, but games have to be made for the average rather than the exceptional, so many better than average players won't be challenged by the difficulty.

Nobody is going to invest the resources into a real AI just for the hardest difficulty modes. If it cannot be used on Easy/Normal, it simply isn't happening.

Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?

#27
post #7

Game AI is mostly pathfinding (which basically falls down to creating navigation meshes for levels), and very basic decision making skills, which is usually a weighted decision tree (e.g. if they're getting shot at, cover might be weighted at 80%, shooting back at 20%). You don't want to actually create something actually smart to fight, you want something with understandable, predictable logic for the player and som…

There are actually various anecdotes about game developers playtesting "smart AI" where playtesters came back with very negative impressions, because e.g. a couple NPCs giving suppressive fire while another group flanks you quietly felt to players like the NPCs were cheating.

I believe one of these anecdotes was about the AI in F.E.A.R. and their solution was to add very clear callouts to the NPCs whenever the NPC made a decision ("Flanking, cover me!"). I think FEAR also had the concept of a director AI which handed out "tickets" to NPCs for attacking the player; an NPC without a ticket couldn't attack the player, so this limited how many NPCs engaged simultaneously.

I remember AI in Jagged Alliance 2 frequently flanking you and at first that was very frustrating; the stock (1999) JA2 AI is much better than every newbie to the game. You really had to think tactically and think about your moves and approach to be successful in that game. If you just go in "guns blazing" the AI will outmaneuver and outgun you. AI in that game was sometimes quite adept with grenades and such as well.

Edit: Talk about FEAR AI, might/might not be related https://www.youtube.com/watch?v=BmOOrh5lq7o#t=1m44s

Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?

#28
post #7

Game AI is mostly pathfinding (which basically falls down to creating navigation meshes for levels), and very basic decision making skills, which is usually a weighted decision tree (e.g. if they're getting shot at, cover might be weighted at 80%, shooting back at 20%). You don't want to actually create something actually smart to fight, you want something with understandable, predictable logic for the player and som…

Please... head over to Paradox Interactive and seek to join their team if you're bummed out to a point of thinking that. (And you're welcome to link to this comment in your application.)

Their audience is basically desperate for a better AI that does better strategic and tactical thinking rather than pathfinding, weighted decision trees, and a couple of high level heuristics.

Here's what I and I'd gather many others would want instead: for the AI to go through the dev game logs, and perhaps even end user game logs, and then learn from what humans are doing, so they behave more like them. And then re-inject that into the game so it's something of a challenge to play without needing to give the AI some serious bonuses while playing.

As things stand the AI is so bad you can start as a purposely broken one province nation and still turn into a major power. [0]

And if you're thinking "no, the AI will trash them and they won't find it fun," here's a thought: right now, the AI is so bad that the only way to have some fun is to give it insanely large bonuses. But much like in a game of Go, as a player I'd much rather get those boosts myself to overcome a much stronger AI opponent.

The same holds for other 4X games, like Civ.

Playing Chess or Go against a computer used to suck. It no longer does thanks to how much better AI got.

[0]: https://www.youtube.com/watch?v=qJhyZ-9ktpo

Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?

#29
Watch the talk about Civilization's AI. Seriously, game AI does not need to use advanced ML techniques, and probably shouldn't if you want players to have fun. The trick is coming up with fast algorithms, with a semblance of personality to make it interesting. Difficulty is not required for the AI to be fun in most cases.

Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?

#30
post #9
post #7

Game AI is mostly pathfinding (which basically falls down to creating navigation meshes for levels), and very basic decision making skills, which is usually a weighted decision tree (e.g. if they're getting shot at, cover might be weighted at 80%, shooting back at 20%). You don't want to actually create something actually smart to fight, you want something with understandable, predictable logic for the player and som…

That reminds me of a lesson developer's learned when making a stealth game, Splinter Cell. Originally, when you were spotted the enemies would just try to shoot you, but tester feedback said that players didn't like getting shot out of nowhere. The devs added audible cues that you'd been found, like the guard yelling "Hey you!" before they started shooting. It turns out realistic AI behaviors aren't necessarily fun A…

Thanks for sharing this. It's a great illustration of why playtesting (and testing in general) what we think will work is always a good idea.
Post reply on HN