Jump to content

Return/Frustration on AI Trainers


Recommended Posts

I believe the AI doesn't quite know how to handle Return/Frustration. You might want to prefer other attacks, such as Strength or Rock Climb.

EDIT: Here's an article about the BW subway:

CPU prefers attacks that will KO one of your Pokemon

An exception to the above, the CPU doesn't use the following moves properly: Gyro Ball, Grass Knot, Low Kick, Return, Frustration. They may not use the move even if it would result in a KO.

CPU doesn't use Sucker Punch properly. They may use it to KO your Pokemon if none of their other attacks can or if it's their only attack. They tend to use it more often if a Pokemon has been Taunted. Otherwise, they tend to be reluctant to use Sucker Punch.

CPU does not recognize Storm Drain or Dry Skin; they will continue to use Water attacks if it would normally be their strongest move against the Pokemon.

CPU does not recognize Flash Fire initially, but will stop using Fire attacks entirely once Flash Fire has been activated. In a double battle, however, the CPU will still target your other, non-Flash Fire Pokemon with Fire moves.

CPU will not continue to use a boosting move if one of the stats being boosted is already maxed.

CPU avoids using Trick against a Pokemon that holds one of the following items: Choice Band, Choice Specs, Choice Scarf, Flame Orb, Toxic Orb, or Black Sludge.

CPU tends to avoid using moves that lower their stats unless it results in a KO or they are holding White Herb.

CPU tends to only use recovery moves when they are below half health. They sometimes, however, seem to "predict" when they will go below half health when their Pokemon is slower than yours.

CPU tends to only use Destiny Bond when they are below half health.

CPU may switch if their Pokemon is locked into a move that does not deal damage (either immune or status move) due to a Choice item.

If the opponent is hit with an attack and they have a Pokemon that is immune to that attack's type, they may switch to the Pokemon that has that immunity. Strangely, they still have a chance to switch even if the Pokemon that performed that attack has already fainted.

CPU considers multi-hit moves based on the power of a single hit (e.g. they see Icicle Spear as a 25 Base Power Ice-type attack).

Link to comment
Share on other sites

Cool, thanks for the information. I guess that means I'll need to go and remove Return on all the Pokemon I gave it to . I'll just modify Rock Climb and make it into a 102 power move and remove secondary effects to emulate it for the AI then. Kind of like giving them moves to emulate hidden power(like Flame Burst,Energy Ball, Bubblebeam etc.)

I've noticed the following things in my time playing with ai trainers, though not in battle subway:

The AI will do the same thing with other abilities similar to Flash Fire such as Sap Sipper, Lightningrod etc. Something cool about that is that if the AI have a Pokemon with one of these abilities and you use an attack of the same type on another one of their Pokemon weak to it they will switch in the immunity ability holder on the next turn assuming the Pokemon survives to predict you using it again and absorb the hit.

I think the AI may have been improved some from bw > bw2 as the AI no longer seems to use entry hazard moves on a Pokemon that has Magic Bounce unless it gets your hp low and it predicts you are going to switch.

Link to comment
Share on other sites

http://projectpokemon.org/forums/showthread.php?24589-B2W2-General-ROM-Info&p=161021&viewfull=1#post161021

nature comes from pid: pid % 25

pkm byte 1, gender/abil byte: abil1 = 10, abil2 = 20, abilDW = 30

they check if the poke has frustration as a move. if not, happiness is 255 in case of return. if so, set it to 0.

yeah, it's accounted for and works fine.

Link to comment
Share on other sites

also, since we're talking about it, at the end of every turn the game does damage calcs for every move it has to see what the best move would be the next turn. if it didn't use frustration/return when it could have that's because it thought it found a "better" move given its other moves and options after the damage calc.

Link to comment
Share on other sites

Cool. I know nothing about hex work though so I'll have to stick to modding Rock Climb to emulate Return/Frustration to make sure it's properly used by the AI. I might look around in the Kazowar threads some more if I can find more information about setting that kind of stuff up, at least natures anyways. I Know i can set iv to all 31 by using 255 in the unknown field, which gives a neutral nature, but it would be awesome if I could learn how to adjust that number to give the desired nature. Also a shame there are no EV settings.

Link to comment
Share on other sites

the pids(and thus, natures) are randomly generated.

