DuckfaceNinja's Forum Posts

  • Just disabled

    Lol, it works same... learnt something, can that be right?????

    I was using it as a safety check...

    Ah if it works the same, the "On client update" is not needed at all, that should invalidate my statement [quote:1k1fm7i6]"You still need at least one "OnClientUpdate" to communicate your input"

    I guess the "On Client Update" is still a mystery to me.

    So "Is ready for input" is the better way then... I was just using it to avoid an input prediction error, but it looks like they both work

    I don't remember how I used "is ready for input" before, it might not be necessary at all for that event. I still think the sync is already started on start layout. Can you check what'll happen if both onclientupdate and isreadyforinput is removed?

  • Multiplayer is ready for input

    > On client update

    I'm curious what will happen if you remove on client update, and just leave the ready for input.

    I don't quite remember, but I think "is ready for input" is used by host, undoubtedly I need to revisit this one.

  • kmsravindra I think you still need at least one "OnClientUpdate" to communicate your input.

    The thing I'm unsure of if it is used outside the "OnClientUpdate" whether will it still update the host if "OnClientUpdate" events is placed after "SetClientInput".

  • for this help....In the Pong example, multiplayer.peerstate("peerid","y") is used in the host group to position the paddle

    That is because it is necessary to track the mouse cursor position in pong, so the question is, do you need to track the mouse position? If not, then use send message, there's no reason to increase the networking load by sync.

    I am trying to understand basics of multiplayer so that I can create something

    If you have a good understanding of the event system, almost everything in MP is some sort of very similar in flow, you just got to find the "relation/equivalent".

  • I went through all the tutorials in detail on multiplayer and have few questions. Will be great if someone could please answer them -

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

    A. It think this is wrong, it should be Multiplayer.PeerState (AssociatedObject.peerid, "<variable>") sequence

    B. Refer to my reply in your previous thread.

    C. Refer to my reply in your previous thread.

    2. I have no comment on this, but I think if you use outside of the on client update, it's either having no effect on host or it works like a trigger. I haven't test this out, probably do this on weekend.

    3. This has something to do with the 8bit=1byte excerpt. I don't remember where I read it from.

    4. MyId is always the client user Id, while peerID will be the peer that involved in the triggered event.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a sync - position on sprite...But I was thinking set client input state "x" and "y" to mouse.x / mouse.y on double click and using create sprite at Multiplayer.peerstate("peerid","x") and Multiplayer.peerstate("peerid", "y") should do the trick...I didnt try sending the mouse.x, mouse.y in the message directly...Do you know what is wrong with my approach?

    There's nothing wrong with your approach, but it's rather complicate things, I would say it's a not-so-good practice rather than being wrong for something that simple. It's unclear with your Multiplayer.peerstate("peerid","x"), it seems it doesn't associated with any object. Check this first.

    Why?

    Send message will provide pin point accuracy at the double click event on peer.

    If you use sync, the position might be a bit shifted (might even be outside of the screen) depends on the current mouse.x mouse.y on host.

    The difference between sync and send message in terms of usage is as follow:

    Sync is the equivalent of every tick occurence. (actually not equivalent, but same principle)

    Send message is the equivalent of trigger.

    Double-click is a trigger, so it is more intuitive to use send message. If you worry the mouse.x and mouse.y is hackable by peer, you can always restrict the condition in host.

    What game genre are you working anyway?

  • It dont want to work for some reasons

    I guess you still don't grasp the flow of object creation. If you already can spawn peer's character without broadcast, there's no reason at all why you need to broadcast. I think you have to revisit the official example, either the shooter or pong, both shows how to do it. Or, study the flow of peer character creation on your project, it's obvious that you don't understand the flow because creating peer character and creating item on host is absolutely the same process.

    I can't point out anything specific because I don't have C2 right now.

  • This sprite needs to be broadcast to all other peers...I am trying to do this for a while now and have not been able to get across.

    The only reason sprite is not created on all peer is you didn't sync it with position. It might be created on the default (-1000,-1000).

  • [quote:3g2s1ofr]Start

    [quote:3g2s1ofr]Condition: Onstart layout

    action: Sync Sprite (position only)

    Connect etc etc

    [quote:3g2s1ofr]Host

    [quote:3g2s1ofr]condition: On doubleclick

    action: Create sprite at (mouse.x,mouse.y)

    [quote:3g2s1ofr]condition: On message "sprite"

    action: create sprite at (int(tokenat(multiplayer.message,0,"_")),int(tokenat(multiplayer.message,1,"_"))

    [quote:3g2s1ofr]Peer

    [quote:3g2s1ofr]condition: on doubleclick

    action: send message tag: "sprite" message: mouse.x&"_"&mouse.y

    I don't have C2 in front of me now, I might miss something, theoretically this should work.

  • It's worth much more compared to its competitor, and it's for a lifetime.

  • i dont think anyone read my first post

    I don't think you described it concisely.

    When you're asking something, don't be too lazy to describe it, it's not like we know some voodoo to actually understand what you're asking.

  • What I see from digisnake is you need to know how to use array and tilemap (or tilebackground will work too). However, to manipulate the array that way would be a bit of undertaking there since you're a novice. Even though it seems like a very simple game, this is actually falls into intermediate level, which I recommend to learn something more basic first.

  • The traditional snake game can be done through spawn tail - destroy oldest instance. However the sprite will not move just like this example.

    If you want the tail somehow stays and follow the head, you need to record the head's waypoint, so that the individual body piece will follow that path.

  • For me, the fastest way to learn is understand official example with manual on your side, then try to to recreate the example. By the time you covered the beginners and intermediate example, you should have a good grasp at C2, you should be able create a flappy bird without a sweat at this point with just under a few minutes. Good luck!

  • I've tested. It's not working without broadcasting something too =(

    That tells me that your event is not complete on the host side or you got the wrong condition, my old tests proves there's no broadcast required, and I believe this is still valid. I haven't test with LoS before, possibly your character LoS did not overlap with your item in host, this mean you have to sync the LoS angle too.