keiwen/competition 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

keiwen/competition

Composer 安装命令:

composer require keiwen/competition

包简介

Competition management

README 文档

README

A PHP library that allow competition management

Games

A 'game' is played with multiple players. They are several type of games:

  • duel: opposition of only 2 players. The highest score win the game
  • race: opposition of 2..n players. All players are ranked from 1 to n, the first win the game.
  • brawl: opposition of 2..n players. Players are not ranked as in race, but only 1 players is defined as the winner of the game.
  • performance: opposition of 2..n players. Each player scores into 1 or several performances, the highest sum win the game.

Competition types

A competition is a set of games (all of the same type) managed by common rules. They are several type of competition:

  • Duels championship: Each round, each player have a duel versus a single opponent (= round robin)
  • Races championship: Each round, players race all together, ending in an ordered list of final positions
  • Brawls championship: Each round, players brawl all together, ending in a unique winner
  • Performances championship: Each round, players register their best performances
  • Contest: Each round, players register their best performances. The lowest are eliminated for next round
  • Threshold competition: Each round, players register their best performances. Players reaching a minimum performance are qualified for next round
  • Bubble championship: Each round, each player have a duel versus a single opponent ranked directly above or under him. The winner swap to highest rank. Points does not matter in this competition
  • Swiss system: Each round, each player have a duel versus a single opponent with similar rank. This system features considerably fewer rounds that classic duel championship
  • Tournament: Each round, each player have a duel versus a single opponent. The looser is eliminated and competition continue until a final player remain. On first round, high seeds will face low seeds. Highest seeds are dispatched so they cannot face each other on early rounds. This competition is designed for a power of 2 number of players (4, 8, 16, 32, ...). Elsewise, a play-in round is added first to eliminate excess number
  • Double elimination tournament: Similar to classic tournament, except that players are eliminated after a second loss only. After first loss, they fall down to a loser bracket for their 'second chance'. Play-in are not supported for this competition
  • Swap tournament: Each round, a player have a duel versus a single opponent ranked directly above or under him. The winner swap to highest rank. At the end of each round, first seed and last seed still in competition earned their final spot and will not be included in further rounds. Points does not matter in this competition. This competition is designed to have limited number of player, as winner is decided on first round, and the next only refines middle spots
  • Gauntlet tournament: Each round, last 2 seeds remaining have a duel. The loser earn its final spot while the winner will face the next seed, and so on until the top seed to determine the winner. Points does not matter in this competition. This competition is designed to advantage best seeds.

Competition have a pre-determined number of round, which can contains several game but each player is affected to only one of them. Player rankings are available during the competition progress and updated after each game.

Teams

On a competition, you can freely define team compositions, giving the list of players that belongs to each team. This way, you can retrieve rankings for teams as well.

Group, phase and tree

Sometimes we may need to mix different types of competitions, and we often see a first part with round robin then a second part as a tournament with the best players of the first part. This is managed in 'trees', where each part are called 'phase'. Phases cannot be played in parallel, only one after the other. Each phase contains 1..n group(s) that are defined as a basic competition part. In previous example, we have have a first phase with x 'duels championship' competition inside, then a second phase with one 'Tournament' competition.

During a phase, each groups are played in parallel: all games of round 1 should be done in all group before going to any game of round 2.

When a phase ends, there are rules defining which players may be picked or not in following phase.

Builders and iterations

Builders are object that can prepare the competition. Here will be defined the ground rules of the competition (for example, points given for a win, loss or drawn). There are builders for group (or simple competition), phase and tree.

When all rules are set, you can start an 'iteration': defining the list of starting players, you can start to play games and set results. When a first iteration ends, you can simply reuse the same builder to start a second iteration: no need to set rules again.

ELO

Competition supports ELO system for players, as a single integer value that can be updated or using the Keiwen\Utils\Elo\EloRating object. If teams are defined, you can retrieve its ELO as the average ELO of its players.

Performances and expenses

In this library, all competitions are supporting performances and expenses. These are totally optional and can be defined freely when creating a competition.

Performances are data collected on each game for each player (for example, number of chocolate bars eaten during the game). Totals will be used for rankings tie-breaker. They are not determinant for the result of the game, except if explicitly set as this for competitions using performance games.

Expenses are collected on each game for each player (for example money spent in pyro for player entrance). Remaining budgets will be used for rankings tie-breaker.

keiwen/competition 适用场景与选型建议

keiwen/competition 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 11 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 keiwen/competition 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 keiwen/competition 我们能提供哪些服务?
定制开发 / 二次开发

基于 keiwen/competition 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-11-08