• 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.
Consistent non-random AI - Revised!

Resource Consistent non-random AI - Revised! 2.0.4

DemICE

QoL junkie
Member
Joined
Jan 12, 2018
Posts
97
DemICE submitted a new resource:

Artificial Stupidity (Consistent non-random AI) - Completely removes the randomness from AI decisions, making it consistent. Also some extra tweaks.

What if I tell you that current Essentials AI is actually at its core quite decent?
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...

Read more about this resource...
 

Amallah

Horror Maze Enthusiast
Member
Joined
Apr 3, 2023
Posts
42
Do i need to remove improved ai pluggin for this to work?

Does this work with improved ai plugin?
👇
I've taken measures for this plugin to be able to be used alongside this Improved AI plugin that i've found on this site, because I noticed it does some useful tweaks to effect scores for hazard and weather moves. However the rest of my edits will override that plugin's edits because the decision making is still RNG-based there, and the whole point of my plugin is to eliminate randomness.
 

EndlessBeat

Professionally Unprofessional
Member
Joined
Apr 2, 2021
Posts
89
1697228439006.png

I'm using the latest version, and it's still giving me the error where the opponent tries to switch with one Pokémon left.
 

niels

Rookie
Member
Joined
Apr 15, 2019
Posts
2
when i'm in a triple battle and the furthest pokemon cannot do anything it gives me an error. this site won't let me insert a picture but it looks nearly identical to the one from EndlessBeat
 

DemICE

QoL junkie
Member
Joined
Jan 12, 2018
Posts
97
DemICE updated Consistent non-random AI (also a version for Essentials v18 in the thread) with a new update entry:

A complete revamp of the Consistent non-random AI plugin

It's been a while, and after running this AI on multiple projects and adding more and more elements to it, I'm confident to finally publish a massively improved iteration of the original plugin, which now feels very barebones in comparison.

In addition to what it was already doing, now this AI comes with these improvements:
  • 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...

Read the rest of this update entry...
 

CelestialFearow

Venipede User
Member
Joined
Jul 24, 2020
Posts
200

DemICE

QoL junkie
Member
Joined
Jan 12, 2018
Posts
97
When it comes to mega evo, I think it would be a stupid change to make the ai don't mega, imo. What if the game has new custom megas? Feel like the ai should always mega regardless. After all, you give the mega evo to a trainer for a reason
examples (PoV: you are an AI):
1) staying as base form charizard (you have charizardite X) when opponent has only ground moves or is locked into one
2) you are an aggron and the opponent can oneshot both your base and mega forms from full. so you stay in your base form if you have sturdy to survive and hit back.
3) staying as base form sharpedo after using protect to gain a speed boost before mega evolving
4) staying as base form sableye to will o wisp an opponent with priority before mega evolving next turn to take less overall damage
5) staying as base form garchomp because you are faster than your opponent and can KO them, while your mega would be slower
6) staying as base form venusaur because you have chlorophyll and its sunny (you didn't plan for it but you're glad it happened) and you can use it to your advantage
7) it's already sunny and your charizard has zardite Y and you know the opponent has rain dance. you stay in base form to benefit from solar power while staying as a looming threat to mega evolve and cancel their rain if they use rain dance.
 

CelestialFearow

Venipede User
Member
Joined
Jul 24, 2020
Posts
200
examples (PoV: you are an AI):
1) staying as base form charizard (you have charizardite X) when opponent has only ground moves or is locked into one
2) you are an aggron and the opponent can oneshot both your base and mega forms from full. so you stay in your base form if you have sturdy to survive and hit back.
3) staying as base form sharpedo after using protect to gain a speed boost before mega evolving
4) staying as base form sableye to will o wisp an opponent with priority before mega evolving next turn to take less overall damage
5) staying as base form garchomp because you are faster than your opponent and can KO them, while your mega would be slower
6) staying as base form venusaur because you have chlorophyll and its sunny (you didn't plan for it but you're glad it happened) and you can use it to your advantage
7) it's already sunny and your charizard has zardite Y and you know the opponent has rain dance. you stay in base form to benefit from solar power while staying as a looming threat to mega evolve and cancel their rain if they use rain dance.
That's some point. But, if I give a mega to a trainer, I want to see them use it regardless of what Pokémon the player use. So, just add an option to make the ai use mega evo regardless of what Pokémon the player use, and that should fix everything
 

BIGFriv

Mr. Bigglesworth
Member
Joined
Mar 31, 2017
Posts
58
That's some point. But, if I give a mega to a trainer, I want to see them use it regardless of what Pokémon the player use. So, just add an option to make the ai use mega evo regardless of what Pokémon the player use, and that should fix everything
That's a bit odd no? This is to make the AI better, and you want to dumb it down?
 

RegalSword

Pokemon Itinerant Developer
Member
Joined
Feb 13, 2021
Posts
522
Hello! I just finished installing v2.0 and tried entering a battle. This message pops up when I finish selecting a move. My move is executed but the opponent's turn is skipped.
Code:
Expand Collapse Copy
=================

[2024-08-28 22:23:49 -0700]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: ArgumentError
Message: Invalid argument passed to method.
Expected [nil, 0] to be one of [Symbol, GameData::Item, String], but got Array.

