With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

Postby torhu » Sun Sep 20, 2009 7:13 pm

What about a formula that makes the damage decrease very slowly in the beginning, but then faster? That would make the damage more predictable when you're within the weapon's 'best' range. Easier to know how many hits it takes to kill someone. It would also be more like the way it currently works.

The orange line in the graph looks nice, but I think it might reduce the damage too much too soon. Even when setting range_kari to 9000 it affects the number of hits to kill already at 500 units.

I can't remember that much of my high school maths, so any help is welcome. And consider duplicating the sheet rather than adding more columns. :)
In game: =SG=monSter
Monster Browser
User avatar
torhu
SG Team
 
Posts: 1125
Joined: Thu Jan 06, 2005 8:12 pm
Location: Norway



Postby iap » Tue Sep 22, 2009 4:59 pm

Hi, if I may add my thoughts about it:
From my knowledge of guns, it's usually not the impact that is dramatically decreased with the distance, its the precision. By this I mean that the bullet just loses it's momentum and start falling. if there is a way to mimic this - it would be best. You know, you perfectly aim for the head but in the distance you hit the legs. But if not, what torhu said looks to me like the best way.


I've found the formula that does just that, and saved it in the spreadsheet. The graph shows the result over time. I also added a constant that can be changed that controls the degrade rate of the weapon.
Code: Select all
(max_distance-((bullet_distance-max_distance)/degrade_constant)^2)/(max_distance/max_damage)


My default constant is 42, not related to any other philosophical question. The higher it is, the slower the bullet loose it's power. I think this constant can be used to make a big difference between guns, because now I can't feel the difference in the game.

Hope this helps :)
iap
Pistolero
 
Posts: 26
Joined: Sun Sep 20, 2009 4:08 pm
Location: Israel



Postby torhu » Tue Sep 22, 2009 11:25 pm

Thanks, that looks interesting. Would it be possible to alter the formula so that you can remove the "if range > distance" condition and have it still work? And it would be nice to have a formula with only the degrade_constant, no range.

I really expect spread to be more important than range, so maybe shouldn't put to much work into this, though.
In game: =SG=monSter
Monster Browser
User avatar
torhu
SG Team
 
Posts: 1125
Joined: Thu Jan 06, 2005 8:12 pm
Location: Norway



Postby moRtem » Tue Sep 22, 2009 11:33 pm

iap wrote:From my knowledge of guns, it's usually not the impact that is dramatically decreased with the distance, its the precision. By this I mean that the bullet just loses it's momentum and start falling. if there is a way to mimic this - it would be best. You know, you perfectly aim for the head but in the distance you hit the legs.


That's exactly what i meant with "I don't think it is necessary to make game more complicated than needed though, since too much realism takes away the fun.".

Since it's not possible to see the way bullets go this would do nothing but confuse players. Plus almost makes it impossible to learn how to aim correctly, since you have to guess where you have to aim at.

But at the same time, it of course makes sense to decrease weapon's power on distance. There are 2 ways to decrease power: 1) decrease accuracy .. 2) decrease damage

While i think (1) is mainly confusing (and pissing off - especially - new players) like mentioned before, i believe that (2) would be a good compromiss (altough physically the minor problem).


Smokin' Guns shouldn't be a gunfight-simulator, but a game which can be enjoyed while playing. So please let's turn our heads towards maximizing the excitement, rather than maximizing the realism (otherwise the next things to implement would be wind, stoppage of guns, duds, blurred vision due to cowboys drinking beer and frost-fingers when sun ain't shining)


/quit
User avatar
moRtem
Gunslinger
 
Posts: 284
Joined: Sun Mar 15, 2009 5:56 pm



Postby iap » Wed Sep 23, 2009 12:54 pm

torhu wrote:Thanks, that looks interesting. Would it be possible to alter the formula so that you can remove the "if range > distance" condition and have it still work?
Sorry to tell you, but not only that you must have this condition, but you also have too add "if result < 0"...
What are the restrictions? why can't you have if statements?

And it would be nice to have a formula with only the degrade_constant, no range.
Sorry again, the distance calculations are the most important part of the equation.

I really expect spread to be more important than range, so maybe shouldn't put to much work into this, though.
What do you mean by that?
iap
Pistolero
 
Posts: 26
Joined: Sun Sep 20, 2009 4:08 pm
Location: Israel



