Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cosine-Sim-Matchmaking

A proof-of-concept matchmaking system that uses cosine similarity to pair players with compatible playstyles. Players are represented as vectors across three dimensions — Damage, Skill, and Synergy — and matched based on directional similarity combined with a skill gap penalty.

This was built as a companion project to the paper "Implementasi Cosine Similarity dalam Sistem Matchmaking pada Game Online" (IF2123 Linear Algebra and Geometry, STEI ITB).


How It Works

Each player is encoded as a 3D vector:

[DamageScore, SkillScore, SynergyScore]

Match quality between two players is scored as:

score = cosine_similarity(a, b) / max(skill_gap, 1)

This rewards similar playstyle direction (cosine similarity) while penalizing large rating disparities.

The top 9 most compatible players are then split into ally and enemy teams in alternating order.


Files

File Description
matchmaking.py Core matchmaking logic
generatePlayers.py Generates a random player pool
generateNames.py Generates random gaming usernames
players.json Player dataset (pre-generated)
gaming_usernames.txt Username pool for generation

Requirements

  • Python 3
  • numpy
pip install numpy

Usage

# Generate a fresh player pool (optional)
python generatePlayers.py

# Run matchmaking for a random player
python matchmaking.py

Sample output:

Match for xXShadowBlade99Xx with rating 7.43:
(Min: 1.02, Max: 9.87, Avg: 5.31)

Ally Team:
xXShadowBlade99Xx
NightOwl42 (0.98)
...

Enemy Team:
PixelProwler (0.97)
...

License

MIT

About

Application of cosine similarity for matchmaking proof of concept

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages