It is currently Sun Nov 24, 2024 8:46 pm

All times are UTC - 5 hours



Forum rules


Please stay on topic.

Please respect other community members moderators and administrators.

No spam.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: New matching algorithm suggestion
PostPosted: Wed Sep 17, 2014 8:16 am 
Corporal
Corporal
 Profile

Joined: Fri Mar 07, 2014 10:03 am
Posts: 48
I would like to suggest an algorithm to improve matchmaking and reduce cheating.

Short description: a player must play with a number of other unique players before he can be matched against another certain player.

Long description: Every (online) player has an index and we will add a small circular buffer in the database for each player to hold last n matches, let's say 5. So, let's say player of index 1 starts the game, the database row will look like this:

1,, 0, 0, 0, 0, 0

Now player of index 1 will play four matches against random opponents, players 25, 36, 200, 321:

1,, 25, 36, 200, 321, 0

Buffer almost full, now server chooses player 25 as the next opponent. Oops! 25 is already in the buffer, choose another: 666

1,, 25, 36, 200, 321, 666

Player of index 1 start another game, this time his opponent is player of index 701. But the buffer is full, so the writing position goes back to first position and overwrite the index 25:

1,, 701, 36, 200, 321, 666

Now the index 25 is no longer in the list of player 1 so after 5 matches player 1 can play again against player 25.

Tweaks:
a) you can set the buffer as long as you consider 3, 5, 10 or even make it dynamic based on the number of players online;
b) you may encounter the following case: a player A could match a player B, but player B cannot yet match player A because he didn't play enough matches to round the buffer. You will have two options:
- use OR: if player A can match B OR player B can match A then match them;
- use AND: if player A can match B AND player B can match A then match them;
c) if a player logs out, references to his index may remain, but that won't affect the game in anyway;
d) since players will now have 0% chance to meet the same person in a row, you may increase the matching rank range or even completely remove it (so rank 1 could be matched with a rank 8 for example) to make game more fun and the waiting queue shorter, but it's up to you.

Memory usage: assuming you have 500 players online at a time, and each index is a 2 byte long, this means 500 x 5 x 2 = 5000 bytes = 5 Kb. For today computers and especially for servers, 5 kb of memory isn't a problem.

Let me know if this was useful or if you have any questions.


Top
 

 Post subject: Re: New matching algorithm suggestion
PostPosted: Thu Sep 25, 2014 4:00 am 
Second Lieutenant
Second Lieutenant
User avatar
 WWW  Profile

Joined: Thu Sep 29, 2011 9:44 pm
Posts: 248
Location: New Zealand
Gender: male
Hey!! It sounds like a great idea!

_________________
Matmanmax
Helping Dawners Since 2011


Spoiler:
Retired BattleDawn Tribune Reporter
Retired Maintenance Team Member
RC Game Tester
Active Forum User


Top
 

Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group  
Copyright Tacticsoft Ltd. 2008   
Updated By phpBBservice.nl