MM6: Chance to Hit

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).
User avatar
Agalloch
Leprechaun
Leprechaun
Posts: 36
Joined: 26 Aug 2010

MM6: Chance to Hit

Unread postby Agalloch » 27 Jan 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
Round Table Hero
Round Table Hero
Posts: 1660
Joined: 29 Nov 2005

Unread postby GrayFace » 27 Jan 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

Unread postby Agalloch » 28 Jan 2013, 09: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?

User avatar
tomchen1989
Pixie
Pixie
Posts: 136
Joined: 21 Jun 2008
Location: Europe / China

Re: MM6: Chance to Hit

Unread postby tomchen1989 » 26 Aug 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 26 Aug 2017, 19:35, edited 1 time in total.


Return to “Might and Magic”

Who is online

Users browsing this forum: No registered users and 65 guests