arrow drop search cross

Programming Multiplayer Video Games on the Web Platform / Advanced JavaScript



With UCA Department of Computer Science

Format: Online


  • Michel Buffa (Université Côte d’Azur, I3S)


We offer here a course about multiplayer video game programming, including 2D and 3D graphics at 60 fps, real-time multiplayer aspects, reactive behaviors and implementations of classical algorithms (graphs, A*, quadtrees, etc.). The implementation will be done in JavaScript and probably using a 2D or 3D library. This minor course is a follow-up of the Web Technologies / JavaScript introduction.


The lesson plan is as follows:

  • Introduction to drawing and animation at 60 fps 2D in HTML5 canvas, with and without libraries/frameworks. In parallel: modern Object Oriented Programming in JavaScript.

  • Introduction to 3D programming by presenting all the basic concepts (markers, cameras, materials, lighting, heightmaps, etc.) illustrated using the BabylonJS 3D library.

  • Use of algorithms to give intelligence to entities controlled by the computer (steering behaviors, A* etc.).

  • Implementation of a NodeJS server for a naive implementation of a multiplayer game. In parallel: introduction to asynchronous programming in JavaScript.

  • Highlighting classic latency problems between client and server. Introduction to the notions of prediction and correction (latency compensation). Implementation of a correction/prediction system and testing tools. We will also consider compensation algorithms that self-adjust to bandwidth, ping, number of players (number of entities to synchronize)


  • Multiplayer aspects

    • I propose to study this article, in particular the parts at the end, which deal with the classical problems of "latency compensation" and "client-side prediction" of the movements of remote entities in multiplayer games.

      • You can test this online demo with several users for example : (open the same URL from multiple machines), each player moves a small colored square. The server is in the cloud at It should not work too bad. Now, in the menu on the right, open the "Methods" section and disable the "client prediction" option, and test. Do the same with "client smoothing"...

      • This book also covers in a very detailed way, the concepts mentioned and can help you to better understand them (chapters 7, 8 and 9) and also contains, for those who want a good general knowledge on the subject, a complete history of the algos used since the first multiplayer games, a study on security, on scalability, compares the classical and P2P approaches, study the "multiplay as a service" offers etc.

  • On reactive behaviors and other nice algorithms to look at, I propose these resources

    • D. Shiffman's book The nature of code, which explains, among other things, the Steering Behaviors algorithms. The online book contains many interactive examples. Look especially at the examples in Chapter 6.

    • These algorithms have been implemented in the YUKA library dedicated to 3D games, which we will certainly use, and which can easily be extended (creating your own behaviors). The official website contains many demonstrations.

    • This web page shows what you can do with cool algos in games, it doesn't only cover reactive behaviors but a huge amount of classical algos.


Completion of the minor Web Technologies / JavaScript Introduction


To be announced