I am interested in creating a pre-game lobby for my upcoming shooter title. The lobby tutorial for Smartfox is ok but is not quite what I need. Below is an example of the process a player would go through in order to play online:
Select Multiplayer from the main menu
Type user name Log in
After logging in the player would be sent to the “Map Selection Room”
The player then would select the desired map and be sent to the lobby for that map
Once in the lobby the player would be greeted with a character setup screen with the usual info
Once the player has finished setup they would then be free to roam the lobby and interact with other players (maybe even a upgrade shop).
The problem is that I have designed a room that would act as the player lobby but have no idea how this could be implemented. Here was a thought:
Have the lobby scene loaded after the player connects and logs in
Have a timer in the lobby scene that tells the players how long before the next match
Once the timer is up the players are then sent to the map and the match begins.
Once the match is over players are then sent back to the lobby and the process starts over.
Problems I can see happening:
matches will start with one person if no one joins before the time runs out
no way to switch maps while in the lobby after playing
you can check the amount of players in a room and if there is only one player, just reset/restart the timer.
I don’t know what you mean with the second question.
If you want to use ElectroServer as your middleware, it’s pretty easy to do what you outline above and I’d be happy to give advice in the Electrotank forums.
Go a global lobby where all players gather and setup your character
Go to the different games (shown as doors and info on the wall beside it) and place your ‘I’m in’ tag in the virtual “slot”. If you want to change the game you want to play, retrieve your tag and place it in the slot of another game.
If you really don’t want the player to select the game via 3D avatar walking around, select a game via an onscreen scroll box.
Here is MY setup:
Click “Start playing”
Login box pops up and validates your account
Automatically log in to the first available server
Walk around a 3D environment where you speak with other players, buy items, review your settings / stats etc
Go up to the map selection object and select a map (or cancel and stay where you are) and be teleported there.
That setup sounds more like what I am aiming for, and I have that setup up. The problem is more so figuring out how to get the lobby setup itself. I need the timer to start only after a minimum of 6 ppl enter the player lobby. Then once the timer hits 0 then the players in that lobby will be sent to the map. And all while that is going on as other ppl login to play the process repeats itself.