Sign in to follow this  
Aqua Costa

How do first person shooters work?

Recommended Posts

jyk    2094
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.

Share this post


Link to post
Share on other sites
Aqua Costa    3691
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.


Share this post


Link to post
Share on other sites
Argo15    122
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.

Share this post


Link to post
Share on other sites
Captain P    1092
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.

Share this post


Link to post
Share on other sites
Aqua Costa    3691
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

Share this post


Link to post
Share on other sites
frob    44916
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.

Share this post


Link to post
Share on other sites
oliii    2196
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.

Share this post


Link to post
Share on other sites
taz0010    277
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.

Share this post


Link to post
Share on other sites
WuTz    100
Yeah, right. All you can see of your weapon is this:

SeptemberUpdate

And the arm around it, will look like this.
No body hangs on it, in the most (All?) public shooters.
New Arm
(Both from our old mod Tre-TheSpreading)


Another thing:

To make your shooter more interesting, you can draw your body, just like this:
JuneUpdate
(Second part of that mod, Tre-LastLife)

And in both situations, the collision is just made with a cylinder around the player. Nothing more.

It just has to be big enough, that the player *thinks* his body would collide with a wall. :)

Share this post


Link to post
Share on other sites
Decibit    140
Even if you "bake" your collision detection model into the physics engine there will be still a lot of problems to solve. One of the problems is when NOT to use the "ordinary" physics.

An example for this would be a staircase. Most of the players are annoyed if they have to stop at every single step. So you probably have to ignore the steps for collision detection. Nevertheless they expect the staircase to behave like a staircase when a grenade has to bounce off it. In this case you are not allowed to ignore the steps.

This article can be useful for you.

Share this post


Link to post
Share on other sites
frob    44916
Quote:
Original post by Decibit
An example for this would be a staircase. Most of the players are annoyed if they have to stop at every single step. So you probably have to ignore the steps for collision detection.
A snowman or capsule solves this problem. The round base can easily navigate steps.

Share this post


Link to post
Share on other sites
Anddos    588
There done with ray testing i believe when the gun shoots the enemy model etc, or the bullet moves with a ray on it going at the direction its fired , etc the camera direction look and up direction

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this