Hitscan

Last updated

Hitscan in video game design, most commonly in first-person shooters, is a type of hit registration system that determines whether an object has been hit or not simply by scanning if the item used was aimed directly at its target and then applies the effects of the item (usually damage) instantly. A weapon, for example, does not launch a projectile the player needs to lead, damage is applied as soon as the player's crosshair is on a target and the fire button is pressed. Internally, this is most commonly done by simulating a ray from the origin of the item along the trajectory of the "projectile" and simply scanning for any objects touching the ray. Games might still show a visual of a projectile although it technically has no effect. In contrast, a projectile-based weapon would launch an actual projectile object that moves through the virtual space at a certain speed and will apply damage only once it has actually touched ("hit") a target.

Contents

A projectile weapon which uses unmodified hitscan information to dictate whether or not it has hit its target is often called a hitscan weapon. Shooting the weapon calls the hitscan function, and if an object is detected in the projectile's path, a hit is registered. Since the effect is immediate, the projectiles effectively travel at infinite speed and have a linear or otherwise simple trajectory—a practical approximation of a bullet's speed and accuracy over short distances.

A simplified hitscan operation occurs in the first-person shooter DOOM ; when the player holds down the fire button with the pistol, it fires inaccurately from the second shot. As another example, the submachine gun in Half-Life 2 calls a hitscan function in the middle of a 'blazing gun' animation, creating a small amount of lag between weapon deployment and the hitting of the target to better approximate real-life ballistics.

Advantages

The primary advantage is the simplicity of the simulation, which uses relatively simple mathematics to calculate hits. Although bullets do not move at infinite speed via perfectly straight trajectories, they move fast enough that a hitscan solution is normally a reasonable approximation. It leaves the question of where a weapon has hit to just one function, streamlining the programming of weapons.

