Has anyone ever attempted to decompile the code for a Pokemon game and figure out how the battle AI works? e.g. How it decides which move to use, or use a Potion/even withdraw based on the current state of the game. I'm very interested in how it works because I would like to build my own battle AI as part of a research project.
Asked
Active
Viewed 1,803 times
1
-
Probably they push random buttons like you do – mrexodia Sep 02 '18 at 09:24
1 Answers
1
There is a project to disassemble the Pokemon games at https://github.com/pret. As a reference in Pokemon red, You can find the file that defines the trainer AI here https://github.com/pret/pokered/blob/master/engine/battle/trainer_ai.asm
Unfortunately this is all in assembly and I don't believe there is a translation to C at this stage.

dbulger
- 11
- 1
-
Are there efforts underway to disassemble more recent Pokemon games, like XYORAS or Sun/Moon? I know that with earlier generations there are some flaws in the AI, for example this video describes a fascinating Gen I glitch: https://www.youtube.com/watch?v=CClsivwN8aw – James Ko Sep 02 '18 at 16:26