DuckfaceNinja's Forum Posts

  • Hi. I am looking for experienced users of the multiplayer plugin and want to ask if it is possible to create a "seamless host transition" if the host left. So can the other players/peers join a new host and continue the game where it was without starting over again?

    I want to use players as Hosts instead of a Server run by me so people in the same game region or zone (multiplayer instance) will join another player in the same region (up to a limit like 6 or 8). So you can see other players, play together, make quests and so on but if the host leaves the other players should stay together or at least not disconnect and lose progress. Is it possible to use something like a global "pause" (timescale) for all players when the host left and then continue at the same positions with what they where doing? As far as I know about the multiplayer plugin this could be possible but every player has to send his position when the host left to the new host, same for all enemies and objects to get them synced again and stay at the same position? Is this possible?

    I tried that, it is possible but there are some quirks. The events are quite elaborate and convoluted, in the end I manage to do it except there are transition stutter which most probably caused by the recreation of objects and sync, more data means more funny reload visuals. I don't see any way to mitigate this because it's a technological limitation. The transition phase can take from ~0.1 seconds up to 3 seconds based on my experience. That is depends how much connected peers are there and how much object there are in the host, not to mention that the host has to wait for all peer to get in before resuming.

    For it to be seamless, I doubt that it is possible unless you have a custom made events just to handle visual during the transition. For me, loading screen is pretty much acceptable and easier solution.

    Note that there is a bug that will make this mechanism very unstable.

  • If the objects are sync, the host will destroy their instance automatically. Unless objects that you created is not sync, you would have to create events to destroy them manually in the host.

  • Additional verdict:

    I observed that when the host quit, only one of the trigger "on kick" or "left room" will trigger on peer side.

    I'm not sure whether "left room" was supposed to trigger at all if host force quit but theoretically it should happen, in which I think "on kicked" supposed to trigger first and then "left room" trigger will follow after that.

  • Problem Description

    Ashley On Kick triggers inconsistently, most of the time it wont trigger. I remember from 1 month or so ago that it works flawlessly, but i didn't notice since when did this start to happen.

    This is actually quite important since I'm using it to trigger actions to mitigate the situation in client, when host quit.

    Attach a Capx

    [attachment=0:wpmy9n5a][/attachment:wpmy9n5a]

    Description of Capx

    Capx is the official example of MP chat. Unedited.

    Steps to Reproduce Bug

    • Please refer to video below. Force close the Host tab/window to simulate host quit.

    Observed Result

    Please watch this.

    In the video, don't be confused that chrome managed to get the trigger most of the time, in my actual tests, Chrome basically perform the same like opera and firefox. So, don't conclude that chrome did better, actually it's not.

    Expected Result

    The trigger supposed to trigger regardlessly.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Opera: (YES)

    Operating System and Service Pack

    Both Win8.1_64 and Win7_64

    Construct 2 Version ID

    Tested r190, r189, r188, r187 all similar inconsistent result.

    The last time I remember it work flawlessly is around r175-r178, couldn't try them now because I'm quite occupied with work.

  • You can already filter rooms when requesting room lists to skip ones which are full or locked.

    Lol I totally forgot there was already the dropdown option for that.

  • Back to Multiplayer Object... for example small lag when new user join room. If you create smooth animation or movement, all objects lag when new user connect.

    I never experienced this, how many object are you using? I used a lot before, and found out host bandwidth is the limiting factor. That is why a lot of my answers in this forum emphasize on not using the sync object when it is unnecessary. I doubt it's a bug on plugin, most likely bandwidth problem.

    Śometimes I see ghost Host user (I use same name for all hosts) even if they are at different instance and room! Host join an empty room but this ghost user is already in (and is host too for different room and instance)!!!

    Have you reported this with capx? I never tried this, if it is genuinely a bug, then report it. Or give me link if you have reported this, I'll check it out.

    Peers not want to leave room or even log out from server (this happens all the time). I saw this problem at someone else here on forum. So If I want a Peer to logout, I must ose Browser.reload().

    Are you sure your event is properly executed? I never experience this problem as well, I can even automate the process of leaving/joining room without problem but I admit the events are not simple at all.

    Sometimes if you active EditBox or stuff like that (I think it have something with focus ability), Multiplayer Object stops receive (or send?) messages. Friends sometimes report this and it happens lots of times when they start type chars into chat...

    I never tried this as well, ditto to second point.

    BTW I not use Sync or other functions. Only use SendMessage. This work well but sometimes it looks slow even when ping is < 20ms. I saw lags over seconds at one browser window while second browser was allright!

    I totally expect this, because send message is a reliable-type feature, it is designed in a way that the data packets are arrive no matter what. Lags can accumulate if you sending to much message per tick, and even worse lag if it is reliably ordered. Use different mode of reliability to mitigate lag issue. What is your case of use anyway? If it is real-time non-informative data, just positional object data or dynamic data, you should be using sync object or sync variable.

  • Yeah, I agree, +1.

  • rexrainbow, wow that is cool! I never noticed this plugin before, it seems like a something that I should try, thanks for sharing!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • what if my host left ?! all peers must reconnect again ...this is not good and so many other things happening like transfer messages between all peers for 1 game with 4 players ! and if i have 20 games running then i have so many message transfer and this is so much wasting bandwidth.

    If you worried if the host left the game, you yourself should host the game! Why would you give that kind of authority to your player if you don't want them to be able to do that? You need to revisit your design obviously.

    now i just disconnect and reconnect again and make room with another game instance .. so new room is hidden from list.. (reconnect is a problem because host can change in reconnect and sometimes peers can not join properly)

    another way. i connect to each host and get state of game when i listing the rooms (so many connections to multiplayer server (scirra server) and possibility to get blocked (i can use delay for connect to each host but still so many connections))

    another way.

    This why I said you need a room manager, as in a centralized lobby host. This is actually the way to reduce connection to signal server! Have the lobby host to list "open" room to newly connected player, by storing the list of which room has started and has not in an array or whatever. You don't have to connect to each host to get game state this way, because the lobbyhost can filter this. That is the price to pay if you intend to get, I don't think hosting a lobbyhost would be costly, it's like your own customized signalling server.

    Ashley , some suggestion here:

    The only thing I think that is more useful to add for case like this is host action [action: unlist current room from signalling server], which is like tagging a roomname so that it won't appear if other new peer requested a roomlist, or something else that can provide the same end result.

    The reason why I think unlisting room is better that the ability to open/close room is, roomlisting is simply the higher level of management, because if open/close room is implemented anyway, the closed room will appear in the list anyway (I'm not sure whether this is still true, because I tested this a long time ago).

  • Oh I see, that's why you want to send picture's in and out, now that make sense. About the image size, the only method I can think of is to get the image converted into data URI, then if it is too big, send the URI in a few chunk of packet. I'm not sure whether is there a plugin to convert picture into data URI, but I think I've seen it somewhere.

  • Looks great! I wonder if is canvas plugin is usable with MP plugin. Would be cool if people can doodle on everyone's screen.

  • peers see the rooms and they choose a room and they connect to that room but after they clicking on the room they got kicked because players in the game...and they can't join in the room but room is not full and they can see that ... so this is not good .. because they must join in available rooms .. and if we have a very big room and all peers join into that... we can not do that .. that is obvious..(if lobby host got disconnect - peers disconnect and reconnect problem - they must return to that room after game end they must disconnect again! and who made the room must be host .. but we can not tell who is the host in game because we tell every body disconnect and reconnect again so maybe who is made the room not be host ! and after game that player is not host !!

    You just need to be creative to be able to figure that out. You need a room manager, which you can do yourself, I did it, I call it lobbyhost. Instead of open/close room, let the lobbyhost assign running number to rooms, this way is much easier to maintain a unique room number. In my case I use unix time stamp as the running number.

    Leaving and joining room is as normal as it is, if you look at any other MMORPG, such as WOW, TERA they did this as well, notice the loading screen? It's actually a fake screen to download current data of the room, not loading the game locally. Game load locally much faster than they download all current data, that's the truth.

    In case of you're design your game in a way that you let players to create room themselves, and set who can join with or without password, set the room peer limit, create unique room name, auto join room, this is extremely doable, in fact the the MP plugin was designed totally for this scenario, which we call peer-to-peer MP.

    construct 2 is here for making things easier... not harder !)

    It is already much easier for most people than you can imagine. Try the traditional way then, see how it goes. The complexity of MP goes exponentially to the complexity of your game, you need to realize that first!

    Don't blame the bow if you can't get a bulls eye.

  • There are simple tutorials (4) for Multiplayer Object. Multiplayer Object have some bugs but it work well for sign/login and sending messages. Try to avoid all other functions - only use SendMessage (and parse messages with tokenat).

    What bug are you talking about? I never encounter one so far since the last time I reported.

  • This topic discussed what are you looking for I think.

    The title is a bit off (actually it's the reply were off lol), so next time you might want to search post instead of thread.

  • It should be:

    1. On start layout sync object (position or None depends on cases), if object moves every tick, use position, if static, use none. Your case should be None.

    2. Peer send message object.X&"_"&object.Y

    3. Host create object at x=tokenat(MP.message,0,"_") y=tokenat(MP.message,1,"_")

    Should be just that. Your no 4 is unclear, you need to be more specific on what the global variable is for.