Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Motion synchronization in multiplayer game

Motion synchronization in multiplayer game

Problem

I am playing with a simple demo where I can walk around in first person in an environment. i used three.js to achieve this.

I want to be able to spawn another player when that player joins and be able to synchronize the Motion of both player so they can see eachother moving around the map. Spawning the player is not an issue, but synchronizing each of the player's movement so they can see eachother is.

I am primarily a web developer so I do not know where to start in doing this efficiently. Would I want to store the positions of each player in a database like mysql or can it be more efficiently stored in memory somehow using node.js? If anyone knows any good resources or has any comments or suggestions, I would greatly appreciate it.

Problem courtesy of: Scarface

Solution

you can use a combination of node.js and socket.io to let the different players communicate with each other in real time.

here's a somewhat similar question which can maybe help to point you in the right direction:
https://gamedev.stackexchange.com/questions/13207/multiplayer-html5-node-js-socket-io

Solution courtesy of: Philipp Kyeck

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Motion synchronization in multiplayer game

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×