Code Monkey home page Code Monkey logo

kruise-game-open-match-director's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

kruise-game-open-match-director's Issues

[Feat] Support multi games selector

背景

当前director默认支持一种游戏的游戏服筛选。现在提出一种支持多个游戏的director方案,来支持集群中部署多种游戏服。

设计

director

新增名为 game_name 的 profile,pool filter为string类型。例如,集群中存在三种游戏:football、basketball、tennis,director将生成以下profile:

	p := []*pb.MatchProfile{
		{
			Name: "football",
			Pools: []*pb.Pool{
				{
					Name: "game_name",
					StringEqualsFilters: []*pb.StringEqualsFilter{
						{
							StringArg: "game_name",
							Value:     "football",
						},
					},
				},
			},
		},
		{
			Name: "basketball",
			Pools: []*pb.Pool{
				{
					Name: "game_name",
					StringEqualsFilters: []*pb.StringEqualsFilter{
						{
							StringArg: "game_name",
							Value:     "basketball",
						},
					},
				},
			},
		},
		{
			Name: "tennis",
			Pools: []*pb.Pool{
				{
					Name: "game_name",
					StringEqualsFilters: []*pb.StringEqualsFilter{
						{
							StringArg: "game_name",
							Value:     "tennis",
						},
					},
				},
			},
		},
	}

这里的game_name对应在Kubernetes集群中的GameServerSet的名称。若希望返回正确结果,集群中应存在名为football、basketball、tennis的gss对象。

open-match其他自定义组件的处理逻辑

  • mmf 根据pool来筛选ticket与backfill

  • game frontend创建ticket时带上相应的searchField,例如希望匹配足球游戏时,ticket创建所示:

    &pb.Ticket{
      	  SearchFields: &pb.SearchFields{
      		  StringArgs: map[string]string{
      			  "game_name": "football",
      		  },
      	  },
        }
    

[Feat] Support Backfill

背景

当存在玩家间允许异步进入房间,或是允许玩家退出补位的情况时,需要利用Open Match Backfill机制实现上述功能。

设计

  • Backfill 新增 SearchFields Tag "game.kruise.io/connected",表示该Backfill对应的房间已经开始游戏。
  • Backfill 新增 Extensions Key "game.kruise.io/connection",记录Backfill对应对局的连接信息。
    上述字段同时出现,例如:
pb.Backfill{
			SearchFields: &pb.SearchFields{
				Tags: []string{"game.kruise.io/connected"},
			},
			Extensions: map[string]*anypb.Any{
				"game.kruise.io/connection": any,
			},
		}

director fetch Match时若出现Backfill,则查看该Backfill是否已经分配过,若分配过,则将match的tickets assign 对应连接信息;若未分配过,则新分配gs给match的tickets。

[Feat] Supports transparent transmission extensions from “match” to “assignment”

背景需求

存在以下情况,进入匹配后对局(Match)信息需要反馈给玩家客户端或游戏大厅。例如,一个对局中存在多个队伍,每个队伍的对应的玩家ID情况需要在Assignment所表示,以便玩家客户端或游戏大厅watch Assignment时可以及时获取对应信息。然而,该类信息通常由匹配逻辑决定,匹配结果的产物是Match,因此需要一种协议,将Match中的extensions透传至Assignment。

设计

Director会将match对象所有的extensions透传至Assignment. 因此对于开发者,在编写match function时,将希望被玩家客户端或游戏大厅的新增信息记录在match的extensions即可。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.