Database Redesign

Moderators: flockmastoR, Gipfelstuermer, Alkworld, systemmods

Alkworld
Posts: 1184
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: 259
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

Alkworld
Posts: 1184
Joined: Sat Feb 27, 2010 8:40 pm
Contact:

Re: Database Redesign

Post by Alkworld » Sat Nov 16, 2024 3:41 pm

Hi everybody,

the new version is now ready to be tested, i.e. all the important features might work correctly, but maybe they aren't and I just haven't noticed. As the changes were that big, it's hard to notice if I missed out anything important.

You can reach the new version on http://cycling4freaks.com/c4f-3.0/c4f-react/, the picture on top is replaced by something ugly so you know you're not in the real (old) C4F. The data is a copy of the original data from a week ago (Andes is cancelled there), therefore you can login with your usual account details.

So if you're interested in finding any bugs there and help me finalizing the new version, feel free to test whatever you want and whatever comes to your mind. Areas that require a bit more testing are the following:
  • check if the transfermarket still looks fine and has the usual kind of riders (the code for generation of riders has been changed)
  • check various kinds of one-day races and tours, ITT, TTT, rest day, half stages, pavé. The core of the race code hasn't changed, but there's lots of translations between old and new data model
  • check if FPC functionality is complete and includes Gipfel's recent changes
  • check race editor and calendar planning tools
  • check nations committee functionality
  • check all the stats
If somebody is interested, I can assign the admin role in the test environment (max one or two people, as it could get chaotic otherwise), then you can test races a lot faster (day change and race calculation can be triggered). Same with the calendar planner role, which allows to publish races in the test environment.

Radunion
Posts: 384
Joined: Sat Mar 27, 2010 2:09 pm
Contact:

Re: Database Redesign

Post by Radunion » Sat Nov 16, 2024 4:59 pm

Thanks for the effort, a view early observations:

- my 20 year old rider was not transferred to the new version
- non of the riders on the transfer marked are available, probably an error which div can buy them
- I still see the canceled races (10 h and 15 h) on the inscription screen (should check what happens with the 19 h race)

Alkworld
Posts: 1184
Joined: Sat Feb 27, 2010 8:40 pm
Contact:

Re: Database Redesign

Post by Alkworld » Sat Nov 16, 2024 5:50 pm

Thx for the feedback!
Radunion wrote:
Sat Nov 16, 2024 4:59 pm
- my 20 year old rider was not transferred to the new version
Data is from around day 2 of Andes, maybe last Sunday. Which rider is it?
Radunion wrote:
Sat Nov 16, 2024 4:59 pm
- non of the riders on the transfer marked are available, probably an error which div can buy them
OK, will check
Radunion wrote:
Sat Nov 16, 2024 4:59 pm
- I still see the canceled races (10 h and 15 h) on the inscription screen (should check what happens with the 19 h race)
I cancelled Andes manually, they are still shown because the calculated time is not over yet. New races are cancelled because nobody signed up :)

Radunion
Posts: 384
Joined: Sat Mar 27, 2010 2:09 pm
Contact:

Re: Database Redesign

Post by Radunion » Sat Nov 16, 2024 8:01 pm

Alkworld wrote:
Sat Nov 16, 2024 5:50 pm
Radunion wrote:
Sat Nov 16, 2024 4:59 pm
- my 20 year old rider was not transferred to the new version
Data is from around day 2 of Andes, maybe last Sunday. Which rider is it?
Norbert Wiener (ID 1209457). The transfer is shown under transfers but the rider is not shown in the rider list und Team.

Hansa
Posts: 1044
Joined: Wed May 19, 2010 8:27 pm
Contact:

Re: Database Redesign

Post by Hansa » Sat Nov 16, 2024 8:19 pm

Site crashes if you order by number in the inscription page
Hansa

est. 03.08.2009

Alkworld
Posts: 1184
Joined: Sat Feb 27, 2010 8:40 pm
Contact:

