Earlier quoted context omitted.
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, yo…
But smart AI isn't fun to play against. Take Chess- AI is smart to the point of domination against players. In a FPS setting you just have an aimbot. In a RTS game you would have an AI with passable macro and insane micro. I think the only real chance of a smart AI being fun is in a pure strategy game (I believe it's GalCiv 2 with the epic story about a backstabbing, scheming AI). Smart AI is easier to make than a me…
Ask HN: Game devs, what is the hardest part about designing an AI for your game?
81–89 of 89 posts
Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?
#82I 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 m…
2. It can, imitation learning turns RL into a supervised learning problem though from my experience it's not really needed. It's more of a if you already have it then you can make the training a bit faster
3. Yes all the RL part becomes tuning a config file where the game developer needs to describe the task it wants to be accomplished
Regarding technical details, the infra is agnostic to the specific deep learning library you'd like to use and the algorithms are chosen based on the types of inputs (continuous vs discrete), size of the space (the end all of strategy games or a casual puzzle game) and type of game (full information vs partial information).
Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?
#83Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?
#84Earlier quoted context omitted.
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, yo…
But smart AI isn't fun to play against. Take Chess- AI is smart to the point of domination against players. In a FPS setting you just have an aimbot. In a RTS game you would have an AI with passable macro and insane micro. I think the only real chance of a smart AI being fun is in a pure strategy game (I believe it's GalCiv 2 with the epic story about a backstabbing, scheming AI). Smart AI is easier to make than a me…
In a real time strategy, it seems we're approaching that level with that StarCraft ai. Need to perhaps restrain the ai's ability to micro by fuzzing it's ability to control quickly and precisely in bursts, and then continue to advance it's strategic ability, but I expect it'll get there eventually.
In the case of shooters. It might involve giving the AI a noisy view of the game world, to force it to approach the problem the way a human does. Humans don't just have an accuracy rate or a timer between an event entering their screen and their ability to shoot at it. A human has to filter through visual noise to notice a target, and decide how to engage. A human has to use an arm and hand and muscle memory to manipulate a mouse to get bullets on target. Those are all imperfect controls, with a certain amount of uncertainty between intent and action. All that is further influenced by how prepared the human was, how much they have to adjust their previous plans, or recenter their attention.
It's a difficult task to identify all the things that actually make a game difficult for a human and make sure the AI faces a close approximation of the same problems. Then it's even more difficult to get an AI to a point where it can compete on a human level, not to mention various human levels.
That doesn't mean it's not possible or not worthwhile.
Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?
#85Game 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…
Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?
#86Game 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…
For example, something like Battle Brothers, where the AI tends to attack the least armored ones. You can put a group of poorly armored people on one side of the map and then put heavy damage ones on the other side. The right side draws the combat which gives the left side space to take out the dangerous targets. Humans would spot the tactic straight away. Setting up I exploitation tactics is not so fun for some people.
A worse case scenario are the FIFA games. Every release has some untested exploit. In some, the defenders often push too high and you can score goals from halfway across the field easily. In some, the goalkeeper gets confused when passing the ball right in front of goal. It becomes less a football sim and more how to get formations that optimize exploits.
Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?
#87For instance, a designer might say "It'd be great if I could put a tower between myself and the enemy town, but kind of at the border of mine, but only if I don't have enough money for a cool castle and I'm not overwhelmed." There's a lot of fuzzy logic in statements like those. The API between the game and the "AI" usually has to be general enough not to need spatial information, but also specific enough not to do things that feel unintuitive or silly to the player.
It's worth noting that machine learning helps avoid a lot of these issues, but I find AI tends to be designed for an feeling or experience, so I'm not sure if things like the Starcraft AI competition bots tend to make better products. Perhaps if ML could make the building blocks for designers to design AI?
Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?
#88Earlier quoted context omitted.
Eh, I think Civilization is a great example of an awful AI. Specifically I mean here Civ5 and they way it does combat. It is absurdly easy to outmaneuver and defeat even vastly superior armies. It'd be much more fun to have an enemy who can put up a fight.
You say "awful AI", but it's clearly a AAA selling game, where 90%+ of players play on the single player setting. What is your goal as a designer? To make a game with state of the art AI, or to make a game that has AI that keeps people buying and playing your game? I know which I would choose.
Yes, 90%+ of players play on the single player setting - despite an awful AI. And I say that as one of that 90%. It is certainly not the AI that made me buy and play Civ. I don't expect nor want AI to play perfectly, but I do want AI to play good enough to not make ridiculously dumb decisions.
For example, notice how often AI leaves embarked units unprotected, so they can be easily destroyed. Or how often despite having long range artillery, it will enter town's firing range (even with that artillery!). Or how with its own towns it prefers so much to fire at even slightly damaged units, before attacking siege weapons (which deal much greater damage to towns).
Re: Ask HN: Game devs, what is the hardest part about designing an AI for your game?
#89The biggest surprise I have found on this subject is this strange entanglement of ideas between "AI designed to kill the player" ("Military" AI), and "AI designed to make the game fun ("Game" AI). This is like comparing a F-22 stealth fighter to a 747 commercial airliner -- sure, both are technically "jets", but they serve completely different functions.
The only AI we should be talking about here is AI designed to make a game more engaging and enjoyable for the player. That may include emulating a tiny bit of behavior that resembles military tactics, but only where games use that as a topical facade -- unless you play The Sims waaaay differently than I do.
Easy Mode
There are several posts here where people assert that "they don't want a game to be hard, that would be bad". As a counterexample, I would invite these individuals to view the awards, testimonials, and revenue from the ["Souls"](https://en.wikipedia.org/wiki/Souls_(series)) series (Demon's Souls / Dark Souls). I have spoken to psychology experts at game development conferences, as well as professors that explicitly study psychology in games -- and they are still struggling to define and quantify the exact elements that came together to make this series such a hit. But there is no denying that it is an absolute favorite, with a huge following, and tremendous profits to prove the efficacy of the model.
Obviously, I'm not advocating that "every game should have a Souls-style difficulty curve". That series caters to a specific audience -- and there are an ocean of subtle differences between fans of the series. The point is: broad statements like that go directly against a mountain of evidence. We need to think about this issue with its full (tremendous!) complexity, and how to leverage some immense computing power to address it. Speaking of which...
Based on your Purchase History...
Right now, companies like Amazon and Google are mashing up the entire history of everything you've purchased, every web page you've ever visited, along with demographic and social media data about you. They can then deliver a product recommendation / advertisement / etc. within milliseconds that targets your specific needs, even for things you didn't realize you wanted / needed yet.
If that can be done in milliseconds, then the same principles can be applied to tweaking the difficulty for players in real time. You don't even need to maintain a hot internet connection to constantly feed some huge cloud implementation at all times -- some local processing combined with daily or weekly micro-updates can do the trick. For a perfect example of local / cloud balance, check out SnapChat -- that thing uses the local computing power on your phone to identify your face, and then attach various 3D objects and effects to it in real time. That's done at 20-30 FPS on a smartphone without any special dots or markers to help "anchor" the models. That's amazing. And it's all possible because the [Convolutional Neural Network](https://en.wikipedia.org/wiki/Convolutional_neural_network) models that make that possible get trained on the cloud and downloaded every now and then.
So, yes -- you can code a game to dynamically customize itself for every single player. This is the [exact point of my video series](https://www.youtube.com/watch?v=hTDSGU2vAow) about this subject. Thus far I've made over a half-dozen Skyrim mods that demonstrate some of these concepts, and our team is expanding into other games that are finally opening up their engines to 3rd parties. If folks would like to talk about the nitty-gritty of all that, I'm happy to chat.