Some multiplayer questions - could someone please educate?

Discussion and feedback on Construct 2

Post » Wed Oct 15, 2014 8:57 am

kmsravindra wrote:Thanks @Ashley. That technique worked! Now I am trying to add a textbox to each sprite and move it along with the sprite in multiplayer mode...The way I went about it was by adding a container textbox object and tested it..However the textbox doesnt move along with the sprite...Looks like sync doesn't sync container objects? Do I need to repeat the same code that I did for sprite to move the textbox as well?

Edit - I think I got the answer in the forums from Ashley's response to one of the bug - "Closing as not a bug. You only sync one of the objects, so the other object in the container will be created, but not synced".

But I couldnt understand why sync - position cannot happen on container objects...wont that be a good/required feature?



I would imagine you just have to sync every object in the container (and since not every object in a container share the same X and Y coordinates, as some may be just static, syncying them by default would be unessecary)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Wed Oct 15, 2014 9:11 am

Aphrodite wrote:I would imagine you just have to sync every object in the container (and since not every object in a container share the same X and Y coordinates, as some may be just static, syncying them by default would be unessecary)

Actually only one object is required to be sync in the container, for other object in the container, they would have to be positioned and pinned on peer side upon creation, since they are spawned at default (-1000,-1000). Syncing all objects would kill the bandwidth though, it's unnecessary when they already have the coordinate reference from the synced object. This would apply to animation too.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Wed Oct 15, 2014 1:11 pm

Sync does not sync anything other than what you explicitly tell it to, in order to save bandwidth. Nothing is automatically included, not even containers. If an object is always positioned on top of another, then syncing it as well is just a waste of bandwidth - you can just position it on top of the other object on the peer without needing any extra data to be sent.
Scirra Founder
B
397
S
236
G
88
Posts: 24,408
Reputation: 194,506

Post » Sat Oct 18, 2014 6:34 am

I am exploring Multiplayer features and hence several questions...As I find answers, I am very excited about the potential it has...Please bear with me...

My question is - Is there any limit on the size of multiplayer.message? I converted sprite image to base64 image string and sent it as a message...Good news is that it works for images upto the size of upto 300px by 300px (around 13kb size) or so...However when I try to send something like 60kb size (600px by 600px) a strange thing happens - Multiplayer kicks the peer out! OR the message is not received at the peer side forever...Could you please tell me how this can be circumvented OR what is the limitation on messaging size/feature? BTW, I am sending the message from host only after "On image URL loaded" condition...I know that this is async on host...but isnt supposed to send the message to peer anyway whenver that happens on host? And why it is that sometimes the peer gets kicked out?
Thanks....
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Sat Oct 18, 2014 6:46 am

kmsravindra wrote:I am exploring Multiplayer features and hence several questions...As I find answers, I am very excited about the potential it has...Please bear with me...

My question is - Is there any limit on the size of multiplayer.message? I converted sprite image to base64 image string and sent it as a message...Good news is that it works for images upto the size of upto 300px by 300px (around 13kb size) or so...However when I try to send something like 60kb size (600px by 600px) a strange thing happens - Multiplayer kicks the peer out! OR the message is not received at the peer side forever...Could you please tell me how this can be circumvented OR what is the limitation on messaging size/feature? BTW, I am sending the message from host only after "On image URL loaded" condition...I know that this is async on host...but isnt supposed to send the message to peer anyway whenver that happens on host? And why it is that sometimes the peer gets kicked out?
Thanks....

That would depends on the limit of packet size, I'm not sure what is the packet size limit for webrtc, but I'm assuming 64kb. I don't think sending pictures in MP is a good idea and is not what it was built for. I would understand if this involve custom player avatar transfer, but the avatar shouldn't be that big. Furthermore, this is very bad bandwidth management, I suggest look for other method of loading image.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Sat Oct 18, 2014 7:07 am

@DuckfaceNinja - Thanks for your perspective. However I think there could be a limit on messaging size but I dont think its a bad bandwidth management especially when the world is already talking about video streaming using webrtc...If the limit is on message size, then I could probably think of split/concatenate approach for larger messages...This approach brings up another interesting question - It would be nice to have a event - Multiplayer - On message sent "tag" ? Even if we keep my current problem aside, this event could be helpful for sending serialized messages one after another as well?
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Sat Oct 18, 2014 7:59 am

In a game context, I think the largest message I ever transferred are json array. How do you intend to use MP anyway?
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Sat Oct 18, 2014 8:08 am

I am planning to develop a tool using MP ( which is not in gaming context ) and sorry that I cannot disclose more than this...
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Tue Oct 21, 2014 6:56 am

I have to spawn a new sprite on peer or host whenever the user double clicks on a screen...While I was able to get this working, I am not able to update the sprite.peerid with the peerID's of the user who creates them...I am using "Sprite - oncreated" event on peer and then assigning it to multiplayer.peerID...(as per the example multiplayer.peerID is supposed to contain the peerID whenever sync object creates a sprite on the host)...Strangely multiplayer.peerid gets set only for very first sprite that gets created on the peer / host...The sprites that get created from then on have blank values in their peerid instance variables..I am sending a message to host to create a sprite whenever peer double clicks on screen...

@DuckfaceNinja OR @DUTOIT....Any help or have you encountered such a situation?
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Tue Oct 21, 2014 7:33 am

Also I have noticed that if sync - variable happens to be a text, then it doesnt sync? It only syncs number type variables...
@Ashley, I have referred the tutorials and examples but couldnt find any answer to this. Could you please help?
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests