How did shooting simulation in FPS evolve?



First-person shooter (FPS) has been one of the main genres in gaming since Wolfenstein 3D was launched. The game itself called FPS has evolved through improvements in graphics and e-sports, but software engineer Tristan Jung talks about how simulation of the laws of physics in shooting has evolved.

Gamasutra: Tristan Jung's Blog-How Do Bullets Work in Video Games?
https://www.gamasutra.com/blogs/TristanJung/20191206/355250/How_Do_Bullets_Work_in_Video_Games.php

◆ Hit scan
In the early 1990s, when FPS was first introduced, the mainstream was to render a 3D environment using a method called ray casting to determine the intersection of objects.

The following image is an example of a 3D map generated by ray casting (click to play GIF animation: about 229KB)



And the idea of 'hit scan' was born from the idea of 'what if a muzzle emits a bullet-like bullet?'

In hit scan, when a player fires a bullet, the physics engine works as follows:

1: Identify the direction the gun is pointing.
2: When fired, it emits light rays from the muzzle to the specified range.
3: Use ray casting to determine if a ray (wall, enemy, etc.) has crossed an object (trajectory).
4: The ray intersects with the object, and the target determined to be 'hit' is calculated such as being broken or damaged.

In the image below, if point A is a gun, emit light to point B. If the ray intersects the cube, it is considered a collision.



Hit scanning is a simple technique, but can be applied to a variety of attack patterns. For example, if a ray penetrates an object, you can destroy multiple objects at the same time, or you can set the maximum range of the ray to infinity and fire a laser that lasts forever until it hits something.

Another advantage of ray casting is that processing is fast. The server only needs to track the direction of the light beam, so the processing required when multiple users synchronize is minimized.

As a result, Jung says that many games in FPS use hit scans. Many games continue to use hit scans as of 2019, including Wolfenstein 3D and

DOOM, and guns that appear in Overwatch and Call of Duty also use hit scan techniques. .

Below is a scene where hit scan is used in Wolfenstein 3D (click to play GIF animation: about 204 KB)



The scenes used in Overwatch are as follows (click to play GIF animation: about 2.28MB)



The disadvantage of hit scans is that the bullets reach their destination in an instant because the rays emitted from the gun have infinite travel speed. In other words, if there is a target on the line of fire, the bullet will hit the target at the moment of firing even if it is hundreds of kilometers away. In addition, because the trajectory of the hit scan is straight, once the bullet is fired, wind pressure, gravity, etc. do not affect the bullet.

Hit scan systems tend to be used in casual FPS for beginners. According to Jung, hit-scanning cannot create a satisfactory experience if the game is designed to create an 'immersive and realistic' shooting experience.

◆ Projectile
Projectile is a method of generating all bullets and projectiles fired from weapons as new physical objects. The physics engine can calculate the mass and speed of the bullet, the wind pressure, friction, gravity, temperature, etc. that the bullet receives after firing. With the emergence of the Projectile, weapons with non-linear trajectories can be reproduced, and weapons such as grenades and rockets have appeared.

Jung cites Mac Spain 3 and Superhot as games using projectiles.

The following is 'Mac Spain 3', where the trajectory changes according to the movement of the character etc. (Click to play GIF animation: about 7.1 MB)



The following is a scene in which the trajectory bouncing in “Superhot” is drawn (click to play GIF animation: about 3.47 MB)



Projectiles are more computationally intensive than hit scans due to the increased computation of the physics engine. On the server side, it is necessary to confirm that all objects are synchronized and resolve inconsistencies and conflicts between players so that there is no lag between players on the same server It becomes.

Many people tend to think of projectiles as a relatively new method, but in fact, Jung said projectiles were born before hit scanning. It was used in arcade shooting games such as '

Asteroids ', ' Space Invaders ', and ' Galaxian ' since the 1970s before FPS was born.

The following is a scene in which a projectile is incorporated in Asteroids (click to play GIF animation: about 4.97 MB)



◆ Hybrid system
According to Jung, at the time of writing, most game engines incorporate both hit scan and projectile. Games such as the '

HALO ' and ' Grand Theft Auto ' series have weapons that support both hit scan and projectile.

The following is a scene where the hybrid system is used in 'HALO' (click to play GIF animation: about 3.68 MB)



Game developers combined the two techniques to create more realistic gun movements to cover the weaknesses of the hit scan and projectile systems. For example, to correct for trajectory shifts, a ray is drawn on each trajectory, and the physics engine determines if the rays intersect and collide in the air.

Also, in the

Sniper Elite series, after pulling the trigger, the physics engine uses hit scans to determine whether the bullet is approaching a detectable target and is determined to be approaching the target. In this case, a system that fires bullets with trajectories is adopted. (Click to play GIF animation: about 1.93MB)



'It's interesting that the basic drawing of bullets in the game focuses on small improvements, not big changes,' said Jung. Jung predicts that in the future, shooting simulation will evolve in a form that adds additional functions to the hybrid approach method, and a more realistic shooting experience will be possible due to increased CPU power and so on.

in Software,   Video,   Game, Posted by darkhorse_log