Battle Overview

Battle Overview
by Lay

Introduction
​
The massive development of RMMV plugins has open the door to the creation of very elaborate battle strategy. Mainly, battle complexity has been provided by the ability to create complex states and skills. Unfortunately, from the player point of view, there isn't a satisfacting way to acess a nice and clear description of what those complex states really do. On the other hand,the use of specific skills usually need to have at least an estimation of the opponent parameters and elemental affinity. As a consequence, players are, for most of them, invited to adopt a "die and retry" game plan until the effect of states has been perfectly understood based on how battlers behave and react to them. However, not all developers expect from their game to require this kind of game plan for being understood. For those kind of RMMV makers, this plugin propose a way to give to player minimal information he needs on battlers to elaborate a strategy. A command named "overview" (by default) is added either to the ActorCommand Window or the PartyCommand Window. This command open a window that display information about the selected battler.​

Features​
game features :​
  • A new battle command that open a window to display information about a selected battlers. It includes the list of states the battler is currently affected by, the battler parameters and the battler element rate. The battler list and states list are selectable items. Upon state selection, a description of the state is displayed.​
  • Add a new object to game party to store the enemies element rate. You can choose to display element rate with an empty icon in the battle overview window. This new object can be update in the middle of battles to set a specific element Icon to an other value. Thus, this allow you per example to hide all the enemy element rates by default and reveal them upon hit with the corresponding element. This feature might be computed using lunatic mode, providing you a huge flexibility.
dev features :​
  • Made with respect to Yanfly plugins architecture and should be compatible with most of the Yanfly plugins.​
  • A lot of effort has been dedicated to window customization. Thus, this plugin propose a huge amount of adjustable parameters.​

Requirements​
  • This plugin required Lay_WindowDrawPolygon plugin. This plugin doesn't bring any change to the game but contain all the function I use to draw object in windows. If you are a baby scripter like me, you can enjoy an easy access to the drawing functions this plugin provide.​
  • (optional) if you are using YEP_X_AnimatedSVEnemies, the enemy battler sprite will be drawn.

Compatibility​
  • Might be place above MOG's Battle HUD plugin @Vis_Mage​

Development...
​
Coding things is a hobby for me and I don't pretend that I'm a good scripter since I'm not a pro. After a recent discovery of JavaScript, I really enjoy to create extra features to RPG Maker. Here, I propose you to help me in perfecting this plugin. If you are interested in the feature it proposes, go test it and give me your feedback !! Implementing new features, parameters or bugs correction is my absolute priority at this stage. Meanwhile, if you are an experience scripter and see something in the code that could be improve, I will really appreciate to have your feedback too and will dedicate the time I can to optimize it.​

Therms of use​

Free to use for all RMMV project, including commercial games.
Free to hack.
I will appreciate to know if you use it so don't hesitate to respond here or to send me a message with the name of your project (this is not mandatory).

BattleOverview_CurDev1.png


Bug report & Work in progress​

  • The current version don't allow you to customize the command name and the element affinity diagram legend. I'm currently working on that with low priority. If you're in a hurry and want to modify them, see in the discussion below how to modify them from the plugin code. FIXED​
  • The battle overview window doesn't give information on Enemies or Actors that appears in the middle of a battle. I'm currently working on that with a high priority. Thanks to @ScorchedGround for this report.FIXED​
  • BUG : the current version doesn't support the load of old save files if the enemy databse has been updated. I'm currently fixing this bug.FIXED (see update page 2 for details)​
  • TODO : notetags to hide gauges @ScorchedGround ​
  • TODO : extend the elemental affinity bar customization @ravenhood​
  • TODO : extend the battler selection window customization ​
  • TODO : Implement a visual notification of parameters buff/debuff
  • TODO : Add buff stack and state counter

Troubleshooting
Spoiler: Element rate related index conflict
Element rate related index conflict can be detected when the enemy element rates are not properly updated or when the enemy element rates are updated without any evident reasons. This could happen after the following action in the editor :
  • If you decide, for some reasons, to swap two elements in the database. There isn't any possibilities for the plugin to understand such a thing. As a consequence, if you per example swap element 2 and 3, the element 3 will be drawn with the icon of element 2 and vis versa for all monsters that were present in the database before you decided to swap those elements. Updating the elements icon plugin parameter will only be took into account for newly added monsters.
  • If you decide, for some reasons, to swap two monsters in the database or to change the index of a given monster. Same than before, impossible to understand it. As a consequence, all the element that has been discovered for a swaped monster will be replace by the discovered element of the other swaped monster.
  • All other manipulation that can create Element Index conflict or monster Index conflict I didn't think about are susceptible to make Element_Weakness_Discovery inconsistent with the updated database.
