Open Terrorforge opened 6 months ago
I wouldn't say never switch, since that could lead to weird behaivour. We could just assign a negative value to entry hazards that effect the pokemon, and possibly a slight positive to pokemon that are specifically immune to the entry hazards e.g. toxic spikes you want a poison type to absorb the spikes
Oh yeah, I guess it wouldn't be great if you could reliably trap them and just switch in a resist to set up on them.
I don't know exactly how the algorithm works at the moment, but from a player perspective it looks like it considers both the threat to the current pokemon and how much of an advantage the switch-in has. It should probably still consider the latter; where it gets dumb re:rocks is that it seemingly tries to save pokemon that are beyond saving, like switching out low-health flying type A into high-health flying type B and getting both of them killed because B takes a free attack and A dies to rocks.
So maybe IF dead to rocks THEN assign the "saving" half of the equation some fixed low value. Then it should hopefully only switch as a sac to bring in a better mon.
Ideally it would only do that if the current mon is ineffectual against the opposing mon, but the AI seems to struggle with that as it is. Pretty easy to find setup opportunities for bulky mons, especially against monotype trainers, because the AI doesn't seem to like switching unnless it's got a type disadvantage AND a type advantage to switch into.
The AI does not seem to factor entry hazards into its switching decisions at all. A common scenario I've encountered when using Stealth Rocks is the AI switching out a pokemon that's dead to rocks, taking both rocks damage and a hit to the face on the switch-in, and later just throwing the original down to die on the rocks anyway. I think a very simple check would go a long way to stop this obviously silly behavior:
IF there are entry hazards AND IF current pokemon would die to those hazard on switch-in THEN never switch