How much does formation matter?

xlucky_rat

They/Them
Veteran
Joined
May 16, 2022
Messages
77
Reaction score
85
First Language
English
Primarily Uses
RMMV
I know in some games, people towards the front of the party are more likely to get hit by enemies. Is this true for MZ by default?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,925
First Language
English
Primarily Uses
RMMV
Kind of. Every actor has a target rate parameter (sp-parameter in the traits list).

When an enemy is choosing a target, they roll a random number, then go through the party list seeing if that actor's target rate is large enough to be chosen as the target.

So the target rate can weight it quite a bit, but it does technically look in party order, so if the roll was low enough (or if everyone has the same target rate), being lower in party order makes you more likely to be hit.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,325
Reaction score
9,714
First Language
German
Primarily Uses
RMMV
by default, the formation screen is the only way for the player to change party order.

also by default, the first four party members are the battle members, and everyone in fifth or later positions are the reserve members that do not participate in battle.

so the formation decides which actors are available in battle if your party is larger than four people.
additionally, the developer can decide (database system 1 tab, "EXP for reserve members") if the reserve members get the same EXP as the battlemembers or not.

So if your party has a maximum of four members, the formation screen has absolutely no technical use.
But if you have five or more members in your party, the formation becomes your key to success as it determines which actors are in the battle or not.

(while the target rate is handled like @ATT_Turan describes in the post above, the effects of changing position 1 to 4 on the probability of being targeted are neglegtable. No random generator ever is truly equidistant, but the target rates are scaled and added before the target roll and the generator is good enough that you would need several thousand rolls to detect the difference in target probability.)
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,925
First Language
English
Primarily Uses
RMMV
the effects of changing position 1 to 4 on the probability of being targeted are negligible....you would need several thousand rolls to detect the difference in target probability.
Sounds like you don't have enough random encounters in your games :wink::guffaw:
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,684
Reaction score
2,765
First Language
EN
Primarily Uses
RMMZ
I think these are the main cases:
  1. Substitution - if an ally is attacked when at critical (< 25%) HP, the first living member with a Substitute trait will take the hit for them. So, for example, if you have 2 Substitute members, the one behind will never substitute for the one in front.

  2. Full-unit effects - things that target a whole unit (e.g. an All Enemies scope skill) do so in order, leader first. This can tie in with the Substitute trait, for example: if your leader is the tank and they're low on HP, they might die from the hit, leaving the rest of the party unprotected; if they're at the back, they could at least take a hit for the leader instead.

  3. Inventory user - if you use an item from the inventory menu, the user will be the first party member with the highest PHA value. E.g. if all party members have 150% PHA, the item user will be the party leader. This can matter for items that affect the user as well as the target.
(Math.random produces values with 52-bit precision, so like Andar says, the effect of party ordering on a weighted random pick is typically negligible. Most player issues with RNG are due to a poor understanding of what randomness is, coupled with natural human pareidolia, e.g. the "clustering illusion".)

As always, though, plugins can change any game mechanic.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,925
First Language
English
Primarily Uses
RMMV
Full-unit effects - things that target a whole unit (e.g. an All Enemies scope skill) do so in order, leader first. This can tie in with the Substitute trait, for example: if your leader is the tank and they're low on HP, they might die from the hit, leaving the rest of the party unprotected; if they're at the back, they could at least take a hit for the leader instead.
Does this happen? Can a battler Substitute during an all whatever attack and take two hits from it? Or is this more if you're, say, using action sequences with the target action field, so it's hitting the whole unit but treating them as individual hits?

It's never come up for me.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,325
Reaction score
9,714
First Language
German
Primarily Uses
RMMV
@ATT_Turan @caethyril
I vaguely remember another point that might have added to the misconception of hitting low number battlers more often: a bug-default.

I don't remember which maker it was or which plugin (although now that I think about it again, it was likly one of yanfly's lunatic targeting), but when a skill was already processing and the targeting selection comes back empty for whatever reason, the skill defaults to the first index even if the random number was something else.

Since the default engine doesn't filter targets it was likely in combination with a plugin that introduces such filtering, to prevent bad lunatic code from wasting the action.
But since most people use many yanfly plugin without understanding them (or knowing everything they do), such a default in one of them could easily cause the misconception that the random generator hits the first actor more often.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,684
Reaction score
2,765
First Language
EN
Primarily Uses
RMMZ
Does this happen? Can a battler Substitute during an all whatever attack and take two hits from it?
I just tested to be sure, and yes. My test case was:
  1. Default party (Reid, Priscilla, Gale, Michelle);
  2. Make sure Michelle is the only one with a Substitute trait;
  3. Make an enemy that uses the default Dust Devil skill (Physical Hit, All Enemies);
  4. Start a battle test;
  5. Console -> $gameParty.leader().setHp(5) ("set Reid's HP to 5");
  6. Guard until the enemy uses Dust Devil;
  7. Watch as Michelle takes Reid's hit and her own.
It's possible that whatever plugins you use change this. Or maybe you always put Substitute actors up front or something. Note that by default actions are only ever applied to one target at a time. Check out BattleManager.invokeAction (rmmz_managers.js) for more details~

[Edited: substitute applies to Magical Hit actions, not just Physical Hit.]

...when a skill was already processing and the targeting selection comes back empty for whatever reason, the skill defaults to the first index even if the random number was something else.
Good point, that reminds me of the smoothTarget logic in the MV/MZ core scripts (not sure how VX Ace etc handle it). With the default Turn-Based system it's possible to select a target that will be ineligible, e.g. dead, by the time the action is actually performed. smoothTarget works around this by replacing an ineligible target with the first valid target (rmmz_objects.js):
JavaScript:
Game_Unit.prototype.smoothTarget = function(index) {
    const member = this.members()[Math.max(0, index)];
    return member && member.isAlive() ? member : this.aliveMembers()[0];
};
There's a similar one for dead targets. I believe enemies select their actions/targets immediately before acting, so this would probably only be common for party skills, e.g. aim Heal at party member #3, but they're dead by the time the action goes off so party member #1 gets the heal instead.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,925
First Language
English
Primarily Uses
RMMV
I just tested to be sure, and yes...It's possible that whatever plugins you use change this.
You didn't have to go through all that! :guffaw:

Like I said, it's never come up for me - I don't use Substitute, so I've never seen nor bothered to look up how it works with multi-target attacks. But thanks for the info.
 

Latest Threads

Latest Profile Posts

After a little test with the parallax mapping, found it lags like a cat on a leash. Instead of the original idea to parallax map the entirety of the ship, I guess I'll settle for editing the tilesets. Probably should have done that first. :kaosigh:
So I kinda came back and learned how to mod other RPG Maker games so... Hello everyone!
Captura-de-pantalla-475.png
Version 1.0.1 done! Now finally free time... oh
Capture.PNG
I'm Really proud of how my game over screen looks!
UldJFr1.png
I felt inspired by a piece of art I saw. So I made this.

Wanderer Doge.png

Forum statistics

Threads
123,282
Messages
1,155,473
Members
161,678
Latest member
brideinmydreams
Top