Because plugins can't communicate with the editor, if you want to do something similar to one of the database update cited above, you will need to reset the Element_Weakness_Discovery manually. To do so, open the console and enter the following command :

Code:
$gameParty.setUpDiscoEnemWeak()
if you are not familiar with console, you can also create a NPC and put this command in Script... Talking to this NPC will run the command.

This command will re-create the Element_Weakness_Discovery table according to the database statement. You will loose all the element you has discovered throught game advancement. However, since you will only have to use those things during game development, it shouldn't really break you're game testing.
Spoiler: Uncaught SyntaxError: Unexpected token in JSON at position 0
This error usually pop up if you have updated the plugin from a version below 0.3 to a version higher than 0.3. This occurs when plugin parameters are badly formated.
method 1 : remove the plugin from the plugin manager and reload it. This will cause to reset all parameters to default.
method 2 : carefully check the plugin parameters entries. Pay a particular attention to "Draw Icon Condition" and "Element Rate Scalling Script". Those parameters might be provide from the "Note" and not "Text".
Looks very nice and interesting, but so far it does not work for me.
Do you know of any Plugin incompatabilities? I use some VE, SRD, YEP and HIME Plugins.
If not are there any ways to break this plugin itself in some ways?
Like if you have too many states, element types or the sort?

Also I did not change any parameters of the plugin so far because I wanted to see if it works before I start
configuring it.
Thanks for this first feedback @ScorchedGround.
This error is not a plugin compatibility issue. Thanks to your screenshot I was able to identify the problem.
When opening the overview window, if the first actor is not affected by any state then it generates this error.
I've updated the plugin in consequence and now it should work.