Postby Joe Kari » Wed Sep 23, 2009 7:31 pm

Just to say that with your current formula, the damage deteriorate faster and faster, and can eventually be nullified. I'm not sure that this will be good.
Gunfight in El Paso will be... erf...

And I don't understand what do you mean by increasing the spread with range... Did you realize that this mean that bullet will not travel in a straight line but curvy if we make it this way ?

What if we use a formula simply based on arctan ? (I just hope that the mathlib that come with the engine have a fast and good implement of it).

Here the arctan graph

We should just rescale it, flip it horizontaly, and offset it.

Something like:
Damage * (pi/2 + arctan( Constant - Factor * x )) / pi
is a good start.

You need just to tune Constant and Factor.

So we will have 2 asymptotes... one at the begining, one at the end.
User avatar
Joe Kari
SG Team
 
Posts: 879
Joined: Sun Sep 16, 2007 8:44 pm
Location: France



Postby iap » Wed Sep 23, 2009 8:57 pm

Joe Kari wrote:Just to say that with your current formula, the damage deteriorate faster and faster, and can eventually be nullified. I'm not sure that this will be good.
Gunfight in El Paso will be... erf...

This can be solved with a big sinus wave or your suggested arctan. However, it seems more correct to do it this way. A pistol can only shoot to a certain distance, if you want a to shoot someone very distant, then get a better weapon, or just go pursuit him.

By the way, I'm new to this game, so what I'm saying is just from experiencing the game.
I didn't noticed a big difference between the pistols types, only the reloading time is different. I think making a significant difference of range and degrade rates between them, it would make the choosing of a specific gun more interesting (i.e. I need an accurate gun but it's reloading time is too long)
iap
Pistolero
 
Posts: 26
Joined: Sun Sep 20, 2009 4:08 pm
Location: Israel



Postby Sucalakafufu » Wed Sep 23, 2009 11:27 pm

iap wrote:I didn't noticed a big difference between the pistols types, only the reloading time is different.


hopefully you noticed the extremely weak power of the remingtons :)
especially when you shoot someone point blank in the head and they survive :P
SG Name: Sucalakafufu
Clan: [CWNN] - Clan With No Name
User avatar
Sucalakafufu
Gunslinger
 
Posts: 239
Joined: Thu Apr 16, 2009 8:59 am



Postby Tequila » Sat Sep 26, 2009 4:42 pm

Nice thread guys,

about that weapon stats, I would like us to clarify the vocabulary. Actually the "range" term is like a parameter but with the current formula it has not a good and understandable meaning...

I'm really surprised to understand now the formula give a remington the availability to kill someone from very very far. Do we really want to accept that ?

In my opinion, "range" should mean you won't hit someone if his distance to you is greater than that... I may be wrong, but that sounds logical from the word meaning.

Joe Kari wrote:IMO, the formula should meet few things:
- the falloff should be proportional to the weapon base damage
- the damage should never fall to 0, so the falloff shouldn't be linear


This formula seems good to me:

Damage = BaseDamage * WeaponRange / ( Distance + WeaponRange )

BaseDamage: the damage of the weapon at close range (for distance=0)
Distance: the distance between the shooter and the target
WeaponRange: when Distance = WeaponRange, the target take 50% of damage.

Like moRtem, I would prefer simpler formula. And here is what I propose with the idea to clarify the "range" parameter:
1. First current weapon ranges should be multiplied by 3 or 4, maybe more, and tuned
2. We should continue to apply a cut-off test and apply full damage if target is in 2/3 to 3/4 of the weapon range, what I mean the cut-off range.
3. We should decrease with a simple linear formula from full damage to 0 damage between the cut-off and the weapon range.

If we consider the cut-off at 2/3, the formula could be the following after the cut-off:
Damage = 3 * BaseDamage * ( 1 - Distance / WeaponRange )

Remark: Number 3 here is in fact WeaponRange/(WeaponRange-CutOffRange)
Remark2: I'm not sure Cut-off word is the good one


This may gives a minor optimization for the engine as we won't try to trace after the weapon range.

This may also involve tactical change. You'll need to move near from your target is you are too far...

And finally we may think we will need to change the weapon range in big maps with too few players. Or can we think to compute weapon range relatively to players count ?

Of course, that's just my ideas.
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Postby Pardner » Sat Sep 26, 2009 5:59 pm

