ID:265831
 
doubling your str, then dividing the total damage by the enemies defense (by a small amount)

or just doubling your str for the total?
There is no 'better' way, just what's better for your game. However, I suggest incorporating defensive attribute in your formula, otherwise they won't have much use...
I'm not sure of the original source, but I've always liked a method that Lexy mentioned for RPGs. Pick a random number between the target's negative defense and the attacker's strength. If the result is positive, then apply it as damage.

The advantage of this method is that, while increased stats will put the odds in one's favor, there's always a chance for the owner of the lower stats.
I always liked D&D's method of calculating damage.

Just roll some dice and apply the necessary bonuses/penalties.
In response to D4RK3 54B3R
This, it is simple and it works.
I use it but with a minor change. An enemies defence is between 0 to 100, and any damage they receive is reduced as a percentage by that much (30 defence reduces damage by 30%).
In response to The Magic Man
Seems too much to me. Defense should be reduced to something around a half in a formula, since it doesn't seem natural to remove a lot of damage with it magically; if you get hit, then you get hit.
With your current, unchanged formula 100 defense will cause invincibility and similarly you're going to have to make the maximum defense something like 40, otherwise people could take ages to die.
Though I don't really mess with formulas a lot, so I could be somewhat off here; still, 100 is commonly used as the cap for a stat, if any.

one way is to make 2 damage vars... like a predamage and a damage and making it so that your predamage is equal to streingth and subtracting the enemies defense from that to get the damage... that's what i did:

mob
verb
attack(mob/M as mob in oview(1))
var/PREdamage = usr.atk
var/damage = PREdamage - M.def
M.HP -= damage


just a suggestion
In response to Shiny11100
That's completely unnessessary..
Why not do
var/damage = (src.atk) - (M.def) //Put predamage formula in one ( ) and post-damage in the other ( )
In response to Kaioken
Defence is capped at 90, though most players will never get more than 40-50 without magical means, and getting 90 defence requires very strong magic.
Most enemies that have above 50 defence are usually very large or strong. 100Ft tall giants with a foot thick skin for example, or golems made out of very hard substances (like diamond) have high defence.

Also, this game puts emphasis on other things than simply damage will kill you. The longer you fight the more damaged and ineffective your armor will become, you could also get your limbs damaged/broken or even removed (getting your head damaged, broken or removed is the same as instant death). If you get hit by a critical hit it will ignore any defence you have and particularly strong attacks will cause you to start bleeding (if you can inflict 10-20 damage with a single hit then inflicting 19-20 or getting a critical hit will have a chance of making the enemy bleed, this chance is increased with bladed or piercing weapons), which will kill you unless you patch it up, which cannot be done in combat.
A lot of enemies also have other ways of hurting and killing you, some will just gobble you up whole and attempt to kill you that way, others will try to strangle or suffocafe you, things like poison are also common among certain types of enemy.

In the game I am making though defence is important and will help you survive for longer it is not a god stat and will not make it impossible for you to die.
Anyone who stands in a fight doing nothing but slowly slogging an enemy to death, even if they have 90 defence will die a lot quicker than they would think.
In response to Kaioken
In D&D, armor doesn't reduce damage (Unless it's some magical armor). Instead, it lowers the chances of a successful attack.
Critical hits mean that you get to roll twice for damage.

Damage from an attack is calculated by:
Rolled Dice (Based upon weapon used) + Attack Bonuses (Based upon character) - Target Resistance (In case the target has some sort of special resistance, like a skeleton has resistance to slashing damage)
I prefer to give the people 2 stats that counteract each other:

Strength = 1
Endurance = 1

And have health always max out at 100, its a stat that does not increase. Only goes between 0 and 100, as in 100%

Strength and Endurance however do increase.

Damage is calculated by Strength divided by enemy Endurance. Times 5

So if guy with 1 strength attacks guy with 1 endurance, he does 5% damage.

Guy with 1 strength attacks guy with 2 endurance. He does 2.5% damage

Guy with 18 strength attacks guy with 9 endurance. He does 10% damage.

Guy with 57 strength attacks guy with 98 endurance. He does 2.91% damage
In response to Dragonn
Interestingly, a different approach in some games uses an "Endurance" stat to determine your maximum health among other things. However, it doesn't function as "defense"; the only thing that lowers battle damage is armor, which actually takes (some of) the damage to itself instead of the player until it breaks (optionally you could include an option to repair it before/after it does); this makes more sense (realism) and is more balanced in a way, since the damage doesn't "disappear", it just goes to your armor instead, which can "die" too.