A competitive team-matchmaking algorithm for the melee game Mobius that utilizes genetic programming to optimize for balanced team matchup schedules.
The early-access multiplayer PvP game Mobius features a competitive tournament league for teams to compete against each other on a weekly basis. Whereas traditional tournaments run on scheduled dates, Mobius's competitive scene permits teams to schedule their availability throughout the week on the game's Discord server and are to be automatically scheduled to compete against other teams.
While randomly scheduling teams to compete against each other is a simple solution, it is not a fair solution. Mobius's competitive scene aims to be fair and balanced which is important for the competitive integrity of the game and for the enjoyment of the players. Unfortunately, there is no obvious algorithm to solve this problem optimally, as the search space is massive and the constraints are complex to optimize for. Further, an algorithm should optimize for fairness across every team, not just for a single team.
This repository implements a competitive team matchmaking algorithm for Mobius that strives for fair and balanced team matchup schedules by utilizing genetic programming to optimize for desirable matchmaking criteria. The algorithm is designed to be extensible and configurable for other competitive games and leagues, or for optimization of other criteria.
Prebuilt NPM packages are available for this repository via Releases and GitHub Packages.
This project uses Node.js v20 and Yarn v2 for development. To build the project locally, run the following commands:
corepack enable
yarn install --immutable --immutable-cache --check-cache
yarn run build
Note:
corepack enable
will likely need to be executed in a terminal with elevated permissions.
There is a single public API function for performing matchmaking:
matchmakeTeams(teams: ITeam[], options: IMatchmakingOptions): IMatchmakingResult
.
An example implementation can be found in
the matchmaking demo with
the default genetic configuration. To run the matchmaking demo with
the existing dataset in ./data/teams.json
, follow the build instructions and then run the
following CLI command:
yarn run demo
A non-exhaustive list of tasks (in no particular order) to maybe be completed
-
Initial experimental matchmaking API v0.1.0
- Implement genetic programming library
- Implement matchmaking API contracts (i.e. inputs, outputs, constraints/options, etc.)
- Implement default matchmaking algorithm with custom genetic operators
- Implement matchmaking API
- Implement demonstration example with existing Mobius dataset
- Automated CI/CD:
- Automatic build validation on new commits
- Publish to GitHub NPM Packages on new semver tags
-
Significantly improve repository quality
- Document TypeScript types and functions
- Abstract complex data aggregations and mathematical operations to separate library functions
- Improve README documentation
- Shorten 'Motivations' section
- Explain matchmaking criteria and difficulty
- Explain genetic algorithm approach and optimization criteria
- Explain the API and its supported options
- Add silly GitHub badges and ✨flair✨
-
Implement new library features
-
Permit any derived type of
ITeam
to be used in the matchmaking API -
Merge the region-partitioned matchmaking API with the non-partitioned API; expose a configuration option lambda for partitioning (defaulting to team region for Mobius)
-
Rewrite all genetic algorithm types to be more modular, extensible, and serializable
- Abstract all genetic algorithm types to a tree-traversable
GeneticOperator
class (including rootIGeneticOptions
) - Implement various helpful functions for tweaking
GeneticOperator
properties/weights without needing to rewrite an entire genetic operator configuration
- Abstract all genetic algorithm types to a tree-traversable
-
Implement configurable asynchronous multithreading pool using Node.js workers
- Implement configuration option for asynchronous and worker pool size
- Determine how to pass consumer genetic operators to worker threads (e.g. pure functions and class definitions that are serializable? scoped closures would not be supported)
- Auto-parallelize matchmaking partitions to different workers
-
-
Improve Node.js project architecture
- Integrate
eslint
linter for TypeScript - Integrate
prettier
formatter for TypeScript with IDE integration - Integrate unit test framework
- Implement unit tests for all trivial library functions
- Integrate
This repository is licensed under the GNU GPLv3 License.