Sign in to follow this  
AngleWyrm

Damage per Second vs Rate of Fire

Recommended Posts

So we have three weapon models: A). 20 shots/sec at 5 dmg/shot = 100 dmg/sec. B). 10 shots/sec at 10 dmg/shot= 100 dmg/sec. C). 80 shots/sec at 1 dmg/shot = 80 dmg/sec. If I only had to choose between A and B, I would pick A, because it reduces the lost time and damage of a miss. But what about C?

Share this post


Link to post
Share on other sites
Those rates are pretty high, ranging from assault riffle rates to multibarrel AA gun. I wouldn't be much concerned with 50 ms of lost time when firing a gun, so I don't see a huge difference between A and B. I don't know what kind of a game you're thinking of, but C doesn't sound like a good option because of the reduced damage.

Share this post


Link to post
Share on other sites
I suppose it depends on how easy it is to hit the target, as well as how much damage a typical target can absorb.

However, since these are all fairly rapid, C clearly falls short. What is the probability of hitting the target with any individual shot? The average damage done over time by all of these will be just as proportionate over a length of time.

This is more important for slower weapons or relatively weak targets.

Let's change it up a little. Let's say you were given an option D:
D). 1 shot/sec at 1000 dmg/shot = 1000 dmg/sec

Obviously, this is a much more powerful weapon. Would you still use it or not? Why?

I don't know if you are using specific examples from your project, or if these are just out of your hat, so what is the expected damage threshold of a typical target?

Share this post


Link to post
Share on other sites
Here is the example, re-designed to be less abstract:

Assault Rifle: 10 shots/sec * 10 dmg/shot = 100 dmg/sec.
Sniper Rifle: 1 shot/sec * 100 dmg/shot= 100 dmg/sec.
Fictional Rifle: 85 shots/sec * 1 dmg/shot= 85 dmg/sec.

So far, I've tried modelling my idea of a miss as a portion of the shots fired. So maybe I guess that I hit 9 times out of 10 shots, which is to say 9 hits/10 shot:

shots/sec * dmg/hit * hits/shot = dmg/sec.

It does exactly what you would expect though, which is just scale the dmg/sec by whatever the hits/shot proportion is. If I expect 9 hits/10 shots then the dmg/sec is just 9/10 of what it used to be. Doesn't show a preference between the Assault Rifle and the Sniper Rifle -- which is what I'm after.

Share this post


Link to post
Share on other sites
Is there a reason you are only taking into account damage and rate of fire. The speed of the bullets leads to the ability to dodge. Things like spreadshot and accuracy seen in things like shotguns. Recoil and tons of things determine the difference between guns. Often you see firing modes also like single shot, burst, or full auto. Also you have the concept of maximum range or effective range.

You can't really model a gun correctly by looking at it's damage and fire rate. A sniper rifle for instance has high accuracy and long range and fast bullets making it's single shot (if it is single shot) bullet count for a lot more than a machine gun. Typically unless it's short range firing a perfect shot with a pistol or smaller weapons means leading a target maybe. I mean think about when you use a sniper and a pistol. Totally different combat. Not sure what this is for, but if players are at a far range and one has a sniper rifle and the other has a shotgun. If you just want to use something like fire rate and damage and not take into account anything else you might get odd results because both can fire at around the same interval. (just guessing).

You aren't seeing the difference because you aren't taking into account a weapons category of combat among other things. Clips size and a few other things can play into the equation.

Share this post


Link to post
Share on other sites
There are a virtually unlimited number of additional dimensions that can be tacked onto the problem -- which are being suggested because I have made the model less abstract. Thus we see why abstract is good, because people are easily distracted.

We could just as easily say this has to do with ship-mounted lasers, wizard's fireballs, and psyonic attacks that have nothing to do with guns at all.

The math problem is to measure the quality difference in the DPS, where the total is the same, but the rate of fire is different.

