I'm trying to learn how games implement tactics for opponents/enemy player.

In games like Street Fighter with maximum difficult, the opponent (computer) is too good at predicting and countering my moves. Do they use AI (like neural networks) for defining opponent behaviour or can it be achieved using vector math (linear algebra) and collision detection algorithms?

enter image description here

  • \$\begingroup\$ Why do you think the ai needs to predict your movements? It has full knowledge of your input and does not need to predict it \$\endgroup\$
    – Zibelas
    Sep 27 '21 at 6:57
  • \$\begingroup\$ My question is relating to finding the optimal behaviour of the player and not predicting my inputs. I thought since the opponent can counter my move in many different ways (specially in 3d) there would be some learning process where the opponent would find the best move to counter my action based on the set difficulty level. \$\endgroup\$
    – student
    Sep 27 '21 at 7:13
  • 2
    \$\begingroup\$ Vector math can still be part of "AI". It's fashionable these days to use neural networks and machine learning for many high-profile AI projects, but the field of AI is much broader than that and also includes things like pathfinding, motion planning, game tree search (minimax), behaviour trees, reaction matrices, and other non-neural techniques. \$\endgroup\$
    – DMGregory
    Sep 27 '21 at 11:21
  • \$\begingroup\$ This is awesome! Thanks for the list of algorithms. I will look them up. Are there any recommended books to learn more on this? \$\endgroup\$
    – student
    Sep 28 '21 at 3:15

"Real" AI in form of machine learning and neural networks still plays a niche role in game development. It is not unheard of, and considering that even mainstream engines like Unity add it to their tool belt, we might see more of it in the future. But it's usually not the default approach for implementing opponent behaviors.

When game developers talk about AI, then they usually mean techniques like:

I can't tell you which of these techniques the newest version of Street Fighter uses and how it uses them. But keep in mind that the Street Fighter franchise is over 30 years old now, its core gameplay formula did not change much over the decades and it always had pretty strong AI opponents which only evolved with every new iteration of the game. So I am certain that the AI code is really sophisticated by now, which might not make it the ideal study subject for a beginner in game AI programming.

  • \$\begingroup\$ Thank you so much. This is very helpful. I will go through the algorithms you listed. Is there a book or any resource that can I follow to learn more on this topic? \$\endgroup\$
    – student
    Sep 28 '21 at 3:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .