I'm working on a thesis about programming an AI combat system for Pokemon (To be implemented in Showdown!). However, I would like to include historical information about the existing implementations of Pokemon AI. This information would offer valuable context to my thesis.

I have been scouring the internet for some sort of algorithm that explains how the AI Trainers make their choices, but have found nothing promising. I realize the fan-games have implemented some more interesting AI systems for their trainers, these would be interesting to see as well.

What I am looking for is examples of the methods used for Pokemon Battle AI decision making used in Pokemon videogames, whether from main series by Nintendo or the many fan-games out there. I realize most of these pose no challenge to an experienced player, but I don't mind, I only wish to compile historical information on previous Pokemon AI attempts.

  • \$\begingroup\$ Currently this question reads as you asking for resources or example, also it can be argued that it is too broad. I suggest to edit the question to narrow it, in particular: what do you mean by "suck"?, do you have an example that "sucks" you are trying to improve? and how would it not "suck"? (that is, what is the requirement you are trying to meet?) Edit: you may delete your old question in videogames SE. Edit 2: I also want to note that we don't answer questions about how a game was done, but may answer how you could do it. \$\endgroup\$
    – Theraot
    Feb 14, 2017 at 5:39
  • \$\begingroup\$ Both answers are great, I have upvoted them. But both also answer my question equally well. \$\endgroup\$
    – ChibiNya
    Feb 15, 2017 at 6:07
  • \$\begingroup\$ It seems like your specifically asking for examples directly from their implementations in the actual games. These questions are off topic. \$\endgroup\$
    – Gnemlock
    Feb 15, 2017 at 7:21

2 Answers 2


First off, I want to say that this particular case can be approached as a generic AI problem and solve it by training a neural network that has for input layer whatever information is relevant in the battle (such as health of the Pokémon, number of items, PP of the attacks, etc...) and having as output layer the different actions to take.

If you want to take that approach, and you have no idea how neural networks work, you can look for an introduction to the topic (there are videos, books, articles, etc...) and I'd suggest the approach described in Evolving Neural Networks through Augmenting Topologies to train and evolve your AI. For abstract, the paper proposes an approach to use genetic algorithms to evolve the topology (the connectivity) of neural networks.

Of course, training the AI requires to have it play multiple times, and using the feedback to improve it.

I cannot really comment on AI of third party games, although we can talk about the AI bot created by drac5290 who was kind enough to publish the decision tree it uses combat. We can consider it an expert system.

Note: Whatever it sucks or not is debatable. The AI beats the Elite Four of Pokémon Blue, but it was given arguably strong Pokémon to battle and an endless supply of healing items. Also, there are new mechanics in newer Pokémon that it doesn't have to bother with.

The decision tree is the following (Yes to the left, No to the right):

Pokémon battle decision tree

As you see, it requires to calculate if the Pokémon currently out will die of an attack of the enemy in the next turn, it also requires to determinate what Pokémon will take less damage and which one will do most damage to the enemy.

Also, it doesn't have much actions, it only does: Switch, Attack (with the best attack available), and Heal using items. As far as I can tell, inflicting status effects to the enemy is not taken into account.

  • \$\begingroup\$ Are neural networks really necessary for that kind of problem. It is all about comparing stats and probability, neural networks looks like an overkill \$\endgroup\$ Feb 14, 2017 at 9:32
  • \$\begingroup\$ @realUser404 no, they are not. In the answer I say that they are viable for this kind of problem, in particular I don't really know what OP expects from the AI but using that approach it should be possible to train a AI as good as needed. \$\endgroup\$
    – Theraot
    Feb 14, 2017 at 9:37
  • \$\begingroup\$ This doesn't answer the question at all really, ChibiNaya is asking what was actually used, not what could work. \$\endgroup\$
    – Elva
    Feb 14, 2017 at 12:13
  • 1
    \$\begingroup\$ I was thinking of using some sort of Min-Max based algorythm using some heuristics to evaluate game state. Neural networks seem really cooll, though, though I always had a hard time programming with them. And this post DOES answer my question with that flowchart. Anyways, my goal down the line will be to make the strongest AI possible. But will be making another question for that. \$\endgroup\$
    – ChibiNya
    Feb 15, 2017 at 0:11
  • 1
    \$\begingroup\$ @ChibiNya if you find neural networks troublesome and prefer flowcharts, you may be interested in using genetic algorithms to train behavior trees. aigamedev has a good introduction to modern behaviour trees if you join for free. Edit: Up vote what helped you, accept what solved your problem. \$\endgroup\$
    – Theraot
    Feb 15, 2017 at 1:45

The AI for Pokemon depends on the version, but it's nothing really advanced. I'll talk about a bit red/blue/yellow in this answer, sources below.

The AI picks a move using rejection sampling from the moves it considers usable, which moves it considers usable depends on the turn the Pokemon is out and what kind of trainer it is.

For example, on turn 1 if the trainer class is not youngster or cue ball: do not use an attack that only gives a status if the opponent already has a status.

They also have a preference for super effective moves (with some bugs because gen1 is held together by bugs) and will not pick a "not very effective" move if there's no alternative.

There's also some cases where (for story reasons generally) a specific attack is chosen, this overrides regular selection and can lead to doing impossible things (i.e. a 2-turn move like fly starting, and then a different move happening).

Basically the AI does no planning ahead and just looks at the current state, it's not a very good AI because, well it's a game. You don't want a great AI opponent because then you'd lose far too often.

Source: http://wiki.pokemonspeedruns.com/index.php/Pok%C3%A9mon_Red/Blue/Yellow_Trainer_AI

  • \$\begingroup\$ Oh, thanks. This is technically the sort of information I needed. It seems trainer class determines the "skill". I'll be looking at that link! \$\endgroup\$
    – ChibiNya
    Feb 15, 2017 at 0:13

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