I'm a huge fan of Formula 1 racing.
For the past few seasons myself and my other F1 loving friends have taken part in F1 Fantasy Leagues. The problem is that they've come and gone and each seemed to have a variety of issues; generally around the scoring or transfer systems.
During the current 2015 season I decided that I wanted to take a stab at creating a system to use for next years season. A personal project with a deadline! Oh my.
The objective is to create a system which the players have to balance two goals:
1) increase their teams bankroll
2) have their selected drivers earn as many championship points as possible
To explain the bankroll idea; at the start of the season each player will be given X millions of in-game dollars. Up until qualifying of each race weekend players are able to select the two drivers who will make up their team for the weekend. After the race the value of each driver is re-evaluated based on their performance in qualifying and the race (with qualifying result having a lesser weight).
The resulting value of the player's selected drivers (in addition to any left over money from their bankroll) becomes the player's new bankroll going into the next race weekend.
Secondary to simply trying to predict which drivers are currently under valued the players will need to be selecting drivers who will be scoring points in the Formula 1 drivers championship.
It will be the combination of these two goals which the players will need to balance. Do you select drivers who you think have the best chance of gaining in value, even though they may not be winning big championship points?
I've already made progress on the system I'll use to collect results and the logic behind updating driver values.
Here's an example (the change column displays the change in driver value from the most recent round at Silverstone):
I'm still tweaking the value logic, as it appears that it is rewarding the lower drivers too much and punishing the higher drivers too hard. I'm already exempting drivers from having their value adjusted after a DNF.
With the basics of the backend up and running my initial instinct was to put together a simple php based web front end for the users to manage their teams and display the results. However it dawned on me that this is the perfect opportunity to mess around with Flask; a python based web framework. I've had this on my radar for a while now and it seemed silly to switch languages between front and backend, when I'm sure at some stage there will be code cross over.
My progress on this front has been pretty rapid. I've set up a dev environment;
An Ubuntu 14.04 server running in a VirtualBox VM
Postgres for the DB
I used Flask-Appbuilder to kickstart everything, very impressed
I've then built a setup.py which allowed me to get all the python modules required by the backend installed
Next up I'll get the backend running in this environment. I plan on hacking together a script which will take information from f1calendar.com to build a schedule of cron jobs so the system will automatically collect the results after each race weekend. This weekend's Hungarian GP will be a great test of this.
Once I've got some data in my dev environment database I'll then work on setting up views to display the results of each round and the changes in values of the drivers.
After that it'll be done to working on the system the users will use to select drivers for each round. My idea is to allow users to make changes to their teams before every round (obviously limited by their current team bankroll). Then it'll be a matter of balancing how much each player has as an opening bankroll.