Trainer battle AI

ConquestTrainers gives gyms, the Battle Subway, quests and roaming trainers a tactical AI with levels from Novice to Champion, instead of trainers that just pick the move that looks strongest.

Novice to Champion

Role
Design and development
Status
Live
Built with
  • Java
  • Cobblemon
  • Pokémon Showdown

How it decides

  • A battle-maths engine scores every option: damage ranges, speed and priority, KO checks, setup moves and pivots like U-turn.
  • Lower levels have to estimate what they can't see. They assume 31 IVs and 84 EVs and an 80 power same-type attack. Champion trainers see the real moves, stats, items and bench.
  • Each trainer has its own level, set in config, with a command or through the API.
  • The level hooks Cobblemon's own NPC battle builder, so every mod that starts a trainer battle gets the right AI without extra code.

More than battles

  • ConquestTrainers is taking over the server's other NPCs too, replacing Taterzens: characters with dialogue, quests and battles in one place.
  • Staff edit them on the staff portal. Every save is a revision with an audit log and undo, and all 52 NPCs at spawn convert without errors.

Worth knowing

Switching used to get a fixed bonus, so even a weak swap outscored a decent attack and hard trainers spent whole battles switching. Switches are now scored only by how much the matchup improves, minus what the switch costs.