Bomberman Online - HTML5 multiplayer online game from habrauser. We are testing the load!
Bombermine Online - the result of the last two weeks of testing and preparing the engine for a large number of players online.
The engine is written in Java + Jetty (backend). Front End - HAProxy + Nginx + Node.js. The client side is GWT, which is translated to HTML5 / canvas + javascript + websockets. Everything is hosted in the cloud.
Currently, the record is 50 players online. All necessary software for load monitoring is configured. After a habraeffekt we promise to lay out the report. We are waiting for guests. ')
Gameplay video
Background to the creation of the engine
Recently there was a fashion to rewrite old games under HTML5 - the idea that childhood games can be ported to the browser and, maybe, even play them with friends turned my head.
For large maps, the method I used to look at in Minecraft was used when I wrote my Mine Upside Down mod : the map is divided into square chunks, and the user sends defs relating to the squares in his visibility zone. In this case, the client performs a part of the update of the game state itself, and what it cannot - it receives as diff from the server. It is clear that, in the ideal case, out-of-sync should occur only at the limits of the player’s visibility and are extinguished due to redundant information in the differential.
Since this method seemed to be the most difficult and potentially important part, I began to implement it immediately, using unit testing. The test with a random movement of tanks across the desert terrain caught the out of sync between the client and the server.
Then it is time to write a mapping. When drawing a tile map, a problem arose: if the tiles are 16x16 and the screen is 640x480, then 1200 squares should be drawn. At the same time drawing tile depended on its neighbors. The resulting FPS did not please me. Saved the thing used in the same Minecraft - the chunk received from the server should be drawn and remembered until it changes. In this case, the buffer for displaying chunks can be used periodically, slightly larger than the screen.
Now, instead of 1200 16x16 images, the numbers of which depended on the neighboring ones, you only need to draw only 6 256x256 images, without any extra calculations. The FPS immediately went up to the cherished 60. The GWT DevMode on my laptop comes out with 17 FPS - for debugging it's just great.
The network part turned out to be quite simple - WebSockets via Jetty.
Clientside : Chrome shows itself best (holding 60 fps even on old hardware), then Safari, FF and Opera. About donkey better not to ask :)
Bombermine Online Crew
The authors of the engine are me and fibulwinter . Web and interface - demark . Tuning and tuning server - stolen . Artists - DaveDee and d3emp .