Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ELO rating #61

Merged
merged 7 commits into from
Apr 23, 2024
Merged

ELO rating #61

merged 7 commits into from
Apr 23, 2024

Conversation

bal7hazar
Copy link
Collaborator

@bal7hazar bal7hazar commented Apr 17, 2024

Closes #60

Introduced changes

  • Add a method to compute ELO change between two ELO scores
  • Introduce a matchmaker contract example very efficient (not a single loop or recursion to match 2 players)

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Add a dedicated CI job for new examples
  • Performed self-review of the code

@bal7hazar
Copy link
Collaborator Author

@ponderingdemocritus @tarrencev
It will be used as a fondation for a future matchmaking mechanism

@bal7hazar bal7hazar marked this pull request as draft April 18, 2024 07:54
Copy link
Contributor

@tarrencev tarrencev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super cool. Do you think it is worth having a match maker module that is easily reusable by games? So people don't end up copy/pasting the example?

crates/src/rating/elo.cairo Show resolved Hide resolved
crates/src/rating/elo.cairo Outdated Show resolved Hide resolved
examples/matchmaker/src/helpers/bitmap.cairo Show resolved Hide resolved
@bal7hazar
Copy link
Collaborator Author

bal7hazar commented Apr 19, 2024

This is super cool. Do you think it is worth having a match maker module that is easily reusable by games? So people don't end up copy/pasting the example?

@tarrencev I don't think we can have it generic enough to make it compatible with all games (for instance if you want to do 1v1 or NvN or 1vN, etc.). If we are able to get enough feedbacks after a period of usage, maybe we could consider it again.

In addition, I was also thinking to maybe have a single deployed match marker world to allow people to find an opponent among a selected list of games (worlds), so all the ratings of all subscribed games will be centralised inside a singe Registry (which open the door to Gaming Identity, etc.).
So the match maker will probably come with a MatchMakerGameTrait to implement by games wanted to register.
So for instance you can search for a Pistols or Paved 1v1 game or a zConqueror 1vN, etc. in the same time.
but it will be another version in another PR I think.

@bal7hazar bal7hazar marked this pull request as ready for review April 20, 2024 07:28
@bal7hazar
Copy link
Collaborator Author

@tarrencev @ponderingdemocritus
I have finished the first version I think, tests ongoing @ https://matchmaker-ivory.vercel.app/

@bal7hazar
Copy link
Collaborator Author

bal7hazar commented Apr 22, 2024

Note: PR made to Alexandria keep-starknet-strange/alexandria#296

Edit (2022-04-22): PR has been merged but we will need to have dojo to be compatible with starknet 2.6.3 to be able to add alexandria as a dep.

@bal7hazar
Copy link
Collaborator Author

@tarrencev @ponderingdemocritus are you comfortable to merge it as it is?

I will update these helpers once we are able to support the latest version of Alexandria (currently blocked by dojoengine/dojo#1659).

I think creating a temporary math crate inside origami could be a high risk to encourage developers to add features in it which will be definitely in clash with Alexandria scope, which is something we don't want.

@ponderingdemocritus
Copy link
Contributor

Yeah lets do it

@ponderingdemocritus ponderingdemocritus merged commit 501dcd4 into dojoengine:main Apr 23, 2024
8 checks passed
@bal7hazar bal7hazar deleted the feat/elo branch April 23, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Elo rating system
3 participants