Accuracy system

Accuracy system

Requests for features in the spring code.

Moderator: Moderators

User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Accuracy system

Post by KDR_11k »

The idea is to add a random chance for a weapon to miss that can be varied by the circumstances and applied to all weapon types (some weapontypes like beamlasers, guided missiles and flamethrowers cannot be made inaccurate ATM).

Basically both the weapon and the target have a hit ratio (usually between 0.0 and 1.0) with a falloff value that defines how range influences this, on a shot the ratios are multiplied, a random number between 0 and 1 rolled and:
If the random number is less than the ratio: The weapon is fired accurately, receives a spread angle of less than atan(target radius / target distance).
Otherwise: The weapon receives a spread angle of greater than atan(target radius / target distance), in the case of a guided missile an invisible flare is launched in a random direction instead and the missile locks onto that flare.

The weapon should have modder-definable multipliers for the spread angle in either case (so e.g. misses can miss by at least 5 metres while hits are only fired at the central 5% of the target hitsphere).

The COB could set variables that control both a weapon's hit ratio (per weapon, possibly as a multiple of the weapon's fbi-defined hit ratio) and the hit ratio enemies get against this unit. This would allow e.g. movement or smoke grenades to increase the chance of a miss or maybe give an accuracy boost if the unit had enough time to get prone.

I realize there's accuracy on the move and spread angles but those don't differentiate between targets and have a fixed accuracy decay for larger distances.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Basically both the weapon and the target have a hit ratio (usually between 0.0 and 1.0) with a falloff value that defines how range influences this, on a shot the ratios are multiplied, a random number between 0 and 1 rolled and:

Imagine the same but modifying the damage output instead of accuracy by firing range.

Needed tags:
dynamicDamage: enabled/disabled
minRange: 100% damage applied from point blank to minRange
minDamage: x% damage applied at weapon's maximum range
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Starcraft mechanics ftl.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Starcraft is hardly monopolizing accuracy systems.
User avatar
mehere101
Posts: 293
Joined: 15 Mar 2006, 02:38

Post by mehere101 »

Still, there are more graceful ways to do inaccuracy than to just use random numbers.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

I like the accuracy system as it is now.

Damage dependant on range I would quite like, and min ranges can already be done if you're clever
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Yeah, but that's not what I'm on about. Minimum firing range for the damage multiplier, i.e. distance between firing vector to target vector > minRange makes the damage multiplier kick in and in-/decrease damage. Actually some sort of effective range would be better I think.

Weapon range = [2000], effective range = [500] to [1500]
Then you'd need a mutliplier for 0 to [500] and one for [1500] to [2000]
So shooting stuff at point blank may cause little damage as well as maximum range. Well okay this brings up new problems... how do you get your unit move into enemy range other than a dummy weapon?

Uh... I'm kinda stealing the thread.


About the accuracy system, something such as hit or no hit based on distance and occasional randomness would be cool indeed. I don't like it that weapons either have to hit or won't be able to hit their target at all.

This would probably bring quite some mods one step closer to realistic combat. In fact units should have a defence and attack value to influence their ability to hit.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

Guessmyname wrote:Damage dependant on range I would quite like

