How do multiplayer shooter video games track bullets. In games like Battlefield thousands of “bullets” can be fired in a round. How does the game know who fired what and who hit/killed who?

565 views

How do multiplayer shooter video games track bullets. In games like Battlefield thousands of “bullets” can be fired in a round. How does the game know who fired what and who hit/killed who?

In: Technology

4 Answers

Anonymous 0 Comments

This is basically a weird way of asking “how do computers work” or “How do games work”.

Everything that exists inside a game is it’s own entity, or game object.

When a bullet is fired, that bullet is an entity that exists in the game, and holds a ton of information.

Information including what the ID of that bullet is (for example, ID 2887), who shot it, how fast it’s travelling, what direction it’s going in, is it effected by gravity, how much damage will it cause, how far can it travel before being deleted, etc etc etc. It just holds a list of everything it needs to know, and does some maths to work out where it’s travelling.

A server is powerful enough to hold all of this information, for every bullet that ever exists in a game, 10000 times a second.

Each player has their own “Player ID” of some form, so when a bullet hits another player, the sever is basically saying “bullet entity 2887, from Player ID 180837, collided with Player ID 788973”.

“Reduce player ID 788973’s Health points by Bullet 2887’s damage output”.

You are viewing 1 out of 4 answers, click here to view all answers.