Code Monkey home page Code Monkey logo

realtimemultiplayernodejs's People

Contributors

hikirsch avatar onedayitwillmake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realtimemultiplayernodejs's Issues

webRTC support / UDP

Hello

My understanding is that websockets run over TCP, therefore being much slower than webRTC which supports the UDP protocol.
Typically realtime games use the UDP protocol instead of TCP, is there a chance to make this work in this library ?

Thanks

"wantsFullUpdate" & full/half "EntityDescription"

Hi,
congratulations for this framework, but especially for having released as open-source.
I'm starting to use your framework for the construction of a multiplayer game (or at least I try).
I did some initial adjustment to adapt the framework to the latest version of socketio.

the "constructEntityDescription" In "GameEntity" allows for "wantsFullUpdate" but then not used within the function.
"If true, Certain Things That are only sent When changed are always sent"
You have commented.

What can I do about this parameter?

Another related problem is that I would send over the network initially and then only when asked for a full "EntityDescription" to initialize the object (bodymass, bodyfriction, geometryWidth, geometryHeight etc. ..)
Then inside the loop send a simple "EntityDescription" that contains only "position, rotation and id .."

  • I have to edit the source of the framework, or is already prepared for this?
  • It is connected with "wantsFullUpdate"?

I hope I was clear and I apologize in advance for my English "google translated"

CirclePackingJS outdated

I believe the js/lib/circlecollision is outdated from your CirclePackingJS repo. There it is fixed, but in this repo CircleManager.js should be

// Wrap X
if(boundsRule & wrapXMask && xpos-diameter > this.bounds.width) {
aCircle.position.x = this.bounds.x - radius;
} else if(boundsRule & wrapXMask && xpos+diameter < this.bounds.x) {
aCircle.position.x = this.bounds.width + radius;
}

Currently they are both " - radius" so the circle will appear to jump on the right side when you navigate your player through the left boundary.
I want to say thanks for releasing this its really great for getting started making a multiplayer game.

Serving static files / obeying the Same Origin policy for websockets

The instructions in the readme are very vague.

"run the server and brows to "/DemoHelloWorld.html"

On localhost? What port? I can just open the file DemoHelloWorld.html, but then it will be on a different origin from the websockets, causing it to print this:

14 Nov 23:57:57 - Initializing client with transport "websocket"
14 Nov 23:57:57 - WebSocket connection invalid or Origin not verified
14 Nov 23:58:02 - Initializing client with transport "xhr-polling"
14 Nov 23:58:02 - Client 03701277635991573 connected
1 joined the game!

If you want to use websockets, you have to be on the same origin, right? So you should have your server serve up this static file. And you should be clear about where your server is serving it to. It does not print out the client port to the terminal, and it took me a bit of hunting to find where that is even set.

Trouble running server

Hey,

I'm not able to run this step:

  1. Within another terminal, navigate to the root directory and run "python -m SimpleHTTPServer"

Can you please elaborate?

Black screen

I followed the steps in the readme, it seems as though it is not working. I followed the error and it looks like it has something to do with socket.io failing to connect?

Choose a licence

The package.json in the root doesn't specify a licence. A licence should be chosen for the project ๐Ÿ”

Demo fails to produce any output (Mac 10.7)

I'm trying to follow the simple 3-step instructions, but I'm running into some trouble.

The server starts and outputs the normal message:

$ node js/DemoCircles/server.js
29 Jul 00:31:22 - Your node instance does not have root privileges. This means that the flash XML policy file will be served inline instead of on port 843. This will slow down initial connections slightly.
29 Jul 00:31:22 - socket.io ready - accepting connections

But when I try to load the demo (in Safari or Chrome), nothing happens. The browser appears to connect (as the loading spinner runs until I ctrl-c the server), but no more console output appears, and nothing appears in the browser(s).

I've tried connecting to a variety of URLs (I'm assuming the default port of 8081 is correct):

http://localhost:8081/RealtimeMultiplayerNodejs/DemoCircles.html
http://localhost:8081/DemoCircles.html

Any help? Am I missing any dependencies?

Getting server errors after vanilla node.js install

Hi Mario

Great work btw! I just downloaded and installed the node.js v0.6.13 mac port.