In terms of game design, it readily ties cause (the player presses a 'fire' button, executing a hitscan function) to effect (the hitscan returns a result, the player sees the weapon's effect at that location). As a heavily simplified model of real world ballistics, it makes games more accessible in that there is no need to aim slightly ahead of a moving target in order to compensate for the time it takes for the projectile to reach it. Although less realistic, this model requires no understanding of real weapon handling in order to play the game, and reinforces the intuitive understanding that whatever the reticle is placed over will be hit.

Disadvantages

Visually representing the firing effect of a hitscan weapon can be difficult: since the weapon hits its target instantaneously, any bullet or projectile that comes from the weapon is merely a 'ghost', and where it lands may not necessarily represent its actual hit. In particular, a projectile bullet effect will always lag behind the effect of its hit, a problem which can be compounded by Internet latency in online multiplayer gaming.

With advances in processing and Internet bandwidth, it has become more practical to simulate the ballistic nature of real-world firearms in real-time games by using a more realistic "projectile" model, spawning bullets as actual game objects with mass and velocity, and continuously simulating them until they reach their target.

Related Research Articles

<span class="mw-page-title-main">Bullet</span> Projectile propelled by a firearm, sling, or air gun

A bullet is a kinetic projectile, a component of firearm ammunition that is shot from a gun barrel. They are made of a variety of materials, such as copper, lead, steel, polymer, rubber and even wax; and are made in various shapes and constructions, including specialized functions such as hunting, target shooting, training, and combat. Bullets are often tapered, making them more aerodynamic. Bullet size is expressed by weight and diameter in both imperial and metric measurement systems. Bullets do not normally contain explosives but strike or damage the intended target by transferring kinetic energy upon impact and penetration.

<span class="mw-page-title-main">Projectile</span> Object propelled through the air

A projectile is an object that is propelled by the application of an external force and then moves freely under the influence of gravity and air resistance. Although any objects in motion through space are projectiles, they are commonly found in warfare and sports.

<span class="mw-page-title-main">Terminal ballistics</span> Projectiles behavior after reaching their targets

Terminal ballistics is a sub-field of ballistics concerned with the behavior and effects of a projectile when it hits and transfers its energy to a target.

<span class="mw-page-title-main">Trajectory</span> Path of a moving object

A trajectory or flight path is the path that an object with mass in motion follows through space as a function of time. In classical mechanics, a trajectory is defined by Hamiltonian mechanics via canonical coordinates; hence, a complete trajectory is defined by position and momentum, simultaneously.

From the viewpoint of physics, a firearm, as for most weapons, is a system for delivering maximum destructive energy to the target with minimum delivery of energy on the shooter. The momentum delivered to the target, however, cannot be any more than that on the shooter. This is due to conservation of momentum, which dictates that the momentum imparted to the bullet is equal and opposite to that imparted to the gun-shooter system.

<span class="mw-page-title-main">Ballistics</span> Science of the motion of projectiles

Ballistics is the field of mechanics concerned with the launching, flight behaviour and impact effects of projectiles, especially weapon munitions such as bullets, unguided bombs, rockets and the like; the science or art of designing and accelerating projectiles so as to achieve a desired performance.

<span class="mw-page-title-main">Ricochet</span> Rebound of a projectile off a surface

A ricochet is a rebound, bounce, or skip off a surface, particularly in the case of a projectile. Most ricochets are caused by accident and while the force of the deflection decelerates the projectile, it can still be energetic and almost as dangerous as before the deflection. The possibility of ricochet is one of the reasons for the common firearms safety rule "Never shoot a bullet at a flat, hard surface." Ricochets can occur with any caliber, but short or round ricocheting bullets may not produce the audible whine caused by tumbling irregular shapes. Ricochets are a hazard of shooting because, for as long as they retain sufficient velocity, ricocheting bullets or bullet fragments may cause collateral damage to animals, objects, or even the person who fired the shot.

<span class="mw-page-title-main">External ballistics</span> Behavior of projectiles in flight

External ballistics or exterior ballistics is the part of ballistics that deals with the behavior of a projectile in flight. The projectile may be powered or un-powered, guided or unguided, spin or fin stabilized, flying through an atmosphere or in the vacuum of space, but most certainly flying under the influence of a gravitational field.

<span class="mw-page-title-main">Ballistic gelatin</span> Testing medium used in ballistics

Ballistic gelatin is a testing medium designed to simulate the effects of bullet wounds in animal muscle tissue. It was developed and improved by Martin Fackler and others in the field of wound ballistics. It is calibrated to match pig muscle, which is ballistically similar to human muscle tissue.

A smart bullet is a bullet that is able to do something other than simply follow its given trajectory, such as turning, changing speed or sending data. Such a projectile may be fired from a precision-guided firearm capable of programming its behavior. It is a miniaturized type of precision-guided munition.

Stopping power is the ability of a weapon – typically a ranged weapon such as a firearm – to cause a target to be incapacitated or immobilized. Stopping power contrasts with lethality in that it pertains only to a weapon's ability to make the target cease action, regardless of whether or not death ultimately occurs. Which ammunition cartridges have the greatest stopping power is a much-debated topic.

<span class="mw-page-title-main">Ballistic coefficient</span> Physical measure of overcoming air resistance

In ballistics, the ballistic coefficient of a body is a measure of its ability to overcome air resistance in flight. It is inversely proportional to the negative acceleration: a high number indicates a low negative acceleration—the drag on the body is small in proportion to its mass. BC can be expressed with the units kilogram-force per square meter (kgf/m2) or pounds per square inch (lb/in2).

<span class="mw-page-title-main">Kill house</span> Training facility for urban combat

A kill house or shoot house is a live ammunition small arms shooting range used to train military and law enforcement personnel for close contact engagements in urban combat environments. Kill houses are designed to mimic residential, commercial and industrial spaces and are used to acquaint personnel with techniques to infiltrate structures and the methods used to overwhelm the target(s) in the quickest and most efficient manner. The construction of one of these facilities can vary in material and cost depending on the needs and the resources available. Like any shooting range, there are rules that must be followed to ensure a safe kill house training session.

<i>B-Wings</i> 1984 video game

B-Wings is a vertically scrolling shooter first released as an arcade video game by Data East in 1984. A version was released in 1986 for the Family Computer. It was Data East's first home release for the console. The Family Computer version is notable for its inclusion in many unofficial Famiclone multicarts.

The meplat is the technical term for the flat or open tip on the nose of a bullet. The shape of the meplat is important in determining how the bullet moves through the air. In particular the size and shape of the meplat has a significant effect on the ballistic coefficient of a bullet.

The following are terms related to firearms and ammunition topics.

Deflection shooting is a technique of shooting ahead of a moving target, also known as leading the target, so that the projectile will "intercept" and collide with the target at a predicted point. This technique is necessary when the target will have significantly displaced its position during the time the projectile would take to reach the target, which can become the case over very long distances, due to fast moving targets, hunting a running animal, or while using relatively slow projectiles.

<span class="mw-page-title-main">Kinetic energy weapon</span> Weapon based solely on a projectiles kinetic energy

A kinetic energy weapon is a projectile weapon based solely on a projectile's kinetic energy to inflict damage to a target, instead of using any explosive, incendiary/thermal, chemical or radiological payload. All kinetic weapons work by attaining a high flight speed — generally supersonic or even up to hypervelocity — and collide with their targets, converting their kinetic energy and relative impulse into destructive shock waves, heat and cavitation. In kinetic weapons with unpowered flight, the muzzle velocity or launch velocity often determines the effective range and potential damage of the kinetic projectile.

Since the origin of video games in the early 1970s, the video game industry, the players, and surrounding culture have spawned a wide range of technical and slang terms.

<span class="mw-page-title-main">Ballistic table</span>

A ballistic table or ballistic chart, also known as the data of previous engagements (DOPE) chart, is a reference data chart used in long-range shooting to predict the trajectory of a projectile and compensate for physical effects of gravity and wind drift, in order to increase the probability of the projectile successfully reaching the intended target. Ballistic tables commonly are used in target shooting, hunting, military sharpshooting and ballistic science applications.

References