Rifle accuracy


(next_ghost) #1

I always felt that the rifles are a little inaccurate in long range so I did a little accuracy test today (on target.bsp) and found out that I was right. The inaccuracy size is as big as the circle crosshair so I looked to source code (g_weapons.c). Here’s what I found:


float G_GetWeaponSpread( int weapon )
...
case WP_MP40:
case WP_THOMPSON:
  return 400;
...
case WP_GARAND:
case WP_CARBINE:
case WP_KAR98:
case WP_K43:
  return 250;
...

That looks fine, rifles are more accurate than SMGs, but there’s still something out there:


void FireWeapon( gentity_t *ent )
...
case WP_GARAND:
!!  aimSpreadScale = 1.0f; !!
  Bullet_Fire( ent, GARAND_SPREAD*aimSpreadScale, GARAND_DAMAGE, qfalse );
  break;
...
case WP_K43:
!!  aimSpreadScale = 1.0; !!
  Bullet_Fire( ent, K43_SPREAD*aimSpreadScale, K43_DAMAGE, qfalse );
  break;
...

Notice the lines marked with exclamation marks. That looks very interesting compared to other weapons’ code:


void FireWeapon( gentity_t *ent )
...
case WP_MP40:
  Bullet_Fire( ent, MP40_SPREAD*aimSpreadScale, MP40_DAMAGE, qtrue );
  break;
case WP_THOMPSON:
  Bullet_Fire( ent, THOMPSON_SPREAD*aimSpreadScale, THOMPSON_DAMAGE, qtrue );
  break;
...

For those who don’t see the result - unscoped rifles ALWAYS fire at full spread. No matter if u jump (doubled max spread) or shoot the very first shot (all other weapons fire at 0.15 spread). I think those two lines should be removed when u have complete spread code for rifles that is useless because it’s always overridden by those two lines.

Rifle spread code is there, works right and it’s used by unscoped FG-42 - spread flies to max after each shot but returns back to 0.15.

Here’re the spreads for guns:
MP40/Thompson:
first shot - 60
full spread - 400
jump spread - 800

Colt/Luger:
first shot - 90
full spread - 600
jump spread - 1200

Garand/K43:
first shot - 250 (overridden 37.5)
full spread - 250
jump spread - 250 (overridden 500)


(bani) #2

i talked with SD last year about that. the k43/garand were intentionally designed to work that way in the game. not a bug.


(Sauron|EFG) #3

Interresting.

Does every shot count as first shot when I tap the button (with colt/luger), or is there a minimum time it has to be released before the next shot is counted as “first”?


(Rain) #4

The first shot is whenever your spread has calmed down all the way (the spread scale is indicated by the crosshair size unless you turn off cg_crosshairPulse.)


(bacon) #5

Where do you get that number from?


(dwin) #6

Why would rifles intentionally have such a large spread?


(next_ghost) #7

Well, it’s kinda dragging the rifle down a lot, especially if the riflenades are disabled or banned by match rules. And BTW, hitting with rifle over more than 20 meters is pure luck while SMGs are highly effective almost over whole fueldump (I can do an accuracy test demo if u want). It’s funny when real SMG effective range was about 130 meters and rifles were accurate up to 1 kilometer (unscoped).

I think removing the spread override and raising the rifle spread to 350 or 400 (rifles kick as hell after all) would be worth in next ETpro testfix. It won’t hurt anyone and u can return to override if it does something bad.

From the code (line marked with exclamation marks):


void FireWeapon( gentity_t *ent )
...
  if (g_userAim.integer) {
    aimSpreadScale = ent->client->currentAimSpreadScale;
    // Ridah, add accuracy factor for AI
!!!    aimSpreadScale+= 0.15f;  // (SA) just adding a temp /maximum/ accuracy for player (this will be re-visited in greater detail :)
    if(aimSpreadScale > 1)
      aimSpreadScale = 1.0f;	// still cap at 1.0
  } else {
    aimSpreadScale = 1.0;
  }
...

That means that the spread is current spread + 0.15 (cannot exceed 1) if g_useraim is 1 (it’s autoaim off I think - cheat protected), otherwise always 1.


(SCDS_reyalP) #8

I’d love to see the rifles reward aim skill more, but you would likely have to re-visit their damage, or the damage/effectiveness of rifle nades. Another thought I had was they should have recoil (like the pistols, only more) instead of so much initial spread. IMO, the current rifle/riflenade combo is pretty balanced in terms of how effective you are against the other team, so if you just made the rifle more accurate, it would be over-powered. The covert w/scoped rifle is a bit underpowered IMO, so might not need adjusting.
Edit: I mean that making the unscoped rifle more accurate might not make the covert out of balance.

