Any Game Programmers In The House?

Soldato
Joined
17 Oct 2002
Posts
7,439
Location
Stoke-on-Trent
I'm searching for a formula to work off or some idea's on how an attack and defence system would work.

For example:

Player 1 has an attack value of 50.
Player 2 has a defence value of 34.

I'm looking for a formula to work out a fair fight system. Any guidance is much appreciated.

T.
 
In an advance wars type game I've been making I used this:

damage = (((unit_left_firepower-(unit_right_defence*0.80))*health_left/10)/2);

where unit_left_firepower would equal your player 1 attack value and unit_right_defence would equal your player 2 defence value. health_left is the health of the left hand unit (As in advance wars your firepower goes down with your health).

This is extremely simple and i'll no doubt change this before I finish the game but it may be a starting point for you.

What type of game are you making?
 
Humm....not sure my formula will be very suited to an RPG.

Are you just using attack and defence? no luck/skill or other factors that influence the damage a player can give or receive?
 
Well lets see then:

if health, attack and defence are all out of 100. Something like

Damage = (attack*attmult) - (defence*defmult)

Health -= Damage

might be best, then define attmult and defmult as constants and give them a value between 0 and 1. That way its easy for you to change the effectiveness of attack and defence values until you are happy with the results.
 
As Kreeee implied, either just outright copy another system, or it really shouldn't be too hard to come up with your own. You haven't really provided enough specifics for us to help you much. Are those values you provided absolute or a portion of a maximum (say, 100)? Should a player with 25 attack do half the damage to player 2 that player 1 would do, or none at all?
 
Back
Top Bottom