Tournaments

Options
kujo
kujo
Hi,

I'm a newbie to Photon, so this might be a really obvious answer, but I've had a Google around and not found much relevance.

I'm making a darts game and would like to introduce real time tournaments, this could be 4, 8 or maybe even 16 man tournaments. I'd like the user to choose the type of tournament they want to play, such as a 501 tournament or Cricket tournament, and then be automatically matched with others looking for the same type. Before a match actually starts, I'd like to be able to show a sort of tournament tree structure to show who's playing who, and then be taken into their match. Each match would only have 2 players until there is a winner, then that player moves onto the next round.

I'm wondering what the best way of doing something like this is in Photon? Would I create a room that has 4 players and then take them into the game? Or would each tournament of players would be a lobby and then the two players join a room of their own?

Thanks for any advice :)

EDIT: something I missed - these tournaments are available at all times.. so for example there is 'The Local' tournament that players can enter. There could be hundreds of instances of this tournament running at any one time, but me as a player are involved in just the one.

Comments

  • Tobias
    Options
    Sorry for the late reply!
    I read this post and had to think about it and now I think you can actually get away with just plain old matchmaking and a room per turnament.
    Per match type, you can set a room property and use the possible values as filter for JoinRandomRoom. Players already in a fitting room will see new players join and get the players list updated. This is the basis for the tree structure.

    Players could start a game/tournament early if they like. Just close the room to avoid others joining late (set: Room.open = false and Room.visible = false).

    I don't think that the interactions will overload the clients as you don't have constantly changing positions to update. Use RPCs per shot.
    You can use Groups to divide the room into separate 1:1 match. If you have 16 players max, you need groups 1..8 and anything that's sent into one group is only sent to the other player who's also in that Interest Group. It's a PhotonView setting you should be able to use without much problems.
  • kujo
    Options
    Hi,

    Thanks for that. The groups thing sounds particularly interesting. Does this mean that the photon views need to be created in my tournament tree screen, rather than in game? If so, how can these be passed between scenes so it still works. The way I'm currently working on it with a 2 player game is that you join a lobby and a random room. This is what would be my tournament tree screen, with each player listed. I'm just collecting the PhotonPlayer list from the network and when I have enough players (2 in this case) I start the actual game scene then, which creates the PhotonViews. Is this the right way to do it?

    Thanks
  • kujo
    Options
    Hi Tobias,

    I've been continuing working on the tournament model, and trying what you've said about setting different groups. So I have a room configured that has a max of 4 players. The game waits until the room is full, then starts the game.

    Once the level has loaded, this is when I use PhotonNetwork.Instantiate to create my players in the scene, and set their groups accordingly. So player 1 and player 2 get assigned group 0, player 3 and 4 get group 1. But only two of the PhotonViews get created. So if I look at client 4, it just shows player 1 and 2 in there, Player 3 or 4 haven't been created.

    I tried a test and set all the PhotonNetwork.Instantiate methods to use Group 1 and none of them get created. Set them all to 0 and all of them get created on everyone's screen.

    Am I doing something wrong here?
  • Tobias
    Options
    Group 0 is always "everyone". Use 1 and up.
    Per player/client, you can define which groups you receive. This is not done implicitly when you instantiate something in such a group! You can have PhotonViews in groups you don't receive.
    You have to manually set which groups you listen to via PhotonNetwork.SetReceivingEnabled(int group, bool enabled).
    As said: Group 0 is always listened to.
    The PhotonView's group defines which group it sends to and you can send to groups you don't listen to.