Yanfly's Battle AI Core: Randomly skipping turns

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
60
Reaction score
8
First Language
English
Primarily Uses
RMMV
I'm having an issue in Yanfly's AI Core where, for some reason, listing skills in the "AI Priority" tag causes the enemy to just sometimes not use skills even if they meet the condition.

For example, I have two skills I want an enemy to use. Both will only trigger if a variable is equal to or greater than 3 and equal to or less than 5, and only one will trigger if a second variable is above or below 50.

Code:
Variable 206 >= 3  +++ Variable 206 <= 5 +++ Variable 208 < 50: SKILL 701
Variable 206 >= 3  +++ Variable 206 <= 5 +++ Variable 208 >= 51: SKILL 702

Even if the enemy has met these conditions, it will sometimes ignore them and spend a turn doing nothing or even use the wrong skill entirely. Even forcing the enemy to use a skill on turn 1 causes it to do nothing sometimes. It seems entirely random as to if a skill will work or not and I can't work out a cause.

All my plugins are organized correctly and I'm not using any other plugins that change battle systems outside of Yanfly's own, so I'm not sure what the issue is.
 

MagicPizzaGuy

Mother of All Omelettes
Veteran
Joined
Jul 16, 2014
Messages
50
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
I had some problems also with AI core and all of them until now were my fault. I don't know exactly what's going on, but it would be good for you to press F8 and check if your variables are all acting correctly.

I don't know how much you already know about this, so I will act as if I was problem solving my own game.

Inside the battle I would press F8, F8 is my best friend and I love him.
There I would write $gameVariables.value(206) and enter. Check value.
Then I would write $gameVariables.value(208). Check value.
I would look at the mana cost for the skill and how much mana the monster has. $gameTemp._actionBattlers (IDK if this is a thing from RPG MV or Yanfly, but I think it should work). I would search in the arrow for the enemy I want to look.
Then I would look into the notetags and see if I made the monster with AI of 100 (I think this is what it must be done so the AI follows the command strictly instead of acting on its own)
Then I would check if the plugin in the plugin list is set at 100 and not the deafult 80

If nothing works I would be frustrated, but would search somewhere else, I can't remember what else I would look now, I hope I could help
 

Lay

Veteran
Veteran
Joined
Jul 18, 2019
Messages
124
Reaction score
47
First Language
French
Primarily Uses
RMMV
This is how I understand your conditions :

condition for skill 701 : Variable 206 must be between 3 and 5 included and variable 208 must be strictly lower than 50.
condition for skill 702 : variable 206 must be between 3 and 5 included and variable 208 must be greater or equal to 51.

condition are not met
- if variable 206 is strictly lower than 3
- if variable 206 is strictly greater than 5
- if variable 208 is equal to 50.

try to insert more condition in order to cover all possibilities :

Code:
Variable 206 >= 3  +++ Variable 206 <= 5 +++ Variable 208 < 50: SKILL 701
Variable 206 >= 3  +++ Variable 206 <= 5 +++ Variable 208 >= 51: SKILL 702
Variable 206 < 3 : SKILL 801
Variable 206 > 5 : SKILL 802
Variable 208 === 50 : SKILL 803

use skill 801, 802 and 803 as reporter skill for checking purpose.

You will see if sometimes your condition are not met.
Also, add a skill to the enemy using the default setting. Thus, if no condition are met, you will see it.
 

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
60
Reaction score
8
First Language
English
Primarily Uses
RMMV
try to insert more condition in order to cover all possibilities :

I've attempted to make individual conditions for each possible combination, but for some reason it still misses turns even when conditions are met.
Even more confusing is that if I just apply a basic "Always: Skill 1" command it still likes to skip turns.

I'm using the latest version of AI core and this happens even on a new project, so I'm really not sure what's happening.
 

Lay

Veteran
Veteran
Joined
Jul 18, 2019
Messages
124
Reaction score
47
First Language
French
Primarily Uses
RMMV
Have you set <AI Level: 100> as @MagicPizzaGuy recommended ?
If you didn't, you have a 20% chance that a condition will be false regardless of its code. The default value of 80 can be change in the plugin parameters. you can also use the notetag to fixe a value for each enemy.

Since I can't reproduce your problem I'm just guessing.
 

Latest Threads

Latest Profile Posts

Yay! Someone did a playthrough of my game. :D


When you thought you'd be finished with the grid, and spend ~8-9 hours on an arrow. How is this more difficult to than player movement?

Still some bugs hiding in there, but it's nearly complete.

I'm having it strictly follow the path a user draws, because there will be booby trap and other similar mechanics where you want to avoid specific cells.
I feel like banging my head against a wall every time I want to find that post that shows all the plugin header codes. Then I think "next time I find it, I'm going to bookmark it". Then I think "wait a minute ... maybe I bookmarked it last time because it took me so long to find it". Check bookmarks, and there it is :)
... a few of my main characters standing around doing nothing lol. I mostly wanted to see them together on screen.

Forum statistics

Threads
107,832
Messages
1,032,491
Members
139,982
Latest member
nanduh
Top