Thoughts on Hitscan Weapons

As anyone who’s read nearly any entry on this blog can attest to, I’m a fan of developers and believe that if more gamers understood just what goes into making a game, we’d generally be better off for it.  With that in mind, today we’re going to talk about hitscan weapons.  It’s a concept mostly in first-person shooters, and a fundamental aspect at that.  It’s not realistic nor very believable, but without it most first-person shooters simply couldn’t work very well, if at all.

How hitscan weapons basically work is the instant as you press the button, the game code takes a look at what’s directly in your line-of-sight and determines if your shot hits or misses.  This is sometimes irrespective of what “type” of weapon you have; E.G., sniper rifle, or handgun, or whatever else.  Generally, you wouldn’t know it existed; the enemy didn’t react (or enemy player didn’t have their health reduced) until the projectile actually hit, which made the entire process effectively invisible.

You can see it in action, sometimes, however.  For one example, in games with some Bullet Time implementation, when in said Bullet Time sometimes you’ll see enemies react before the bullet actually hits them.  Somewhat more egregious would be, in some games (particularly found in M.M.O.s, but by no means solely found in them), you or an enemy would hurl something like, say, a huge truck or a boulder or something, and while the enemy or you race around frantically, the projectile follows you, as if it were laughing maniacally while urinating on the laws of physics.

While not the only way developers can handle weapons in video games, any way they choose won’t be very believable, but in this case they shouldn’t be.  In this case, it’s all about the Rule of Fun—the belief that making a game fun to play is more important than making it always adhere to believability.

Hitscan weapons were mainly used in early video games, though you can still find it around these days as well.  It’s a very resource-efficient bit of coding; essentially, projectiles operate on a very linear path, ignoring things like weather conditions, gravity, and whatever else.  As time has progressed, such things can be hinted at a little in the animations of the actual projectiles themselves; projectiles with more mass tend to move more slowly, for example.  All it is, really, is window-dressing, fluff.  It’s not bad, not by far.

Also has time has progressed, simulating actual projectile effects has become more commonplace, as systems and computers have grown more powerful.  This has brought to light plenty of advantages and disadvantages to the nature of hitscan weapons.

As mentioned before, a primary advantage is the it’s resource-efficient, letting the developer to focus on creating code for things like better non-player character path-finding, in-depth action/reaction scripting, even making the conversations a little more free-flowing by allowing more options.  A game is limited by the systems it will be designed for—and if you’re going into it knowing you’re going to make a cross-platform title, it stands to reason that you’re going to naturally limit yourself at least a little.  The more convoluted and complex a game’s code is, the more difficult it will be to alter for another system, after all.  Therefore, using shortcuts that are efficient and—most importantly—fun for the player would be seen as quite desirable.

Another advantage, although that’s starting to change, is that players expect it.  Players expect the time differential between pressing the button and the enemy reacting to be measured in milliseconds at most.  While bending to player expectations is not always a good idea, this is one of the areas where it would serve the developers well.  It’s so common as to be not even thought about—but when it’s not there, it may be noticed by the player and thus wondered about to the point of keeping the player from fully enjoying the game.

A disadvantage (or another advantage, depending on how you look at it) is that since, as stated above, some games animated bullets and while the hit was already determined it wouldn’t be “counted” until the projectile actually hit, you ran into a potentially humorous situation.

Imagine fighting a magic-user, and they throw a fireball at you.  While the hitscan coding has already determined that it’s going to hit you, it won’t count it until the fireball has actually intersected with your avatar, itself counted with collision detection and hit box scripting.  So the magic-user throws that fireball, and, not wanting to be hit, you speed away.  The fireball can follow you, twist for twist, turn for turn.

Where this becomes a disadvantage is that it isn’t always coded to be tied to the animation of the projectile, so in on-line multi-player matches it’s not uncommon for their to be high latency—lag—that means you will die before you ever see the shot.

On the other hand, in games where there is a set distance as to how far the projectile will travel before it’s erased from the game-world, it’s possible to outrun the projectile long enough for it to be erased before it hits.  That’s not always possible, of course, but it can happen.

These days, hitscan weapons aren’t really ubiquitous anymore, though they’re still quite popular.  I, for one, don’t mind them.  Yes, there’s something more realistic about simulated ballistics, but as I said before, hitscan coding being such comparatively small code allows the developers to devote that space to other things, things that can make the game more interesting.

Anything that lets the developers make games more interesting as well as more fun for the player is something that I think should be fostered when possible.  Interesting games are ones we’ll throw money at, which means the developers get paid for their hard work.  In the end, everyone wins.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: