Trainer AI

Post Reply
Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Trainer AI

Post by Exarion » Thu Dec 11, 2014 6:01 pm

What information do we have on the trainer AI in this game? It seems much more complex than Gen 1. I feel like it's necessary to have more info than we do, because many strats depend on what move an opponent uses.

A page like this would be useful, even if we aren't able to get into the code like we did for Gen 1: http://wiki.pokemonspeedruns.com/index. ... Trainer_AI
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

User avatar
Amoeba
Cooltrainer
Posts: 280
Joined: Thu Apr 24, 2014 12:26 am
Contact:

Re: Trainer AI

Post by Amoeba » Thu Dec 11, 2014 9:57 pm

I've just splurged a load of info that I remember below, but it's all based upon my experience from running the game. It's probably useless, unless no one has actually opened the game up to figure out the AI, but I guess it might promote some talking~

Based on intuition I'm guessing that gymleaders/e4/champ/rival all seem to have a more intelligent ai. There seems to be a list of effects that they prefer, for instance in the rival 2 fight the grovyle will prefer Quick Attack to Absorb if both of them can kill, even if you can survive a quick attack on a low damage roll. I'm guessing it prefers it because of the added effect that QA has priority. It also seems to favor non-offensive boosting moves in a scenario where it can't kill with a single attack, most commonly seen by T&L's xatu, which will always use psychic when there is something on the field that will die to it, but switches to sunny day/confuse ray/calm mind when not (which is why having swampert+pooch up is a deathwish). In a pinch I'd reckon that the "smarter AI" has a priority list something like
1. Damage dealing move that will kill with bonus effect
2. Damage dealing move that will kill
3. Super Effective damage dealing move
4. Status move / Stat boosting move / weather effect / other
5. Damage dealing move
It's obviously going to be more complicated than this, and I'd be interested in seeing how the stat/status/other move section gets broken down (i.e. does confuse ray have priority over sunny day, for instance) but that's just what it feels like to me. Though the only stick in the mud for my ideas here is the T&L fight, where I have had Xatu randomly switch to Sunny Day when I have a pokemon out that it can kill with Psychic. Maybe the AI there actually calculates damage ranges or something and doesn't attack when it wont kill, but I'm super speculating now.
~

luckytyphlosion
Pokémon Trainer
Posts: 182
Joined: Thu Apr 24, 2014 2:26 am

Re: Trainer AI

Post by luckytyphlosion » Sat Dec 13, 2014 2:00 am

The only disassembly I can find for gen 3 is an incomplete Fire Red disassembly, here: Link

of course, you'd need to understand ARM, and the disasm only spans from 0x000000 to 0x2483FF, which doesn't give you a lot to work around with.

mooba quoted most of the standard ai rules in emerald, but there are probably more hidden features we don't know. It'll be a much harder task than Gen 1, as it only had very simple and straightforward ai (sanqui told me RBY doesn't calc damage before attacking, and the ai in gen 1 only bases decisions on simple circumstances like hp, and a random percent)

I also found this link: here that documents standard ai clauses.

There's also this (note that it's a site for hacking): battle ai

posting this for now, will add more sites (maybe), if I find some more.
Jack-Flys are OpieOP.

"GO ASK SANQUI" - luckytyphlosion whenever someone asks about how something in Pokémon Red/Blue works. (this means you exarion Kappa)

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Trainer AI

Post by Exarion » Sat Dec 13, 2014 2:39 am

Thanks for the replies. So with this "points" system that those links reference, why does the AI not always use the move with the highest points? If it's because several moves are of equal priority, you'd think each would have an equal chance of being used. But I did some testing on Winona's Swablu, and when Aerial Ace wouldn't kill, it used Mirror Move about 50% of the time and each of its other three moves about 15% of the time. So a simple priority system like the one that exists in Gen 1 doesn't seem to exist. Perhaps a move is only favored (not guaranteed) when it has slightly more priority (e.g. Mirror Move > Aerial Ace, Perish Song and Safeguard), but it is guaranteed when it has significantly more priority (e.g. Rival 2, always Absorb when you're at full HP because of the 4x effectiveness).

I might do some testing with other fights to see if they have similar traits, but if we could get into the game's code (not sure how), that would probably be best.
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

Post Reply

Return to “Pokémon Emerald”

Who is online

Users browsing this forum: No registered users and 1 guest