Live data from Hacker News

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

news.ycombinator.com

61–70 of 89 posts

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

#61

I think any game with strategy is going to have to use reinforcement learning to have any hopes of being understood by its players. Concerns around cheesing strategies can be mitigated for real time games using constraints and cheesing in turn based strategy games is a symptom that maybe the game you're working on isn't that strategic. Ultimately Chess, Go, Dota, Starcraft are compelling games to watch and play becau…

Thanks for your response, I had actually heard about Yuri before and was hoping you would respond to this post!

I have a lot of questions for you if you don't mind, maybe you don't want to answer any/all of them that's fine.

1. How do you handle constraining the AI such that it's enjoyable? If you read through the comments here you'll notice just about everyone is saying the hard part is not making a good AI but in making a fun AI. Do you know of any research in this area? most examples I see are all about making the best AI possible. It seems like it's really hard to find a good reward signal to use for "fun". Have you seen this [0,1] paper on learning from human preferences? does Yuri attempt to do something similar? It seems like it would be labor intensive for the play testers.

2. Does Yuri make use of imitation learning at all? I.E learning from lots of human data when it's available to bootstrap the learning process?

3. Do you let the game designers impose any structure on the AI? I.E. "I want three phases for the boss where he progressively gets more aggressive" or use RL just for certain small parts of the behavior? A well defined path finding algorithm with the RL deciding where the agent tries to go? stuff like that?

I have a ton of questions about the technical details side of Yuri too, what frameworks are you using, which RL algorithms etc etc, not sure if you are willing to share those or not.

[0] https://arxiv.org/abs/1706.03741 [1] https://blog.openai.com/deep-reinforcement-learning-from-hum...

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

#62
post #58

Earlier quoted context omitted.

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.

"Playing to Lose" : https://www.youtube.com/watch?v=IJcuQQ1eWWI Personal preferences aside, they specifically talk about how to make the game "fun". For example, they try to account for things like real-world leader's personalities. "Gandhi" shouldn't just attack his neighbors unprovoked, but maybe "Caesar" should. And why do the AIs even bother to ally/trade/help the player at all, since the player is the only enemy…

Interesting talk, but it really pretty much confirmed a lot of my assumptions about Civ AI. He pretty much admits that they are constrained on developer resources and AI code only makes of a small percentage of the game. Because of that, they have to make do with very naive assumptions about strategy. And because of that, they have to cheat to get the AI up to a level that's even considered fun.

At first I thought he seemed to be making a lot of false dichotomies, but really, he was saying, these are my only choices, given the overarching constraint on how much effort we can put into our AI. Basically, all of the AI decisions he talked about were small scale heuristics, with no ability to really look at the bigger picture, which is what the player is always doing when making small decisions.

And of course, personalities are a great idea, and not mutually exclusive with a strong AI. One thing I very much disagreed with was when he said an AI can roleplay, but a player wouldn't do that, the player just plays to win at all costs. But earlier on he even talked about one of the player types is people who play for a narrative. Those are roleplayers. So, especially at lower difficulty levels, it makes a lot of sense for the AI personalities to trump optimal play. But that doesn't mean you can't have a strong AI in general, that makes some limited sacrifices for the sake of fun.

Likewise with diplomacy. It isn't about making the game as difficult as possible. If that were the goal, you could just make the player lose when he loaded the game. It's about making it feel like you're on roughly even footing with your opponents, so that success has meaning. To that end, I would expect each empire to act in its own best interest, and therefore treat the player the same as it would any other opponent. It's also why diplomatic options need game mechanics to enforce them. As he pointed out, if there's no mechanic to stop a player from accepting money for peace, and then declaring war again, then there is no reason to every pay for peace. You should design these mechanics with player behavior in mind, and the AI should use them the same way players do. Think about how players behave with one another, make that fun, and then make the AI behave similarly. This wasn't possible given their constraints, but it's certainly possible in the more general sense.

As far as "making the game too hard isn't any fun" that's the problem. Too hard is subjective. What's too hard for one person is perfect for another, and way too easy for yet another. If anything, to please the maximum number of people, you'd have to write (or train) a very skilled AI that can compete with the brightest players. If you can do that, it should be much easier to tone it down or penalize it to make easier difficulties for the average and casual players.

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

#63
post #42

Earlier quoted context omitted.

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.

How does that fit into games like Dwarf Fortress where "fun" is in losing? Does winning count as achieving whatever goals the players set for themselves before reaching game-over?

Some players play DF with specific goals in mind. Others play in order to have a story like experience. In the latter case, the "fun" in losing is only "fun" if it creates a kind of dramatic tension. DF is also unusual in that worlds are intended to be played over and over again. "Losing a game" only adds more interesting history to the world, so "winning" and "losing" loses a lot of meaning. What's "fun" is playing again and having that historical "loss" influence your next game.

Like I said, though, many players choose a goal oriented play through. Achieving that goal is a win for them (and often they abandon the fortress and start a new world afterwards). I remember one person bitterly complaining on the forums that the game was too easy because they had already won the game. After they succeeded in becoming the mountain home for their civ, they felt the game was over. Sometimes it's hard to explain other ways to play games ;-)

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

#64
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.

Not 8f you are playing Dwarf Fortress. Losing is fun :)

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

#66
No matter how dumb you make the A.I., you will have players complaining that it's too hard or unfair. I literally had the computer make a list of all possible moves and pick one out of the list at random for the default A.I. of one of my games and I got accusations that the computer was cheating on that difficulty level on a fairly regular basis.

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

#67
post #10
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?

Even if the AI is friendly being able to predict their behavior is still desirable. Nothing worse than friendly AI ruining your game because it went off and did something you couldn't anticipate.

What if the friendly AI called out it's plan, and the player then could have an agree/disagree option with the proposed strategy?

If done well, it could feel much more like you're playing with a human partner.

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

#68
None of those (e.g. lighting, physics, graphics) are truly difficult today with the advent of modern game tools (e.g Unity). Assuming you know basic vector math and can think in 3 dimensions, most problems related to sound, physics, graphics etc can be solved by some Googling.

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

#69

A friend is working on a solution for this. Check it out https://yuri.ai

Looks cool, if not overkill for the vast majority of games. I hope I remember this if I ever get to make a moba or a hardcore strategy game.

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

#70

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.

I love that Gambit system and wish more games would adopt similar systems. The Rules based approach allows complex behavior to emerge from a relatively simple set of rules. Although this is a per-unit approach, in combination with an overarching management AI, this could be very engaging.
Post reply on HN