游戏的配对算法 [英] Matchmaking algorithm for a game

查看:90
本文介绍了游戏的配对算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(这是我正在设计的游戏),可以说一个游戏中有2个玩家团队.每队将有4名球员.每个玩家都有一个等级(0-9),其中0表示坏玩家,而9表示出色玩家.等待玩家玩游戏的队列(或列表)(可能是很小的数目,也可能是很大的数目).可以说,每支球队的整体排名是其中的4名球员的平均值.可以在多个开放式游戏和球队中放置一名球员.

(This is for a game I am designing) Lets say that there are 2 teams of players in a game. Each team will have 4 players. Each player has a rank(0-9), where 0 indicates a bad player and 9 indicates an amazing player. There is a queue (or list) of players who are waiting to play a game (This could be a small number or a very large number). Lets say that each teams' overall rank is an average of the 4 players within in. There are multiple open games and teams where a player can be placed.

问题:有什么好的算法可以将玩家置于团队的等待队列/列表中,以使游戏中的每个团队在游戏中的总体排名大致相同(不一定是完美的) ?另外,球员们不必等待超过一分钟就可以被安排到一个团队中(如果球员很少,则可以更多)[他们放置得越快,越好]

Question: What is a good algorithm that places a player in the waiting queue/list on a team so that each team in a game will have more or less the same overall rank in a game (Does not have to be perfect)? Also, the players should not have to wait more than a minute to be placed on a team(Can be more if very little players) [The faster they are placed, the better]

推荐答案

您应该开始由一个人来构建表.如果人物A的等级为8,而另一名玩家以等级4加入游戏,而您的展示位置指导系数是2,那么

You should start to build the table with one person. If person A has a rank of 8, and another player joins the game with a rank of 4, and your placement guide is a factor of 2, then

玩家A拥有桌子 玩家A的等级为8

Player A has the table Player A has a rank of 8

玩家B进入房间 玩家B的排名是否在6到9之间? 10?

Player B enters the room Does player B not have a rank between 6 & 10?

if (Brank < Arank - 2 || Brank > Arank + 2)

如果是这样,则该排名不在表格的限制之内,因此您应该以"Brank"作为要比较的排名来开始创建新表格.

If that is true, then the rank is not within the limits of the table and you should start a new table with Brank as the rank you compare to.

如果这是错误的,则排名是表中已声明排名的+-2,并且该玩家可以加入.

If that is false, then the rank is +- 2 of the table's declared rank and that player can join.

如果您真的想花哨的话,可以根据等待桌子的人数来声明排名.

If you really want to get fancy, you can declare the ranking based on the number of people waiting for a table.

如果大厅有100人,则限制为+-2. 如果大厅有15个人,则将上限设置为+-4.(使游戏更加不均匀,但不会导致人们等待那么长时间).

If 100 people in lobby, make the limit +- 2. If 15 people in lobby, make the limit +- 4. (make it more uneven game, but will not cause people to wait as long).

这篇关于游戏的配对算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