Tournament system with live website bracket updates - implementation notes

  • Thread starter Thread starter /u/Only_Advantage_4056
  • Start date Start date
U

/u/Only_Advantage_4056

Guest
I run a Cobblemon server (Fabric 1.21.1) and we built a tournament system that updates live brackets on our website while matches are happening. The main challenge was getting match data out of Minecraft and onto a web page without lag.

Setup is pretty straightforward on the backend. We wrote a mod that hooks into Cobblemon's battle events and sends match results to a REST API. The website polls that API every few seconds and updates the bracket display. What made it more complicated was handling the actual bracket logic.... single elimination is easy but we run double elimination tournaments and the loser's bracket pathing gets messy fast.

The mod tracks battle start/end events, pulls player UUIDs and usernames, records the winner, and posts that data to the API endpoint. On the website side we're using a Javascript bracket library that renders the tournament tree and updates match results in real time. Players can watch the bracket progress on their phones while they're waiting for their next match.

We hosted our biggest tournament a few weeks ago (Season 2 Eclipse Cup) with 55 people online at peak. Server held 20 TPS throughout which was a relief because I wasn't totally sure how it would handle that load. The live bracket updates worked pretty well, only hiccup was one match result took like 30 seconds to show up because someone's internet dropped right as the battle ended and the event didn't fire properly.

The other thing we added was a match history page where you can see past tournament results, who fought who, what teams they used. That data's all stored in the same database so it was just a matter of building the frontend for it.

Has anyone else built tournament systems with external website integration? I'm curious what approaches people have used for the bracket logic, especially for formats more complex than single elimination.

https://cobblemoneclipse.com/ if you want to see what the live bracket display looks like (we have one up for our next event).

submitted by /u/Only_Advantage_4056
[link] [comments]

Continue reading...
 
Back
Top