Chance to hit (accuracy) - does not sense in 3.1 (?)

The place to discuss balance changes for future versions of the game.
(Master releases & 3.X)
Post Reply
Deus Siddis
Trained
Trained
Posts: 235
Joined: 18 Aug 2007, 06:58

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Deus Siddis »

Jorzi wrote:The problem with simulating actual trajectories is the computing requirements; it is not a trivial thing to do efficiently and its cost is always proportional to the amount of units on the map.
Every simulation is an approximation. You use the degree of approximation that balances realism and transparency against the limitations of hardware and developer resources.

So for direct fire weapons you could use a totally flat trajectory, i.e. a vector for projectile travel.

For indirect fire you create an arc for the projectile to fly along, created between the firing unit and the terrain coordinates its targeting. Then for accuracy based spreading you either mess with the arc directly or with the target terrain coordinates based on distance to target (dynamically, no set short distance / long distance boolean type crap, I agree with Per on that). This appears to be how the Spring engine does it, though I've never looked at the source.
Also, collision with the actual geometry is, as said, not an option. We would have to use some kind of proxy object / bounding box system for collision, so that the graphical appearance of units doesn't affect hit probability.
Well it is an option, actually, since there is no hard reason for it not to be. My feeling is that having hitting a smaller target be more difficult is totally intuitive and totally desirable. I think it would be a good thing for the player to consider, but would not become a "constant preoccupation" as Iluvalar somewhat dramatically puts it.

Either way, this is a separate discussion, since the collision geometry can be the same dimensions for all units, the same for all chassis sizes or conform specifically as much as possible to the graphical geometry.

The point is let collision detection decide what's a miss and what's a hit. That's its job and its very good at it. :wink:
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Iluvalar »

Deus Siddis wrote:I think it would be a good thing for the player to consider, but would not become a "constant preoccupation" as Iluvalar somewhat dramatically puts it.
Stop thinking, and do the math. In realism, Rambo die ! It's not "dramatic" after 90 minutes, it's more anticlimactic in the first few scenes.
Heretic 2.3 improver and proud of it.
Deus Siddis
Trained
Trained
Posts: 235
Joined: 18 Aug 2007, 06:58

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Deus Siddis »

----?
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Iluvalar »

We have a cartoonish accuracy where a assault gun miss half of his ammo even when facing an enemy that is wider than it is far. There is no way we can make it realistic without changing the whole game...

Unless you have a solution that doesn't rely on a magic balance fairy that will come a fix your mess, it will not happen any soon...
Heretic 2.3 improver and proud of it.
iap
Trained
Trained
Posts: 244
Joined: 26 Sep 2009, 16:08

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by iap »

Maybe think about it from a different perspective. Chnace to hit and accuracy are different. Accuracy is a chance to shoot correctly. Shooting correctly doesn't mean hitting, but it does mean being very close.

If physical symulation is not an option (too bad :-( ) then the formula can be double: First Iluvalar suggestion, for chance to shoot correctly, then for long range like artilery, a different formula for chance to hit, I can suggest something based on vectors, distance, bullet speed and hit size.


P.s. no way for real bullet physics? I really miss it in the game.
Deus Siddis
Trained
Trained
Posts: 235
Joined: 18 Aug 2007, 06:58

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Deus Siddis »

Iluvalar wrote: We have a cartoonish accuracy where a assault gun miss half of his ammo even when facing an enemy that is wider than it is far. There is no way we can make it realistic without changing the whole game...

Unless you have a solution that doesn't rely on a magic balance fairy that will come a fix your mess, it will not happen any soon...
It doesn't need to happen soon, but IMO it should be somewhere on the roadmap.

Because its the only solution to this kind of problem. Trying to apply highly abstract or graphics-only band-aid fixes to cover for the fact you use dice rolls for most everything, will be a hopeless effort. As long as the physics don't look real (or are nonexistent) the game never will either.
User avatar
Giani
Regular
Regular
Posts: 804
Joined: 23 Aug 2011, 22:42
Location: Argentina

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Giani »

Deus Siddis wrote: you use dice rolls for most everything
Eh? O_o
My maps: http://forums.wz2100.net/viewtopic.php?f=10&t=9501
Deus Siddis
Trained
Trained
Posts: 235
Joined: 18 Aug 2007, 06:58

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Deus Siddis »

Giani wrote:
Deus Siddis wrote: you use dice rolls for most everything
Eh? O_o
Not *literal* dice, what we mean when we say that is "decided ahead of time by a pseudo-random number generator calibrated by a various unit stats" as opposed to a more physical simulation.

Of course WZ uses a bit of both, but less so simulation than say Spring or Supreme Commander.
User avatar
Giani
Regular
Regular
Posts: 804
Joined: 23 Aug 2011, 22:42
Location: Argentina

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Giani »

Deus Siddis wrote:
Giani wrote:
Deus Siddis wrote: you use dice rolls for most everything
Eh? O_o
Not *literal* dice, what we mean when we say that is "decided ahead of time by a pseudo-random number generator calibrated by a various unit stats" as opposed to a more physical simulation.
Can you use more simple words? :roll:
My maps: http://forums.wz2100.net/viewtopic.php?f=10&t=9501
Deus Siddis
Trained
Trained
Posts: 235
Joined: 18 Aug 2007, 06:58

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Deus Siddis »

Giani wrote: Can you use more simple words? :roll:
I can try, but then I have to use a much larger number of them. :wink:

Okay, basically what "dice roll" means is if a weapon's stats say it has a 75% chance of hitting a target, then when the weapon "shoots" at the target, the game instantly decides whether it is a hit or miss based entirely on this number, before the bullet has even left the gun.

Then the game draws the bullet landing somewhere near the target if it is a miss or shows it hitting the target directly if it is a hit. By doing things this way, the game doesn't care if the bullet has to shoot out of the side of the gun barrel at a 90º angle to avoiding hitting a target that is very close, because the game has predetermined the shot must be a miss. And it doesn't matter if the target moves out of the line of fire if the game predetermined it should hit-- you will see the bullet change its direction in mid air in impossible ways in order to hit the target. And if the game decides to draw a miss by landing the bullet behind the target, then the bullet will appear to go straight through the target and explode on the ground somewhere behind it, while doing no damage to the target.

That's what using a 'dice roll' means in its purest form.

The alternative is to shoot the bullet out of the gun in the same direction the gun is facing and use collision detection alone to make the bullet hit and do damage to only what it actually, visibly hits. The bullet will do what a normal person expects it to do because a relatively simple physics simulation was used to create more accurate, realistic-looking result.
Reg312
Regular
Regular
Posts: 681
Joined: 25 Mar 2011, 18:36

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Reg312 »

@Deus Siddis you say right things, can you provide test formula or code piece? :)
missed destination calculated before user can see bullet, so we can set any direction and it will look natural, if angle <= 30 degrees
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Iluvalar »

