Monday, January 1, 2018

How is AI most commonly implemented in popular games?


I'm no gamedev, I'm just a curious coder of not-games. I wonder, how does AI work in popular modern games, say, FPSs? Is it based on hard-coded rules? How much does it have in common with other kinds of AI (like the one which powers autonomous cars etc)? How do developers ensure the AI behaves naturally and is fun to play against?


Stuff I've googled mentioned different derivatives of MinMax but failed to answer how AI deals with continuous, changeable world, for what actions/states AI is rewarded and how it figures out its chance for success of different actions. I've also seen Machine Learning mentioned here and there but it seems it's not used in any serious game?



Answer



There are many methods. I will answer for FPSes because each genre has its own set of problems, and AI approaches are heavily dependent on the problem domain and how best to represent it.



Common FPS approaches include:



And various permutations and variations on the above.


Minimax is not generally used for games with continuous state like FPSs, more for turn-based games in discrete game spaces like Chess etc. It can be used for planning at a high level, but generally it is not because there are better systems (ie. the above) when faced with multiple enemies, incomplete information, but simple plans.


They ensure the AI is fun by playtesting. If it's too challenging, they may introduce error into any decision heuristics, or a delay on their reactions, or apply a random factor to their aiming, etc. If it's not challenging enough, they will just need to improve the data supplied to the algorithm.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...