Calculating Player's abilities to improve map balance.
by Zmur · in Game Design and Creative Issues · 05/10/2007 (4:33 am) · 1 replies
Hello to everyone!
I want to excuse myself in advance for some mistakes in the text.
This article is made mostly to make mappers life a bit easier, however, it is posted here because it also has connection to game design as well.
The idea came to me when I first seen what crazy things may be calculated in physics using simple logical functions and maths. I wanted to see if I can do some calculations for the games world.
Before I begin I'd like to highlight that the theory here has not been made to give exectly correct results and to limit mappers imagination. NO. It was created for those cases when you don't know for sure what to do. It will not result in "the x = 100 and no "buts" about it!" Instead it will show that X is approximately 100, 200 is too much and 10 is not enough. Leaving you plenty of space to for creativity and testing.
Thank you in advance for understanding and correctly criticysing this article.
OK, let's begin. Let's say you have some weapons with values, such as weapon shooting rate, damage, radius and so on. You want to know for example what is optimal length of the passages in your map or at what distances will the players tend to fire at each other. Not to say you don't sense these distances, as a mapper you must have good intuition. But sometimes this doesn't work as well as it should. In these cases having a "plan B" by your side is a good thing.
A weapon should have at least two parameters Shooting Rate [Shots per time interval] and Damage [Damage points]. Usually there are more values, but let's begin with the simplest.
Theoretically damage points are same as player's Health points only they are negative by value. Then:
HP0 [Hp] + D [-Hp] = HP1 [Hp] //(here and further square brackets [] contain unit types for values)
Where HP0 - Player's HP before hit.
D - Projectile damage.
HP1 - Hit points after hit.
In other words, a bullet carries "negative" health to player. If D is positive, then, theoretically, the player will be healed.
If two weapons have different damage and shooting rate values then we can compare them, using this formula:
D [-Hp] * Sr [Shots/sec] = -Hps [(HP*shot)/sec]
Sr - shooting rate.
Hps - Hit-Points per second.
The Hps value shows, how much HP player will lose in a fixed time interval (1 second in this example). For various weapons this value should be equal if you are willing to get the player-player balance right. This formula also highlights that Shooting Rate is more valuable than the Damage. Why? Because the more shots you make, the larger is be the probability to hit your opponent. So if you miss with a shotgun, your Hps for this interval will be 0, but if you miss a few bullets with a machinegun, your Hps value will be lower than it should, but not 0. However if you cannot miss (you are in a narrow passage for instance) the weapon with the highest Hps will be more preferable.
The moral for all this is as follows: players will tend to run with powerful but slow weapons (shotguns for instance) when in crampy areas and with Machineguns when outside. In general ofcourse.
That was the simplest case. Now I'll make it more complicated.
The range.
Weapon's range is a distance on which it's projectile is harmful for the player. But the range (distance or time - theoretical range) that the programmers use to calculate when the projectile should disappear won't do for us. This is simple. If you found a sniper 1000 meters away from you, then, if you carry a Rocket Launcher, you will try to get closer even though the bastard is in your theoretical range. Yes, you will probably shoot at him but this won't do you any good because until your rocket reaches the guy he will get time to shoot you down, go out for a smoke and doge your shot. Well unless you get lucky and he will not see your missile comming. But in general you will want your missiles to get him for sure that is why you will get into the RL's EFFECTIVE radius where the Rocket's slow speed is compensated by little distance.
I want to excuse myself in advance for some mistakes in the text.
This article is made mostly to make mappers life a bit easier, however, it is posted here because it also has connection to game design as well.
The idea came to me when I first seen what crazy things may be calculated in physics using simple logical functions and maths. I wanted to see if I can do some calculations for the games world.
Before I begin I'd like to highlight that the theory here has not been made to give exectly correct results and to limit mappers imagination. NO. It was created for those cases when you don't know for sure what to do. It will not result in "the x = 100 and no "buts" about it!" Instead it will show that X is approximately 100, 200 is too much and 10 is not enough. Leaving you plenty of space to for creativity and testing.
Thank you in advance for understanding and correctly criticysing this article.
OK, let's begin. Let's say you have some weapons with values, such as weapon shooting rate, damage, radius and so on. You want to know for example what is optimal length of the passages in your map or at what distances will the players tend to fire at each other. Not to say you don't sense these distances, as a mapper you must have good intuition. But sometimes this doesn't work as well as it should. In these cases having a "plan B" by your side is a good thing.
A weapon should have at least two parameters Shooting Rate [Shots per time interval] and Damage [Damage points]. Usually there are more values, but let's begin with the simplest.
Theoretically damage points are same as player's Health points only they are negative by value. Then:
HP0 [Hp] + D [-Hp] = HP1 [Hp] //(here and further square brackets [] contain unit types for values)
Where HP0 - Player's HP before hit.
D - Projectile damage.
HP1 - Hit points after hit.
In other words, a bullet carries "negative" health to player. If D is positive, then, theoretically, the player will be healed.
If two weapons have different damage and shooting rate values then we can compare them, using this formula:
D [-Hp] * Sr [Shots/sec] = -Hps [(HP*shot)/sec]
Sr - shooting rate.
Hps - Hit-Points per second.
The Hps value shows, how much HP player will lose in a fixed time interval (1 second in this example). For various weapons this value should be equal if you are willing to get the player-player balance right. This formula also highlights that Shooting Rate is more valuable than the Damage. Why? Because the more shots you make, the larger is be the probability to hit your opponent. So if you miss with a shotgun, your Hps for this interval will be 0, but if you miss a few bullets with a machinegun, your Hps value will be lower than it should, but not 0. However if you cannot miss (you are in a narrow passage for instance) the weapon with the highest Hps will be more preferable.
The moral for all this is as follows: players will tend to run with powerful but slow weapons (shotguns for instance) when in crampy areas and with Machineguns when outside. In general ofcourse.
That was the simplest case. Now I'll make it more complicated.
The range.
Weapon's range is a distance on which it's projectile is harmful for the player. But the range (distance or time - theoretical range) that the programmers use to calculate when the projectile should disappear won't do for us. This is simple. If you found a sniper 1000 meters away from you, then, if you carry a Rocket Launcher, you will try to get closer even though the bastard is in your theoretical range. Yes, you will probably shoot at him but this won't do you any good because until your rocket reaches the guy he will get time to shoot you down, go out for a smoke and doge your shot. Well unless you get lucky and he will not see your missile comming. But in general you will want your missiles to get him for sure that is why you will get into the RL's EFFECTIVE radius where the Rocket's slow speed is compensated by little distance.
Zmur
It is logical that Effective radius is dependant on projectile speed:
Reff [meter] = Tc [s] * Vu [m/s] ; (m/s is for meters per second)
There we have it. Reff is effective range, Vu is Projectile speed, Tc is time coefficient. Note that if Vu is close to infinity (as it is in CS 1.5), then effective radius will also be very close to infinity. This means that this weapos effective radius is limited by players skills and distance of view.
Some words about the Tc value. It represents time between shot and hit, at which a precise shot is possible. In a real battle this value is approximately 0.7 maximum but usually somewhere around 0.4. But the main thing is that Tc is constant to all weapons. You can calculate it yourself for your game if you have statistics about distance at which most of battles were made.
Also, this formula can be made more precise if we put the player move speed in it. How? If we simply divide or multiply it by Vp (player speed) then we will get incorrect units in the result or no units at all. But we need distance. No more, no less.
I also had my thinking time here. The answer is simple. We create a dimentionless coefficient which shows how much players speed affects the result.
Cp = Vp [m/s] / Vu [m/s]
The faster the bullets will move, the less efficient the strafe will be. If the bullet speed is infinity then Cp is zero, which means that strafing will not help the player to avoid the shot (roughly) - who strafes in CS as they do in Q3?
Now what we need to do is to place the Cp in our formula:
Reff [m] = ( Tc [s] * Vu [m/s] ) / Cp
So if our Cp value is zero, the Reff will be infinity. Or if the Cp is 1 or larger (player is faster than a bullet) the Reff is smaller. This means that the formula works.
And, as already stated above do not expect this formula to give exactly correct results. It only shows what you can expect from players.
Now you can gather some statistics. Write down needed parameters of all the weapons in your game and calculate the average effective radius for them. You can also see the minimum and maximum differences of this values from one weapon to another.
Now let's make some calculations when viewing two players fight each other with two different weapons.
In most cases they will try to hold their opponent at the minimum Reff distance possible for their weapons.
For player with classic shotgun - the closer the better.
For one with RL - also as close as possible, but out of spalsh of his own rockets.
For sniper - as far as possible.
And so on.
Your objective as a mapper is to create the map where most of locations meet the distance requirements of all the weapons. Give sniper a chance to save himself from shotgunner in a dungeon and place some obstackles for the shotgunner to hide from sniper when outside.
Strafing is a very important factor.
Sp [m] = ( Vp [m/s] * L [m] ) / Vu [m/s]
Sp is the distance the player will make while strafing until his previous position is reached by the projectile. Vp is players move speed and L is distance between the two players. It is better to keep this value under control. Not too big (players will not use most of your maps surface) and not too small (players will not have a chance to doge a shot). However this depends on what you want to achieve in your map.
All for now. To be Continued...