In addition to what Josh Petrie mentioned: if you're looking for more advanced ways to aim weapons, the center dot in your bottom image is also called a "pipper" in real-life applications.
This especially applies when some device is actively predicting where an arcing projectile will impact, like a bomb or grenade, instead of simply showing which direction ...
Simple answer: cheat or don't be that accurate!
If you've played some shooter online, you'll most likely have experienced the so called "rubber banding" if your connection to the server is bad.
This is caused by your client correcting your position from time to time.
Basically, what happens on the two sides:
The server will track your movement and send ...
Shoot a ray from the camera through the center/reticle into the world. Find out where in the world it hits. Fire the bullet from the gun's muzzle at that point instead of straight out of the gun.
Bonus points for animating the hands and gun to point in that direction while aiming around so the bullet still looks like it's firing straight out of the muzzle ...
Always assume the client is a lying, cheating, bastard.
The client is responsible for:
Receiving input from the player (and sending commands to the server, which validates)
Rendering the known gamestate
The client is in no way allowed to calculate the gamestate except as client-side interpolation for smooth animations.
You could decompose your quaternion into a yaw/pitch/roll set of angles, but that's overkill usually.
Instead of composing your quaternions like this:
cameraOrientation = cameraOrientation * framePitch * frameYaw;
cameraOrientation = framePitch * cameraOrientation * frameYaw;
It will then never generate tilt/roll and is equivalent to storing ...
The main problem is tunneling.
Game physics engines typically use discrete collisions. That means they advance all the bodies by one short time step, then check if they're intersecting, and handle collisions in response.
This works well for medium-sized objects at medium speeds.
But if you have a small object (like a bullet) moving very fast (like a ...
The industry standard for first-person view simulation in most shooters is to have character models and animations distinct from those used for third-person view. There are several reasons for this:
The player has a much smaller field of view upon the world than a real person in the character's situation would, and he lacks other forms of input such as ...
This is a problem I had for a while, and I couldn't find any answers for, so I thought I would post it here.
It is actually quite simple. How you are most likely doing the rotations is like this:
currentDirection * newRotation;
But, doing it like this doesn't work either.
newRotation * currentDirection;
What you have to do, is do it in the first order ...
When dealing with different frames of reference interacting with each other instantaneously, you have to compromise somewhere, you cannot have everything consistent everywhere; that's a fact of life. The scenario you have outlined is basically this: the shooter thinks she has hit her target, but the target thinks she has successfully hidden behind an ...
I'll state the obvious - FPS games are doing the best they can within the limitations of a single 2D display device.
The interesting part - this might change soon thanks to the Oculus Rift project - a VR headset for games. I've seen info that DOOM 3 is fully supported (due to Carmack's involvement) and that Hawken has promised support. There is also work on ...
To measure framerate you need two counts:
How many frames (not draw calls) have passed, and,
How much time has passed.
Your framerate is therefore calculated as:
frames / time
There are a few subtle complexities to this.
First thing is that you need a good, accurate, high resolution timer. You don't say what platform you're on so I'm not going to make ...
There are many reasons a designer/programmer would want to draw the crosshair on the exact center of screen, or a little lower. A hybrid system may even be implemented, taking advantage of the properties of these two systems in a game fich of different weapons, vehicles, interactive spots, and so on.
Drawing the crosshair centered or lowered can depend on ...
If you haven't already, I suggest you to read these two deep but understandable articles : https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking and http://fabiensanglard.net/quake3/network.php.
These explain why it's advised to use 'fixed interval' packet sending.
To be short, it's in fact mainly important for packets sent by the server.
When we implemented our networking engine we exploited a number of compression techniques:
First we write all of our snapshot bit-wise: bools are only 1 bit
instead of 1 byte (or more depending on compiler). We wrote a
bitstream class that reads and writes data to a stream. This saves a
fair bit of data all alone when packing flags down. For an example of ...
To have the gun heat up quickly but reach its overheat threshold slowly, you could take the gun's current temperature into account in the heat dissipation, rather than having a constant rate of heat dispersion. That's actually how it works in the real world: the rate of heat / thermal transfer is proportional to the difference in temperature. Wikipedia has a ...
It's hard to tell exactly what's being asked here but I'll try to give the best answer I can. There are a few misconceptions going around in comments and answers so I'll try to clarify all this, to the best of my knowledge.
[I] noticed that the camera perspective is similar to the 'one eyed
view' of the surroundings.
Indeed, the default (horizontal) ...
For an FPS camera you usually don't want roll and are limited to +/- 90 degrees pitch, so I'd just keep track of the current state using yaw and pitch angles. The full power of quaternions isn't really helpful for this.
You can still convert the yaw/pitch angles to and from quaternions in case you want to transition between the FPS camera and animated ...
Why has this happened?
This HASN'T happened.
Duke Nukem 3D and Unreal Tournament (to use your examples) were creative games, both were trying lots of exciting new things, in new themes, in new ways.
But most other games from those eras weren't doing that.
Quake 1, for example, had a pistol and a shotgun and a machine gun and a rocket launcher and etc. ...
You're probably looking for a combination of the following concepts:
Particle system for the bullet hitting a surface (i.e. sparks on hitting metal, wood splints on hitting wood etc.)
Decals to allow projectiles to leave hit marks
The short answer is that yes, server side occlusion culling is possible, but it's often not done due to complexity and limited benefit.
Keep in mind that for a large portion of modern FPS games, complete occlusion is rare. Characters these days use cover or hide in grass, and the actual uniforms and camouflage actually has an impact on visibility. Walls ...
Having one UDP port per client seems complicated an inefficent. The client would need to start by sending a open-port-request so the server opens a new port for that client. Also, the performance for checking ports for available data might degrade with the number of sockets.
As long as the received datagram is handled quickly so the thread can continue ...
Why not look into the free Unreal Development Kit?
You can stick to the high level stuff or you can get down and dirty with the code. It includes an FPS demo.
The map editor is a ton of fun to play with too.
The short answer: You need client-side scripting to make real-time games possible.
The long answer:
What is a server?
A server is a computer used to run services for other computers on a network.
What is a web request
A web request is what web servers handle. It is a request, often created by a user from home on a home computer, netbook or a smartphone, ...
The server is running the game as well. And because it's transmitting your character's transform to every other client, it knows where you are. It can work out your character's hit boxes in exactly the same way that the client does.
Sending the hit boxes' location up to the server would be a recipe for exploits. There'd be an extremely trivial hack that ...
Aside from Josh's answer you have to keep in mind something else: players know what each of these weapons does. If I pick up a sniper rifle I know what I can probably do with it (shoot long distances, scope) and when I pick up a shotgun I also know to use it on shorter distances. If these weapons are replaced by say a deathRay and a doomshooter I might not ...