Live data from Hacker News

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

news.ycombinator.com

11–20 of 89 posts

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

#11
post #8
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…

I'm curious about that. Keeping it dumb of course makes sense for adversarial uses - if the AI is you enemy. But I could imagine there are scenarios where the AI is on your side - e.g., as a support player, NPC or pet. Would a smarter approach be more useful in such a game?

If it's too smart on your side, wouldn't it do all the playing for you? For example, you enter a room full of enemies and your AI partner kills them all the second they come into view. What's the point of playing, then?

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

#12
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 moves.

He later added "personalities" to the AI, where each one would try their own sets of strategies and attributes. He continued to make it better and better.

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

#13
IIRC, the developers of Final Fantasy XII said in an interview that the Gambit system that the player uses to set the behavior of their computer controlled party members is basically just a GUI representing the same logical structure used behind the scenes for enemy behavior.

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

#15
One big issue I can imagine with applying ML is that most games are buggy and poorly balanced, but the majority of your players arent optimizing machines (outside of speedrunners), and will follow “natural” paths, so its fine.

The only kinds of games that see enough time and resources to the same issues that would trap an AI in some optimal but horribly boring strategy (or rather, “unfair” strategy) would be competitive multiplayer games — and even then, only those that can classify for e-sports. That is, those games who already treat players (or rather, the wetware community optimization machine) the same as they would treat your ML AI.

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

#16
post #8
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…

I'm curious about that. Keeping it dumb of course makes sense for adversarial uses - if the AI is you enemy. But I could imagine there are scenarios where the AI is on your side - e.g., as a support player, NPC or pet. Would a smarter approach be more useful in such a game?

[deleted]

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

#17
post #11
post #8

Earlier quoted context omitted.

I'm curious about that. Keeping it dumb of course makes sense for adversarial uses - if the AI is you enemy. But I could imagine there are scenarios where the AI is on your side - e.g., as a support player, NPC or pet. Would a smarter approach be more useful in such a game?

If it's too smart on your side, wouldn't it do all the playing for you? For example, you enter a room full of enemies and your AI partner kills them all the second they come into view. What's the point of playing, then?

True - but that would require that would require that the AI partner is both overpowered (they can kill the whole room without risking to take damage) and completely ignores me.

maybe an alternative appraoch could be to have an AI that tries to figure out what you're trying to do - and then help you with it.

E.g., if the two of you have frequently witnessed a certain enemy launching an attack that can only be deflected by a particular shield spell, an AI healer could "learn" to cast that spell in advance when they see such an enemy.

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

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

You should also prioritise credible behaviour that will keep a gamer immersed. If you can achieve this with simple rules / tables etc that might be better than a full-blown AI.

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

#19

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?

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

#20

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…

> My friend was working on a chess variant for years, and it was very easy for him to make the AI be very, very good but that isn't fun at all! It would always win.

Oh yeah, I can relate to that experience. My chess app had an "undo turn" button, where you could jump back an arbitrary number of turns. The most frustrating thing wasn't the AI winning, but realising that the AI had already won several turns ago and you're just a dead man walking, with all remaining options leading to failure.

I never hated A* as much as during those games.

Post reply on HN