Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to come up with a formula for the computer to determine who should win a match between an attacker and a defender, in a way that would improve how engaging the battle rules would be in a Player Vs Player scenario.

In short, what should the math be where I can build a character in a certain way, without having a clear-cut winner when my build goes up another build each time I attack.

Example

Attacker 15 strength - would this be a function of Attack and Stamina? 60% chance of a critical hit

Defender 7 Agility - would this be a function of Energy and Defense? 10 defense

The outcome should have the following: Who wins, how much damage dealt, health lost (health is normally 100)

Any play between Attack, Defense, Stamina, Energy and Crit Chance would be good for us to discuss as well.

Any help would be appreciated.


Extra info

It's a simple text based game where people can hit each other. Just a single hit not multiple.

A person has Stamina, Attack, Defense. Depending on the weapons equiped also increase your defense and attack.

At first comparing the attacks Attack vs defenders Defense was considered. But it results in to many draws. So we added in chance of a critical hit and change do dodging.

Attack = Users attack stat + weapons attack stat * {crit=2, hard=1.5, normal=1}(Chance) Defense = Users defense stat + weapson defense stat * {dodge=2, sway=1.5, normal=1}(Chance)

if draw who has the better chance wins.

It just seems to easy.

share|improve this question
1  
Some more informations about the goals of your model may help us to give you some useful ralation. –  FxIII Dec 29 '11 at 14:15
1  
Maybe related: This question and this question. –  bummzack Dec 29 '11 at 14:27
3  
You ask a tough question. The short answer is "it dependes 100% on the (unique) characteristics of your game." I recommend trying to simulate the most probable outcome and using that result. –  ashes999 Dec 29 '11 at 14:32
1  
This question is way too broad to be answered in its current form. You need to tell us what kind of gameplay you're trying to create. How you want the game to play out, what you intend for the player to learn as they advance, what you intend for these stats to mean and do, etc. –  Nicol Bolas Dec 29 '11 at 19:33
    
This is a QA site, not a discussion forum. –  Jari Komppa Dec 29 '11 at 20:43
show 3 more comments

2 Answers 2

up vote 1 down vote accepted

Figuring out the exact stats and formulas is something that requires a lot of tweaking and tests to get right. It's hard for somebody to give advice without having a deep insight in your game mechanics.

Some similar questions have been asked on this site, so maybe these are useful to you:

share|improve this answer
add comment

This is a vast topic. And it all depends on your focus. Do you want to focus on realism, levels, items, competences...

There are literally hundreds of combat rules, you could try to base your approach on one of the existing ones. Table top role playing games usually implement combat mechanics that are made to be as simple to resolve as possible - with dice - and the logics can be very quickly transposed to video games. You could get inspired by GURPS the d20 system and the Storytelling System.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.