Live data from Hacker News

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

news.ycombinator.com

31–40 of 89 posts

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

#32
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…

Splinter Cell also has cooldowns in some/most levels (like most stealth games), which is of course an absurd notion. A guard on a military base wouldn't back out of "DEFCON1" after two minutes just because the invader didn't show herself for that long.

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

#33
post #24

Earlier quoted context omitted.

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.

Considering how many successful games are released targeting a niche market, there's probably a pretty sizable niche market of 'better than average players' that some studio could take advantage of.

Market size is only half the equation, the other half is the cost to develop the feature. As methods and technology improve, the cost to make a smart AI for a complex game system should decrease. As the cost decreases, you need less of the overall gaming market to make a return. Might just be a matter of time before somebody takes a gamble on a tough AI, has a huge success, and then everyone starts to emulate it.

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

#34
post #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.

What talk is that? Last time I tried a Civ game, I was underwhelmed. That AI just isn't fun to play against, to me. And the games run too long to play against humans in a reasonable timeframe on normal settings. I'd love to play Civ with competitive AIs.

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

#36
post #24

Earlier quoted context omitted.

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.

> Nobody is going to invest the resources into a real AI just for the hardest difficulty modes.

Which is really sad because "hard" difficulties in most games just mean that you have less health and NPCs do more damage or their "cheat factors" are turned to 11. They're still the same stupid NPCs as on "easy", but now they just headshot you behind cover and have zero recoil / perfect accuracy. It's technically difficult but not really fun.

One of the most obvious examples of this is GTA 5 where all NPCs are equally dumb, but "harder NPCs" just mean that they tank huge amounts of damage, while they have very little aim delay and essentially perfect accuracy. Due to various bugs in the game they'll often shoot through walls or even entire buildings: technically hard, but not fun.

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

#37
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 ma…

[deleted]

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

#38

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…

Fun and challenging is key.

One thing about predictable AI's that irks me is once an optimal strategy is discovered, variance from that strategy is no longer rewarded. This creates a tactical endgame I wish didn't exist.

For instance, I played a lot of Gears of War Horde mode and difficulty is increased by increasing health, accuracy, and damage of the enemies. And the same strategy will win over and over. That's great for a grind-y game like Gears 4 Horde, but beyond a certain level it becomes a race to build an automated killing machine that once solved is no longer engaging.

Once you build a wall of turrets, why in god's name would an enemy keep rushing? Just the smallest bit of learning would go so far. The game would be way harder, but also WAY more interesting. Playing on normal where you actually have to hunt the enemy instead of holing up and waiting for them to rush your lane would have been awesome!

That's just one example in one game that I'm very familiar with, but isn't a unique problem. Even in 2019 there is a lot of room to make a challenging and fun AI.

The trick is to make every match feel like you could lose, not like you can't win. AI/ML should figure out what makes close games close, and keep evolving the enemy's strategy to keep them close, not just their stats.

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

#39
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…

TA:Spring had these AIs that would exploit shit in a terribly annoying way. Like, you had ballistic projectiles that would take a while to arrive at the target, and your units would fire them. Well, the enemies had them too, except the AI would exploit its superior micro by firing off the projectiles at maximum range and maximum inbound velocity and then immediately shifting outbound.

You can't move your bloody units as fast as them so your units would fire at the place where they were 'going to be' within the range or at the place they were at the limit of the range.

Utterly infuriating as a player. I know it doesn't have to be that way, and the path could be closer to strategic decision making, but it's a funny example of one of those AI decisions that wasn't constrained in one way.

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

#40
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…

I'm not much of a chess player, but one thing I've wondered is whether the games against Chess AIs are interesting for good players. Do they feel exciting as though you were playing against a similarly skilled human player? And can you distinguish between an AI and a similarly skilled player very easily?
Post reply on HN