Multiplayer server and syncing objects

Get help using Construct 2

Post » Wed Dec 03, 2014 12:47 am

Hello! I have played around with the multiplayer plugin and I like it a lot, I am interested in making a server which serves as the host in a seperate project and a client which players can connect to the server with but I am fairly new to this.

I have read the multiplayer tutorials and know how to create a game which sync the host game with the peers and I can connect from a client to the server with two separate projects but my problem is I don't want the host to parcipate in the game at all (only log it so no sprites) so I guess I can't use the sync object function, what would be the best way to store and send the position and other instance variables of the player sprites from the client to the host and then back to all the peers so they can see the change but not the host? Should I use an array which stores all the players data or something else?
B
18
S
4
Posts: 22
Reputation: 994

Post » Wed Dec 03, 2014 6:18 am

It probably would actually be easier to have sprites on the host then just make the layers invisible so you dont have to bother with drawing them, yet still keep the advantages of having objects that exist.
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Wed Dec 03, 2014 12:14 pm

Ah I see, thank you for the answer. I was thinking that would just be more heavy on the server to have objects when you have 100+ players online.
B
18
S
4
Posts: 22
Reputation: 994

Post » Fri Dec 12, 2014 1:37 am

Another question about this (sorry for the double post), is it possible for peers to only sync objects with certain instance values? For example, I want to make rooms but I still want the host to be able to connect to all peers in every room (so you can kick them, send messages, get the room count and so on) and this is not possible (I think?) if I have to keep a tab open to host every room. If this is not possible could it be in a future release?
B
18
S
4
Posts: 22
Reputation: 994


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests