PyBoyP
PyBoy7mo ago
scudfpv

Help on Debugging a Bot for Pokemon Red

Hi guys, I'm new here. Also, programming is a hobby, so please don't evaluate the code as a real programmer. Attached is the code and requirements I'm using to create a bot so I can accelerate the speed of leveling up.

In summary, the code reads the flags from text files where I toggle "y" to activate the features. The main feature is the training, where the character goes from left to right in a zone where there are wild pokemon. If HP or PP are zero for the 1st pokemon in the party, then it goes to the pokemon center. The path to pokemon center was previously recorded based on X, Y and Map ID and saved in another log file.

Issue: the bot works as expected (levels up ~10 levels) until some point where it gets stuck after PP=0. Instead of going to the pokemon center, it goes left, hit the wall, and there is this infinite loop. I tried the best I could to debug what could happen, but I think it is time to get some help from experts. Any hint on what I could do different, I'll appreciate.

Disclaimer: I'm using Pyboy 1.6.9 because I got issues with other dependencies in the new version and it crashed a lot, so I gave up and focused on the version that was working.
Was this page helpful?