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.

Ive been developing an RPG for sometime, and its far enough now where I need to get some formulas down for attacking and whatnot. What Im looking to understand is a basic hit and miss formula based on dexterity or another stat. If someone can give me a basic framework to modify and extend, or helpful pointers, Id be appreciative.

share|improve this question
if(random(1,100)>dexterity) { hit(); } else { miss(); } –  thedaian Jan 24 '12 at 20:05
You should ask more specific questions, preferably with a short summary of what you tried and what you're struggling with. "Attacking and whatnot" or "based on dexterity or another stat" are not things that make it believable that you put any thoughts into this yet. –  bummzack Jan 24 '12 at 20:30
This question seems related: gamedev.stackexchange.com/questions/14309/… –  bummzack Jan 24 '12 at 20:32
There is no way that this question can be answered without knowing things about your game. Is it real-time, real-time-esque, or turn-based? Are there positional components like range and distance, or is it like Final Fantasy where anyone can attack anyone? What kind of gameplay are you trying to create? Do you want a combat system that rewards strategic play, or are you looking for more of a grind-based system? In short, your question is far too broad to answer as stated. –  Nicol Bolas Jan 24 '12 at 20:38
@thedaian: That would make you less likely to hit as dexterity increases. Probably not what you should be going for. :) –  Michael Madsen Jan 24 '12 at 21:49

2 Answers 2

The formulas that you define are the game design for your game. You can specify whatever it is you want it to be.

You would probably do something like define a "base" hit rate based on your level compared to the enemy's level. Maybe have weapon expertise play a role (if that's a stat in your game). That kind of thing.

But if you want an example to work from, there are a lot of pages of people doing things like deconstructing the internal formulas in World of Warcraft. Like this one, for example: http://www.wowwiki.com/Hit

share|improve this answer

Here is a page with an equation to determine attack skill for Everquest. You may wish to follow the links on that page to other parts of the hit/miss/damage formulas. The formula has gotten very complicated over the years as the developers have added items that give bonuses to many of the secondary stats.

share|improve this answer

Your Answer


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.