Already semi-possible using dirty hax. Its not as good as a smooth scaling tag would be (which we'd love :D), but by giving a unit three (or more, depending on how many gradations you want to do) weapons that look identical but with different damages, you can approximate this effect. The trick is to set them with descending ranges - one long range weapon, one medium range weapon, one short range weapon. Then, in the script, have each shorter range weapon lock the longer ones above it. So when the long range weapon is active, any of them can fire; when the medium range weapon is active, the short range and the medium range one can fire, and when the short range one is active, only that one can fire.

and poof, you have range dependant damage. Although in a very inefficient and hackish way - a tag that smoothly scaled weapon damage depending on range would be lovely.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Post by Pxtl »

Guessmyname wrote:I like the accuracy system as it is now.

Damage dependant on range I would quite like, and min ranges can already be done if you're clever
Are units aware of their minimum range? Will they retreat to firing range if an enemy unit has entered minimum range?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

No but have you ever tried running up to a magella tank in Gundam? Get close enough and the center of your hitsphere is too high for its aiming arc to include so the poor thing tries to move closer and closer in the hopes that you'll be part of its arc.
User avatar
Strategia
Posts: 575
Joined: 06 Apr 2006, 18:32

Post by Strategia »

mehere101 wrote:Still, there are more graceful ways to do inaccuracy than to just use random numbers.
Define "graceful" so as not to mean "memory-hogging".
User avatar
Fanger
Expand & Exterminate Developer
Posts: 1509
Joined: 22 Nov 2005, 22:58

Post by Fanger »

I like the people who complain about random number accuracy systems.. Let me quickly outline why such a system would be useful in spring..

Accuracy as we know it in real life is based on the hand eye coordination of people and or the equipment they are using, however physics has alot of variables that can throw stuff of, and even with missiles/bombs and rangefinders there is still a small amount of guess work/mechanical failure. In essence the reason stuff misses in real life is because of an extremely complicated set a variables that even science could not put into a single equation.

Spring does not by any stretch of the imagination use a completely realistic physics system, nor does any game by really. It instead uses a "dumbed" down version of newtonian physics to figure out how stuff would end up acting, this version is barebones enough that your computer does not choke trying to do the calculations. This however is a two edged sword, because as the number of variables had been reduced to a small number to make it easy to run, it also makes it easy to break the system. Essentially all the units in spring have Aim bots, they can easily calculate where to fire a weapon to hit a target because there are only a few variables needed to understand. In addition to this is the fact that the ranges and speeds of objects in spring are not in any way realistic or even near realistic, battles in real life take place over several miles, battles in spring take place over several dozen yards at best. Applying realistic ranges would be near impossible as you could only play on a 40x40+ map with like 5 units given the extreme range they can fire. What this means is that units in spring are generally not very fast moving, do not have to shoot very far to hit stuff and do not have to track very fast moving targets. This means that unless you make the projectile a unit is firing incredibly slow moving, or slow firing pretty much any unit can hit any other unit almost spot on a good deal of the time, more often than would be thought given the weapons. This ends up with units like aircraft often being shot at by units that in a more realistic setting would have no chance of hitting them.

We already have a couple of tags that apply random "innacurracy" to weapons, tags like spray angle and accuracy, these fudge the numbers when a unit fires and make the shot go off center of the actual line of fire. This however is not specifically enough all the time.

Given these circumstances it might be nice to have the ability to dictate the accuracy of a certain weapon against a certain unit via armor or some other method, so that we can "fake" the innaccuracy of things like main battle tank cannons vs aircraft or some other things that cannot be easily done without creating odd looking firing..

In addition it would be nice if we could give some sort of inaccuracy to missiles beyond wobble..
User avatar
mehere101
Posts: 293
Joined: 15 Mar 2006, 02:38

Post by mehere101 »

Fanger, I see your point. It should be mod defined, and I'll just whine at the mod makers about it if they change it (and I notice it :wink:)
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

You know, if you had the "hit percentage" of the weapon basically define when the weapon's wobble and accuracy kick in, that might be the solution. Basically the weapon would be innacurate if it had a "hit" flag, but the shot would use the wobble and accuracy - no matter what type of weapon - on a "miss".
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

All this shit is supposed to be emergent in a true RTS simulation like Spring. Adding in completely arbitrary accuracy crap like this shuold remain firmly in the domain of Starcraft and its ilk.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

Not necessarily. Without a system like this, only external effects can be simulated. Internal effects, such as manufacturing defects, would be much better simulated by the described system.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

Dragon45 wrote:All this shit is supposed to be emergent in a true RTS simulation like Spring. Adding in completely arbitrary accuracy crap like this shuold remain firmly in the domain of Starcraft and its ilk.
+1
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Dragon45 wrote:All this shit is supposed to be emergent in a true RTS simulation like Spring. Adding in completely arbitrary accuracy crap like this shuold remain firmly in the domain of Starcraft and its ilk.
You won't notice any of it in the OTA (read: BA) mods anyway. Would greatly enhance any mod IMO. It's retarded that a weapon deals the very same damage and hits all the time (or is supposed to hit all the time). No microing units out of the way does not count. Actually they are supposed to do that on their own, a miss/hit system simply simulates this.

I doubt anyone thought of Starcraft in the first place, at least I didn't because I don't like the gameplay in any *craft games (but WC1).
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Dragon45 wrote:All this shit is supposed to be emergent in a true RTS simulation like Spring. Adding in completely arbitrary accuracy crap like this shuold remain firmly in the domain of Starcraft and its ilk.
Spring is a platform for mods, not a game. It should be up to the mod to decide how real it should be. Considering Spring doesn't use cover and other effects that introduce inaccuracy in real life we need other ways to define that.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Mods are games, in a real sense.
Post Reply

Return to “Feature Requests”