# Enemy Action Rating - help please!

#### Ravenith

##### Veteran
Hello, I could use some help with the actual math involved in Enemy Action Ratings.

So, "Of all actions meeting the conditions, the one with the highest rating will be the standard, and the one within 2 rating points of the standard will be used. Actions 1 rating point away will be used 2/3 of the time and those 2 points away will be used 1/3 of the time."

Could someone (who knows what she's talking about) please give me an example involving 3-4 different actions, their ratings and chance to be used? I'm getting pretty confused! :/

#### bgillisp

##### Global Moderators
The example they give is horrible, and honestly not how it works. If you read through the script, what you will see is that the system will only consider actions that are 2 ratings below the highest rating one. So for instance, if you set it up to read:

Attack Rating 2

Cast Fireball, Rating 4

Guard, Rating 1

Guard will never happen, as it is 3 below the highest rating (as 4 - 1 > 2). However, with those numbers, what the system will do is it will add up the ratings for attack and fireball (4 + 2) and then roll a random number between 1 and the sum, and pick an action based on that. As for how it picks the action, not totally sure, but I think it would pick attack if it rolled a 1 or 2, and fireball if it rolled a 3 - 6 with those examples.

How I usually use it is I leave everything between 4 - 6 (since the default is 5 anyways), and if I want an enemy to always do a certain action on a turn, I set that rating to 10. So if I want an enemy to always case Armageddon on turn 10, I would set the rating of the Armageddon spell to 10, and the action to only occur on turn 10 + 0*X. Since all my others are 6 or less, they will not even be considered, since 10 - 6 > 2.

That's as much as I can type now as I'm heading out the door to work.

Last edited by a moderator:

#### Ravenith

##### Veteran
I sincerely can't understand WHY they'd come up with a calculation like that.

I've been using RPG Maker software for years on end, and I've been doing pretty much the same as you. I never put much thought behind attack rating.

What I want to do now is a "Fear" state. I thought I'd create a skill that does nothing except say "X cowers in fear" and have the enemy use it roughly 50% of the time as long as it's inflicted with the appropriate state.

As it turns out, the way Attack Rating works is impractical to say in the least. Any ideas?

#### optimum45

##### Veteran
I would actually set the Fear state to do that for me, and have the Fear state just be a static incap.

You can have the state's own messages do that for you without any alteration to normal skills.

Edit:  This is the closest thing I have to it.  But this is where I would start.

Last edited by a moderator:

#### Wavelength

##### Pre-Merge Boot
The example they give is horrible, and honestly not how it works. If you read through the script, what you will see is that the system will only consider actions that are 2 ratings below the highest rating one. So for instance, if you set it up to read:

Attack Rating 2

Cast Fireball, Rating 4

Guard, Rating 1

Guard will never happen, as it is 3 below the highest rating (as 4 - 1 > 2). However, with those numbers, what the system will do is it will add up the ratings for attack and fireball (4 + 2) and then roll a random number between 1 and the sum, and pick an action based on that. As for how it picks the action, not totally sure, but I think it would pick attack if it rolled a 1 or 2, and fireball if it rolled a 3 - 6 with those examples.

How I usually use it is I leave everything between 4 - 6 (since the default is 5 anyways), and if I want an enemy to always do a certain action on a turn, I set that rating to 10. So if I want an enemy to always case Armageddon on turn 10, I would set the rating of the Armageddon spell to 10, and the action to only occur on turn 10 + 0*X. Since all my others are 6 or less, they will not even be considered, since 10 - 6 > 2.

That's as much as I can type now as I'm heading out the door to work.
Ah, this is interesting.  So if you have five abilities rated 5, 5, 6, 6, and 7, then all five will be used with almost the same frequency (5/29, 5/29, 6/29, 6/29, 7/29), if I'm understanding your explanation correctly?

This would definitely explain why abilities that I expected to be used "about half the time" in a large set were used far less by enemies than I was hoping.

I have also noticed, through some testing, that changing an item's place in the actions list seems to have some effect on its use by enemies.  Specifically, the higher the place in the list, the more bias is given to that action.  Has anyone else seen this phenomenon?

BTW, I'm almost sure I've seen items with 3 below the highest (conditions-met) rated action get used rarely.  For example, if Attack is rated 4 and there's an item rated 7 that's in the mix, Attack still gets used very rarely.  I'll pay more attention in the future and see whether this really is happening.  I've never seen an action that's 4 below the highest-rated action get picked, though.

#### Kes

##### Global Moderators
Something else I have done is to put the same skill in the list twice so as to increase its chances of being used.

#### Ravenith

##### Veteran
@optimum45

What I'm aiming for is a status effect that works somewhat like Paralysis in Pokemon. It should last for the whole battle and SOMETIMES randomly restrict the battler's actions.

I always thought that Action Rating worked differently - the way it's implemented is frankly illogical.

#### Seriel

##### Veteran
Something else I have done is to put the same skill in the list twice so as to increase its chances of being used.
Same here, I find it sometimes simplifies the system.

#### Wavelength

##### Pre-Merge Boot
What I'm aiming for is a status effect that works somewhat like Paralysis in Pokemon. It should last for the whole battle and SOMETIMES randomly restrict the battler's actions.
Well you could do this by having a move that does nothing like "Help I'm Paralyzed" and then placing the action in that enemy's Actions entry with the condition "State: Paralyzed" several times to represent, say, a 50% chance of using it when the enemy is paralyzed.

I don't think there's any way to do it for the player's party without using Troop eventing (or scripting).

#### Andar

##### Veteran
I always thought that Action Rating worked differently - the way it's implemented is frankly illogical.
wrong, it is logical - in the only way a computer can handle probability easily. It's just that humans are more conditioned toward the use of percentages, but percentages require a fixed value for 100%.

The probability as handled by the action ratings (or the random encounter ratings or a few similiar places) doesn't require that fixed scale, which makes the programming logic a lot simpler (and also results why the resulting rates are numbers like 6/29 instead of 20,69/100 (which is another form of writing 20,69%)

#### Ravenith

##### Veteran
wrong, it is logical - in the only way a computer can handle probability easily. It's just that humans are more conditioned toward the use of percentages, but percentages require a fixed value for 100%.

The probability as handled by the action ratings (or the random encounter ratings or a few similiar places) doesn't require that fixed scale, which makes the programming logic a lot simpler (and also results why the resulting rates are numbers like 6/29 instead of 20,69/100 (which is another form of writing 20,69%)
Maybe I'm getting it all wrong.

I always thought that the chance of a certain enemy action to happen was equal to that action's Rating divided by the sum of all eligible actions' Ratings. So yes, something like, say 6/29, and that's fine - it's not the lack of percentile scale that bugs me.

Apparently, that's *not* how it works after all - no?

Last edited by a moderator:

#### bgillisp

##### Global Moderators
I think the reason behind this is if you want an enemy to *always* use an action on turn x, if the system were set up to just add up all the ratings and divide by the total, that would be impossible. This allows for that possibility.

As for what you want, the best way is to edit to a state. I thought I saw a script somewhere that allowed a state to apply a paralysis type ability with x%, but I don't remember where.

If you don't want to do that, what you can do is set all your default actions to rating 1. Then, add another set to use if state x is applied, set those to rating 5 (this way the system will ignore the default actions). Within that set, add the action "Cowers in fear" once for each action you add with rating 5. This way it will be 50% of the time.

The disadvantage is you need to apply this to every single enemy you want the state to apply to. That's why I recommend looking at a way to add it via a state using a script.

@wavelength: That might be possible, I thought the script said it totally discarded anything < 3, but it might have been <= 3. Though that could be also because I'm not on the default system (though I don't think it changed how that worked anywhere).

### Latest Profile Posts

Me: anime is okay. There are a couple good ones and a lot of really bad ones but the good are worth it. Brother: if you bring anime anywhere near me I'll break your nico nico kneecaps
Wasting so much time trying to get a sprite behavior to work. I feel like banging my head against a wall.
Well... it’s been a real pain in the IRS today. :/
My kitty still young (3-4 months), I think I could teach her some funny tricks... like: "Play dead-ly good music for my games"
Here's a quality DPS class idea: The Beekeeper, who uses the "Bees!!" skill to attack and poison enemies.