How do first person shooters work?

Started by
12 comments, last by Anddos 14 years ago
How do first person shooters work? Like player has a body? How do it interact with the world?
Advertisement
Quote:How do first person shooters work?
The question as stated doesn't have a concise answer. There are many ways to go about creating an FPS, all the way from writing it 'from scratch', to creating a game or demo using an authoring tool such as FPS Creator.

If you need more info, you'll probably need to provide quite a bit more info, such as how much programming experience you have, what programming language(s) you're comfortable with, what platform(s) you're interested in targeting, etc., etc.
I just want to know if player has a body... because in the most popular FPS like COD or Battlefield player cant see his torso, legs and feet. So if player as a body, the body is invisible...
If player doesn't have a body how can I check collision and other interactions with the world?

Quote:Original post by jyk
If you need more info, you'll probably need to provide quite a bit more info, such as how much programming experience you have, what programming language(s) you're comfortable with, what platform(s) you're interested in targeting, etc., etc.

I've programming experience in C++, Java, Actionscript 3.0 and Objective-C, Im programming a 3D game in DirectX 10.


bounding box!
Just because the body is not technically drawn doesn't mean the data isn't there. You can still do collision with an imaginary body or even an imaginary box wrapped around where your body would be.
As others already mentioned, just because something is invisible doesn't mean it's not there. However, just because something is visible doesn't mean that that's all there is to it. The 3D models that you see on-screen are often not used for collision purposes. Collision/physics systems often use simplified versions of these models, sometimes just bounding spheres or boxes. In most cases that works well enough - perhaps even better for some purposes.

You may want to check out some existing FPS games and their modding tools to get a better understanding of these things. Those modding communities also contain a lot of articles and other useful information. Most of it is geared towards content creation, but that's an important part of content-heavy games.
Create-ivity - a game development blog Mouseover for more information.
Quote:Original post by Captain P
As others already mentioned, just because something is invisible doesn't mean it's not there. However, just because something is visible doesn't mean that that's all there is to it. The 3D models that you see on-screen are often not used for collision purposes. Collision/physics systems often use simplified versions of these models, sometimes just bounding spheres or boxes. In most cases that works well enough - perhaps even better for some purposes.

You may want to check out some existing FPS games and their modding tools to get a better understanding of these things. Those modding communities also contain a lot of articles and other useful information. Most of it is geared towards content creation, but that's an important part of content-heavy games.


I was thinking about that, so I will "cook" the player body geometry into a PhysX actor but I will not draw it.

Thanks for you answers

There are little people living inside each machine, and they really do run around and kill each other. So when you play, you are killing them all.

That's why gamers need new machines so often, they start to run out of little people inside the machine.





Sorry, I couldn't resist.

A player is little more than a point with an orientation, and some player state information. This information is small, and easy to send across the wire.

In the physics world they are generally implemented as a snowman (2-3 spheres) or a capsule. In the expensive FPS games they are implemented as a set of articulated capsules and spheres. (Sphere for the head, capsule for the core, capsules for the arm, sphere for the hand, etc.) Outside the FPS world, a snowman is good enough. Inside the FPS world, where you need to have more accurate injury areas, an articulated model is better.

Both spheres are capsules are great because they have rounded edges. Boxes are horrible, since they snag on bumps. You set the curves to be how far up they can step. When the player is squatting the capsule or spheres get closer and fatter, when the player crawls the physics objects are, too. When a player peeks around a corner the spheres or capsule tip. Spheres are extremely easy to check for collisions, capsules are harder, but not much. Capsules are supported on most physics systems these days.

If you have the resources to spare, or just want to play with a physics engine, you can even make a fully articulated physics model that matches your rendered model. As a hobby game I wouldn't bother, but if you have the time and resources, go for it.

In graphics, they are shown as fancy articulated models with complex animations.
1st person shooters are, all things considered, just like 3rd person shooters. The difference is in the perspective, and the rendering of the player. Well, parts of it. Arms, legs, weapon, ... For example, Borderlands allows you to play 3rd person or first person, with a couple of config file tweaks.

The models and anims for the weapon in 1st person games are usually of higher quality than for 3rd person games, since you get to see a lot more of the gun than in 3rd person.

Everything is better with Metal.

In most games, the weapons you see in your character's hands, and the hand itself are not connected to anything. If you play multiplayer and look at another character, you see a different (and lower resolution) model. The character's weapon is usually rendered in screen coordinates, and so it's always visible, and never pokes through walls and objects when the player gets too close to them. For purposes of collision detection with the environment, the character is probably represented as a sphere or cylinder. In modern shooters, the player's collision mesh is more detailed so it's possible for head/torso/leg shots, etc. But you don't need that level of detail for resolving collisions with the environment. When the player crouches or goes prone, you can just replace the shape with something smaller.

This topic is closed to new replies.

Advertisement