Backtrace:
Validation:29:in `validate'
GameData:92:in `get'
[Generation 9 Pack] [003] Battle_AI.rb:69:in `pbEnemyShouldUseItem?'
[Essentials Deluxe] Battle.rb:375:in `pbDefaultChooseEnemyCommand'
[Consistent AI] AI Utilities.rb:2621:in `block in pbCommandPhaseLoop'
[Consistent AI] AI Utilities.rb:2566:in `loop'
[Consistent AI] AI Utilities.rb:2566:in `pbCommandPhaseLoop'
[Essentials Deluxe] Battle.rb:242:in `pbCommandPhase'
[Terastal Phenomenon] [004] Battle.rb:160:in `pbCommandPhase'
Battle_StartAndEnd:338:in `block (2 levels) in pbBattleLoop'
 

Almeidarts

Novice
Member
Joined
Jan 2, 2022
Posts
15
Hello! I've recently updated the script to 2.0, and in a battle against an opposing trainer's Capsakid, an error message appears when I select a move. The game doesn't crash and the move is executed, but the opponent's turn is skipped. This was the only time I've seen this error appear so far.

=================
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: NameError
Message: uninitialized constant PBEffects::ClearFlute

Backtrace:
[Consistent AI] AI Move EffectScores.rb:3090:in `pbGetMoveScoreFunctionCode'
[Consistent AI] AI Move.rb:352:in `pbGetMoveScore'
[Consistent AI] AI Move.rb:178:in `pbRegisterMoveTrainer'
[Consistent AI] AI Move.rb:46:in `block in pbChooseMoves'
Battle_Battler:455:in `block in eachMoveWithIndex'
Battle_Battler:455:in `each'
Battle_Battler:455:in `each_with_index'
Battle_Battler:455:in `eachMoveWithIndex'
[Consistent AI] AI Move.rb:41:in `pbChooseMoves'
[Consistent AI] AI Utilities.rb:34:in `pbDefaultChooseEnemyCommand'
=================

Additionally, this message also appears on the Debug Log when this error happens:

=================
Damage calculations for: Capsakid
------------------------------------------
Razor Leaf damage on Wisp: 14 / 53
Exception `NameError' at [Consistent AI] AI Move EffectScores.rb:3090 - uninitialized constant PBEffects::ClearFlute
=================
 

DemICE

QoL junkie
Member
Joined
Jan 12, 2018
Posts
97
Hello! I've recently updated the script to 2.0, and in a battle against an opposing trainer's Capsakid, an error message appears when I select a move. The game doesn't crash and the move is executed, but the opponent's turn is skipped. This was the only time I've seen this error appear so far.

=================
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: NameError
Message: uninitialized constant PBEffects::ClearFlute

Backtrace:
[Consistent AI] AI Move EffectScores.rb:3090:in `pbGetMoveScoreFunctionCode'
[Consistent AI] AI Move.rb:352:in `pbGetMoveScore'
[Consistent AI] AI Move.rb:178:in `pbRegisterMoveTrainer'
[Consistent AI] AI Move.rb:46:in `block in pbChooseMoves'
Battle_Battler:455:in `block in eachMoveWithIndex'
Battle_Battler:455:in `each'
Battle_Battler:455:in `each_with_index'
Battle_Battler:455:in `eachMoveWithIndex'
[Consistent AI] AI Move.rb:41:in `pbChooseMoves'
[Consistent AI] AI Utilities.rb:34:in `pbDefaultChooseEnemyCommand'
=================

Additionally, this message also appears on the Debug Log when this error happens:

=================
Damage calculations for: Capsakid
------------------------------------------
Razor Leaf damage on Wisp: 14 / 53
Exception `NameError' at [Consistent AI] AI Move EffectScores.rb:3090 - uninitialized constant PBEffects::ClearFlute
=================
Hi, I just saw this. I'll be fixing it. There are 4 instances of
|| @battle.field.effects[PBEffects::ClearFlute]>0
remnants from me working on Ashen Frost that had this item. I thought I cleaned everything Ashen Frost exclusive but i always forget that exists...
 
Last edited:

DemICE

QoL junkie
Member
Joined
Jan 12, 2018
Posts
97
Hello! I just finished installing v2.0 and tried entering a battle. This message pops up when I finish selecting a move. My move is executed but the opponent's turn is skipped.
Code:
Expand Collapse Copy
=================

[2024-08-28 22:23:49 -0700]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: ArgumentError
Message: Invalid argument passed to method.
Expected [nil, 0] to be one of [Symbol, GameData::Item, String], but got Array.

Backtrace:
Validation:29:in `validate'
GameData:92:in `get'
[Generation 9 Pack] [003] Battle_AI.rb:69:in `pbEnemyShouldUseItem?'
[Essentials Deluxe] Battle.rb:375:in `pbDefaultChooseEnemyCommand'
[Consistent AI] AI Utilities.rb:2621:in `block in pbCommandPhaseLoop'
[Consistent AI] AI Utilities.rb:2566:in `loop'
[Consistent AI] AI Utilities.rb:2566:in `pbCommandPhaseLoop'
[Essentials Deluxe] Battle.rb:242:in `pbCommandPhase'
[Terastal Phenomenon] [004] Battle.rb:160:in `pbCommandPhase'
Battle_StartAndEnd:338:in `block (2 levels) in pbBattleLoop'
hi, just saw these.
It looks like your game is trying to call pbEnemyShouldUseItem? but this shouldn't be happening because i have commented that line out in def pbDefaultChooseEnemyCommand.
From your backtrace it looks like Essentials Deluxe has a version of def pbDefaultChooseEnemyCommand that is overriding mine.
I never found this issue because in my build Consistent AI loads after Essentials Deluxe.
I will be adding Optional = Essentials Deluxe,1.0 in my meta.txt. That should fix it.
 
Back
Top