Game Development Reference
In-Depth Information
Voxel.js ( http://voxeljs.com/) is a good example of a networked game
framework using Three.js. If you are building a Minecraft-style game, it is a
great place to start. For more information and code examples on writing game
networking code in JavaScript with Socket.io and Node.js, there is a good article
at http://buildnewgames.com/real-time-multiplayer/ . It uses a 2D game
as an example, but everything applies cleanly to 3D games as well.
Anticheating
Stopping cheaters in multiplayer games is a hard problem in general, and it's
particularly difficult in JavaScript for three reasons. One, it's very difficult to detect
whether client input is automated or their display has changed illegally; two, JavaScript
code is relatively hard to obfuscate and validate without significant performance
penalties; and three, cheating programs can directly and easily override your client
code. As a result, anticheating efforts typically focus on moving as much logic as
possible from the client to the server, detecting unusual patterns of client activity,
minimizing the benefits of cheating, and perhaps creating just enough annoying
barriers to cheating that some aspiring cheaters give up. Common methods include:
• Only letting the client send whitelisted inputs to the server, not arbitrary
values; this allows a trusted computer (the server) to do important
calculations and avoids letting cheaters make illegal requests such as
addPoints(1000000)
• Tracking how long the user plays the game; if a user plays for 48 hours
straight, they're worth investigating
• Tracking the amount of time that passes between user actions; if a user clicks
on the same part of the screen every 10 minutes (suspiciously accurate) or 16
milliseconds (suspiciously fast), they might be automating their behavior
• Reporting snapping, the behavior in first-person shooters of instantly turning
to shoot at a target as soon as there is nothing in the way, even when that
target wasn't onscreen, and never missing
• Making debugging harder, for example by disabling console logging
( console = {} ) and wrapping your entire client-side code in a closure to
prevent any global variables from being easily available to cheaters' scripts
• Making it easy for users to report abuse
This is certainly not an exhaustive list, and it's very difficult to stop cheaters entirely,
but these suggestions are a reasonable place to start.
 
Search WWH ::




Custom Search