1. Game has 3 player slots everyone plays for himself
2. In order to start to play, you search for a game like matchmaking and if 2 other people are searching it will create a game between you 3
- My current setup is:
- DB Server - it's database that i am hosting myself that holds the main info of a user and of the game mechanics that I want to get from during the (3 player) multiplayer games.
- PlayFab - hold the user accounts (that's all for now but will add more stuff in the future)
- Unity - The game
I am new to Multiplayer and Playfab, from what I saw is that i have to put a (Unity Server) inside (Playfab multiplayer functionallity). When I do so I will have 1 more component so everything will be: DB Server, PlayFab, Unity Game, PlayFab/Unity Server
It's turn-based game so I imagine based on the above components It should work something like this:
- Unity Game (Player 1) -> PlayFab/Unity Server -> calls the DB Server API -> PlayFab/Unity Server retrieves and works with the DB Server API data -> (Player 2,3)
The idea is that I want to use this as dedicated server that gets info from the main DB Server and then returns to users. Not sure if it makes sense but everything should be connected to the main DB Server.
3. Another thing is that I want when a player leaves or disconnects to be replaced with a (BOT/AI) that will take his place until he returns. I think this code should be placed in the Playfab/Unity server to make most sense, but maybe I am wrong. And if that's the case how should I set it up, so when a user leaves AI takes his place and vice versa?
4. Another thing I don't understand is if this is dedicated server + matchmaking how do I separate all the data. Let's say we have 30 users so this should be 10 matches in total for 3 players in a match. So if all our player data goes into 1 server how does the server knows where to return the data to?
I am new to multiplayer and just want to understand how things should work. I looked also into Photon but i think that solution is a bit expesive atm so I was thinking if PlayFab server could do the job for me. I would be grateful if someone can provide pointers to my questions.