Example source code for https://mas-bandwidth.com/creating-a-matchmaker-for-your-multiplayer-game
To run the simulator:
make && ./dist/matchmaker
You should see output like this:
2024-02-18 04:57:15: 25312 players 2s average search time 33ms average latency
2024-02-18 04:57:16: 25288 players 2s average search time 33ms average latency
2024-02-18 04:57:17: 25308 players 2s average search time 32ms average latency
2024-02-18 04:57:18: 25300 players 2s average search time 32ms average latency
2024-02-18 04:57:19: 25308 players 2s average search time 33ms average latency
2024-02-18 04:57:20: 25308 players 2s average search time 33ms average latency
2024-02-18 04:57:21: 25296 players 2s average search time 33ms average latency
2024-02-18 04:57:22: 25284 players 2s average search time 33ms average latency
2024-02-18 04:57:23: 25296 players 2s average search time 33ms average latency
2024-02-18 04:57:24: 25288 players 2s average search time 32ms average latency
2024-02-18 04:57:25: 25276 players 2s average search time 33ms average latency
2024-02-18 04:57:26: 25268 players 2s average search time 32ms average latency
2024-02-18 04:57:27: 25256 players 2s average search time 32ms average latency
2024-02-18 04:57:28: 25260 players 2s average search time 32ms average latency
To view the real-time visualization of players on a map, just open map/index.html in a browser.
Or you can just watch it on YouTube:
![image](https://private-user-images.githubusercontent.com/696656/337907642-c222d80e-3706-4e87-9ec6-12b563ee57cd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NjgwNTAsIm5iZiI6MTcyNTk2Nzc1MCwicGF0aCI6Ii82OTY2NTYvMzM3OTA3NjQyLWMyMjJkODBlLTM3MDYtNGU4Ny05ZWM2LTEyYjU2M2VlNTdjZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMFQxMTI5MTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02YmIxZWFjMDE4NTMxMzA1NzI5N2YwZWZkMzIyYzI5NTYxZGE3Mzg1MDUxNGRlMDY5ODcwOTQ4YmZhMzdiZDJmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.lf6QrVIp-9gOHcTfiJUnXaO2rIYIS5_5KWFJ1EfZ4QI)
The datasets are included under the "data" folder. In particular, players.csv defines the player lat/long coordinates joining each second.
The rest of the data defines the set of datacenters and the latency maps per-datacenter.
Tested on MacOS. Linux should work. Windows untested.