Main Menu
  • Welcome to The RPG Maker Resource Kit.

Does "Position" really DO anything?

Started by jfjohnny5, December 01, 2009, 12:55:54 AM

0 Members and 1 Guest are viewing this topic.

jfjohnny5

Front, Middle, Rear position. Seriously...so far they seem to do the opposite of what I'd expect in testing. I just finished another test combat. 4 enemies vs 2 PCs (1 Front position, 1 Rear position). Of the 6 attacks dealt to the PCs, 5 went to the "Rear position". This seems to happen a LOT. Is something actually wrong? Or am I just witnessing an astounding failure of probability?

Grafikal


modern algebra

#2
Failure isn't a correct term - and while 5/6 attacks is unlikely, it's not astounding. In any case, the chance depends in part on the composition of the party. The way random targetting works is the actor is added to the array (4 - position) times. Front is 0, so that actor is added to the array four times. Rear is 2, so that actor is added twice.

Thus, there is a 1/3 chance that the rear actor would be targetted by random targetting. So it's unlikely, but not impossible. Also, it is not linear with the number of people in the party. In a party with one front character and three rear characters, the chance that a specific rear character will be hit is 1/5. In a party with three front characters and one rear character, the chance the rear character would be hit is 1/7. And in a party with only one front character and one rear character, the chance is 1/3, which isn't that unlikely.


One thing to note, a sample size of six is not a reliable sample size.

jfjohnny5

Gotcha. Thanks for explaining the background math. Kinda wish they gave us the option to weight a little more heavily one way or the other.

modern algebra

Well, if you wanted to, you could change the odds method of Game_Actor, which is here:




  #--------------------------------------------------------------------------
  # * Get Ease of Hitting
  #--------------------------------------------------------------------------
  def odds
    return 4 - self.class.position
  end


If, for instance, you wanted it weighted heavier so that front classes are more likely to get attacked you could have something like this:



  #--------------------------------------------------------------------------
  # * Get Ease of Hitting
  #--------------------------------------------------------------------------
  def odds
    return 5 - (self.class.position*2)
  end


Then, in a party of one rear actor and one front actor, the chance the rear actor would be attacked is 1/6 and the chance the front actor is attacked would be 5/6. In a party with three rear actors and one front actor, the chance the front actor would be attacked is 5/8