Enemy Battle Resource Question

Hello everyone!

I’m currently at work, doing some developing note taking on the side and while working on my battle system notes I ran into somewhat of a snag.

A quick explanation of the battle system I’m currently calling the “Elemental Reign System”:

It's turn based, 4 PCs on the players side with the option to switch in and out reserve characters.

There's an elemental bar that fills as each element( Earth, Fire, Water, and Wind) is used. As the bar fills with Elemental Charge points (EC), that particular element becomes more powerful throughout the battle. Both the player cast and enemies has attacks that both build EC and use it and all battle participants both enemy and player benefit from the effects of filling and emptying the EC bar.

Strategically and ideally, this would force the player to ask such questions as “I know this boss is going to use the super fire attack he’s been building up to this battle. Is it better this turn to use the water element to deal a big chunk damage to this fire dragon boss or should I switch in a fire character to use a fire move that yes won't deal as much damage but will use up some Fire elemental charge thus rendering his flame breath super attack unuseable.

Players also have passive skills that grant them buffs or special abilities as well as reaction abilities (enemies have these as well) that auto trigger when certain conditions are met. For example I have a wind based healer that has a 50% chance to raise her AGI by 50% for 2 turns when she's hit with a wind elemental attack thus allowing her to heal more allies in a shorter amount of time. PCs also a have special ultimate they can use when the elemental charge bar is full.

To balance this the player only has 50 Skill points to work with and regular builds SP. Goabove 50SP and you suffer damage and your SP is reset to 0. This way they can't simply spam normal attacks to win.

All enemy types have both a physical and elemental weakness thus greatly encouraging the switching of party and characters as wach character can only have one weapon type and element.


There are a few more mechanics but this is the main drift. My main question is: if the enemy doesn’t have EC to use a move would it just do nothing or intelligently use another attack?

I understand that for example if we forget to add enemy MP, the enemy will be unable to use any of its skills and default to attack. I am unsure of what would happen in my case because EC isn’t a natural resource in the engine but rather one I got a specific custom made plug-in for and I’m not 100% sure how it the engine would process it.

If the enemy will not automatically know to just use a move it does have access to if it doesn’t have enough EC, is there a way I can tell it to do that through eventing or plugins?

Thank you so much for anyone who has taken the time to read and give an answer!
If I may make the suggestion - try to focus your questions down to the necessary information. All of the stuff about your elemental bar, how many actors and switching them, what questions you want the player to ask, having passive skills and buffs, none of that is relevant to your actual question.

And it makes a lot of stuff for other people to read through and try to parse what is actually germane to the matter at hand.

Once you get to the bottom, the answers are:
- We don't know for sure because you never said what plugin you're using, so no one else can tell you how it works. 😉

- As a general rule, enemies don't "intelligently" do anything. You know this from your example with not having MP. The enemy may choose that move then be unable to perform it on their turn. Why would it be different with a custom-added resource?

- If you want to control exactly what your enemies do, a plugin like Yanfly's Battle AI Core will do it.
Depends completely on how you implement your logic, because by default the internal logic will not know to even look at your elemental charges.

By default the skill selection is based on cost and rating only. If a skill has a cost that the enemy cannot meet, it is removed from the available skill list (usually MP or TP too low)
Then between all available skills, the one with the highest rating is checked.
The second step is to remove all skills with a rating more than two points lower - if for example the highest available rating is 5, then all skills with ratings 1 and 2 will be removed.

After that the game builds a weight chard with weight 1, 2 and 3 based on the ratings and randomly rolls which of the skills is used based on that weight.
If I may make the suggestion - try to focus your questions down to the necessary information. All of the stuff about your elemental bar, how many actors and switching them, what questions you want the player to ask, having passive skills and buffs, none of that is relevant to your actual question.

And it makes a lot of stuff for other people to read through and try to parse what is actually germane to the matter at hand.

Once you get to the bottom, the answers are:
- We don't know for sure because you never said what plugin you're using, so no one else can tell you how it works. 😉

- As a general rule, enemies don't "intelligently" do anything. You know this from your example with not having MP. The enemy may choose that move then be unable to perform it on their turn. Why would it be different with a custom-added resource?

- If you want to control exactly what your enemies do, a plugin like Yanfly's Battle AI Core will do it.
Thank you for your reply!

I am in fact using Visustella’s enemy AI plug-in and while I have it doing almost everything I want, this particular aspect seems like it is something I will have to further investigate. Thanks again!
Well, the instructions say your entries in the Condition List will be evaluated as JavaScript. So if you know how to reference your EP variable (we still don't know how you're making that), you would simply check user.ep>=15 or whatever as a condition for the skill to be selected.
Depends completely on how you implement your logic, because by default the internal logic will not know to even look at your elemental charges.

By default the skill selection is based on cost and rating only. If a skill has a cost that the enemy cannot meet, it is removed from the available skill list (usually MP or TP too low)
Then between all available skills, the one with the highest rating is checked.
The second step is to remove all skills with a rating more than two points lower - if for example the highest available rating is 5, then all skills with ratings 1 and 2 will be removed.

After that the game builds a weight chard with weight 1, 2 and 3 based on the ratings and randomly rolls which of the skills is used based on that weight.
Thank you for your reply!

It was my understanding that the engine wouldn’t know my plug-in by default which prompted me to ponder this question so it’s good to know I’m at least on the right track on how things work (hobbyist not professional game maker).

I didnt know that’s how the engine natively works with enemy AI as I went in I Visustella’s AI. So thank you very much for that information! I have successfully been able to program what the enemy does each turn. I can tell it to use an EC charging move for turn 2 and an EC costing skill for turn 3.

I guess my confusion would be if there are no regular attacks the enemy can use and the player uses an EC Costing skill on their turn 2: what happens on turn 3 when the enemy try to use its EC costing skill and there’s non left? By default use a different skill or does the game break?

Either way it appears I just need to test and see what happens! Thank you for taking the time to answer 🙂
Well, the instructions say your entries in the Condition List will be evaluated as JavaScript. So if you know how to reference your EP variable (we still don't know how you're making that), you would simply check user.ep>=15 or whatever as a condition for the skill to be selected.
Please excuse my ignorance: coding knowledge is quite limited.

I commissioned this plug-in so I cannot say how it is references by the engine. But I must thank you again because you have confirmed another unasked question that I intended to search for as well about checking conditions and in fact, your answer may have solved my entire conundrum I will have to look now, thank you so much!
If you commissioned the plugin, the author should have given you instructions as to how you can reference EP on a battler.
If you commissioned the plugin, the author should have given you instructions as to how you can reference EP on a battler.
To be fair, he may 100% have and I just didn’t understand it. As I mentioned earlier I’m a hobbyist and while I’m great at following directions and understanding them and even most of the time applying them to future ideas- sometimes my understanding of the process and terminology is askew.

For example I had to create each element as variable. Now from tutorials and my novice understanding - the numbers I assigned as variables should be the ones used in the Java Script. Now if I’m wrong, my understanding is incorrect and I don’t know why. I’ve reached out to the coder to ask 🙂

Original thread: https://forums.rpgmakerweb.com/threads/enemy-battle-resource-question.157339/