Logarithmic Score Graphs

Moderator: keyser

Logarithmic Score Graphs

Postby everywhere116 » 28 Jul 2016, 00:24

I don;t know whether it would be better to put it here or on the beta balance forum, but I'll put it here until it gets moved.

Is there a way to change the end-of-game score graphs from a linear scale to a logarithmic scale? The point of the graph is to see how each player has done in the game so far compared to the other players at any point in the game. However, the score for each player increases exponentially, not linearly, so if the game goes long enough that players are racking up 300k points or more then the graph becomes so compressed that you can't tell each player's scoreline apart from everyone else's at the beginning of the game where the differences in player score my be a couple hundred or a couple thousand points. All of the lines just merge together into one blob at the beginning and the only useful information is to determine who ran away with score in the game at the end, and can't see who contributed the most early on. The colored background showing the ratio of each player's score relative to time helps, but it can be hard to see who has more when the players are close in score. It also isn't ordered.

I believe this can be fixed by changing the score screen from a linear graph to a logarithmic graph, where each successive unit of height represents a ten-fold increase in score. This type of graph would still show how each player's score increased over time but would also better show how each player's score relates to every other player's score at the beginning of the match as well,where the differences are much smaller.

I realize that many people here don't even look at that screen, but I think it can be a small thing to do to improve the experience for people who do, such as myself.
everywhere116
Avatar-of-War
 
Posts: 134
Joined: 04 Oct 2015, 08:24
Has liked: 0 time
Been liked: 53 times
FAF User Name: everywhere116

Re: Logarithmic Score Graphs

Postby nine2 » 28 Jul 2016, 03:49

I don't like logarithmic graphs at all but if it was optional sounds nice
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Logarithmic Score Graphs

Postby Androish » 28 Jul 2016, 04:17

As a toggle this is a great idea!
Androish
Avatar-of-War
 
Posts: 115
Joined: 18 Mar 2013, 23:40
Has liked: 9 times
Been liked: 14 times
FAF User Name: Androish

Re: Logarithmic Score Graphs

Postby Crotalus » 28 Jul 2016, 13:21

Code for the score graphs is here:
https://github.com/FAForever/fa/blob/de ... tstats.lua

A single lua file with code that need a makeover. Anyone should be able to do this, it's a very trivial thing to do, only needs time / motivation and almost no skill except some basic programming knowledge.
Crotalus
Priest
 
Posts: 319
Joined: 27 Jan 2013, 20:37
Has liked: 2 times
Been liked: 102 times
FAF User Name: Crotalus

Re: Logarithmic Score Graphs

Postby Morax » 29 Jul 2016, 20:34

Tis a pretty good idea 8-)
Maps and Modifications Councilor

M&M Discord Channel

Come join us and help create content with the artists of FAF.
User avatar
Morax
Councillor - Maps and Mods
 
Posts: 2865
Joined: 25 Jul 2014, 18:00
Has liked: 1167 times
Been liked: 662 times
FAF User Name: Morax

Re: Logarithmic Score Graphs

Postby everywhere116 » 29 Jul 2016, 20:46

I took a look at the code Crotalus linked, while I am no LUA expert the program seems to draw the graph by dividing the x axis into tiny chunks called periodes (spelling? The code always spelled it like this.) and calculating the change in the y variable for every periode based on the score table. The code that seemed the most relevent seemed to be here:

Code: Select all
-- prepare the data, calculate the ya=start y position and the yb=end position of the ligne for each player for this periode
         for index, dat in player do
            if periode==1 then val=0 else val=return_value(periode-1,dat.index,path) end
            ya=parent.Top() +y2 - val*factor
            local val=return_value(periode,dat.index,path)
            yb=parent.Top() +y2  - val*factor

            -- put all the data in this table
            line[dat.index]={grp=grp,ya=ya,yb=yb,y=ya,  -- note: y is the current position for this graph; the x is commun to all graph
               color=dat.color,index=dat.index,
               y_factor=(yb-ya)/dist*size} -- important: the factor of deplacement for the bitmap
         end


