• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Resource icon

v21.1 Advanced AI System 2.5

This resource pertains to version 21.1 of Pokémon Essentials.
## Critical Crash Fixes
  • NameError: uninitialized constant Battle::AI::ItemIntelligenceItem_Intelligence.rb line 588
  • NoMethodError: undefined method 'battler' for Battle::Battler0_Move_Scorer.rb line 1862
  • NoMethodError: undefined method 'damagingMove?' for GameData::MoveDoubles_Coordination.rb line 2790
  • NameError: uninitialized constant Battle::AI::DoublesCoordinationDoubles_Coordination.rb line 3613
  • NoMethodError: undefined method 'stat_up' for Battle::Move::NoneDoubles_Coordination.rb line 144
  • NoMethodError: undefined method 'physicalMove?' for GameData::Move0_Move_Scorer.rb, Move_Memory.rb, Prediction_System.rb (4 sites)
---
## Behavioural Fixes
  • Toxic / Will-O-Wisp / Thunder Wave no longer score positively against immune types (e.g. Toxic vs Steel/Poison)
  • ReserveLastPokemon ace is now strictly reserved until all other party members are down
  • Reduced excessive switching when no meaningfully better option exists
  • Dazzling / Queenly Majesty / Armor Tail now correctly block priority on the entire side in doubles
---
## New Option
- ENFORCE_SLEEP_CLAUSE toggle in 0_Settings.rb (default: true)
Fixed 1-2 more bugs......................
Fixed 1-2 more bugs......................
Added a better check for double battles - fixed undefined method `stages' for #<Pokemon DONDOZO Lv.50
Fixed undefined method `damagingMove?' for #<Pokemon::Move>
v2.4.0 Update — Full Gen 1–9 Coverage + Bug Fixes

Missing support for moves, abilities, and items has been implemented — the AI should now cover everything from Gen 1–9.

Console bug and some other small bugs are fixed too.

---

Moves

  • Heavy Slam / Heat Crash — Weight-ratio → 40–120 BP calculation
  • Low Kick / Grass Knot — Target-weight thresholds → 20–120 BP
  • Terrain Pulse — 2× BP + type change in active terrain
  • Topsy-Turvy — +80 vs setup, −40 if would invert drops
  • Armor Cannon — Def / SpDef drop cost penalty (−10)
  • Bitter Blade — Drain bonus (+15) when user < 70% HP
  • Hydro Steam — 1.5× BP in Sun / Harsh Sun instead of penalty
  • Psyblade — 1.5× BP in Electric Terrain
  • Pledge Combos — Fire + Grass → Sea of Fire, Water + Fire → Rainbow, Grass + Water → Swamp; 150 BP
  • Fusion Flare / Bolt — 2× power when partner used complement move
  • Ruination — Fixed 50% current-HP damage scoring

Abilities

  • As One (Glastrier) — 2.5× weight, +1.2 threat, 1.9 snowball
  • As One (Spectrier) — 2.5× weight, +1.2 threat, 1.9 snowball
  • Mind's Eye — 1.5× weight, +0.5 threat, Scrappy + accuracy bypass in damage calc
  • Seed Sower — −1.0 defensive weight, +0.4 threat, Mold Breaker bypass (+10)
  • Zero to Hero — 2.5× weight (Hero-form Palafin)
  • Ice Scales — −2.5 defensive weight, 0.5× special modifier, Mold Breaker bypass (+20)
  • Tera Shell — 0.5× all moves at full HP, Mold Breaker bypass (+25)
  • Stamina — Gen 9 defensive ability dictionary
  • Weak Armor — Gen 9 defensive ability dictionary
  • Anger Shell — Gen 9 offensive ability dictionary
  • Electromorphosis — Gen 9 offensive ability dictionary
  • Wind Power — Gen 9 offensive ability dictionary
  • Toxic Boost / Flare Boost — Gen 9 offensive ability dictionary
  • Cotton Down — Gen 9 defensive ability dictionary
  • Embody Aspect — Gen 9 offensive ability dictionary

Items

  • Light Ball — 2.0× damage for Pikachu; +0.8 threat
  • Thick Club — 2.0× physical for Cubone / Marowak; +0.8 threat
  • Shed Shell — has_shed_shell? helper; trapping moves −30 vs holder; −0.2 threat
  • Ability Shield — −40 for ability-changing moves vs holder; −0.3 threat
  • Power Herb — Two-turn move bonus
  • White Herb — Stat-drop recovery bonus
  • Booster Energy — Paradox Pokémon stat boost scoring
### Critical Fixes
- Side/Field-Targeting Moves Scoring 0
Stealth Rock, Spikes, Reflect, Light Screen, Tailwind and all other moves with
num_targets == 0 were never scored because vanilla Essentials calls
pbGetMoveScore() without a target argument. The scorer's guard clause
(return 0 unless move && user && target) rejected them all.
- Core.rb: Added fallback target resolution — picks the first non-fainted
opponent when target is nil.
- 0_Move_Scorer.rb: Relaxed guard to return 0 unless move && user with
internal target resolution for nil targets.
- GrassyTerrain PBEffects Crash
PBEffects::GrassyTerrain does not exist; Grassy Terrain is a field terrain,
not a battle-side effect. Protect/Detect scoring crashed when evaluating
passive recovery.
- 0_Move_Scorer.rb line ~1680: Changed to
@battle.field.terrain == :Grassy && user.battler.affectedByTerrain?.
- Kernel#pp RGSS Safety
RGSS/mkxp lacks the pp standard library. Any call to pp (including AI
debug logging) caused a fatal NoMethodError.
- Core.rb: Defines Kernel#pp as a safe echoln-based fallback when the
native implementation is unavailable.
- SystemStackError Recursion Guard
Effectiveness.calculate and GameData::Type.calculate could infinitely
recurse in certain type-matchup edge cases.
- Hotfixes.rb: Added recursion depth guard (max 10) on both methods.
Fixed Status Moves in Move scorer/ fixed pp bug
### Critical Bug Fixes
#### PBDebug.log ArgumentError Crash

- Issue: PBDebug.log was being called with 2 arguments (message, category) but Pokémon Essentials v21.1 only accepts 1 argument (message)
Caused ArgumentError: wrong number of arguments (given 2, expected 1) crash when AI tried to switch Pokémon with debug mode enabled

  • Files: 4_Battle_Strategy/Switch_Intelligence.rb (lines 1388, 1409, 1430, 1450, 1459, 1468, 1807-1865)
  • Result: Debug logging now works correctly without crashes

#### Knock Off vs Unlosable Items
- Issue: AI was giving +100 bonus for using Knock Off against Mega Stones, but Mega Stones are unlosable items that cannot be removed by Knock Off
AI would incorrectly prioritize Knock Off against Pokémon holding Mega Stones, Z-Crystals, and other unlosable items
Back
Top