Home / IT Books / Multiplayer Game Development with HTML5

Multiplayer Game Development with HTML5

While HTTP is a great protocol to reliably retrieve documents from web servers, it was not designed to be used in real-time games; therefore, it is not ideal for this purpose. The way HTTP works is very simple: a client sends a request to a server, which then returns a response back to the client. The response includes a completion status code, indicating to the client that the request is either in process, needs to be forwarded to another address, or is finished successfully orerroneously (Hypertext Transfer Protocol (HTTP/1.1): Authentication, (June 1999).

1. Getting Started with Multiplayer Game Programming
Understanding the basics of networking
Peer-to-peer networking
Client-server networking
Networking protocols – UDP and TCP
Network sockets
Socket programming in JavaScript
The WebSocket protocol
Creating a client-side WebSocket
Game clients
Game servers
Putting it all together – Tic-tac-toe
Node.js – the center of the universe
The /Player.js class
The /BoardServer.js class
The /server.js class
The /public/js/Board.js class
The /public/js/app.js class
2. Setting Up the Environment
JavaScript outside the browser with Node.js
Node.js
Installing Node.js
Writing modular JavaScript
CommonJS
RequireJS
Managing Node.js packages with Npm
Managing frontend packages with Bower
Browserify
Automating your workflow
Grunt
Gulp
3. Feeding a Snake in Real Time
Hello world for game development
Setting up the game
package.json
Index.jade
The game modules
Game.js
snake.js
Other supporting modules
app.client.js
The game loop
Frame rate independence
Time-based game loop
Multiple game loops
Implementing an authoritative server
Game server interface
Updating the game client
Understanding the game loop
Game client’s game loop
Game server’s game loop
Lobby and room system
Implementing the lobby
Implementing the rooms
Matching players within game rooms
Inviting friends into your world
Auto-matching
Skill-based matching
Socket.io
Installing Socket.io
Client-side Socket.io
4. Reducing Network Latency
Dealing with network latency
Synchronizing clients in lockstep
Fixed-time step
Synchronizing the clients
Predicting the future with a local game server
Reporting user input
Error correction
Play through the intent, but not the outcome
How close is close enough?
Smooth user experience
5. Leveraging the Bleeding Edge
HTML5 – the final frontier
Maximizing your game with the fullscreen mode
Better controlling with gamepad
Peer-to-peer with WebRTC
Capturing the moment with Media Capture
6. Adding Security and Fair Play
Common security vulnerabilities
Encryption over the wire
Script injection
Server validation
Artificial intelligence
Building secure games and applications
Authoritative server
Session-based gameplay
Security through obscurity
Reinventing the wheel
Npm install validator
Npm install js-sha512
Npm install closure compiler
Fair play and the user experience

Multiplayer Game Development with HTML5


Top books

About huydam

Check Also

[UWP] The program could not build Windows Universal Samples

If you get this error like this: “Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, …

Leave a Reply

Your email address will not be published. Required fields are marked *