i don't think you were understanding me. you don't need to "mod" any move. when the game is creating the trainer's pokes from the provided data, if any of them have frustration their happiness is set to 0 automatically. otherwise it's 255. just give the poke you want to have frustration/return the move you want and the rest is taken care of.

also, are you using an old version of the tool? it's not "unknown" anymore. he finished the tool after i posted that. you should download the latest ones. that unknown is actually "strength". take the value and multiply by 31 then divide by 255 and you get the iv number to use for all 6 ivs. i think they did that to make it more difficult to modify. they could easily have made it a 0-31 value, but instead added some very needless complexity.

ex. unkown is set to 255: 255 * 31 / 255 = 31

so you can see why it's kind of a waste.

Really? Well, I guess I shouldn't believe everything smogon says then :)

i found the thread this was from on smogon. all of that is just based on observation without actually knowing how any of it works or looking at any of the code behind the decisions. i'd wager it's wrong just as often as it is right, or worse.

Link to comment
Share on other sites

Oh, ok. Yeah I just read it wrong. I won't need to go through all the Pokemon I gave Return to afterall!.

Well, it doesn't say unknown for the Pokemon, just the trainer AI. It says difficulty for the Pokemon. I'm using BWTE2. I downloaded it January 25th. I will update though as I just checked and there is indeed a new version.

Link to comment
Share on other sites

yeah, for trainer pokes the pid is random and then they do pid % 25 to get the nature(like in gen 3/4).

trainer ai will eventually be editable. that said, it's pretty huge for 1 person to figure out so it'll be awhile for that one. there's quite a few commands aside from the main logic. i might eventually take a stab at making the trainers smarter at some point in the future. the best you can do at the moment is copy from other trainers of the same type. (1 for a normal path trainer, 7 for event trainer, 87 for friendly doubles, etc)

Link to comment
Share on other sites

I just put 7 or equivalent for doubles/triples for the trainers since there isn't much else I can do other than try to give them movesets they can use somewhat effectively.

What is the nature part of the program for? It's locked so I'm assuming it isn't functioning yet and is just there as a placeholder?

Link to comment
Share on other sites

oh, i'm not sure actually. kazo may have thought that nature was editable. it's 100% definitely not, though:

RAM_ARM9:02030EC8             loc_2030EC8                             ; CODE XREF: setTrainerPkmStats+62j
RAM_ARM9:02030EC8                                                     ; setTrainerPkmStats+66j
RAM_ARM9:02030EC8 28 1C                       MOVS    R0, R5          ; pPkm
RAM_ARM9:02030ECA 00 21                       MOVS    R1, #0          ; field
RAM_ARM9:02030ECC 00 22                       MOVS    R2, #0          ; data
RAM_ARM9:02030ECE EB F7 29 FF                 BL      getPkmStat      ; pid
RAM_ARM9:02030ED2 00 12                       ASRS    R0, R0, #8
RAM_ARM9:02030ED4 19 21                       MOVS    R1, #0x19       ; denom
RAM_ARM9:02030ED6 5C F0 D8 EB                 BLX     divmodSigned    ; make nature
RAM_ARM9:02030EDA 09 06                       LSLS    R1, R1, #0x18
RAM_ARM9:02030EDC 28 1C                       MOVS    R0, R5
RAM_ARM9:02030EDE 09 0E                       LSRS    R1, R1, #0x18
RAM_ARM9:02030EE0 EC F7 94 FB                 BL      setNatureResetStats ; set nature

see where it says "getPkmStat"? the field argument before it is 0, which is the pid. so it gets the pid, does a bit of math, and does %0x19(note the "divmod" right afterward) which is 25 in decimal.

Link to comment
Share on other sites

fyi: i am working on this, but i'm transitioning to windows 8(which i fucking love by the way) and thus am working slowly. what i thought was going to be a small project with 1 function made by me is turning out to be bigger than expected to say the least. there's going to be a very long post detailing everything i had to do once i finish this thing.

right now i have the sort of scaffolding implemented. a limitation that gamefreak had placed on the trainer pkm files is now gone and i have access to the trainer pkm files and the resulting pkm files.

Link to comment
Share on other sites

Cool man. I'm really looking forward to it. I appreciate your work. Always wanted to be able to edit natures on the ai trainers. It'll help out a lot so the AI are a bit less gimp than they already are by messing up their stats with random natures.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...