How do you build a game with good AI?

Just wondering how the AAA game developers build good AI into the RTS, FPS Open World games?

And how those techniques and approaches can be applied to Unity?

Note: I’m sure there are AI / Pathfinding systems on the asset store but this is more of a what AI systems do the AAA guys use, and where can I find out more about AI programming?

Are they using Neural Networks, Genetic Algorithms, Behavioural Trees, Finite State Machines, Cellular Automaton, Baking AI into Pathfinding/Navigation Data?

What tools are they using to make good AI?

Ideally they are using their brains! :slight_smile:

1 Like

Deep learning

1 Like

Would deep learning work in a game setting as it needs lots of training examples for it to learn how to recognise patterns, that could be an issue depending how you build the game. E.g. you would probably need at least an open beta to capture data to train up the AI.

Run at walls, realise that isn’t a good idea then jot it down on a notepad. Throw stones at rocks, see if anyone does actually pay attention, jot it down in a notepad. Chase chickens to see if they lay eggs when you run at them, jot it down on a note pad then cook breakfast.

Rinse and repeat.

Main tool of use: Paper based notepad.
Secondary tools used: Pan, Fork, Plate.

6 Likes

http://www.hevi.info/tag/artificial-intelligence-in-real-time-strategy-games/

No, they’re using dumbest approach possible. The most difficult part of the game AI is collision avoidance and pathfinding. Actual behavior decisions are trivially simple most of the time.

You will want Behavior trees, of course, but only because those will give you overview of what system does at any given point of time. Not becuase they’ll magically make your system better.

2 Likes

I would recommend asking AAA developers.

This topic again?

You need to realize that purpose of game AI is to be fun.
The purpose of self-learning solution is to find perfect approach to something.

Meaning IF you succesfully develop decent solution, it will be undefeatable by any human player.

Example:
https://en.wikipedia.org/wiki/Human–computer_chess_matches
Short version: machines were defeating humans at chess since about 2005.

And if you’ll try to train ai for being fun, you’ll need to define fun using mathematic means in order to create fitness function.
https://xkcd.com/720/
Good luck with that.

I’ve never been given an AAA, BBB or any other certificate but I’ll reply anyway :wink:

AIGameDev is a good place to start learning. From what I’ve seen AI in games is usually simpler than it seems. Forget about neural networks, learning algorithms and genetic algorithms, they aren’t really relevant at the moment to the games industry. State machines for simple games, behaviour trees for less simple games, reaction over planning, and lots and lots of cool animations.

3 Likes

Mostly math. (deterministic)

Yes, simple is better. Or at least as simple as possible. Complexity always grows, keeping it as simple as needed (or only as complex as needed) helps keeping it from growing exponentially. Genetic algorithms are fun, and done experimentation with them, but not practical in typical games (I should say, not practical in game play, they can be useful for development). Depending on the game, they should be deterministic and very controllable. It is often like procedural content, if you attempt to replace human designers with algorithms, it can suck the fun out of a game.

And again and again and again… I don’t want to say ‘get used to it’, because I haven’t and wouldn’t expect anyone else to, either… but this science fiction-esque stuff is a frequent topic amongst those who will never program such a system or design a game that needs it.

1 Like

Yeah, I’ve had some fun with procedural generation but you realize quickly that unless you’re making a game like Spore it isn’t really useful for anything except terrain generation, texture generation, and a few other things. I’ve also played with some simple neural networks and I couldn’t even imagine how anyone would approach using it for any realistic implementation of AI.

That’s not to say that I don’t believe that everything under the sun can be understood and created using logical principles, but asking a computer farm to reproduce human evolution just so you can have some half-decent AI in your game is just horribly inefficient. State machines, behaviour trees and a variety of cool animations will be the recipe for a while to come I think.

This.

Undefeatable AI is pretty simple to write for most games. In a stealth game, for instance, literally all you have to do is have one guard actually look at the objective they’re “guarding”, and suddenly there’s no way to reach it undetected. All of the smarts on top of that are actually smoke and mirrors to make things feel dangerous while actually giving the player more opportunities to win.

5 Likes

THIS!!!

That?

2 Likes

While you make a great point about fun, the purpose of self learning is not necessarily to be good at winning. One might give the algorithm the task of finding the perfect solution to simulating the average human joe.

However simulating the correct inconsistencies, fallibilities and quirks of a human-like AI is actually another layer that must be built on top of simulating the intelligence of that character, and no algorithm has come anywhere near the latter.

1 Like

WhAt ElSe???

Yea, that is a big part of it. In theory you could use simulation to create these types of things, but there is point where the effort to create the simulation is more expensive/time consuming than traditional methods. Like theater or film, you don’t have to create every detail, just the parts that are seen.

4 Likes