Does the sequence of chat message the same for all peers?

0 favourites
  • 7 posts
From the Asset Store
Chat with smart animals using the OpenAi Chat GPT 3 API
  • Hi, I am reading the official Multiplayer chat example capx.

    Assume there are two players (peers) send their message at the same time.

    1. The message first show at local text area, then send it to host.

    2. host will broadcast received message to all peers

    3. Peers will show the received message to local text area.

    For example player1 send "P1 say hi", player2 send "P2 say hi". After these 3 steps,

    The text area of player1 will be

    [quote:1cqlqj4y]P1 say hi

    P2 say hi

    But the the text area of player2 will be

    [quote:1cqlqj4y]P2 say hi

    P1 say hi

    Other peers might be the same as player1, or player2 .

    The sequence of chat message is different between player1 an player2 .

    Is it right or do I miss something?

  • With reliable ordered, you're going to have it so that:

    P1: Sends message at 11:25:32.500 (first)

    P2: Sends Message at 11:25:32.550 (second)

    P1: MESSAGE

    P2: MESSAGE

    P2: MESSAGE

    P1: MESSAGE

    However, since it's reliable ordered, Peer 3 will see what Peer 1 sees(Assuming it reaches the host at the same order and time difference). IRC works the same way and there's no way to prevent what Peer 2 sees, but he's the only one to see it. If there is enough time between, Peer 2 would receive the message before sending his and wouldn't have a difference

    I am curious though if Reliable Ordered applies to the tag or the message system as a whole.

  • Thndr

    Thanks, I just want to confirm that the sequence will be all the same or not.

  • I would assume it's the same for all peers except the one in that case if you use Reliable Ordered

    Multiplayer Tutorial pg.10

    Ashley describes it as holding other messages back until it can complete the communication on that one message and says it's perfect for chat. If there are intricacies with it that we need to know -like how the ordered method of 1 message affects another message with a different ordering, if it's a different tag or same tag- hopefully he can enlighten us.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thndr

    There are some prediction methods used in ghost shooter example which is a real-time game. How about predicting the chat message. (Just kidding~)

  • It's possible messages could appear in a different order for different peers, but only because you add your own chat message locally instantly. If you send a message while another peer's message is in-transit to you, then you will both have added your own message instantly and then receive the other peer's message after a delay, so both peers see themselves going first. If the host sent back your own chat message to you, firstly there'd be a delay before your own messages appear, and secondly there's still a race as to who's message will reach the host first, so someone on a faster connection could still beat you. However everyone would see the same message sequence. I don't think any real chat clients do that though. If you send a message while another message is in-transit to you, it's impossible that your message could be a response to that, so the ordering is not important.

    Basically network stuff happens in-order using "reliable ordered" mode, but the chat example does not use the network for adding your own messages, so exceptions can occur.

  • The chat message and ghost shooter might be similar, they response the input immediately.

    The different is -

    Peer of ghost shooter will do correction (reset position) when received sync-data (synced object).

    Peer of chat does not do any correction. So if the correction added , the sequence of message of all peers will all be the same as host.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)