I'm getting some startup errors do I need to nph install something? I'm new to node.js.

Toms-MacBook-Air:RealtimeMultiplayerNodeJS Tomo$ node js/DemoBox2D/server.js
17 Mar 12:16:30 - socket.io ready - accepting connections

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: listen EACCES
at errnoException (net.js:646:11)
at Array.1 (net.js:732:28)
at EventEmitter._tickCallback (node.js:192:40)
Toms-MacBook-Air:RealtimeMultiplayerNodeJS Tomo$

How to run the demo?

Hi,

how are you supposed to start the demo? The documentation just says: 'Browse to "/DemoHelloWorld.html"' but on which server or port or just with file://? I tried

http://localhost/path/to/DemoHelloWorld.html (via my local Apache)
file:///path/to//DemoHelloWorld.html
http://example.com/path/to//DemoHelloWorld.html (Apache on the internet)
http://localhost:8081/DemoHelloWorld.html (Port from js/model/Constants.js)
http://example.com:8081/DemoHelloWorld.html (Port from js/model/Constants.js)

The description suggests that this would be perfect for what we try to do (a multiplayer server/client game with node in the browser) but it seems not to matter what I try to get the demo up and running (I even tried it as root as one other guy suggested), either nothing happens or I get the error:

Lala:game jeena$ sudo node js/DemoHelloWorld/server.js
Password:
7 Jun 13:59:08 - socket.io ready - accepting connections
7 Jun 13:59:29 - Initializing client with transport "websocket"
7 Jun 13:59:29 - WebSocket connection invalid or Origin not verified
7 Jun 13:59:34 - Initializing client with transport "xhr-polling"

/Users/jeena/game/js/lib/Socket.IO-node/lib/socket.io/transports/xhr-polling.js:119
    res.setHeader('Content-Type', 'text/plain; charset=UTF-8');
        ^
TypeError: Object #<a ServerResponse> has no method 'setHeader'
    at Polling._write (/Users/jeena/game/js/lib/Socket.IO-node/lib/socket.io/transports/xhr-polling.js:119:9)
    at Polling._payload (/Users/jeena/game/js/lib/Socket.IO-node/lib/socket.io/client.js:167:28)
    at Polling._onConnect (/Users/jeena/game/js/lib/Socket.IO-node/lib/socket.io/transports/xhr-polling.js:59:12)
    at Polling.Client (/Users/jeena/game/js/lib/Socket.IO-node/lib/socket.io/client.js:49:8)
    at new Polling (/Users/jeena/game/js/lib/Socket.IO-node/lib/socket.io/transports/xhr-polling.js:24:10)
    at Listener._onConnection (/Users/jeena/game/js/lib/Socket.IO-node/lib/socket.io/listener.js:223:66)
    at Listener.check (/Users/jeena/game/js/lib/Socket.IO-node/lib/socket.io/listener.js:142:12)
    at Server.<anonymous> (/Users/jeena/game/js/lib/Socket.IO-node/lib/socket.io/listener.js:68:14)
    at Server.emit (events:27:15)
    at HTTPParser.onIncoming (http:83Lala:game jeena$ sudo node js/DemoHelloWorld/server.js

Client Side Prediction

Hello Mario,
there is some form of client-side prediction in the framework?

I thought about putting some kind of prediction based on user input in "constructEntityDescription" of "KeboardInputTrait" (transformed for my needs "KeboardMouseInputTrait") just simply processing user input and waiting for the next "SERVER_FULL_UPDATE" overwrites the "world state".

constructEntityDescription: function (gameTick, wantsFullUpdate)
{
this.processInputNow ()
return {
EntityID: this.entityid,
Input: this.input.constructInputBitmask (),
inputLook: this.input.constructInputLook ()
}
},

processInputNow: function ()
{
this.attachedEntity.updatePosition ()
this.attachedEntity.updateLook ()
this.attachedEntity.updateFire ()
}

Do you think that is a correct method?
There are better ways?
You're the only person who can help me, thank you anyway!

Demo using JSNES

What about a demo using JSNES?

If it sounds like a good idea, I'm up for doing some/all of the work.

FYI: I've cross-posted a similar issue just to get some more feedback.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.