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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODk3MDgsIm5iZiI6MTczOTE4OTQwOCwicGF0aCI6Ii82OTY2NTYvMzM3OTA3NjQyLWMyMjJkODBlLTM3MDYtNGU4Ny05ZWM2LTEyYjU2M2VlNTdjZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQxMjEwMDhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iZTk0OWEwMjVmZDYwM2ZmYjU5Mjk3ZTg1OGJjZWQ4ZmM2MzJmMWU1OGY1MGI1ZDI4ZjE3NzJhYzJhNzAxZDJiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.WJOgL6gzG0DvW_iTae9NuQrKiiwH2VdHn6EKKLoQk8c)
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.