ST-CS-10-339-75
March 2002
5. Other Client Side Behaviours (U)
The Half-life engine has a number of other tricks which are used to enhance the perception of a realistic no-latency environment for the client.
When a player fires his gun, the client immediately animates the gun, generates a bullet path for the shot and draws a miss decal at the point it thinks the bullet went - this despite the fact the server has no idea the client has fired yet, let alone where the bullet went or if it hit anything. This way the player feels as if the world is responding immediately to his gunfire.
After working out a bullet path and drawing the miss decal, the client then sends information to the server indicating that the player has fired. However, the client does not tell the server about the bullet path it worked out; only that the player has fired.
As such, the server works out a second path for the bullet, which will have a different random element and therefore the "same" bullet ends up in a different place.
This is why, in the footage below, miss decals can be seen on the glass panes - glass panes which immediately break when shot.
| Client side miss decals |
It is important to realise that what the server thinks - where it says the bullet went - is what really happens. What the client does is just make-believe to help fool the player into feeling there is no latency in his connection to the server.
If the server thinks the bullet hit an object which reacts when shot, it tells this to the client and the client then draws the appropriate animation - smashing glass, blood marks, etc.
If the server thinks the bullet missed and object, it does nothing; the miss decal drawn by the client stands. All miss decals are fake; they are not where the bullet really went.
The client will never, ever, draw a hit animation without first being told by the server to do so (e.g. the server having decided a hit has occured). Consider what would happen if client did so; a player fires at the edge of a glass pane. The client thinks the bullet hit and immediately explodes the glass pane. The client then tells the server the player has fired - but the server determines the bullet has missed the glass pane.
Now what? is the client supposed to magically rebuild the glass pane? of course not. The upshot is that if a client thinks a bullet hits a target, it does nothing, except draw a miss decal on that target if a miss decal can be drawn upon it. (Glass panes support miss decals for example, but hostages do not).
However, there is an exception to this. If a client thinks a bullet has hit a player or hostage, it will play the noise of the bullet hitting. As such, when recieving long range fire, you will hear the noises of bullets hitting you despite not actually being hit.
Up to version 1.1.0.6 of Half-life, client drawn miss decals could be very different to the actual server-side bullet paths, especially with the semi-automatic sniper rifles. The Half-life 1.1.0.8 patch claimed to fix this problem, making client side bullet paths match server bullet paths. Certainly, the situation has improved; client side bullet paths are now a lot closer to the server side paths. But they are still not the same.
One final note. Since the client cannot draw a miss decal on a player or hostage, if the client believes a hit has occured but the server believes a miss has occured, the bullet will have disappeared, since there it will have been fired and neither a miss nor a hit will have been drawn.
| prev page | - 8 - | next page |