Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Motion synchronization in multiplayer game

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.

like image 381
Scarface Avatar asked Mar 24 '26 08:03

Scarface


1 Answers

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

like image 158
Philipp Kyeck Avatar answered Mar 26 '26 00:03

Philipp Kyeck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!