- Pokémon Essentials Version
- v20.1 ➖
What if I tell you that current Essentials AI is actually at its core quite decent? I know some of you have been through too much grief to even humor the thought.
Its move effect scores account for most basic scenarios so if it could just reliably make use of those scores, it would do the job you want it to do most of the time.
And therein lies the problem.
For some reason even at the highest skill levels the AI is set to work with an RNG-based system so even if it had a higher chance to click the proper move, that chance is far from what you would want.
Through this plugin i have eliminated the random aspect of the AI decision making. When a move, or a pokemon switch is determined to be the best choice in the decision making process, it will choose that one, no questions asked.
A lot of sections of the AI have been massively reworked, and there has been a lot of code made from scratch. Here are the most notable changes:
Obviously when you make the AI calculate more and more factors for its decisions, eventually the processing time for the decision making grows long enough that it is felt by the player during battle, especially in doubles, where slower PCs had to wait quite some seconds every turn for the AI to finish deciding.
The main culprit of this was just how many times the AI had to go through the entirety of pbRoughDamage (a pretty lengthy method) for every single little thing. We are talking about countless iterations.
To solve this, the AI now calculates all possible damages between every pokemon in the battle once at the start of the turn, and saves them in a hash through the registerDamagesAI method. And so instead of recalculating it every time, it just grabs the appropriate calculation of x move vs y opponent from the hash.
Things that I hope to tackle in an unknown future:
-Improving decision making in doubles. Naturally the more factors are in the battle at the same time, the more complex the AI processing becomes. I am very satisfied with singles right now, but doubles definitely has space for improvement.
-Mega Evolution related AI, especially calculation of damages after mega evolution for a pokemon that isn't mega evolved yet. More ambitious goal: choose to not mega evolve if it's more beneficial to stay in current form, or to hold the mega evolution for later.
There is always space for improvement. through feedback i can try make tweaks where needed in the future to make this AI play better (see: try making some gimmick strategies to work better).
================
This is a very early iteration of this plugin for games that use Essentials v18. It doesn't have all the improvements I added in v2.0 and I don't know when i'll get around to doing that, but it's still serviceable. Plugins weren't a thing back then so just make a new script page near the bottom of your scripts, and dump the contents of this file in there.
THIS IS FOR ESSENTIALS V18 ONLY
================
Its move effect scores account for most basic scenarios so if it could just reliably make use of those scores, it would do the job you want it to do most of the time.
And therein lies the problem.
For some reason even at the highest skill levels the AI is set to work with an RNG-based system so even if it had a higher chance to click the proper move, that chance is far from what you would want.
Through this plugin i have eliminated the random aspect of the AI decision making. When a move, or a pokemon switch is determined to be the best choice in the decision making process, it will choose that one, no questions asked.
A lot of sections of the AI have been massively reworked, and there has been a lot of code made from scratch. Here are the most notable changes:
- Added a lot more move function specific code in AI Move EffectScores. AI should now have massively improved and consistent decision making for most moves.
- Improved priority move related AI using Reborn's priority moves AI as a base
- Reworked the process of selecting the proper damaging move. Most damaging moves whose power depends on other factors are now handled in pbGetMoveScoreDamage instead of pbGetMoveScoreFunctionCode and will be chosen based on their calcualted resulting damage rather than arbitary scoring.
- Different logic for moves with imperfect accuracy that doesn't impact decision making so drastically,
- Various factors that would affect the score of damaging moves had their score modifiers turned from additive to multiplicative for better accuracy.
- A completely made from scratch AI on selecting the next pokemon to bring into battle that decides based on approximate incoming and outcoming damage calculation, speed comparison, and a lot of other factors. To achieve that a fake battler is created for every party member not yet into battle, and the one that gets the best outcome in a clash with the current opposing pokemon is chosen.
- Reworked AI for usage of healing items in battle. Instead of arbitary scoring based on isolated factors and rng, it now basically uses logic similar to recovery moves for healing items, and similar to set-up moves for X items, with the proper damage and other calculations to assist in decision making.
- New code for the purpose of calculating if a pokemon will survive another pokemon's moves after taking into account damage calculation, abilities, items, priority moves on the following turn, and other factors.
- Code that helps AI access the biggest threat in doubles+, and prioritise targeting it.
- Integration of the new elements from the Generation 9 Pack v2.0 for compatibility.
- Emulation of "mind games" for sucker punch and wide guard.
Obviously when you make the AI calculate more and more factors for its decisions, eventually the processing time for the decision making grows long enough that it is felt by the player during battle, especially in doubles, where slower PCs had to wait quite some seconds every turn for the AI to finish deciding.
The main culprit of this was just how many times the AI had to go through the entirety of pbRoughDamage (a pretty lengthy method) for every single little thing. We are talking about countless iterations.
To solve this, the AI now calculates all possible damages between every pokemon in the battle once at the start of the turn, and saves them in a hash through the registerDamagesAI method. And so instead of recalculating it every time, it just grabs the appropriate calculation of x move vs y opponent from the hash.
Things that I hope to tackle in an unknown future:
-Improving decision making in doubles. Naturally the more factors are in the battle at the same time, the more complex the AI processing becomes. I am very satisfied with singles right now, but doubles definitely has space for improvement.
-Mega Evolution related AI, especially calculation of damages after mega evolution for a pokemon that isn't mega evolved yet. More ambitious goal: choose to not mega evolve if it's more beneficial to stay in current form, or to hold the mega evolution for later.
There is always space for improvement. through feedback i can try make tweaks where needed in the future to make this AI play better (see: try making some gimmick strategies to work better).
================
This is a very early iteration of this plugin for games that use Essentials v18. It doesn't have all the improvements I added in v2.0 and I don't know when i'll get around to doing that, but it's still serviceable. Plugins weren't a thing back then so just make a new script page near the bottom of your scripts, and dump the contents of this file in there.
THIS IS FOR ESSENTIALS V18 ONLY
Consistent AI for v18 v1.0.1
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com
- Credits
- DemICE