Re: Database Redesign

Post by Alkworld » Sat Nov 16, 2024 8:23 pm

Hansa wrote:
Sat Nov 16, 2024 8:19 pm
Site crashes if you order by number in the inscription page
OK, I could reproduce that, will fix it

User avatar
olmania
Posts: 2641
Joined: Thu Feb 11, 2010 8:06 pm
Contact:

Re: Database Redesign

Post by olmania » Sat Nov 16, 2024 8:27 pm

Inscription for the 10h race of today still looks possible.

Hansa
Posts: 1044
Joined: Wed May 19, 2010 8:27 pm
Contact:

Re: Database Redesign

Post by Hansa » Sat Nov 16, 2024 8:29 pm

Alkworld wrote:
Sat Nov 16, 2024 8:23 pm
Hansa wrote:
Sat Nov 16, 2024 8:19 pm
Site crashes if you order by number in the inscription page
OK, I could reproduce that, will fix it
if you order in stats by acronym it crashes too
Hansa

est. 03.08.2009

ATB - Racing
Posts: 282
Joined: Fri May 04, 2012 11:57 am
Contact:

Re: Database Redesign

Post by ATB - Racing » Sat Nov 16, 2024 11:22 pm

race crashes if you:

- open "Bewerten" tab

missing winner interview

Hansa
Posts: 1044
Joined: Wed May 19, 2010 8:27 pm
Contact:

Re: Database Redesign

Post by Hansa » Sat Nov 16, 2024 11:46 pm

Team Tab is buggy during the race, shows team not participating and everyone was shown doubled
Hansa

est. 03.08.2009

ATB - Racing
Posts: 282
Joined: Fri May 04, 2012 11:57 am
Contact:

Re: Database Redesign

Post by ATB - Racing » Sun Nov 17, 2024 12:11 am

crashes when you accept nationality of some riders in the NC section.

lennylenny
Posts: 479
Joined: Mon Aug 08, 2011 10:22 am
Contact:

Re: Database Redesign

Post by lennylenny » Sun Nov 17, 2024 12:53 am

quite some riders have missing flags in statistics tab, i assume because of mismatch of country codes



not a bug, but suggestion: when hovering over flags it would be nice to show the name of the country in the tooltip instead of "c4fcode" (teams page) or "nationality" (statistics)
Spelling mistakes are Special functions Like bugs that are functions of the game

lennylenny
Posts: 479
Joined: Mon Aug 08, 2011 10:22 am
Contact:

Re: Database Redesign

Post by lennylenny » Sun Nov 17, 2024 1:00 am

Alkworld wrote:
Sat Nov 16, 2024 5:50 pm

Radunion wrote:
Sat Nov 16, 2024 4:59 pm
- non of the riders on the transfer marked are available, probably an error which div can buy them
OK, will check
for me it shows the market of riders on the transfer market as unknown instead of the Divs
Spelling mistakes are Special functions Like bugs that are functions of the game

Tukhtahuaev
Posts: 341
Joined: Fri May 13, 2016 7:07 pm
Contact:

Re: Database Redesign

Post by Tukhtahuaev » Sun Nov 17, 2024 9:15 am

Can't sell any riders. Screen looks like this:

Image

Radunion
Posts: 384
Joined: Sat Mar 27, 2010 2:09 pm
Contact:

Re: Database Redesign

Post by Radunion » Sun Nov 17, 2024 9:46 am

Yesterday, Sieb in green looked way to effective. It was something like 50 against 41 climbing, 200 less energy, +11. The time difference looked too small for a normal split as well.

Alkworld
Posts: 1184
Joined: Sat Feb 27, 2010 8:40 pm
Contact:

Re: Database Redesign

Post by Alkworld » Sun Nov 17, 2024 6:15 pm

