Well, I don't want to add any LEVELING system... the idea are an Hero with some variables like:

Atk=a

Def=d

Speed=s

Luck=l

If you have "poor dagger", set Atk+1

If you have "SuperUltraMegaPolishedSwordOfDoom", set Atk+95

If you have "wood shield", set Def+1

If you have "iron shield", set Def+10

Speed are for first strike order...

0- Hero attacks first

1- Enemy attacks first

(maybe I change this with a % value, not 0/1)

Luck= random variable for increase/reduce chance of win.

I think to add some variables for modify Luck, speed (ex. "mega shoes" set Speed +10%).

Another example for modify Luck value, object poison -> set Luck=-20%.

I find some formula for calculate chance of win combat... using SAME values of vars in Hero and Enemy...

...........

*Some formulas founded in forums:*

Formula dragonquest rpg

I'd use a basic mathematical formula. In Dragonquest for instance, the formula for calculating damage is (the character's attack rating/2) - (the monster's defense rating/4). (Attack/2)-(Defense/4)=damage. As you can see, it's a very rudimentary formula. But if you want to calculate variance and all that into the equation you'd have to come up with something more for yourself.

This is something I came up with for myself a while back. It is an equation using variables.

10 ((AW-D)+(SV)) / 3 = damage

for one-handed weapons, damage x 1.1

for two-handed weapons, damage x 1.5

Where:

A is the Attack Rating of the equipped weapon

W is a variable that is unique to each weapon depending on it's class. Lower class weapons have a 1.1 rating, middle class weapons have a 1.2 rating, and high class weapons have a 1.3 rating

D is the enemy's Defense Rating

S is the character's Strength Rating

V is a variable that rolls between 1 and 1.1 where 1 is the lowest base damage a character can deal and 1.1 is the highest base damage a character can deal.

Of course, with a formula like this, statistics need to have a very low cap for monsters in order to deal significant damage or characters must have a very high growth rate. These things must also be considered when creating an algorithm.

When it comes to accuracy, one must use percentages ALWAYS. Even if they're nonsensical numbers at first, they must be calculated into a percentage at the end of everything. Final Fantasy is one of those games where they use a weird number for accuracy, falling between 1 and 250. What does that have to do with anything? Well it makes sense if they calculate that number against enemy evasion and come up with a percentage at the end.

So try this:

BEFORE you even use damage calculation, after the character in question has just picked the Attack command, something must calculate accuracy to determine whether or not they will even hit their opponent. Keep in mind that the higher the accuracy rating compared to the evasion, the better the chance of hitting. This is crucial when coming up with a formula: you must know what you want before you do so.

In this situation, I would create two equations. One for if the enemy had a higher Evasion Rating than the character's Accuracy Rating and another for if the character's Accuracy Rating is higher than the enemy's Evasion Rating.

If Acc>Eva then:

(A-E)/10 = percentage of a connected strike. If A-E>10 then percentage is capped at 100%

If Eva>Acc then:

|2A-E|/10 = percentage of a connected strike. The | | bars mean absolute value, which is a math term that you can look up but basically, it makes it so that there will never be a negative number in the numerator.

Anyway, I hope this helps you. You can use these formulas if they suit you or even build on them or take away from them. I don't really care.

-----------------formula 2

chance_to_hit = 100 * Base_atk / (base_atk + defender_def) * 2 * Attacker_lvl / (attacker_lvl + defender_lvl)

hit = rand(1,100)

if chance_to_hit>hit then do_that_whole_crazy_check_damage_thing

-----------------formula 3

Damage = (AttackerStreght / DefenderProtection) * (AttackerHP / AttackerMaxHP)