Advertisement

Need help with a combat formula.

Started by August 25, 2003 11:50 PM
4 comments, last by Raduprv 21 years, 5 months ago
I was wondering if anyone can help me with this: I need a combat formula, to calculate the damage, and the accuracy of an attack. Basically, the accuracy should be a bool value (either true or false) If it''s true, then calculate and apply the damage, otherwise the hit is missed. Values (for both players) (values from 0 to 120 MAX) Combat skill (values to be determined later) Weapon strenght Weapon accuracy (values from 0 to 20 MAX) Might Matter Toughness Reaction Perception Rationality Dexterity Values for attacking player: (values from 0 to 120 MAX) Attack Skill Values for defending player: (values from 0 to 120 MAX) Defense skill Armor (used to deduct the damage, min/max values to be determiend later) Now, what I need is: accuracy=? damage=? The combat formula is for my MMORPG (Eternal Lands), and the combat is always one to one, turn based but automatic (you can''t control the combat, except for fleing) I would be very grateful for any help. Height Map Editor | Eternal Lands | Fast User Directory
well if don't find any formula by yourself it's maybe all these stat have no meaning, how do you work with the game play??

i mean, things doesn't seems that clear to you
you come with a list of stat you have probably made by analyze stereotype game and think of what you could do, but actually you doesn't seems to have meaning from the game play

what kind of combat it is?? it is turn base?? what the purpose of combat?? what is the meaning of combat in the whole gameplay??

hell, respond to this and thing will come clear, you have not to have complex calculation but efficient one

i often use a simple hp-hit damage calculation, armor just put more hp and weapon add more hit point, simple and efficient if the gameplay rule!!

there is some other simple tricks

well, accurency in the more simple efficient way is a random bias value add to hit point

inteligence or spirit are added value for magic purpose
(offensive>hit point, defensive hp point+hp max, alteration>special effect[burn, poison, blind, rock...])

will power is a comparaison between 2 number and the result give the strength of the effect (prevent from alteration)

speed is a value which divide the time reaction (1/speed)

agility is a effect that minimize the effect of accurency (or maximize it)

luck affect (weight)any random effect use in a good or bad way

it is the simpliest way i use

i have no definition of youre stat i can't help that much
i have not mention special def like attribute or special attack
but i use them usually as a permanent alteration

i use three table to store value with a control of overflow from character possibility and are simply added

the first table have character current inner stat
the second table have current weapon equip value
the third have alteration value like attk, def, esp, agi, will, speed, luck that add each in his place

and a fourth , for special effect alteration which mix value in a formula according to the alteration ('small' is an effect which cut all variable by two for ex)

may this help you

[edited by - Neoshaman on August 26, 2003 5:48:08 AM]
>>>>>>>>>>>>>>>be goodbe evilbut do it WELL>>>>>>>>>>>>>>>
Advertisement
I do have a clear definition of all the attributes, however, coming up with a good formula is not as easy as it seems, especially if you have many variables.

Height Map Editor | Eternal Lands | Fast User Directory
It really is difficult to create a formula without descriptions of what the attributes are for. I''ll just guess until you give use those descriptions.

First, I''d like to point out that having ability scores with a low of 0 basically limits your formulas to +/-, so I''ll base my formulas on a low of 1 instead.

I''ll assume that Perception is for ranged attacks Dexterity is for melee attacks, then the rest are unused for accuracy.

I''ll have to also make up a max value for the weapons. I''ll assume 120, since that''s the number you picked for combat skill. These seem like odd value ranges for a MMORPG, by the way. It would also help if you could explain your rationale for the value ranges.

accuracy=[combat skill/6]*[perception or dexterity]*[weapon accuracy/6]

That gives us an accuracy rating of 1 to (20*20*20)=8000

Defense has a a similar formula, still using combat skill but replacing perception/dexterity with reaction, and weapon accuracy with armor rating (an unlisted defensive value that your armor gives you.)

defense=[combat skill/6]*[reaction]*[armor rating/6]

Now that we''ve succesfully laid the beats on the enemy, we need a damage formula. I''ll have to take some creative liberties again, due to lack of information.

I have no idea how many hit points a character would have, so I''ll just assume that it is roughly equal to the player''s defense rating (range is 1-8000). I''ll also assume that we have a 50% hit ratio in even combat, and that someone should die after taking 10 hits. So if you attack once per 6 seconds, combat should last an average of 120 seconds (that''s 6 secs*10 hits*2 attacks per hit.)

Let''s say combat skill also applies to damage and might is for beating on people. I''m also basing all this on the assumption that combat skill, might, and weapon are all equally important.

damage=([combat skill/6]*[might]*[weapon strength/6])/10

Just like the accuracy and defense formulas, except we divide the whole thing by 10 (for the average number of hits you want for a kill in an even combat). Easy, eh?

Now your programmers will be happy that they have easy formulas to implement, and your players will be happy that they have intuitive combat skills.

If you need a designer for the combat or magic system (or anything else), I''d be happy to volunteer. Email me at nuberus@hotmail.com with Eternal Lands as the subject.
Jim Adams book Programming Role Playing Games w/ DirectX has a very basic combat engine. Another good place to get ideas would be some of the open-source MUD''s out there. Do a search on sourceforge for MUD and you should find some good examples in a number of different languages.

bpopp (bpopp.net)
bpopp, I wanted a custom formula based on OUR variables.

Anyway, more info:
All the attributes:
Might
Matter
Toughness
Reaction
Perception
Rationality
Dexterity

Are secondary attributes, derived from six basic attributes. The six basic attributes serve no other purpose but to be combined and create the secondary attributes. Secondary attributes can''t be increased in any way, except for modifying the primary attributes.
In order to modify the basic attributes, you have to train yourself in those areas, ONLY by paying a trainer.
The payment is the power of 2 of the level you try to get.
So it''s 2 for level 1, 4 for lev 2, 8 for lev 3 , 1024 for lev 10, and 1048576 for lev 20.
You can go beyound lev 20, but it''s VERY expensive.

Might - the courage, the life energy
Matter - your material strenght (like constitution)
Toughness - The ability to withstand damage
Reaction - How fast you can react when there is a threat
Perception - How well you can see the enemy, weak points, etc.
Rationality - Intelligence, ability to learn
Dexterity - How fast you can move

The combat skill is something that rules all the combat, how well you can fight, and defend yourself, in meele combat.
Attack and defense are obvious.
Armor is how much of the total damage is absorbed.
Weapon strenght and accuracy are also obvious, they should add to the accuracy and damage roll.

If you want to join the EL team, as a volunteer, please downoad the game, and also make yourself an account on the community page, so we can talk on the forums, etc.

Someone on our forums came with this set fo formulas:
quote:
first of one need to know if the attacker hits:

attack + dexterity + rand() > defense + reaction + rand()

then one checks for damage:

(weapon''s base damage (maybe random, i dont know) + might) - (targets thoughness + armor) = target takes that many hitpoints...


Height Map Editor | Eternal Lands | Fast User Directory

This topic is closed to new replies.

Advertisement