However, I don't know nothing about SRD and HIME plugins so I can't guarantee the compatibility. Unfortunately, I can't test the compatibility with all plugins...
It works with the main YEP plugins and with VE_BasicModule, VE_BattlerGraphicsSetup (I've just tried those two from VE)

If your first actor was affected by a state when you tried to open overview window, the problem doesn't come from what I've fixed.
Alright, always glad to help.
On another note;
Is it possible to change the names for "overview" "absorb" "resist" "natural" and "weak"?
These don't really work for me because my game is in German.
Not now but this is in my TODO list.

If you are in a hurry, you can directly edit the script.

find the function called :
Code:
Window_BattleOverview_ShowInfo.prototype.drawBattlerResist_cursorVertiMode_YEP

scroll a it below until you find the following lines :

Code:
  this.drawText("ABSORB", legendX, y-9, legendWidth, "right")
  this.drawText("RESIST",legendX, y+partialHeight-9, legendWidth, "right");
  this.drawText("NATURAL",legendX, y+partialHeight*2-9, legendWidth, "right");
  this.drawText("WEAK",legendX, y+height-9, legendWidth, "right");

those function are self explanatory : change the text to what you want to display.

you will probably need to adjust the X and Width if the text is very long. Otherwise, everything will be compress and ugly. this function is parametrized as follow :

Code:
this.drawText ( text , x , y , width , align)

if your text is too long, decrease x and increase width by the same amount

EDIT :

for 'overview' you will need to find the following functions :

Code:
Window_PartyCommand.prototype.makeBattleOverviewCommand = function() {
    this.addCommand('overview','overview',true)
};
and
Code:
Window_ActorCommand.prototype.makeBattleOverviewCommand = function() {
    this.addCommand('overview','overview',true)
};

change the first value to display what you want in windows (not the second) :
Code:
Window_ActorCommand.prototype.makeBattleOverviewCommand = function() {
    this.addCommand('Frühstück','overview',true)
};
Thanks for the quick reply. I managed to change the parameters and it seems to work now.
Excellent work!
I don't know your to-do list, but
Here are a few suggestions for improvements:


#1 Notetags to make certain states not be displayed in the overview window Thank you !

#2 Notetags to make certain enemies not be displayed in the overview window.
This is useful to make boss battles more tense because you don't have much information,
or if you have some kind of "dummy" enemy that is not supposed to be shown.

#3 A way to choose what to display in the overview for each character (like hiding the HP/MP of a boss or making the elements affinity bar disappear for specific enemies)
For example you may not want to show a bosses HP/MP or Parameters.

#4 Configuring the elements affinity bar to show/hide "absorb / resist / natural / weak"
so that for example the bar only goes from weak to resist (If you don't use absorb
) Thank you !

#5 perhaps some way to increase the amount of rows for the names of the battlers for better visibility.
Having too many names in a single row makes it kind of chaotic to navigate.

#6 Ability to change font-sizes and colors of the different text parts of the overview screen instead of just the element affinity names. (Parameter names, state names, battler names etc.)

#7 Another option to show the overview command both in the actor menu and in the party menu.
Now you can only choose either of the menus or none at all.

#8 Remove the "text-gap" when a state has no icon (Icon 0) and is shown in the overview screen.

#9 Auto-Compression of larger text in the state names and battler names.

#10 Option to show HP/MP as a %-Value instead of absolute numbers

#11 Option to show actual parameter values in the parameter pie

Of course these are merely suggestions that I think will add a lot of flexibility to your plugin.
There seems to be some sort of issue still there.

#1 Sometimes When I leave the overview window from the "party action menu" the
"actor action menu" disappears (It still is functional however).

#2 Also any enemies that appear during the fight (appear halfway) do not show
up in the overview window.
Thanks for this feedback,

For the enemy that appear during the fight, this is normal according to how I've coded the plugin but this is a serious problem and I will need to fix it ASAP. I've honestly didn't think about that when I've coded it, I'm really sorry. Unfortunately, I can't fix it in few seconds. I will update this post when I will have something that work properly.

For the Actor command window issue, I don't really understand why it behaves this way.
I've changed few portion of code and it seems to work properly, at least on my rmmv project with a limited amount a plugin.

I will update this thread when the middle battle appearing will be fixed.

PS : It shouldn't work for any changes that occurs to the troop or the party during the middle of battle. Including battler transformation.

PS2 : I'm very sorry that you actually are my beta tester, it is probably not pleasant for you xD But at the end you really help me and you're pointing out bugs and issues that I've didn't think about. Thousands of thanks for your help.
Ahh don't worry about it.
I mean your plugin is a nice addition for my game and I'd love to use it,
but it is not critical for playtesting. So it's no problem if the plugin still has some rough edges.

I don't mind playtesting your plugin, really. Rather, I'm honored.

Just take your time with the plugin and don't feel rushed. I will tell you when I find other problems or
have more suggestions.
Update

Plugin Parameters

General > Command Name
you now can define what is the command name that is displayed in window.

State Area > No State Name
the text to display if the selected battler isn't affected by any state.

Elements Affinity > Legend Name Weakness
Elements Affinity > Legend Name Natural
Elements Affinity > Legend Name Resist
Elements Affinity > Legend Name Absorb

you now can define what are the legend names in the elemental affinity diagram legend.

Elements Affinity > Legend Name Font Size
control the font size in the elemental affinity diagram

Notetag

Enemies

Code:
<Hide Elem Icons: X>
Change X by the desire icon index. All element Icons will be replace by X in the overview window.
note that icon index 0 is an empty icon. Thus, if X=0, no icon will be visible in the window.

example :

Code:
<Hide Elem Icons: 16>

Capture d’écran de 2020-05-12 16-39-43.png


The player know this monster is weak to 2 elements but also resist two other elements. Can you figured out what are those elements ?

Functions

A new feature has been implemented about how enemies store the elements icons. Now, $gameParty contain the information of icons for all elements and for each enemies. Thus, it open the door to a dynamic visualization of elemental affinity with game progress.

Game_Party.setElemIconDefault( enemyID, elementID)

the function above is used to replace the element icon of a given enemy by the elemet icon provided by plugin parameters. Okay I know it's a mess to understand but let's illustrate how this function can be used with the example below (yanfly plugins BuffsStatesCore and AutoPassiveStates required):


As you saw above, I can't see the elemental affinity of the monster.
However, this monster is affected by a passive state that contain the following notetag :

Code:
<Custom Respond Effect>
if (target.result().hpDamage > 0) {
  var EnemyId = target._enemyId;
  var elements = this.getItemElements();
  $gameParty.setElemIconDefault(EnemyId,elements)
}
</Custom Respond Effect>

I've successfully hit the monster with a Ice spell. Honestly it didn't inflict the expected damages... Let's have a look again to the monster in the Overview window :

Capture d’écran de 2020-05-12 16-53-04.png


yeah well I understand why it didn't inflict damages... the monster actually resist Ice. Damn it.


When this function is used, it modify the elemental icon display of the specified monster ID for ever !!
There isn't a way to set updated icons back to there original values yet.
This information is well carried throught game saves and is independent between saves.


Other changes

states with a priority of 0 will not show up in the state list.

Enemies that appear in the middle of battle are correctly took into account.
Well this was quick.
First off, thanks for fixing the bugs and making it possible to make states invisible.

I don't know if these are bugs within your plugin, but I encountered some problems.
I attached some pictures. Maybe I just used the new functions wrong.

I basically made a state with
<Custom Respond Effect>
if (target.result().hpDamage > 0) {
var EnemyId = target._enemyId;
var elements = this.getItemElements();
$gameParty.setElemIconDefault(EnemyId,elements)
}
</Custom Respond Effect>

in its notetag and added the state to the monster.

Said monster also got the notetag
<Hide Elem Icons: 93>


Also, I will update my suggestion list from earlier when some more come
to mind.
Hum I can't reproduce the bugs on my RMMV session.

Have you open the plugin manager, reload the plugin and save the game before testing ?
Can you reproduce this bug in a new rmmv project with a limited amount of plugins ?

EDIT : also, did you hit the monster with a skill before you looked at the overview window ?
does this skill has the element 12 ?
Hmm... I just created a new project and tried it out.
It does not crash, however, hitting the enemy with an element it is weak to did not seem
to update the element icon. That is the first picture in the attachments

As before, the bat had the invisible state with the
following in its notetag
<Custom Respond Effect>
if (target.result().hpDamage > 0) {
var EnemyId = target._enemyId;
var elements = this.getItemElements();
$gameParty.setElemIconDefault(EnemyId,elements)
}
</Custom Respond Effect>


and the bat had this in its notetag
<Hide Elem Icons: 1>

I loaded up my original project and turned off all plugins except
your plugins. the second attachment was what I got when i hovered over the enemy.
Forgot to mention that the notetag you use to reveal elements upon hit require YEP_ElementCore since I'm using a function from this plugin to retrieve the skill element easly.

However, the plugin should work without YEP_plugins... I'm a bit confused about this error, will investigate it deeply. You don't get this error if you don't use the <Hide Elem Icons: 1> notetag right ?

PS : can you tell me if, on your main project, you're testing the plugin with battle test or in loading an existing save ?
First off, for clarification, I do use YEP_ElementCore and your plugins are beneath it in the manager.

I did some more testing and I am quite confused now. But I also managed to clear up some confusion.
First, the good news:
It seems like I got the crashes because I loaded up previous save games from before you even posted
your plugin here.
When I started a new game and got to the point again where I got the crashes, it did not crash.

Now, the not-so-good news:
There seem to be a lot of strange things happening with the plugin.
I added the <Hide Elem Icons: 1> to a single enemy, but somehow every enemy has
their element icons hidden (including actors).
And also the element-checking does not seem to work for me. I hit them with an attack they are
weak to but the icon does not update.
Okay so for the crash problem this is good news.

The plugin store the elemental affinity discovery in $gameParty.
In order to store it, when game party is initialize, the plugin create a new $gameParty property namely $gameParty._DiscoveredEnemiesWeakness
However, gameParty is only initialize when you start a new game. When you load a save, $gameParty is retreive from the save file and is not initialize (otherwise, you will loose all you game advancement related to gameParty).
When you go in battle overview from your save, the plugin search in $gameParty._DiscoveredEnemiesWeakness what's the Icon he must display for a given element. However, because gameParty was initialize without this plugin, $gameParty._DiscoveredEnemiesWeakness doesn't exist. This is why you got a cannot read property of undefined.

For the strange behavior of icon that are erased by the icon in notetag, I've edit the plugin to declare related variable differently. But for some reason, I can't reproduce this problem on my RMMV project so I'm not sure those changes will fixe the issue.
This thread is getting pretty long 😀

So here's more good news:
Whatever you did to fix these problems, it seems to have worked.
The notetags are looking to be working properly now.
I managed to hide the element icons and they did update when I hit them with the element.
And also only enemies with the notetag have their icons hidden now.

Excellent work and sorry for bugging you so often 😀
Hey, I know this thread is kind of old, and idk if it's still active but I've encountered an issue. It was working fine up until I got to the enemies and then an error message popped up. It was working fine in the Troops testing, so i don't know what's going on with it.
BugSnapshot2.PNG
Hey, I know this thread is kind of old, and idk if it's still active but I've encountered an issue. It was working fine up until I got to the enemies and then an error message popped up. It was working fine in the Troops testing, so i don't know what's going on with it.
View attachment 143399

Yes I had that same error before. Lay already explained why this error occurs.

This error happens when you put the plugin in your game and then load an old savegame.
You have to start a new game to make the plugin work.

Also, this thread is not really old and very much active, it's been a couple of days only.

Original thread: https://forums.rpgmakerweb.com/threads/battle-overview.121408/