• All content from the former Roleplaying Games forum has been merged into the Writers' Workshop forum. You can find more information in this thread.

    We hope to see you roleplaying away soon!
  • The World Beyond Restructure is now finished! Check out the update here!
  • It's time for the Writer's Workshop Summer event: our second themed one-shot competition! Check out the sign-up thread here!
  • Hey everyone! Bulbagarden is hosting its first Bulbaleague Conference Pokemon Showdown Tournament! Check out this thread to get the full details!
  • Hey everyone! The Writer's Workshop is hosting an exciting event, Trainers of Fanfiction! It's a community event focused around your characters!

How I Taught an AI to Play Pokemon Emerald

Well-Known Member
Joined
May 13, 2014
Messages
5,085
Reaction score
3,325
Wow, that's very interesting! I kinda get how AI works, and Pokemon without a doubt sounds like a very hard task to do.

In the overworld, what do you do when the barrier isn't physical but because of the story?

How did you handled HMs? Using them is easy in Gen 3, but teaching them to a Pokemon should be hard, I don't want to imagine how to code what happens if you don't have a compatible Pokemon in your party.

Battles also sound very hard to program. I would code it without switching first, because when taking switching into account you have multiple dilemmas: What's better: Lossing the least health possible or inflicting the most damage possible? And how do you take into account what could happen in the next turns? The more turns you include the bigger the decision tree will be.

Also...Should the AI get information about the enemies' stats and moves? Because that seems very unfair to human players who can only get that through trial and error.

How does the AI decides which Pokémon should be caught? How does it decide if it should replace the ones it already has?

I'm just curious. :unsure::p
 
Moderator
Joined
May 27, 2018
Messages
8,768
Reaction score
10,272
I wonder, is there a way to make one only for battles?
 
New Member
Joined
Feb 20, 2020
Messages
8
Reaction score
11
Wow, that's very interesting! I kinda get how AI works, and Pokemon without a doubt sounds like a very hard task to do.

In the overworld, what do you do when the barrier isn't physical but because of the story?

How did you handled HMs? Using them is easy in Gen 3, but teaching them to a Pokemon should be hard, I don't want to imagine how to code what happens if you don't have a compatible Pokemon in your party.

Battles also sound very hard to program. I would code it without switching first, because when taking switching into account you have multiple dilemmas: What's better: Lossing the least health possible or inflicting the most damage possible? And how do you take into account what could happen in the next turns? The more turns you include the bigger the decision tree will be.

Also...Should the AI get information about the enemies' stats and moves? Because that seems very unfair to human players who can only get that through trial and error.

How does the AI decides which Pokémon should be caught? How does it decide if it should replace the ones it already has?

I'm just curious. :unsure::p
Pokemon is quite a challenge for AI - much more than I thought when I started this project. In regards to barriers that move around over time, the only real solution to that is to have the AI start re-checking the boundaries if it gets stuck. So far the AI has never gone far enough to have to deal with HMs, but I know that those (along with puzzles such as those found in gyms or evil team hideouts) are going to be major roadblocks. In regards to catching Pokemon, my original plan was to follow Nuzlocke rules - catch first thing you find in a new area - because it would be easier to implement. There may be a better way, however.
In regards to battling, the decision tree can grow quite large, but the number of possible options each turn is relatively constrained so it isn't too bad to look 3-4 moves ahead. In regards to whether to prioritize maintaining health or inflicting damage, that is simply a matter of assigning different weights to those options in the scoring function, and finding the right mix will probably be a bit of trial and error. Also, I will give it access to the enemy stats and moves. Yes, that may not be fair compared to a human player, but the AI needs all the help it can get :)
 
Top