Most efficient Matchmaking and relaxing filters?

MinimoMinimo
edited June 13 in DotNet
Hello,

I make 1 vs 1 game, and matchmaking by the skill. I have read the official matchmaking guide. I'm a bit confused relaxing the filters. With JoinRandomRoom, we told to wait and attempt to join for each few seconds while relaxing the filters over time. If there is no one available, this logic will loop forever and no one will create a room. Or we could try for max 3 times, and then create a room. I think this logic takes more time of waiting.

JoinRandom with +-50 skill deviation. Failed? Wait 5 sec, retry with +- 100 skill deviation. Failed? Wait 5 sec, retry with +- 150 skill deviation. Failed? Create a room.

So, I have an alternative mechanism.
Try JoinRandomRoom with +- 50 skill deviation. Failed? Then create a room immediately. And wait there until someone joined the room with the matching properties while relaxing the properties over time

JoinRandom. Failed? Create a room with 50pts skill deviation. Wait 5 seconds, increase skill deviation to 100. Wait 5 seconds, increase skill deviation to 150. And go on...


This is the code :

.

// JOINING ROOM ---------------------------

string sqlFilter = "C0 BETWEEN "+ PlayerSkill +" - C1 AND "+ PlayerSkill +" + C1";
// This is the problem, I don't know how to get the value of C1.
PhotonNetwork.JoinRandomRoom (null, 0, MatchmakingMode.RandomMatching, sqlLobby, sqlFilter, null);


// CREATING ROOM ---------------------------

string[] roomPropsInLobby = { "C0","C1"};
ExitGames.Client.Photon.Hashtable props = 
new ExitGames.Client.Photon.Hashtable() {{ "C0", PlayerSkill },{"C1", 50} };

// C0 is Player Skill, and C1 is allowed Skill deviation which will be increased over time

RoomOptions option = new RoomOptions();
option.customRoomProperties = props;
option.customRoomPropertiesForLobby = roomPropsInLobby;
TypedLobby sqlLobby = new TypedLobby("sqlLobby", LobbyType.SqlLobby);
PhotonNetwork.CreateRoom (null, option, sqlLobby);

// After creating the room, for every 5 seconds, the host increase the deviation value, increasing the probability of matching opponent.

So, that is my question. How do I translate the logic into sql expression?
This is the pseudocode for JoinRandomRoom filter

" C0 BETWEEN (MySkill - C1) AND (MySkill + C1) "

*C0 is the room host Skill. C1 is allowed deviation of skill which is relaxed over time by the room host.
Sorry, I'm new to this stuff. I tried my code and ended up with strings like "260 - C1". I want to extract the value of C1 and calculate it.

And I want to know your opinion, is this the correct way for matchmaking system and relaxing filters?
May I know your best method to do this?

Thank you,
Diori
Sign In or Register to comment.