I like the idea of Fantasy Haxball, and when I read through the rules that are used to determine players' points in a match, I immediately thought: Wouldn't it be awesome to calculate the points automatically? I then asked MrP if they already used some kind of tool or script to automate point calculation, which he denied.
So I sat down over the last couple of weeks and created such a script, the Fantasy Haxball Point Calculator (FHPC).
Here's how it works: First you enter the URL to a game on the FM site. Upon pressing the "Load game" button, the script will then load
- The teams' available players
- The goals scored in the match (with scorer and assister)
The user then has to choose the actual lineups for the teams (because those are not stored on the FM site). And that's all the manual work necessary. When pressing "Calculate points", the rules are applied and the points for each player are calculated.
Here is an example of how that would look. (I know it looks shitty, I'm not a designer. Improved CSS files are always welcome.)
The script is still in an early development stage, and some things are missing / buggy, more specificially, the script
- is generally pretty buggy, feedback is always welcome
- does not implement the "suspension" rule (because it is pretty irrelevant)
- does not implement the "team of the week" rule (because these points are usually awarded at a later stage, so it's probably more realistic that these points are added manually)
- can't handle subbing during halves (i.e., players playing less than a complete half; which luckily doesn't happen too often)
I hope this tool is useful and will reduce the time spent on calculating Fantasy Haxball points in the future. Again: Any feedback is welcome. I don't have any experience with the Fantasy Haxball rules, so I might have applied some of them wrongly.
* Let's talk about the "Per 2 goals conceded / scored" rules. There are basically three distinct cases for this rule: a.) a player plays on the same position throughout the game. No problem, rule can be applied easily. b.) a player plays on different positions in the first and second half, and b.1) there is an even number of goals in each half. Each half can be calculated separatedly for the position the player played on (is that how it is done? or is only the first / main position used?), or b.2) there is an uneven number of goals in both halves (i.e. one goal conceded / scored in the first half and one in the second). Will these simply be ignored? Will they be added and calculated using the first / main position?