ya and yb are the values of y at the beginning of each periode and the end of each periode respectively. If a math.log fuction was placed around each of the equations defining ya and yb that should make the graph logarithmic. So for ya the equation would be ya=math.log(parent.Top() +y2 - val*factor ), and the yb equation would be yb=math.log(parent.Top() +y2 - val*factor).

The only problem with this is that A) Changing it like this and at this step would also change how every single other graph is represented as well, some of which I would want represented with a linear graph the way they are now and B) It won't change the maximum height of the graph, which I haven't figured out how to do yet. Or even where it is defined. Hopefully someone more experienced with this can look it over and help, this is my first time messing with the programming of the game.
everywhere116
Avatar-of-War
 
Posts: 134
Joined: 04 Oct 2015, 08:24
Has liked: 0 time
Been liked: 53 times
FAF User Name: everywhere116

Re: Logarithmic Score Graphs

Postby Mot » 01 Aug 2016, 20:38

interesting idea. hopefully someone will look further into it.
Mot
Avatar-of-War
 
Posts: 64
Joined: 22 Feb 2015, 21:50
Has liked: 2 times
Been liked: 3 times
FAF User Name: MayorDamage

Re: Logarithmic Score Graphs

Postby everywhere116 » 05 Aug 2016, 08:17

Well, I was able to get it to work, but turning it into a logarithmic graph didn't have the effect that I envisioned, so I had to scrap it. But once I learned how to do that making other alterations to the score screen was easy, and I found the answer: Roots. Specifically the 4th or 5th root which seemed to work best. I tested both of them on a game I thought was pretty representative. Observe:

Normal Scoreboard:
Image

4th Root:
Image

5th Root:
Image


I couldn't really decide between using the 4th or 5th roots for this, so I decided to make a mod for each of them. I have put them both in this post. Obviously, they conflict with each other.
Attachments
EasyScore - 5th Root.zip
(5.7 KiB) Downloaded 115 times
EasyScore - 4th Root.zip
(5.7 KiB) Downloaded 119 times
everywhere116
Avatar-of-War
 
Posts: 134
Joined: 04 Oct 2015, 08:24
Has liked: 0 time
Been liked: 53 times
FAF User Name: everywhere116

Re: Logarithmic Score Graphs

Postby nine2 » 05 Aug 2016, 13:59

Nice work. Isn't the real solution just to keep it normal but allow zoom?
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Logarithmic Score Graphs

Postby KeyBlue » 05 Aug 2016, 14:28

If zoom is too difficult, maybe you could have tabs for different time periods?
So you would have an extra graph for first 10min, 20,30,45,60 or something.


The main downside i see with your mod is that you can't have multiple representations.
Standard, 4th root, 5th root are mutually exclusive.

It would probably be easy to make extra tabs? (unless this is unmoddable code?)
So you get
Standard - Chart - Standard Graph - 4th root graph - 5th root graph - Dual
or
Standard - Chart - Full Graph - 10min graph -20min graph - ... - Dual


Or what would be even better could be the possibilty to chose the interval you want. So you can set it for example from 10min to 20min.
Combine that with the standard graph and a root graph (also give choice of root (maybe with root 4 as standard)).
This could give you a lot of ways to examine the outcome of a match.
This way you could zoom in to specific intervals and see how you did during different parts of the game. If you were able to keep up/catch up/get a lead.


I just had a moment of creativity, so to be clear: these are mere suggestions.

PS: you can pm me, if you're planning on improving it and want some help. It looks like an interesting project. (some lua exp, no modding exp)
User avatar
KeyBlue
Priest
 
Posts: 403
Joined: 28 Jan 2016, 01:06
Has liked: 140 times
Been liked: 93 times
FAF User Name: KeyBlue

Next

Return to FAF Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest