MM6: Chance to Hit

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).

Moderator: Moderators

User avatar
Agalloch
Leprechaun
Leprechaun
Posts: 36
Joined: 26 Aug 2010

MM6: Chance to Hit

Postby Agalloch » Jan 27 2013, 13:15

Greyface's Might andMagic 6 Game Mechanics page,

https://sites.google.com/site/sergroj/mm/mechanics

and Bones' Combat Guide

http://www.angelfire.com/nt/bones/chance.html

both give alogirthms for calculating the Chance to Hit in Might and Magic VI. However, the two methods are incompatible and produce different results. Greyfaces is a simple calculation of the chance which produces reasonable results, while Bones produces a method for enacting combat in the game which seems more realistic but would not come to the same effect.

Which is the method used in the game? I will disassemble the releant parts of the exe at the weekend if nobody knows.

User avatar
GrayFace
Titan
Titan
Posts: 1385
Joined: 29 Nov 2005

Postby GrayFace » Jan 27 2013, 19:06

Mine comes from decompiling the game.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
Agalloch
Leprechaun
Leprechaun
Posts: 36
Joined: 26 Aug 2010

Postby Agalloch » Jan 28 2013, 9:17

Fair enough, thanks, I'll borrow that for my needs then. His was strangely complex for something he pulled out of his, *ahem*, is it similar to MM7/MM8 or an attempt at working it out via trial and error?

tomchen1989
Peasant
Peasant
Posts: 62
Joined: 21 Jun 2008
Location: Shanghai

Re: MM6: Chance to Hit

Postby tomchen1989 » Aug 26 2017, 19:33

Bones' alogirthms for calculating the chance to hit as well as the resistance are also available here:

http://telp.org/files/resistance.zip
http://telp.org/files/tohit.zip

I checked out, the alogirthm of resistance is exactly the same as GrayFace's.

But the chance to hit's alogirthm is a little different.

GrayFace's formula is:
(15 + PlayerAttack*2)/(30 + PlayerAttack*2 + MonsterArmorClass)

Bone's is:
(PlayerAttack*2+MonsterArmorClass*(1-n)+(30-15*n)+ABS(PlayerAttack*2+MonsterArmorClass*(1-n)+(30-15*n)))
/(PlayerAttack*4+MonsterArmorClass*2+60)
where n = 1 (short range), 1.5 (medium range) or 2 (long range)

which is equivalent to:

Code: Select all

if at short range ( 0 to 40 feet ):
   (PlayerAttack*2+15)/(PlayerAttack*2+MonsterArmorClass+30)

if at medium range ( 40 to 200 feet ):
   if PlayerAttack*2-MonsterArmorClass/2+22.5>0:
      (PlayerAttack*2-MonsterArmorClass/2+22.5)/(PlayerAttack*2+MonsterArmorClass+30)
   else:
      0

if at long range ( 200 to 320 feet ):
   if PlayerAttack*2-MonsterArmorClass>0:
      (PlayerAttack*2-MonsterArmorClass)/(PlayerAttack*2+MonsterArmorClass+30)
   else:
      0

When at short range, Bone's and GrayFace's formula are the same one.
At medium/long range, Bone's seems reasonable, while GrayFace's doesn't have and might need to add these specific circumstances.
Last edited by tomchen1989 on Aug 26 2017, 19:35, edited 1 time in total.


Return to “Might and Magic”

Who is online

Users browsing this forum: Google [Bot] and 7 guests