How does shooting in games work?
What do you think about when you fire a bullet from your rifle in a game?
We suspect it's about the enemy's position, the ammunition remaining in the magazine, and his (and your) health. But distance and air resistance don't usually bother you, because games don't go that far.
Or do they?
We propose to talk about it. In this article we'll discuss how shooting works in games. We will also explain what the hitscan model is and why it is the most viable model in modern FPS games.
What models of shooting exist in games?
There are two main models of projectile flight in games: hitscan and ballistics.
Hitscan
Hitscan is the way games simulate handguns. How does it work? Very simple:
- The game takes into account the direction in which the barrel of the gun is pointing.
- At the moment of firing, the system directs a beam from the barrel.
- The hit is registered by the first object in the path of the beam.
However, there are also weapons in games that can hit multiple objects along the beam. This is still a hit scan. When this happens, it is usually the behavior of a railgun or similar weapon. Well, or armor piercing bullets.
Ballistics
Now let's look at how ballistics differs from hitscan, and whether it's really better.
When the game uses ballistics, each bullet is a real game object with all the resulting properties of the physics engine. These are size, weight, speed and other factors. This means that the player is forced to take all available factors into account when aiming - especially if the target is moving or at a considerable distance from the shooter.
That's understandable.
Is the hitscan better?
And the fact is that not all games need realism. This is probably the most important reason. Diving deeper, other nuances come to light. For example, hitscan is much more faithful to the PC configuration. Yes, for single player games this is not so important, but for multiplayer games it is colossal.
With laser shot confirmation, there is no extra load. But with ballistics there is, and it manifests itself in the form of calculating the huge number of bullets and shells fired by players every second, which greatly increases the risk of lags.
Ballistics are also very difficult to detect at medium and close range. About 70% of all firefights will take place at these ranges. There will be no visual display, but the CPU will be loaded with useless miscalculations.
Of course, the ballistic system has its advantages, which is why many games use hybrid mechanics.
And we think it is an ideal option.
You can do ballistics only for weapons like sniper rifles and rocket launchers. They have a low rate of fire, so their more realistic simulation is not a big burden on the hardware.
But pistols, assault rifles, submachine guns, and shotguns are still better for making hitscan work.
If you develop your own game, you can find a lot of content on our site. For example, these are weapon models that will be very useful for a game in the FPS genre. We also have guides on how to develop games properly and how to implement certain materials in them. All this can be downloaded completely free of charge and without registration.
Don't forget that we have great sections with Assets for Unity and many Unreal Engine packs that are regularly updated and you can easily download them for use in your game projects.
Ctrl
Enter
Noticed a misTake
Highlight text and press Ctrl+EnterRelated news:
Comments (0)