Sign In Register

How can we help you today?

Start a new topic

How to share info about Pending match?

So Pending Match has a GetMatchData() function but not a SetMatchData() function like SparkMatch


This is causing an issue for me..


I have a realtime game.

A player will host a game by making a MatchmakingRequest()

Other players will then search for hosted games by making a MatchmakingRequest() and then making a FindPendingMatchesRequest()


If they choose to join a game they will make a JoinPendingMatchRequest()


The problem is that after the host makes the initial MatchmakingRequest() he cannot update any details about the game for other players to see.

Ideally I'd like the host to be able to host the game... and then for example change which map its being played on, and have that change reflected in what people searching for games will see.


I was thinking I could update the MatchData on the PendingMatch, that would be handy, cus players searching for a match get that data from FindPendingMatchesRequest() , but that does not seem to be possible... Is there some other way of doing this you would recommend?


Just fyi what I am planning to do is,, have the host post the details of their hosted game in their ScriptData..


Then the player searching for games, can get the hosts playerid from the Pending match and use that to get the info from the hosts Scriptdata.


This is incredibly hacky.. and it involves the initial FindPendingMatchesRequest() + a LogEventRequest() for *every* hosted game.

But I think it will work.

Please let me know of a better way of doing this!

Ok so I have a new plan.. 


Anytime someone hosts a game, they create a new entry in the 'Game Data Service' using a random id.

This entry has all the info about the game, and the host can update it.. eg when switching map, or when launching the game.

The host also includes the random id for the game in matchdata in his MatchmakingRequest


When someone is searching for matches, for every pending match found, they get the random id from the pending matches matchdata and use this to retrieved the info about the game from from the  'Game Data Service'


This is pretty good as its flexible.. ie. The host of the game can change (in my game it does, when the host leaves another player is made host)


The only thing Im worried about is that I'm not deleting this data when the game is over.. I will have to find out how to do that

Hi Brian!


How's your progress? I have stumbled upon the same issue: I can't modify pending matches' data. And whole matchmaking system uses pending matches' data for matchmaking. That's stupid.


Right now I am considering why should I hack matchmaking system at all. It seems like implementing our own matchmaking with "Game Data Service" might be simpler, cheaper and more fine-tuned.


What do you think?

 Regards,

Bartosz Chodorowski


Using the 'Game Data Service' worked fine for me.


I think if you just want a simple host/join system then writing your own system might be the easiest way.


You need a 'match' instance from their system in order to start a realtime game.. But you can create those yourself.


See SparkMultiplayer.createMatch


https://docs.gamesparks.com/api-documentation/cloud-code-api/multiplayer/sparkmultiplayer.html

Brian,


Thank for your input. :)


Cheers,


Login to post a comment