It’s rather amusing that the weapons which have no distance damage falloff are worthless at long range O_o


(next_ghost) #9

Maybe it will lead to less riflenading because the rifle itself will be powerful enough in gunfight. And introducing rifles to all other classes (without any secondary function) as an alternative to SMG would be great as well (SMGs were rare compared to rifles in WW2).


(bacon) #10

" aimSpreadScale+= 0.15f;" += ADDS 0.15f to the spread, it would be 0.15 if the line was " aimSpreadScale*= 0.15f;"


(jkr266) #11

i got one problem with that. no way in hell are you gonna hit anything at a kilometer with wither a garand or k43 with open sights. maybe with a peep, but itd be an amaxign ass shot. hell its a damn difficult shot with a scope.


(SCDS_reyalP) #12

Uh, yeah right. A more effective rifle would mean that more people would use it, and hence more nades would be used as well. The rifle is currently a handicap if you have to fight at long range. If it was accurate, it would be far more effective than SMGs, since it has no damage falloff.


(next_ghost) #13

Of course it ADDS 0.15!
0 + 0.15 = 0.15
0 * 0.15 = 0

aimSpreadScale range is <0;1> and 2 in special case of jump!

Most riflemen in ET balance the long range handicap by shooting riflenade. But don’t forget that riflenade takes half powerbar and it takes a short while before u can start shooting bullets after u shot riflenade. Some situations also require NOT to shoot riflenades (like the beginning of goldrush where the tank takes whole powerbar to repair and it’s better not shooting riflenade than risk axis respawn before u complete repair).

And I think it’s right if rifle is more effective than SMG in long range. Don’t forget that SMG can fire in pretty long bursts before it starts kicking while rifle goes to full kick after each shot forcing slower fire.

There’s one solution to this issue - release modified version and see what it does. If the rifles would be too strong, it takes about 20 seconds to put backup file to next ETPro release.


(bacon) #14

Erm, aimspreadscale is setup elsewhere. Hense the if statement following it.

The rifle is fine the way it is. It’s not hard to take out a rambo medic with it from close range…


(Oxygen - o2) #15

rifles are fine the way they are, just wait a little for the spread to calm down, rifles, in real life, suck at close range, why should they be different in-game?

maybe add a lot more spread when using rifle granades, they almost annoy me as much as the panzer, frikken n00b sticks


(dwin) #16

Yes, thats right, they arent effective in close quarters combat, BUT they are supposed to be at long ranges. If it fires at maximum spread on the first shot, then it cant be very effective at long range. That makes them almost useless except for the grenade launcher.


(Oxygen - o2) #17

they all ARE useless :wink:


(EvilBaga) #18

And I think it’s right if rifle is more effective than SMG in long range. Don’t forget that SMG can fire in pretty long bursts before it starts kicking while rifle goes to full kick after each shot forcing slower fire.

Er…ummm…ok


(SCDS_reyalP) #19

The riflenade is far more effective at medium/close range or in closed quarters than long range. At long range, your target actually has a chance to escape, and if they are moving, you have to predict where they are going to be.

I can’t possibly see how making the rifle more effective would mean less nades :???: :???:
more poeple using rifle == more people using rifle nades. That should be rather obvious…

I don’t think you are realizing what a fearsome weapon the rifle itself would be if it was accurate, without any other kind of balancing. There would be hardly any reason to use an SMG. 1v1 at close quarters the rifle is already pretty good, and if it was accurate, it would be a lot better. At long range, it would be superior to an SMG, because of the high damage and lack of falloff. Against groups, the rifle nade would be superior to an SMG, especially if you had an accurate rifle to clean up with.

Please don’t bring ‘realism’ into this argument. The most important thing is a fun and balanced game. Use ‘realism’ as guide where it fits gameplay, but don’t ruin the balance of the game for it.


(EvilBaga) #20

There would be a reduction in nade usage…though probably not significant. Much of the time when I run around with a K-43 I stick a nade on the front…kinda as a panzer, ill die, but ill take the other guy with me…but if the rifle was equal to a SMG, or indeed, slightly superior. I would use that more because it lowers chances of me TKing myself. After all 4 out of 5 situations… the engineer is supposed to stay alive as a top priority.

Im just nitpicking in this post though…