RealtimeMultiplayerNodeJS

RealtimeMultiplayerNodeJS

onedayitwillmake 3 comments
library

RealtimeMultiplayerNodeJS is a framework specifically for building HTML5 multiplayer games with the Client / Server model. In this model, connected users send only input and the game itself runs on the server.
Clients are interpolate between two known world snapshots based on the current synchronized time.

How to use

  1. Download this repo
  2. In the terminal type “node js/DemoHelloWorld/server.js”
  3. Browse to “/DemoHelloWorld.html”

DemoBox2D

RealtimeMultiplayerNodeJS comes with 3 demos

DemoHelloWorld

The most basic interesting working demo I could come up with. Objects move from left to right
DemoHelloWorld

DemoCircle

A demonstration of the engine’s simple CircleCollision engine, which can provide you with simple collision information and fires an event when two objects collide with the two objects.
This demo also shows one implementation of having a special kind of entity which is controlled by the keyboard from a connected user. A character controlled entity
DemoCircle

DemoBox2D

This demo uses a Box2D.js implementation to create a world, and show’s off the idea of synchronized physics, and taking advantage that all the simulation happens on the server.
It also shows synchronized interaction between multiple users, and an example of sending a message to the server which it interprets back into the game
DemoBox2D

3 Comments

headwinds

September 13, 2011 at 1:05 pm

this is an excellent demo! I was going through the source and I can’t seem to find where you are setting the server constants. I was expecting to find a file like RealtimeMultiuserGameConstants.js

ex:
RealtimeMultiplayerGame.Constants.CLIENT_SETTING.MAX_BUFFER
RealtimeMultiplayerGame.Constants.SERVER_SETTING.SOCKET_PORT

where are you setting all the server constants?

 Reply

onedayitwillmake

September 13, 2011 at 2:18 pm

@headwinds
Thanks! 🙂

If you look in, ‘js/model/Constants.js’ – you’ll find the constants there.

 Reply

peak

January 5, 2014 at 9:45 am

It seems the design of putting the physical logic on server side does not fit me.

I use some other tools to generate custom physical shape on my client side, submitting the shape data from the client requires the server side implementing the same physical logic again, which is quite a job.

 Reply

Leave a Reply


*