Database Redesign

Moderators: flockmastoR, Gipfelstuermer, Alkworld, systemmods

Post Reply
Alkworld
Posts: 1169
Joined: Sat Feb 27, 2010 8:40 pm
Contact:

Database Redesign

Post by Alkworld » Wed Sep 04, 2024 5:20 pm

Hi C4F community,

you might have read a couple of times that I was mentioning some mysterious redesign in the past month, which basically keeps me from fixing anything else. I'll try to explain why I'm doing that, what I'm doing (roughly) and what the next steps are.

Why am I changing something?
I need to be a little technical here: The database (which stores all user data, teams, riders, races and a lot more) is organized in tables, but unfortunately not in a very good way especially when it comes to riders and teams
  • the rider table contains rider info (name, skills, value, etc) and info about the rider's current race (energy, points, tempo settings, ...)
  • the team / user table contains user info (name, password (encryted), email address, language settings, etc), team info (balance, number of wins, etc) and info about the team's current race (salary, race ID, next race, etc)
  • retired riders are in a separate table
  • the transfermarket is split over three tables (above mentioned rider table, youth transfermarket and older riders transfermarket with generated riders)
  • the code for race calculation is seriously hard to understand, as it's not well structured and badly documented (no offense to Buhmann, he was still in school when writing it). Fixing bugs there is very tricky without extensive testing. And even then the impact of changes is far from obvious (see pavé fixes).
Having one table for active riders and their races now makes it hard to have multiple races for a rider (like short races in addition or world championships where riders are controlled by different users). Buhmann solved it by making copies of those tables, but this is a pretty ugly solution. The same goes for the users / teams table.

What am I changing now?
  • for all riders (active, retired, transfermarket), there will be one combined table
  • riders in races (called racers in the code) are handled in a different table
  • users, teams and teams in races will be separated (similar like riders and racers)
  • new test environment and better tools for admins to be able to help with the testing (lots of code needed to be changed, which possibly causes new errors)
Benefits of the changes
  • less technical dependencies with the seperation of rider and race data (shorter red light)
  • simpler code, easier to understand and maintain
  • other race types can be in parallel (short races, world championships, retired rider races, etc)
  • signing up for multiple races at a time will be possible
  • races (incl replay) can be available for a longer time
  • better online status solution (incl. sitters, auto-refresh and visitors again)
  • rebuilding the whole race physics will be easier (or even possible at all)
  • better performance, smaller database size, more robust game in general (it's not that bad currently)
Next steps
  • me completing the code (including taking over Gipfel's recent improvements)
  • testing the new code, new database setup and bugfixing --> here you (any player) will be able to help, too. I'll let you know by then.
  • at some point moving to the new version (maybe the game needs to be off for a few hours to migrate the data)

Chemnitz Pro Cycling Team
Posts: 241
Joined: Mon Jul 25, 2022 12:47 pm
Contact:

Re: Database Redesign

Post by Chemnitz Pro Cycling Team » Wed Sep 04, 2024 9:38 pm

All I can say is THANK YOU! Spending so much time in your free time is awesome.

Servicio Médico
Posts: 9
Joined: Thu Aug 31, 2023 5:42 pm
Contact:

Re: Database Redesign

Post by Servicio Médico » Wed Sep 04, 2024 11:09 pm

can only agree with chem here.. really appreciate the effort you put into working on this great game alk
looking forward to whats going to come ... and what we can do to help then

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest