Comments (2)
Hi morfeus87,
Thank you - and please be sure to make an official fork and put any changes you've made updating the code back into the stream.
I will look at your question in a little more detail later, but yes that should be possible in the framework in fact if you look at the DemoBox2D you can see how I approach this.
The gist of it is that, the framework will automatically call 'createEntityFromDesc' (which you should overwrite for your specific game) on the client side, when it comes across an entity it didn't have in the last frame. On the server side whatever information included it will be passed.
So what I would do - create for your game a GameEntity subclass that is 'smart' about it's first call to 'constructEntityDescription' with a firstUpdate flag or something that only publishes those extra details once.....
From a performance point of view, don't do anything 'too javascripty' such as removing and deleting and recreating the prototype chain after the first update, as this will most likely remove the function as a candidate for optimization by V8...
This talk explains what i mean http://www.youtube.com/watch?v=XAqIpGU8ZZk - lots of good info in there for creating a js multiplayer engine running on v8
from realtimemultiplayernodejs.
I have already created a subclass "PlayerEntity" extending "GameEntity" that has inside a method "constructEntityDescription" as your commented example in "GameEntity".
But the method "constructEntityDescription" is not only called on the server?
Calling this method the first time I set the flag "firstUpdate" to false on this entity, but then the next client will not receive the full version of the entity description. I'm wrong?
I do not understand :(
ps: I had already watched the video on youtube and found it really interesting, along with almost all other Google Video Team and GDC12 video.
Unfortunately, there is already Ammo.js doing 'too much javascript'
ps2: my changes seem fairly home-made even if they are working. However if you want I can make a official fork.
Thank you for your attention!
from realtimemultiplayernodejs.
Related Issues (15)
- Demo fails to produce any output (Mac 10.7) HOT 9
- running RealtimeMultiplayerNodeJs on web server - canvas empty
- Choose a licence HOT 1
- Black screen HOT 1
- webRTC support / UDP HOT 2
- undefined is not a function
- Trouble running server HOT 3
- Serving static files / obeying the Same Origin policy for websockets HOT 3
- Getting server errors after vanilla node.js install HOT 8
- CirclePackingJS outdated
- Client Side Prediction
- How to run the demo? HOT 6
- How to Handle Keyboard Events HOT 1
- Demo using JSNES
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realtimemultiplayernodejs.