Search Unity

Question PvP mechanism

Discussion in 'Lobby' started by sava-game, Mar 17, 2023.

  1. sava-game

    sava-game

    Joined:
    Feb 14, 2023
    Posts:
    21
    Hi there I am trying to implement 1vs1 using UGS
    • Users select the desired battle arena.
    • Wait for the online opponent to enter.
    -When an online opponent comes in, a 1vs1 begins. the logic I am saying is similar to this game. https://play.google.com/store/apps/details?id=com.uken.pool&hl=en_US&gl=US -Player 1 selects the desired battle arena. -Transition to the matchmaking scene.
    • Player1 first searches for the lobby he wants.
    (The lobby filter is determined by the selected battle arena.)
    • If there is no desired lobby, create and join the lobby.
    • And wait for another player (player2) to come in.
    • Player2 also selects the battle arena he wants, just like player1.
    • transition to matchmaking scene
    • Player2 searches for the lobby he wants.
    • If the lobby created by player1 is correct (i.e. if you select the same battle arena as player1), join that lobby.
    • The game starts.
    -If there is no desired lobby, just like player1, create and join the lobby and wait for the opponent player. The important thing here is that if any player leaves during the 1vs1, the game does not end, but the AI works and allows the opposing player to continue the game. The problem is that if the hosting player leaves, the game ends and the scene changes. I want the other player to continue playing with the AI player even if one of the two players exits. I hope to see a hero here.
     
  2. veleek_unity

    veleek_unity

    Ben Randall Unity Technologies

    Joined:
    Aug 25, 2021
    Posts:
    59
    The Lobby SDK will not automatically make any scene changes or other in-game updates based on someone joining or leaving the lobby.

    Do you have logic in your game that causes the game to end (and the scene change) if the person who created the lobby leaves? You may need to make an update so that it doesn't do that which should enable the other person in the lobby to continue playing against an AI.
     
  3. sava-game

    sava-game

    Joined:
    Feb 14, 2023
    Posts:
    21
    Thank you for your valuable time to reply.
    Please check this video.
    https://drive.google.com/file/d/1slvYkTfDnkiAld79jbN4uqI1bHanh6aA/view?usp=share_link
    When the client leaves the game scene, object which reflects host is still remaining.(Ofc, object which reflects client is disappeared),
    But if the host leaves the game scene, all objects are disappeared as you can see.
    So how can I make the other player continue to play the game against AI if the host player leaves the scene?
    If I was wrong, please teach me.
    Thank you in advance.