43

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


21

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


20

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


18

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.


17

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; Try this: cameraOrientation = framePitch * cameraOrientation * frameYaw; It will then never generate tilt/roll and is equivalent to storing ...


12

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


10

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


9

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


8

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


7

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


7

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


7

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


6

Server-side web languages such as Ruby on Rails are used to generate/serve HTML, JavaScript and CSS. They receive a request from the browser, act on it to make the HTML response, and then send it to the browser and the transaction is done. With the exception of tricks like long polling, they don't do anything dynamic in the browser; that responsibility is ...


6

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


6

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


5

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


5

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) ...


5

That's probably .kkrieger by .theprodukkt. And yes, the answer to how is: extremely-efficient procedural generation. Wikipedia has some more details for you.


5

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


5

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


5

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


4

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


4

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


4

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.


4

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, ...


4

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


4

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


Only top voted, non community-wiki answers of a minimum length are eligible