Forum

Multiplayer Backend

06 November 2016 17:54 #13456
Wow!
Great job!
I will get your changes commited to the Github repo.
If I run two browser tabs, the latency is not bad at all. I am in North Idaho USA, I guess your server is in Moscow. 1/2 second maybe. That is very encouraging

Hmmm, wonder who I am playing chess with ??
~Will
Blend4Web Videos
https://www.youtube.com/channel/UCp6x8JP7oCiiTjbJorPPMsQ/videos
16 November 2016 16:09 #13880
Just an update:
So thanks to the help Kirill I have a working version on Github:
https://github.com/WillWelker/node_chess
This version is structured to be hosted and served from a node.js server.

Next plans are to streamline the communications so the client only sends information when a piece is moving and does not receive information that it sent originally. i.e. socket.broadcast.emit("…")
Once the mechanics work well, I want to add chat function, user names and basically polish it up to be a good multi-user Blend4Web example.
~Will
Blend4Web Videos
https://www.youtube.com/channel/UCp6x8JP7oCiiTjbJorPPMsQ/videos
16 November 2016 19:02 #13887
hi, good job.
I can help if you need for code, or traduction (French)

I play chess too - average 1900 elo
16 November 2016 19:20 #13889
Ya definitely.
I am new to Git so let me know if I can change anything to make it easier to collaborate.
Also I am unsure on how to structure the project within the Blend4Web SDK. Since I do testing on a local Node.js server I do not use the normal SDK server that starts when you open Blender. Right now I am using the "Bundled Project" option. On the server, the app.js and node_modules need to be in the root directory of the project and everything else goes in the public directory.
If you use Github and want to be a collaborator, let me know your username. I would be happy to have all the help I can get

I should also mention that my long term plan for this is not actually for games but for warehouse and stock-yard inventory management. So basically you have a 3D environment that shows you where all of your inventory is located and it gets updated either manually by people or automatically by various devices that read RFID or maybe an operator just hits a button on a mobile device when he drops of a load and the mobile device records its position. There are many other possibilities with IoT.
~Will
Blend4Web Videos
https://www.youtube.com/channel/UCp6x8JP7oCiiTjbJorPPMsQ/videos
17 November 2016 01:42 #13902
my git account : marshallus
18 November 2016 13:43 #13930
quite busy, but will work on it this week end
18 November 2016 15:22 #13939
No hurry. I am always busy and this project simmers along on my back burner.
Currently the positions of all the pieces are sent to the server which mirrors them back to the clients. I want to send only the position of the selected piece and store all the positions in an object on the server side. That way both clients can log out and back in without loosing the positions. Also there is an object that contains all the reset positions so we can implement a reset button. I look forward to any ideas you have.

Feel free to email me. wwelker@gmail.com.
~Will
Blend4Web Videos
https://www.youtube.com/channel/UCp6x8JP7oCiiTjbJorPPMsQ/videos
23 November 2016 01:51 #14081
A nice little update for the Chess App,
Chat and a reset button were added in by Martial. I have a live demo running at bambinobot.com
Github link: https://github.com/WillWelker/node_chess
FYI this is an Ubuntu server running in Arizona USA in case you are curious about latency over distance.
I have found this to work with two Chrome browser windows open and also from Chrome on Android.

Current issues:
ASDW keys move camera view when typing in chat.
If a new browser logs in and moves a piece it will overwrite the positions of the currently connected clients. If they move first, the newly connected client will get all his pieces moved to correct positions.

It is a little buggy if two people are trying to move a pieces at the same time.

Over all, I am very impressed with how functional this is. Thanks much to those who are helping with it.
~Will
Blend4Web Videos
https://www.youtube.com/channel/UCp6x8JP7oCiiTjbJorPPMsQ/videos
 
Please register or log in to leave a reply.