I’ve always wondered how multiplayer video games – that is, those involving players distributed across a network – decide upon a winner in this typical situation: Player A and Player B fire one-shot-kills bullets at each other at nearly the same time (Player A’s fires 1/1000th of a second first). Being that each player is on their own machine across a network and that the time on their machines is not necessarily correct (a bit fast or a bit slow), the game server cannot simply trust the received data. How are these life or death decisions made?
I posed the question to Quora and only received unhelpful answers. Elsewhere, however, I was provided two good sources that each answered the question. First, from The Valve Developer Community – Source Multiplayer Networking page:
A client receives the current world state from the server and generates video and audio output based on these updates. The client also samples data from input devices (keyboard, mouse, microphone, etc.) and sends these input samples back to the server for further processing. Clients only communicate with the game server and not between each other (like in a peer-to-peer application). In contrast with a single player game, a multiplayer game has to deal with a variety of new problems caused by packet-based communication.
…
Basic Networking
The server simulates the game in discrete time steps called ticks. By default, the timestep is 15ms, so 66.666… ticks per second are simulated, but mods can specify their own tickrate. During each tick, the server processes incoming user commands, runs a physical simulation step, checks the game rules, and updates all object states.
After simulating a tick, the server decides if any client needs a world update and takes a snapshot of the current world state if necessary. A higher tickrate increases the simulation precision, but also requires more CPU power and available bandwidth on both server and client.
…
Lag Compensation
Let’s say a player shoots at a target at client time 10.5. The firing information is packed into a user command and sent to the server. While the packet is on its way through the network, the server continues to simulate the world, and the target might have moved to a different position. The user command arrives at server time 10.6 and the server wouldn’t detect the hit, even though the player has aimed exactly at the target. This error is corrected by the server-side lag compensation)
The lag compensation system keeps a history of all recent player positions for one second. If a user command is executed, the server estimates at what time the command was created as follows:
Command Execution Time = Current Server Time – Packet Round-Trip-Time – Client View Interpolation
Then the server moves all other players – only players – back to where they were at the command execution time. The user command is executed and the hit is detected correctly. After the user command has been processed, the players revert to their original positions.
Client and server hitboxes don’t exactly match because of small precision errors in time measurement. Even a small difference of a few milliseconds can cause an error of several inches for fast-moving objects. Multiplayer hit detection is not pixel perfect and has known precision limitations based on the tickrate and the speed of moving objects. Increasing the tickrate does improve the precision of hit detection, but also requires more CPU, memory, and bandwidth capacity for server and clients.
The question arises, why is hit detection so complicated on the server? Doing the back tracking of player positions and dealing with precision errors while hit detection could be done client-side way easier and with pixel precision. The client would just tell the server with a “hit” message what player has been hit and where.
We can’t allow that simply because a game server can’t trust the clients on such important decisions. Even if the client is “clean” and protected by Valve Anti-Cheat, the packets could be still modified on a 3rd machine while routed to the game server. These “cheat proxies” could inject “hit” messages into the network packet without being detected by VAC (a “man-in-the-middle” attack).
Another great article on the subject is Gamasutra – 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond, which talks about the same subject from the perspective of a RTS game and in the age of dial up.
XenonMKV is a terrific program for converting videos in the MKV format to an MP4 that an Xbox 360 can play.
After upgrading my desktop PC to Windows 7 (64-bit), I found that the MP4 files I was outputting only worked if I changed the version of MP4Box.exe used to 0.4.5 (defaults to 0.4.6). After that I had no problems.
Embedded above is the trailer for the new Sony MMORPG DC Universe Online, available soon for the PlayStation 3 and PC. It’s supposed to have an all-new combat system the likes of we’ve never seen before (in a MMORPG). Interesting stuff, if not just for the 5-minute short movie that is the trailer.
Super Mario Bros. from Andreas Heikaus on Vimeo.
If you’re one of the growing many who own a Xbox 360, you have the opportunity to allow Microsoft to extend the audio, video and picture media on your computer over your TV and home theatre. This is done with an almost one-click process via the software called Windows Media Connect (WMC); all it requires is you to be running a copy of Windows XP SP2.
Viewing your pictures and listening to your music collection via WMC is a snap; the one annoyance when it comes to viewing video has been the restriction to only being able to view movies in the Windows Media Video (WMV) format. Finally, a solution:
TVersity: WMV transcoding for the Xbox 360 is here
Here is an early preview for the on the fly WMV transcoding feature for the 360. Since we have other stuff that needs to make it into the next release and since this is not yet ready we are releasing a patch.
…
Start TVersity, go to the 360 and browse your computer for videos. You should now see all the videos shared via TVersity plus all the online video URLs and assuming your directshow has the filters needed to decode these videos they should all play on the 360.
Transcoding isn’t a perfect solution – simply building in support for codecs like DivX and XviD would be preferable – but hey, might as well put that high-powered PC of mine to use in transcoding over to the WMV codec for the Xbox 360 to see.
Sunday evening, Xbox Live Director of Programming Larry Hryb’s (aka Major Nelson) podcast featured a lengthly comparison of the next-generation disc formats, HD-DVD and Bluray. Appearing as his guests and topical experts were Amir Majidimehr, corporate vice president of the Consumer Media Technology Group at Microsoft, and Kevin Collins, Senior Program Manager at Microsoft.
Fair disclaimer: Microsoft today is firmly in the pro HD-DVD camp, but as Amir points out during the discussion, MS maintained neutrality in the format war for about two years before committing to HD-DVD in September of 2005. Also note that I will also be reprinting the points made during the podcast verbatim – meaning they’re not my words, but theirs – don’t shoot the messenger.
Mail-in rebate will be in the XBOX Live Packaging.
The game everyone’s raving about on the Xbox 360 and 12 months of Live for $10 more than you’d pay for purchasing Ghost Recon by itself? You can’t lose!

With the 2006 International Consumer Electronics Show now underway in Las Vegas, details regarding the pricing of next-generation optical media are finally becoming available.
While players for the lesser-enthused HD-DVD format are ringing in at a moderately high amount of $500 USD this March, Pioneer’s unveiling of a Blu-ray player has turned heads with its impressive array of features – and also with its impressively high price of $1800 USD.
So where does that leave Sony’s PlayStation 3 console? We’re supposedly expecting it to launch in Spring 2006, meaning one hell of a margin for Sony to be eating to drop the console down to match the Xbox360 in price – or even cost just a couple hundred dollars more. Muddying the waters a little further is Microsoft’s announcement yesterday regarding their Xbox360 and its upcoming HD-DVD support. Does this even the console playing field?
My best guess about what to expect next is really what I’ve said all along: A Spring 2006 launch for the PlayStation 3 is next to impossible. We’ve not seen a single leak as to pictures of the PS3 or its peripherals and we’re now just – what, 3 months away from deadline? How about launch title previews? Anything? Unless Sony is pulling off one hell of a security job, I’m thinking 4th quarter 2006 at the soonest.