-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"wantsFullUpdate" & full/half "EntityDescription" #4
Comments
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... |
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? 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. 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! |
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 hope I was clear and I apologize in advance for my English "google translated"
The text was updated successfully, but these errors were encountered: