Google I/O 2012 - GRITS: PvP Gaming with HTML5
Why Game Development Stack Exchange recommends it
Game Development Stack Exchange answerers point people to it for practical HTML5 canvas game techniques, such as off-DOM canvas rendering for speed and tile-based engines, plus a worked multiplayer example.
Recommended by 2 people across 2 different months, 2012 to 2016.
What it is
A Google I/O 2012 session by Colton McAnlis presenting GRITS, a player vs. player shooter built entirely on Google technologies. It walks through an HTML5 canvas engine, WebSocket networking, NodeJS on the server and social integration, with the game's source code published.
What people said
Recommends Tapio · 2012-07 · Game Development Stack Exchange · on “Managing text-maps in a 2D array on to be painted on HTML5 Canvas”
An easy way to keep track of the IDs would be to simply use another 2d array with them in: by only maintaining x,y on that "meta array", you can easily look up the other IDs. That being said, here's Google's take on 2D tiled canvas gaming (well, actually HTML5 multiplayer, but tile engine is also covered) from their recent I/O 2012: [this video] It also has source code available.
Recommends sws · 2013-09 · Game Development Stack Exchange · on “HTML5 Jump and Run Game Performance issues”
I recently watched a Google I/O 2012 video ( [this video] ) which talks about using an off-DOM canvas to perform your rendering, then "blitting" that canvas to an on-DOM canvas for final presentation. The speaker indicates their game saw a 30X performance increase simply by using an off-DOM canvas. YMMV, but maybe this will help you out.
Cites AbstractChaos · 2012-07 · Game Development Stack Exchange · on “2D maps, how to structure?”
2D tile maps are exactly how they sound, imagine something like this: 1,1,1,1,1 1,0,0,0,1 1,0,2,0,1 1,0,0,0,1 1,1,0,1,1 This the design of our map and if we take 0 = floor 1 = wall 2 = chest Then you can see that our map is a room with an entrance and a chest in the middle of the room our data structure for this could be like @georgeK said an Array of arrays ie. var map =[ [1,1,1,1,1], [1,0,0,0,1], [1,0,2,0,1], [1,0,0,0,1], [1,1,0,1,1]]; We would then load each of our tiles into a look up just the once and draw our room by putting that tile in place of the number on the grid. for row in map for each cell in row draw tile offset by the x, y position in the array multiplied by tile width. end
Cites OpherV · 2016-06 · Game Development Stack Exchange · on “How to compensate for moving objects with client side prediction?”
I'm implementing a game server that supports Star Control-like melee [LINK] . So you have ships flying and shooting, with super simple velocity/acceleration/dampening physics to drive movement. [LINK] I've read Valve, Gafferon and Gambetta and implemented Gambetta's algorithm [LINK] for client prediction: [LINK] Client prediction works on the player ship by updating its position from the server as it comes and then reapplying the yet-unprocessed-by-the-server input to the player ship. Unfortunately, it doesn't work well for my game. I believe it has to do with the fact that Gambetta's example doesn't take into account objects that are already moving, or commands that are updated on a step by