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).
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.
| 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 |
- Python 3
- numpy
pip install numpy# Generate a fresh player pool (optional)
python generatePlayers.py
# Run matchmaking for a random player
python matchmaking.pySample 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)
...
MIT