A few fixes done now (v3.0.1):
- team page in race corrected
- no more crash when sorting by number in inscriptions
- no more crash when sorting by acronym in stats (Hansa's "fault" with a number as acronym)
- winner interviews are shown again
- Race leads you to today's race after it's completed
- signing up for cancelled races is no longer possible
- fairplay votings working again (I didn't get a crash there)
- missing flags might be fixed (issue only in older browsers where unicode flags are not used)

lennylenny
Posts: 479
Joined: Mon Aug 08, 2011 10:22 am
Contact:

Re: Database Redesign

Post by lennylenny » Sun Nov 17, 2024 6:30 pm

flags seem to be fixed
Spelling mistakes are Special functions Like bugs that are functions of the game

Schnuggeritos
Posts: 141
Joined: Mon Aug 01, 2022 10:37 am
Contact:

Re: Database Redesign

Post by Schnuggeritos » Sun Nov 17, 2024 7:08 pm

At 1800 race there is only one rider from team bergwerk with starting number "-9". I don't think bw inscribed fully to the race

Hansa
Posts: 1044
Joined: Wed May 19, 2010 8:27 pm
Contact:

Re: Database Redesign

Post by Hansa » Sun Nov 17, 2024 7:52 pm

Riders stop tempo as soon as a team switches to yellow status (offline 3 kms) if you use auto refresh
Hansa

est. 03.08.2009

ATB - Racing
Posts: 282
Joined: Fri May 04, 2012 11:57 am
Contact:

Re: Database Redesign

Post by ATB - Racing » Sun Nov 17, 2024 7:53 pm

18h race:
bergwerk just signed in with Zac (thats the guy with starting number -9), see above schnuggeritos posting:
Sprintwertung:
1. Zac Goldsmith (bergwerk): 6
2. Jacob Fryxelius (Schnuggeritos): 4
3. Clive Bixby (Schnuggeritos): 2

Km: 38, Steigung: 0

500 bis zum Ziel

450 bis zum Ziel

400 bis zum Ziel

350 bis zum Ziel

300 bis zum Ziel

250 bis zum Ziel

200 bis zum Ziel

150 bis zum Ziel

100 bis zum Ziel
Clive Bixby (Schnuggeritos) sprintet von vorne
Clive Bixby (Schnuggeritos):
Jacob Fryxelius (Schnuggeritos) versucht ans Hinterrad zu kommen
Jacob Fryxelius (Schnuggeritos) geht ans Hinterrad

50 bis zum Ziel
Zac Goldsmith (bergwerk) sprintet von vorne
sneaking into a race with just one rider and stealing sprint points :mrgreen: :o 8-)

Hansa
Posts: 1044
Joined: Wed May 19, 2010 8:27 pm
Contact:

Re: Database Redesign

Post by Hansa » Sun Nov 17, 2024 7:57 pm

Schnuggeritos wrote:
Sun Nov 17, 2024 7:08 pm
At 1800 race there is only one rider from team bergwerk with starting number "-9". I don't think bw inscribed fully to the race
bergwerk also doesnt appear in the participants list on the chat but he is shown in the teams tab with 51K salary
Hansa

est. 03.08.2009

Hansa
Posts: 1044
Joined: Wed May 19, 2010 8:27 pm
Contact:

Re: Database Redesign

Post by Hansa » Sun Nov 17, 2024 8:16 pm

schnugge now got kicked out of the race, without being offline for very long
Km: 139, Steigung: 0

Vladimír Suchý (Schnuggeritos) gibt das Rennen auf

Wilfred Elrington (Schnuggeritos) gibt das Rennen auf

Paolo Mori (Schnuggeritos) gibt das Rennen auf

Clive Bixby (Schnuggeritos) gibt das Rennen auf

Jamey Stegmaier (Schnuggeritos) gibt das Rennen auf

Martin Halm (Schnuggeritos) gibt das Rennen auf

Dávid Turczi (Schnuggeritos) gibt das Rennen auf

Jacob Fryxelius (Schnuggeritos) gibt das Rennen auf
Hansa

est. 03.08.2009

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest