Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › How could I find a match by VPlayMultiplayer?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #14455

    NgapWei

    Testing the examples like Onu and MultiplayerDemoSimple, but none of them can find the player on internet.

    To make things easier to deal with, I prefer MultiplayerDemoSimpleto do description.

     

    My steps are :

     

     

    1 : copy the folder of MultiplayerDemoSimple, change the name to MultiplayerDemoSimple_00 and MultiplayerDemoSimple_01

    2 : Compile MultiplayerDemoSimple_00 and MultiplayerDemoSimple_01

    3 : execute MultiplayerDemoSimple_00 and MultiplayerDemoSimple_01

    4 : MultiplayerDemoSimple_00 press the start game button

    5 : MultiplayerDemoSimple_00 press the create game button

    6 : MultiplayerDemoSimple_01 press the start game button

    7 : MultiplayerDemoSimple_01 press the join game button

     

    The results are both of them become the “host” of the new game.

    After I retry the join game button several times(2~5, unsure), I can connect to MultiplayerDemoSimple_00 at last.

    If I cancel the join request because the host accept the game, I cannot rejoin the game again, no matter how many

    times I press on the join game button.Is this an expected feature?

     

    What if I try to find the user manually?

    The device ID + user name(not the true number, but follow the format)

    MultiplayerDemoSimple_00 == 1234_0 player 1123

    MultiplayerDemoSimple_01 == 1234_1 player 1456

     

    At step 7, I try to find the user “player 1123” this time, but it cannot find anything

    The messages are

     

     

    qml: Matched friends

    qml: startPaginatedRequest: {“action”:”search_user”,”query”:”Player 6961554″}

    qml: getPageInformation for request {“action”:”search_user”,”query”:”Player 6961554″}

    qml: pageInfo: {“page”:1,”perPage”:30}

    qml: –> Requesting: search_user [#6]

    qml: ! Warning: Request queued as currently sending another request

     

    Thanks

     

    #14457

    NgapWei

    Forgot some data, I test on windows 10 64 bits, version of v-play is 2.9, compiler is mingw32 5.3, Qt5.7.

     

    ps : How could I edit my old post?

    #14458

    Günther
    Felgo Team

    Hi NgapWei!

    Your steps to build/run the demo are correct. Although it’s not required to copy the project two times. You can also just run the same project a second time. The demo already includes some code to use different users for the two game windows on desktop.

    Matchmaking:
    The reason why both of the users become hosts initially lies with the Photon multiplayer service we use in the background. It takes a short time until the game room that is created by the first player is completely set up and propagated through the Photon service so other users can see it and join in. If you wait some time for the second user, he will join the room at the first try. As soon as there are more players and many open rooms in your game, this won’t be an issue and the matchmaking system starts working really well.

    Game Invites:
    The user search and invitation should work the way you tried. Unfortunately, the “search_user” request is still a bit troublesome for our server and database, we are working on improving the search performance to reduce issues with server timeouts for search_requests that take too long. You can try searching only for the number “1123” instead of “Player 1123” as this search has a higher chance of not timing out on our server.

    Join Games:
    By default, new players cannot join a game if the game has already started, so joining is only possible during matchmaking. You can activate late joining with the VPlayMultiplayer::enableLateJoin setting. This makes the game a bit more complex as players joining or leaving during a game must then be handled appropriately in your game code.

    Additional Note:
    During testing I noticed, that the demo does not handle leaving the game correctly. The “Leave Game” button only sets the game scene invisible, but the player is still in the game.

    To actually leave the game, add the leaveGame() call to the button:

        SimpleButton {
          text: "Leave Game"
          anchors.right: parent.right
          onClicked: {
            multiplayer.leaveGame()
            game.visible = false
          }
        }

     

    I hope this clears up the confusion. 😉
    Best,
    Günther

    PS: There’s a time limit of 3 hours for editing posts in the forum, so you can only edit your post within this time after posting.

    #14466

    NgapWei

    Thanks for the reply.

     

    By default, new players cannot join a game if the game has already started

    My case is I can join the game at first, but after I cancel the join request, I can not rejoin the game even the

    host haven’t start the game yet.

     

    You can also just run the same project a second time.

    I tried it, but QtCreator always close the old exe when I open a new one

     

    the “search_user” request is still a bit troublesome for our server and database

    Got it, hope this problem can be solved in next release

     

    #14470

    Günther
    Felgo Team

    My case is I can join the game at first, but after I cancel the join request, I can not rejoin the game even the

    host haven’t start the game yet.

    I understand, the issue is quite similar to the initial joining. It can take a little time for the Photon service to propagate the free slot on their servers after the user leaves. I was able to join again after a short time during my tests.

    I tried it, but QtCreator always close the old exe when I open a new one

    Ah, I’m sorry, that’s actually an issue on windows. You can choose Build -> Run without Deployment in Qt Creator instead of the default “run” option. The first window should not be closed then.

     

    Got it, hope this problem can be solved in next release

     

    As this is a server-related issue, the fix is independent of our Felgo Engine updates, so you might experience better performance in the future without even updating Felgo. 😉

    Best,
    Günther

Viewing 5 posts - 1 through 5 (of 5 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded