# How much does formation matter?

#### the___blade

##### They/Them
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
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
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
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

#### caethyril

##### ^_^
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
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
@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

##### ^_^
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
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!

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 Profile Posts

Both Mike and Ray here are in a "HYPE!" state after Mike uses "Wild Party", which also heals everyone. they'll do more damage and counter more often, but defense is lower along with hit rate.

Ooker spookers and fun attack mechanics! What a Friday!
Not today... Not today...
I guess I should send my CV to Hasbro. I've made Monopoly cheaters edition more fun and challenging. I've developed custom cheats and chest/chance cards for it. And I've cleared many nightmares through my cards and rules.
I'm only missing 2 more bgms for my game but maaaaan, searching for these tracks is killing me. Can't find anything good to replace MZ's Theme 2 and Scene 5 I have as placeholders. Everything is too epic or too evil or too alarming. That 'scene 5' track in particular would fit nicely with my scene. Well, at least I finally figured what my last click-fest of a gameplay element will be like, so something positive

Threads
124,706
Messages
1,165,398
Members
163,518
Latest member
Vestrio