Page 1 of 1

Fantasy Haxball Point Calculator

PostPosted: January 2nd, 2015, 10:46 am
by saviola
Hi,

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. :D 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?

Re: Fantasy Haxball Point Calculator

PostPosted: January 2nd, 2015, 11:45 am
by Jai
did you watch eastenders last night

Re: Fantasy Haxball Point Calculator

PostPosted: January 2nd, 2015, 3:25 pm
by Ron
Very nice idea Saviola :cheers:

Re: Fantasy Haxball Point Calculator

PostPosted: January 2nd, 2015, 4:25 pm
by mlfaijati
If I could rep you I would

Re: Fantasy Haxball Point Calculator

PostPosted: January 3rd, 2015, 12:31 am
by Tanzim
gd job :thumbup:


also is dere a english translation of ur thesis????

EDIT: WTF whats difference between proejct thesis nd bachelors thesis????

Re: Fantasy Haxball Point Calculator

PostPosted: January 3rd, 2015, 10:52 am
by saviola
Thanks for your comments!

After talking to MrP, I added a button to copy the line-ups from the first to the second half, and (hopefully) correctly implemented the "X per 2 goals scored / conceded" rules.

Tanzim wrote:also is dere a english translation of ur thesis????

EDIT: WTF whats difference between proejct thesis nd bachelors thesis????


Unfortunately, there is no translation of my project thesis (should have written it in English in the first place, as I did with my bachelor's thesis).

As to difference between the two: in our curriculum, we have to do a "project" before our bachelor's thesis. It's more pratical overall, involving more programming and less theory / writing, and most people use it to prepare for their bachelor's thesis (as did I). The project thesis is basically a documentation of what you did during the project, a little less scientific than the bachelor's thesis.

Team of the Week image generator

PostPosted: March 6th, 2015, 2:05 pm
by saviola
Hello again,

I came up with another script, after MrP told me through how many steps he has to go each time he creates the "team of the week" image:

http://s1.saviola.de/fhpc/totw/

The idea is to enter the links to the players' page on the FM site, and the script then loads player name, team name and team colors from the FM site (just took some of the CSS/JS code that is used to display team colors on the FM site) and overlay the information on an emtpy "team of the week" image. Team names (in case abbreviations are desired) and players' points can then be changed / set, and a screenshot can be taken of the result.

Hope this helps.

Re: Fantasy Haxball Point Calculator

PostPosted: March 6th, 2015, 5:03 pm
by MrP
thank u soooo much! :thumbup: