   Please critique my Combat algorithm!!!
  Let me just say, I absolutely HATE the concept of Random Numbers affecting an outcome. I understand that it is a necessary evil that must be incorporated to assume some measure of chance, but how on Earth does anyone know what BEST random number range should be used???In my algorith I use a random range of -3 to 3, because I want a slight variation to allow for random chance.To test out the battle system I just started with basic variables;Givens:playerArmor ranges from 8 to 12playerDefense ranges from 8 to 12playerHealth ranges from 80 to 120playerStrength ranges from 8 to 12playerWeapon ranges from 8 to 12(opponent variables are the same) Oh, I almost forgot, this is for a TURN-BASED combat system.Here's the actual equation:__________________________combatCalculation = rnd(-3 to 3) * [playerWeapon * (playerStrength + playerHealth)] - [opponentArmor * (opponentHealth + opponentDefense)]__________________________The weapon and armor have the biggest influence on outcome (being multipliers). Is that a good idea?To increase the variablity, on each turn, the attacker's weapon score is reduced by rnd(1 to 3), and if it is a hit, the defender's armor score is reduced by rnd(1 to 3)So, on the player's attack turn;playerWeapon = playerWeapon - rnd(1 to 3)If combatCalculation > 0Then opponentArmor = opponentArmor - rnd(1 to 3)So as you can see this works, but I just picked the number three as my variable modifier, with no real reason for choosing 3. I could just as easily have picked 789787367835.I guess my real question is;  "How do you choose the range for 'random' variation?Thanks!   
  I think that you can use some accuracy attribute, and this way you can reduce your dependency of randomness. i.e: Player has an accuracy of 70, so to test if he hits his opponent, you choose a random number in range(0,100). if the random number is less than accuracy, player hits.I think this is the way that most RPGs(not videogames) do.   ;  You should look at some dnd combat systems...In short, you should define combat parameters that way, so that weakest unit can inflict some amount of damage to the strongest unit and that strongest unit CAN(rarely) miss the weakest unit.This is just my opinion...I did it that way.   ;  I'm currently experimenting with a version Inverse Logit function for accuracy. The way it works is that every attack is determined by summing all modifiers and plugging them into this formula:2^x / 1 + (2^x)This gives the probability of a hit. So with 0 modifiers, the probability of a hit is 50/50.Example:The attacker is using phasers which have a +4 accuracy modifier.The attacker is very close which gives him a +2 accuracy modifier.The defender is cloaked which gives him a -3 accuracy modifier.The defender is moving slowly relative to the attacker which gives him a -0.5 accuracy modifier.Summing all the modifiers gives a total modifier of +2.5. Plugged into the formula gives a 85% chance of hitting.Obviously, you still have to figure out the balance of what appropriate modifiers are.What are the advantages of this system?1. It neatly maps all possible inputs onto a range of 0-1. A blind archer firing at a gnat at 100 paces still has a chance to hit. It might be 1 in 1,000,000, but there's still a chance.2. Simplicity. Just add up all modifiers and plug them into the formula.What are the disadvantages?1. It doesn't give you a clean stat like "+% to hit." The change in probability to hit of a +3 sword vs. a +2 sword may vary depending on what other modifiers are in effectSomething that may be either an advantage or disadvantage depending on your game is the fact that the formula naturally offers diminishing returns-- a +10 swords offers more of an improvement against an enemy with a defensive rating of 10 than one with a defensive rating of 1.   ;  These are all good suggestions! Thank you all for the help.   