[Edited by - AngleWyrm on May 13, 2008 2:28:58 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by AngleWyrm
Here is the example, re-designed to be less abstract:

Assault Rifle: 10 shots/sec * 10 dmg/shot = 100 dmg/sec.
Sniper Rifle: 1 shot/sec * 100 dmg/shot= 100 dmg/sec.
Fictional Rifle: 85 shots/sec * 1 dmg/shot= 85 dmg/sec.

So far, I've tried modelling my idea of a miss as a portion of the shots fired. So maybe I guess that I hit 9 times out of 10 shots:

shots/sec * dmg/hit * hit/shot = dmg/sec.

It does exactly what you would expect though, which is just scale the dmg/sec by whatever the hits/shots proportion is. If I expect 9 hits/10 shots then the dmg/sec is just 9/10 of what it used to be. Doesn't show a preference between the Assault Rifle and the Sniper Rifle -- which is what I'm after.


Well, if your opponent takes a large amount of damage to kill, you can expect that to scale linearly.

The big difference in these weapons is the time it takes to aim, their chance of hitting the target when aimed, and the range that they operate at.

A sniper rifle takes longer to aim, but has a higher range, which is a good trade off. The assault and fictional rifles likely take less time to aim because you can walk your shots up to the target, and even if your aim is horrible, the spread of shots can work in your favor if you're off a little. I suppose at a range of 10 feet, I would take either of the first two, but farther away is where they distinguish themselves.

I can't honestly see why anyone would choose the fictional rifle, unless it had some other benefit to compensate for its weakness. Once the rate of fire gets high enough, it stops having a significant benefit. Imagine you had a laser that had a continuous beam of damage at 80 dmg/sec. Would it really be worth it? Maybe the fictional rifle takes less time to aim because walking provides more immediate feedback?

Let's assume that all these weapons have perfect aim, are in range, but the target moves suddenly and unpredictably every 1.3 seconds. It takes varying times to aim properly, for the assault rifle takes 0.3s, the sniper rifle 0.7s, and the fictional rifle 0.1s.

So starting with the sniper rifle, after 0.7s you take a shot, doing 100 damage. You can't fire again until 1.7s, but the target moves at 1.3s and you have to readjust your aim, firing at 2.0s for a total of 200 damage. Fortunately, for the sniper rifle, every shot should hit; every time the enemy moves, it takes 0.7s to aim again and fire. Since it takes 1.0s to be ready again, it will be ready 0.3s before you aim again next time.

To try and make this more generic, let's assign some variables:
D is damage per shot
f is the rate of fire
m is the rate at which the enemy suddenly jump
a is the time it takes to aim again

So the times at which the enemy moves will be:
tjump = n*m where n=(0,1,2,3,...)
That means the time at which you start landing shots is
tstart_shooting = n*m + a
and the time you can shoot until is:
tstop_shooting = (n+1)*m
So your total window to do damage is:
twindow = (n+1)*m - (n*m + a) = m-a

The number of times you can fire in this window is 1 + _(m-a)/f_ where the underscores represent the floor function.

This also assume a high rate of fire, like you have. If you had a slower gun, you would have to expand this so that the window interval was taken from (n-1)*m+a or earlier.

Either way, this should be enough to get you started on an estimation of how to figure this out. To make this more practical, you could assume that the time-to-aim is (rightly) proportional to the angular distance between where you are aiming and where the target is. Then you could assume that the target is making many rapid small jumps, and integrate.

Share this post


Link to post
Share on other sites
Some reasons I like your model:
* As a target recedes into the distance, their angular width diminishes, which can play into target acquisition time.
* Enemy evasive maneuvers become more significant at close range.
* It establishes a relationship between hunter and prey that is much clearer than a generic dice roll.
So yea, fun thanks.

Share this post


Link to post
Share on other sites
Let's look at the two extremes: A gun that shoots once per second and does 100 damage (enough to destroy the target), and a beam that fires continuously for 100 damage per second.

Assume a situation where you get one second long "shot opportunities" and you're missing 50% of the time. With the gun, you have 50% chance of kill with one shot, 75% with two, 87.5% with three etc and nothing happens when you miss. With the beam, you do 50 damage on the first pass and guaranteed kill on the second. Still, in a "gun vs beam" fight the gun will win (50% chance of survival - beam has 25% and both losing has 25% chance). If the base hit chance is lower, the beam may become more effective but I can't be bothered to crunch the numbers.

Share this post


Link to post
Share on other sites
If you're trying to shoot down lots of really weak targets, that's where choice c could have an advantage.

Share this post


Link to post
Share on other sites
With so many shots in one second, it makes very little difference. What matters is how many times I must hit an enemy to kill it. I always preferred a semi auto weapon that I can get 1hit headshots with over anything else. The weapons you described are all submachine guns. I would rather have 1 shot per second, at 100dmg per shot. I played most of the COD series exclusively with bolt weapons, because most often you are fighting from cover, and its better to be able to step out, fire a single shot (tupping one enemy) then step back and cycle the bolt.

If I may be so bold as to make suggestions, I recommend that an assault rifle be nearly perfectly accurate for the first shot, and hand out 10 dmg/shot, for 80dmg per second. The SMG should be the same, but with a faster rate of fire, for 120dmg/second. It should be less accurate, and of course it empties its magazine far quicker. This would give me a real choice of which weapon to carry; I was annoyed with the HL2 series not having an accurate assault rifle, as the previous half life did.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fingers_
Still, in a "gun vs beam" fight the gun will win (50% chance of survival - beam has 25% and both losing has 25% chance).
Another example, working on it:

Little gun fires for 1 damage every time.
Big gun fires only every third time, but for three damage.

The blue dots mark the little gun, where it hits 50%. The red dots mark the big gun, where it does 50%:



This seems to support the answer that if DPS is equal, lower ROF is better. However, that is only during the time after the big gun delivers it's punch, but before the little gun catches up. If a kill can be had during one of the little gun's other firings, then it will kill first.

After looking at it for a bit, I noticed that the transition from Likely to Unlikely seems to occupy a rather narrow band in the numbers. So I did a chart of how many shots hit after so many shots:



The chart shows expected hits after so many shots. The high ground on the left is Definitely hit at least this much. The low ground on the right is Definitely didn't hit this many times. The cliff shows how suddenly it goes from 'did this much' to 'didn't do that much'. With these guns at 50% chance to hit, if one guesses just a little less than halfway (maybe 2/5) then they are very likely to be right.

So in other words: If you wanna hit a target x times, but have only a 50% chance of hitting on each time, just shoot at it 5/2 * x times.

[Edited by - AngleWyrm on May 19, 2008 12:55:47 PM]

Share this post


Link to post
Share on other sites
The beam would be "average" more often, yes. But on the other hand, it would rarely ever do significantly better (or worse) than that. The gun would be riskier (decent chance of 1s kill, decent chance of 4s kill compared to great chance of 2s kill), but on average they would be the same.

So... it doesn't make enough difference to be noticeable. If these are the only differences in your game between weapons, then don't expect the user to care much about which gun he gets.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ezbez
The gun would be riskier...but on average they would be the same.
An interesting point; maybe it comes down to a matter of risk tolerance.

Share this post


Link to post
Share on other sites
I think you are focusing too much on numbers which the user will be totally unaware of. Just work on making the guns balanced, e.g. so people will find reason to use more than one.

Share this post


Link to post
Share on other sites
Quote:
Original post by speciesUnknown
I think you are focusing too much on numbers which the user will be totally unaware of. Just work on making the guns balanced, e.g. so people will find reason to use more than one.


Quote:
Original post by AngleWyrm
This is a math and physics forum, hence the focus.


QFT. He's looking for a numeric method to compare the weapons, I imagine, to the end of balancing.

Share this post


Link to post
Share on other sites
Quote:
Original post by AngleWyrm
This is a math and physics forum, hence the focus.


I dig that, what I'm saying is that balancing at such a low level may not be productive. Reason being, there are far too many variables to put into a simple math formula, when gameplay is inherently unpredictable. The amount of damage per second is not so important as
* the number of body shots required to kill a player,
* whether or not the weapon can get a single hit on a headshot,
* if the weapon can get a single hit elsewhere on the body
* splash damage
* range
* accuracy on the first shot
* shot placement on full auto weapons
* recoil pattern (recoiling up? recoiling randomly? no recoil?)
* weight / affect on speed of player
* time to reload
* amount of ammunition to carry
* number of seconds of full auto fire available
* penetration of body armour

Too many variables to analyse mathematically. I would think about firearms as being in classes, such as:

sniper: long range, large damage per shot, but low damage per second. slow reloading, has a scope, sometimes bolt action, sometimes semiauto.

Battle rifle / marksman rifle: long range, lower damage / second but higher damage / shot, usually semi auto. e.g. M14. I think they got this wrong in COD4, classifying these rifles as asssault rifles despite the obvious differences, and then balancing them as such.(e.g. m14 and G3).

Support: heavy and unweildy, fast rate of fire / high damage per second, low accuracy on first shot, tight shot placement at full auto. slow to reload. very loud. e.g. light machine guns. Soldier of fortune 2 got this wrong, as the m60 was so inaccurate that despite its power, it was useless unless you disabled recoil in the settings. consider the lightening gun and chaingun in quake 3.

assault rifle: range of up to 300m, accurate on first shot, takes 0.5 second of full auto to kill a player, can get a headshot in 2 hits. example: ak47 in counterstrike. You could have a laser rifle, for example, that has these properties. consider the assault rifle in quake 3.

SMG: range of up to 100m, inaccurate on first shot, tight shot placement, higher damage per second, empties magazine faster. e.g the smg in HL2. The three weapons you describe in the OP might fit into this category.

I would make a prototype for each class, and then tweak it. Also, im not trying to tell you to make call of duty or counterstrike; you could use these as a pattern but come up with wacky ones, and you don't have to call them anything like contemporary weapon names.

Share this post


Link to post
Share on other sites
Just strolling by, but felt like mentioning you can also take the variables 'clip size' and 'reload-time' into the equation which can make quite some difference.
This adds more situations to the result: the chance you kill without reloading but more importantly, the chance you have to reload during a fight which costs precious time in which the oponent can kill you if his gun has a greater clip for example.

oh nm, speciesUnknown did a way better job explaining, didn't see his post because i opened the topic before dinner and read+replyd after :)

Share this post


Link to post
Share on other sites
I just said that your variables were too narrow because I've written a weapon system simulation (2D) that took into account around 100 variables on a gun plus around 50+ variables per firing mode. It also took into consideration numerous other things such as whether the person is crouching. Genetic algorithms rule for this kind of toying around. But as I learned before putting 2 AI's in a room to fight isn't conclusive plus the AI for handling the tactics takes a lot of time to program.

I could have sworn there's a thread in the game design or game programming section that has a list of hundreds of variables for a gun and such.

Share this post


Link to post
Share on other sites
Here's a few more variables, just to help that list-of-variables idea along:

In Dungeon Seige, the player casts spells that do damage, and draw from a rechargable battery. Those spells have a number of firings per minute, and a damage per shot. Diablo also uses a similar model with spellcasting.

In Dungeons and Dragons, there is a system called psionics, that a player can use to apply damage to a target. This is also a fired weapon, that has a frequency of firings, and a damage per shot.

In many RPGs, a player can use a sword or club to apply damage to a target, based on strength, speed, stamina, level, etc. They also do damage per shot, and have a rate of fire.

[Edited by - AngleWyrm on May 14, 2008 5:41:15 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by speciesUnknown
assault rifle: range of up to 300m, accurate on first shot, takes 0.5 second of full auto to kill a player, can get a headshot in 2 hits. example: ak47 in counterstrike. You could have a laser rifle, for example, that has these properties. consider the assault rifle in quake 3.

Counterstrike you can headshot in one with any rifle. 300m is an easy distance irl but games tend to have a lot closer ranges, i suppose otherwise characters become too small and it becomes a pixel hunt.

Share this post


Link to post
Share on other sites
Just my 2 cents:
Depending on armor values, using an armor vest or shell that deteriorates, then i'd use the high rate of fire/low damage weapon because of it's ease of aim and higher chance to land hits.

If you were basing armor values on permanent armor with damage absorption/negation, i would go for the high damage guns because of it's ability to pierce armor in high amounts.

Share this post


Link to post
Share on other sites
"Burst" damage is important in most online games.

In the case of tactical shooters (counter-strike, etc), headshots provide a large damage multiple and a higher rate of fire can get you to that burst of damage much easier. For instance, the Tactical Machine Pistol in CS has a lower damage per second than most weapons, but it is still more effective than many because of all the headshots you can score by reacting to where the bullets are going (dragging the stream of bullets towards the enemies head.)

In the case of RPG's, players can heal themselves so a weapon with a high damage and slow rate of fire (imparting a big burst of damage) can be superior to a faster weapon with higher DPS. You can't mitigate damage by healing if you are already dead.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this