• 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 1.5.7

This resource pertains to version 21.1 of Pokémon Essentials.
AAi scans now for installed DBK PLugins to prevent Nomethode crashes
### Critical Fixes
  • Move Scoring Integration: Fixed a major bug where score_move_advanced was defined but never called. The AI now correctly uses the intended comprehensive scoring logic (defined in Move_Scorer.rb) instead of falling back to vanilla behavior.
  • AIMove Reliability: Patched Battle::AI::AIMove with method_missing delegation to prevent persistent NoMethodError crashes (e.g., power, multiHitMove?, battler) by forwarding all checks to the underlying move object.
  • Accuracy Crash: Resolved a crash in Move_Scorer.rb related to accuracy checks by accessing the move's raw integer accuracy instead of the context-dependent AIMove#accuracy.
### Technical Details
- Core.rb Hook: Explicitly connected pbGetMoveScore to score_move_advanced for qualified skill levels.
### Critical Fixes
  • Wild Pokemon Visuals: Fixed glitches where Dynamax/Tera sprites reverted immediately after animation.
  • DBK Compatibility: Patched placeholders overriding tera?/dynamax? methods.
  • Crash Fixes: Resolved pbCalcTypeMod Method Error and missing icon crashes.
### New Features
  • Smart Wild AI: Wild Pokemon now use Advanced AI logic (Level 85+).
  • Wild Gimmicks: Wild Pokemon can now use Dynamax.
  • Event-Only Wild Tera: Wild Pokemon only Terastallize if explicitly configured (e.g. setBattleRule("editWildPokemon", { :tera_type => :WATER })).
### Improvements
  • KO Detection: AI heavily penalizes switching if it can secure a KO (-60 score penalty).
  • Switch Safety: Improved damage calculation logic for defensive switching decisions.
  • Debug Mode: Advanced AI automatically activates when DEBUG_MODE is on.
### Added
- KO Opportunity Detection: AI now recognizes when it can secure a knockout and heavily discourages switching in these scenarios
- New can_ko_opponent? method calculates damage estimates for all moves
- Applies -60 point penalty to switch score when KO is available
- Accounts for STAB, type effectiveness, and damage roll variance (85% threshold)
- Prevents AI from losing momentum by switching away from guaranteed KOs
### Fixed
- Console Output Method: Corrected console logging method from Console.echo_li to Console.echoln_li
- Fixes debug messages not appearing during battles
- All AAI debug output now displays correctly with proper formatting
- Colons and category labels now visible in console
### Changed
- Switch Scoring System: Expanded from 10 to 11 evaluation factors
- Factor 11: "Can Secure KO" penalty ensures AI prioritizes finishing weakened opponents
- Debug console now shows [11/11] for the new KO detection factor
### Technical Details
Files Modified:
  • [001] Settings.rb - Fixed console method, added DEBUG_MODE activation
  • [012] Switch_Intelligence.rb - Added KO detection and switch penalty
Switch Intelligence Improvements:
  • KO detection checks all damaging moves against all opponents
  • Conservative damage formula: (Attack * Power / Defense) * STAB * Effectiveness / 100
  • 85% HP threshold accounts for random damage rolls
  • Ignores type-immune moves (can't KO with 0x effectiveness)
Mediafire didnt overide the last upload

Right file is up now
# Advanced AI System - Patch Notes

## Version 1.5.3 (Hotfix & Logic Update)
  • Crash Fix (Field Effects): Resolved undefined method 'priority' error by safely checking move properties.
  • Crash Fix (Mechanics Hooks): Fixed undefined method 'pbRegisterEnemySpecialAction' compatibility issue with Essentials v21.1.
  • Switch Intelligence:
- Ping-Pong Prevention: Increased the penalty for switching immediately after entering battle (-20 -> -40) to stop the AI from rapidly switching back and forth.
- ReserveLastPokemon: Added robust trainer detection and debug logging to ensure the Ace is correctly reserved until the end.
- Setup Logic:
- Curse Support: Added proper support for non-standard setup moves like Curse using the internal move database.
- Safety Check: Fixed a syntax error in the setup safety check.

## Switch Intelligence
  • ReserveLastPokemon Support: Fixed an issue where the AI would switch into its Ace (last Pokemon) prematurely. It now respects the ReserveLastPokemon trainer flag.
  • Switch Loop Fix: Implemented stability checks to prevent the AI from endlessly switching between two Pokemon with similar matchups.

remember if i use the reservelastpokemon option you need to add teh flag in trainers.txt

[LEADER_BROCK,Brock,1]
Items = FULLRESTORE,FULLRESTORE
LoseText = "Good match!"
Skill = 100
Flags = ReserveLastPokemon
Pokemon = GEODUDE,12
Pokemon = VULPIX,12
Moves = EMBER,QUICKATTACK
Pokemon = ONIX,14
Moves = ROCKTOMB,BIND,TACKLE
Switch Intelligence
ReserveLastPokemon Support**: Fixed an issue where the AI would switch into its Ace (last Pokemon) prematurely. It now respects the ReserveLastPokemon trainer flag.
Switch Loop Fix**: Implemented stability checks to prevent the AI from endlessly switching between two Pokemon with similar matchups.

Added a new Rule in Settings
RESPECT_RESERVE_LAST_POKEMON = true

You can turn it off with falsee

Move Scoring (Critical Hits)
Always Critical Hits*: Moves like *Flower Trick and Wiked Blow now correctly calculate their damage with a 1.5x multiplier.
Focus Energy Synergy**: The AI now heavily prioritizes using Focus Energy + High Crit Rate moves to guarantee critical hits.
Smart Stat Bypassing**: The AI now recognizes that critical hits ignore:
The Target's positive Defense/Sp.Def boosts (e.g. counter to Iron Defense).
The User's negative Attack/Sp.Atk drops (e.g. counter to Intimidate).
Immunity Awareness*: The AI will no longer attempt critical hit strategies against targets with *Battle Armor, Shell Armor, or Lucky Chant.
Sticky Web support
Better Crit logic
Smarter Screens (No redundancy + Context awareness)
Code Refactoring (Simpler, cleaner code)
Fixed multiple undefined_methode errors
Translated some german leftovers
added support type changing stuff like illusion/soak
Back
Top