Real time multiplayer with melonJS and socket.io ?

781 views
Skip to first unread message

Loïc BLABLAA

unread,
May 27, 2013, 2:58:35 PM5/27/13
to mel...@googlegroups.com
Hi !

I was reading this article about real time networking with socket.io for games, but I wondered how could I implement it with melonJS ? The method described in the link I provided replicates the map on the server too, and it implies that physics are manager in the server too. Anyone already had done something like this ?

Thanks for reading and sorry for my bad english...

Roel van Uden

unread,
May 27, 2013, 4:11:38 PM5/27/13
to mel...@googlegroups.com
Sure! I'm beginning to learn about MelonJS internals but there is nothing stopping you from networking with a server to get a persistent world. The reason why you need physics on the server is simple: to prevent cheating! A client can never be trusted, so your server needs to validate movement, collision, and so forth. The client merely predicts

Aaron McLeod

unread,
May 27, 2013, 4:30:46 PM5/27/13
to mel...@googlegroups.com
Yep. This is actually a really good read on different client/server structure types that GGG did to label why they're having de-sync issues. The descriptions of each one might help you decide what you need. http://www.pathofexile.com/forum/view-thread/318115


--
You received this message because you are subscribed to the Google Groups "melonJS - A lightweight HTML5 game engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to melonjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Aaron McLeod
http://agmprojects.com

Jay Oster

unread,
May 27, 2013, 6:19:28 PM5/27/13
to mel...@googlegroups.com
There is a very recent thread here with all of the basics in place for doing multiplayer with socket.io in melonJS: https://groups.google.com/d/msg/melonjs/X6kpO2EdDf8/g4fA25uH6V0J

Loïc BLABLAA

unread,
Jun 8, 2013, 7:58:32 AM6/8/13
to mel...@googlegroups.com
Hi everybody ! Sorry for all this time, I had some problems with internet these days. Well, I looked at all the links you gave me, and I finally did it with the help of this Github reporitory : https://github.com/jroblak/MelonJS-Node-Socket.IO-Boilerplate-Example. A quick demo here : http://melonjsgame.eu01.aws.af.cm/

Vizwind

unread,
Jun 9, 2013, 4:04:56 AM6/9/13
to mel...@googlegroups.com
@Loïc BLABLAA, somehow I can't get this demo running: https://github.com/jroblak/MelonJS-Node-Socket.IO-Boilerplate-Example.

First I tried use the start script, but it reports the error "nv: node\r: No such file or directory". Then I tried add the package.json with express and socket.io, but this time it reports error:

/Users/rolandlu/html5/MelonJS-Node-Socket.IO-Boilerplate-Example/server/server.js:1
equire, module, __filename, __dirname) { var app       = require('express')(),
                                                                           ^
TypeError: object is not a function
    at Object.<anonymous> (/Users/rolandlu/html5/MelonJS-Node-Socket.IO-Boilerplate-Example/server/server.js:1:97)

Loïc BLABLAA

unread,
Jun 9, 2013, 11:03:45 AM6/9/13
to mel...@googlegroups.com
Typ "npm install" and check that package.json contains "express" and "socket.io" in the dependancies. For my case, I did'nt copy/paste the code, I just looked at how it was done, so I can't tell you if it really works or not.

Justin

unread,
Jun 9, 2013, 8:49:12 PM6/9/13
to mel...@googlegroups.com
I fleshed out the README.md in the repository. Check it and see if it helps you figure out how to get it running.

Vizwind

unread,
Jun 11, 2013, 12:17:37 AM6/11/13
to mel...@googlegroups.com
Still the same error. package.json I have tried:

{
  "name": "MelonJS-Node-Example",
  "version": "0.1.0",
  "private": false,
  "dependencies": {
    "express": "2.5.2"
    , "socket.io": "0.9.14"
  }
}

I have also run "npm install -d" and installed the dependencies successfully.
Reply all
Reply to author
Forward
0 new messages