« Anti-Speech Weapons and the “Suck Button” | Main | The Area of a Super-Circle: Elliptic Integrals and Lemniscate Biscuits »
Tuesday, September 7, 2021
CONTINUITY: The Curious Behaviour of Bullets in First-Person Shooter Games
One of the reasons many games use the “hitscan” model, where bullet flight is instantaneous, is that it is very easy to implement and fast to evaluate using “ray casting” from the player's viewpoint in the direction of look (and aim, which is the same). You just project a vector along that direction and look for the first intersection with an object in the scene, and there's your point of impact. Then you just render the shot along that vector with suitable sound and light effects. Modelling the flight of a projectile with physics is a lot more difficult, and requires taking into account motion of objects in the scene while the projectile is in flight.
If you think this is weird, there's been a flaw in Second Life since early 2020 where, in some regions of the grid, when you shoot a projectile, it may just hang in the air in front of the launcher for two long seconds, then take off in the direction of the target. I wasted a huge amount of time in development of my Anvil Tosser trying to work around this and finally concluded it can only be remedied by fixing the fundamental problem in the simulator. Here is some of my research into this problem, and some more.
Posted at September 7, 2021 11:56