Ok here is a more complete description of what I'd like.

First we set a chance to hit based on distance. We have 2 stats : long-mid range chances (longHit), mid-short range chances (shortHit). Having an accuracy lower than the longHit would cause balance problems with high reload time weapons. The same if the mean accuracy in the long range area was higher than expected by stats. As a result everything between maxRange, and midrange will need to have the longHit chance. However, after that point, I dont see any reason not to make the accuracy raise instead of having that large step. We could set that accuracy between mid-point and shortest range to increase and have a mean of shortHit.

We roll the dice to see if the projectile will do damage.

Next, we determine the angle of shoot using a real looking Gaussian bell curve. We raycast the projectile to see were it would land, we determine the closest target to that location. If it's a hit, we correct the angle to hit it, if it's a miss, we correct the angle to miss it. We shoot at that location. Some "hit" will damage the wrong target when accuracy/range is low.

We run the collision detection as usual, except that a miss projectile will never make direct damage (it will splash the hitted unit in that case). We just have to say the bullet bounced on the armor or did irrelevant damage.

This way, a missed shot will never lend direct damage. So we can count on the accuracy of the stat for balance (which is crucial) but at the same time, the projectiles will look just as good as if it was a real simulation. Because of the gaussian bell layer. :ninja:
Heretic 2.3 improver and proud of it.
Deus Siddis
Trained
Trained
Posts: 235
Joined: 18 Aug 2007, 06:58

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Deus Siddis »

Iluvalar wrote: Next, we determine the angle of shoot using a real looking Gaussian bell curve. We raycast the projectile to see were it would land, we determine the closest target to that location. If it's a hit, we correct the angle to hit it, if it's a miss, we correct the angle to miss it. We shoot at that location.
And what happens when the target is nearly pointblank? You'll be correcting the angle quite a lot, like an totally unbelievable looking ~90º.

And when a moving target moves into the path of a "miss" shot, or out of the path of a "hit" shot, you either have to continually adjust the shots path mid-flight or let visible misses do damage and visible hits do nothing.

So ultimately your purely graphical solution is "garbage in, garbage out".
So we can count on the accuracy of the stat for balance (which is crucial)
That is in no way "crucial"; following through on a change like this with some rebalancing work has been done many times in the past and it can be done again. It might not be instant or painless but it is the cost of doing business, the price you pay for significantly improving the game and solving all of these visible inconsistencies comprehensively and permanently.

Otherwise you are best off doing nothing and focusing development efforts on other aspects of the game.
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Iluvalar »

Here is my fix : https://github.com/Iluvalar/warzone2100 ... e5dc6e5161

Need to be merged...

Changelog
Fix : Stop trying to miss through the target in the 90° behind. Missing through the target is what we call a hit. :P
Fix : Prevent trying to miss so close to the target that it try to miss inside the hitbox. ¬.¬
Improvement : Maximal worst shot increase with range. (cone of projectiles)
Improvement : Miss more often close to the target, but sometime also make critical miss very far from the target. (compare with : always miss at the same distance causing a circle around the target).
Heretic 2.3 improver and proud of it.
User avatar
Giani
Regular
Regular
Posts: 804
Joined: 23 Aug 2011, 22:42
Location: Argentina

Re: Chance to hit (accuracy) - does not sense in 3.1 (?)

Post by Giani »

Iluvalar wrote:...
Changelog
Fix : Stop trying to miss through the target in the 90° behind. Missing through the target is what we call a hit. :P
...
:hmm: What does it mean?
My maps: http://forums.wz2100.net/viewtopic.php?f=10&t=9501
Post Reply