I may be putting my neck in the noose on this one, but...

I dont like the idea of having a cutoff on the weapons. We have maps like Hang'em High that are very close range where a player can do well with just a shotgun. Then there are maps like Elpaso where the distance is great.

If you use a cutoff, then it makes the pistols useless in Elpaso....and here is my argument..... most of the players in a BR match are using a Remington '58 and a Schofield. Using a cut off might tip gameplay in favor of the winning team even more than the money system already does.

(granted, watch For a Few Dollars More and Clint could not shoot Col. Douglas Mortimer because his pistol was out of range, but Col. Douglas Mortimer could shoot Clint with his contraption! Of course this is where our map ElPaso comes from!)

Image
Image
User avatar
Pardner
SG Team
 
Posts: 1786
Joined: Fri Nov 18, 2005 5:48 am
Location: MD, USA



Postby dbozan99 » Sat Sep 26, 2009 9:33 pm

Hmmm, it seems to me that we should be more involved with accuracy than damage...

Shotguns - Short range
Pistols - Medium Range
Rifles - Long Range
Sharps - Extra Long Range
Gatling Gun - umm... Medium/Long?

that way, you probably wouldn't need a new formula for damage, because hitting somebody long range with a pistol would be tougher.
User avatar
dbozan99
Pistolero
 
Posts: 43
Joined: Thu Jan 22, 2009 5:14 am



Postby moRtem » Sun Sep 27, 2009 10:43 am

dbozan99 wrote:Hmmm, it seems to me that we should be more involved with accuracy than damage...


screwing accuracy will screw the gameplay (as long as hits within the spread are luck-based and the amount of spread ain't visualized so that you are able to learn playing with it without thinking the game's hitsystem sucks)

reducing damage with range (probably even down to zero damage or close to zero) will do the same trick: balancing weapons regarding their intuitive usable range -- just that this solution ain't luckbased and more intuitive (you appeareantly hit someone, but he takes more hits on distance than he does on close-range)


/quit
User avatar
moRtem
Gunslinger
 
Posts: 284
Joined: Sun Mar 15, 2009 5:56 pm



Postby dbozan99 » Sun Sep 27, 2009 9:49 pm

Hmmm, you've got a point there....

I would much rather hit somebody for little damage than be aiming right at them and miss......
User avatar
dbozan99
Pistolero
 
Posts: 43
Joined: Thu Jan 22, 2009 5:14 am



Postby Joe Kari » Mon Sep 28, 2009 11:32 pm

I'm really against a cut-off !
Damage shouldn't drop to 0 !
Like mortem said, people will just think that hitcode sucks, and this is not intuitive. It will frustrate player ! (and me)

And about the complexity of the formula... This doesn't mean anything at all...
For example many people know nothing about gravity rules, but are able to catch a flying ball. I mean that sometime, a formula mathematically simple does not produce an intuitive result, where some formula really mathematically complex produce a good-looking and intuitive result.
User avatar
Joe Kari
SG Team
 
Posts: 879
Joined: Sun Sep 16, 2007 8:44 pm
Location: France



Postby Tequila » Tue Sep 29, 2009 12:38 am

Hey Joe Kari, don't be frustrated too soon :)

I prefer Pardner argument against cutoff:
Pardner wrote:If you use a cutoff, then it makes the pistols useless in Elpaso....and here is my argument..... most of the players in a BR match are using a Remington '58 and a Schofield. Using a cut off might tip gameplay in favor of the winning team even more than the money system already does.
Maybe we should forbid some weapon in BR mode :P or just start with more dollars as robbers don't attack bank in real life with pistols if it is defended by an army... :D

Personally, I don't think it's intuitive to be killed at 500m with a remington too often. Being hit with less damage is more intuitive IMO.

By the way, tell us what do you think about the "range" definition ? What do you think if we define it as the distance after which damage will be 5 (or what ever), not more, not less ? In my first proposition, the range could define the zero damage limit, but we still can keep it as a greater constant.

I really want a good "range" definition, this will help to choose any formula.

About the formula complexity, I think it's not needed as health is finally an integer and so we should just need a good interpolation to keep the code simple and efficient (even if it is not here we will gain a lot of performance).
8)
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



PreviousNext

Return to Code

Show Sidebar
Show Sidebar

User Control Panel