Sign In Register

How can we help you today?

Start a new topic
Answered

Suggestions for starting real-time game?

Hello everyone,


I am a Unity programmer with about 4 years of experience. In that 4 years, networking is the one thing I have stayed away from entirely because I find it to be very difficult. However, I have a client that has came to me and asked to implement his game in GameSparks. It is already using uNET as its back end, but I need to convert it to GameSparks using the real-time services. This will include 4 player co-op, custom character selection, movement syncing, and anything else that a real-time co-op game would have.


I have seen the GameSparks real-time examples but honestly, they are not very good. You need to have 4 instances of a game up and running for a server to pop up for anyone. I feel that is not too intuitive for real players at all.


So here is what I ask: What are some suggestions you guys have for creating a 4 player, real-time co-op game? A player will need to Host a game and other players will be able to view a list of matches they are able to join and join the one they click.


I know this is a lot but I am totally lost. My client really needs to have GameSparks added to his game, so any and all help would be amazing. Thank you!


Sincerely,

Kyle


Best Answer
Hey Kyle,

As luck would have it we have a guide on making a realtime game for 4 players using Gamesparks RT and Unity here.


Please look over https://docs.gamesparks.com/tutorials/real-time-services/understanding-gamesparks-real-time.html, which will cover many of the key concepts covered in the tutorial.


Regards,

-Dave


Answer
Hey Kyle,

As luck would have it we have a guide on making a realtime game for 4 players using Gamesparks RT and Unity here.


Please look over https://docs.gamesparks.com/tutorials/real-time-services/understanding-gamesparks-real-time.html, which will cover many of the key concepts covered in the tutorial.


Regards,

-Dave

Thank you very much Dave, I will take a look at that first one.

 Hi Kyle, you do not need 4 connections to get a server. You can have one or two instances if you wish to test out your logic.


Hope that helps,

Omar

Hello Omar,


How would I go about allowing that? Is it inside the GameSparks settings somewhere? I am looking to have the functionality where a player can see and join the game after it is created and there is only one player in there.


I have one more question too. Is there a special way to handle game lobbies in GameSparks?


Thank you,

Kyle

 Hey Kyle,

The tutorials Dave linked will get you up and running. All you need to do is to set the 'min-players' option of your match to 2-players instead of 4.



GameSparks RT always starts with matchmaking. You should check out this doc to familiarize yourself with that too.
also, one for RT matchmaking -> https://docs.gamesparks.com/tutorials/real-time-services/real-time-matchmaking.html

The matchmaking process is required in order for the unity SDK to receive the details it needs to connect to the server. Specifically the port, url and access-token to the RT server. This is found in the matchfoundmessage once the match is set to the RT option.

There is no way out-of-the-box to setup lobbies yet, however you can config a match with 1-2 min players. Then set the following options in the match.

  1. RealTime
  2. Drop-in/Drop-out
  3. Manually match players


Drop-in/drop-out will allow players to join and leave when they want. Once you set your match limit, a match can only have players less than the limit connected at one time.
So that the first step. If you dont allow this, you'll still be able to create a match, but no-one will be able to join or leave once the match has started, so the lobby is a bit pointless.


Allow players to manually match is where you get the lobby from.
This option requires you to do a matchmakingrequest as normal, but after you've done the matchmaking request you do another findpendingmatchrequest. This will give you a list of all the pending matches you can join. This is the game/room/map you'll use to display your lobby. In this list you'll get an ID for each pending match. You can then use joinpendingmatchrequest to join a specific match.

Its important during the process not to think of the matchmaking strictly for grouping players. Once you have RT enabled, it covers a lot of other aspects, so it can get quite confusing, but the process above should get you what you need.

Thanks,
Sean






Login to post a comment