dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

Some maths for mappers

 
dev.gamez.lv Forum Index -> Dizains, modelēšana un vizuālā māksla
View previous topic :: View next topic  
Author Message
Zmur



Joined: 08 Feb 2007
Posts: 21

PostPosted: Sat Apr 07, 2007 4:30 pm    Post subject: Some maths for mappers

Hello to everyone!
This is the second part of my article. Versions 1 and 1.5 are here:
http://dev.gamez.lv/viewtopic.php?t=1319
It is about theory of probability for mappers.
I posted this part in the design section because it is made for designers, but no one seems to visit the design page except programmers. And what's even worse, there is no maths page in the Design section... Sad
So here it is, hope you enjoy it.


I'm back. English this time. Language barriers being what they are...
I want to excuse myself in advance for some mistakes in the text.
This article is also made mostly for mappers. This time I'll try to calculate some values, useful for a mapper, using simple formulas, logic and my experience as gamer and game designer.
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 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. This is needed so no one gets confused about damage and HP further.
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 tahat 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.
This effective radius is abstract and also relies on players skills. But we don't need THAT precice value, so we can forget about the skill for a while. { Well if you REALLY want to, than you can try to multiply this value approximately by 0.5 for lamers or 1.5 for masters }
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.
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 also 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...
_________________
Icebolt = СИЛА!
Back to top
View user's profile
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Sat Apr 07, 2007 5:53 pm    Post subject:

Labs gabals. Tiesham noderigs. Cik esmu meklejis par shadu temu resursus internetaa, neko tik jeedziigu neatradu. Paldies par ieguldito darbu.
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
Zmur



Joined: 08 Feb 2007
Posts: 21

PostPosted: Sat Apr 07, 2007 6:02 pm    Post subject:

Благодарю. Скоро вторая часть будет Smile
_________________
Icebolt = СИЛА!
Back to top
View user's profile
Display posts from previous:   
dev.gamez.lv Forum Index -> Dizains, modelēšana un vizuālā māksla All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group