kmsravindra's Forum Posts

  • Thanks ASHLEY. I have also noticed that in Pong example -> Peer group - on-created paddle event - set Paddle.peerid to multiplayer.peerid works only for one single instance of Paddle. In any game, lets say if I want to create multiple paddles (by sending create message from peer to host , using sync object) then the remaining instances of paddle on peer side doesn't get set to multiplayer.peerid...they are getting set to blank. The Pong example says that sync object should automatically get the multiplayer.peerid on peer side when a paddle gets created...This seems to work only for the first instance of paddle on peer side and doesnt work for remaining instances...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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 help or have you encountered such a situation?

  • I am planning to develop a tool using MP ( which is not in gaming context ) and sorry that I cannot disclose more than this...

  • 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?

  • 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....

  • rexrainbow, do you plan on doing this in near future by any chance?

  • 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?

  • Does anyone know how do I make drag-drop behavior on sprite work in multiplayer...Having this behavior on sprite doesnt have any influence as a Peer...Only on host it moves...Is it that I can move on peer side only using client input state variables / sync approach..? Behaviors on objects are not sync'ed?

    Edit - I guess this is the answer from manual - It is important to disable any behaviors and deactivate any events on the peers that may attempt to move the objects themselves; this will conflict with what Sync object is trying to do, and will not have any effect on the host.

    So does this mean any behavior that alters the positions doesnt work on peer? Because Pong example uses Solid behavior and it works both on peer and host...could someone clarify?

  • Thank you very much ASHLEY. This clarifies lot of things

  • Ashley, could you please give some reference help link on the below - I have gone through the tutorials but was not able to make out which one should be exactly used in what case...

    1. Which method out of the below is preferred to propagate data from peer to host in multiplayer and in what conditions each of them is used ?

    A. Set Client input state "<variable>" to something and then use Multiplayer.PeerState (Associatedobject.peerid", "<variable>") sequence

    B. Send message with peer data within the message

    C. Use Sync variable

  • DUTOIT, you are right...sorry for the confusion...Here is the revised capx with changes

  • Thanks to DuckfaceNinja and DUTOIT, I finally managed to get this done with some trial and error but still not satisfied with the complete solution...You can get the capx in the below link as to how it is done and some hitches that I still need to research upon...

  • Great! I got this working....To distinguish the peerid from a non-creating peerid, I had a global variable "creatingPeerid" that I set it in host upon creation of the sprite...Then I check in the next condition if the peerid is not equal to myID and peerid is not equal to creatingpeerId --> Then set sprite.x to Multiplayer.PeerState(Paddle.peerid, "x1") and sprite.y to Multiplayer.PeerState(Paddle.peerid, "y1") where x1 and y1 are client input states set to touch.x and touch.y in peer group...

    Attached is the capx for someone wanting how it is done...it has some redundancies and the comments are not in place as I am trying to modify the pong example template directly....[attachment=0:3vhpvi5u][/attachment:3vhpvi5u]

    One hitch is that I see some lag when I move the sprite on the peer side...it doesnt move instantaneously along with touch...Not sure how to get rid of that...Need to do more research...any thoughts please send them...

    Some of my questions in the start of the thread remain as to when to use which method in propagating the information from peer to host ( DuckfaceNinja / thanks here for your answers, but I think I need to gain some more clarity)...

  • Ok, so does it work when even the "is ready for input" is also removed and some other event like "on touched object coin" is used instead? My question is - "is ready for input" OR "on client update" one of these is necessary to communicate?

    on another note, I am trying to work on this scenario --> As a peer/host , lets say I want to create a coin whenever I double click...And each coin could be moved around only by the peer who creates it....if you have some ideas then let me know