Latest Posts

Topic: Rating system

einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1082
Ranking
One Elder of Players
Location: Poland
Posted at: 2019-09-01, 19:45

Tabs can be imitated by different pages face-grin.png , or loading on user demand. Frontend and API for that can be done in the future. No worries. face-smile.png

Hope your branch will be soon available on widelands alpha site (@kapputnik, is it possible to test it there? Can you remember link to that page?)

But I have a question: how input is sent to the ranking engine? Do you have proper page or so? face-smile.png

EDIT: by imitating tabs, go to your profile page here, in Widelands: https://www.widelands.org/profile/ . You will see tabs, but all of them are just different pages, reloaded on user needs. So they are not "real" tabs. That is the easiest solution for making tabs. face-wink.png

Edited: 2019-09-01, 19:50

einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1761
Ranking
One Elder of Players
Location: Germany
Posted at: 2019-09-01, 21:37

The tables for 'Ratio Score' and 'Glicko Score' can be side by side i think. But i am a bit confused about why we need two different calculations here. Or is this just for a comparison and in the end there will be only one Score system? (Sorry if i didn't read or remember each post in this thread which may explains the need of two systems)

Of course we can, and surely should, test this on alpha face-smile.png


Top Quote
trimard
Joined: 2009-03-05, 22:40
Posts: 194
Ranking
Widelands-Forum-Junkie
Location: Paris
Posted at: 2019-09-01, 22:07

Hope your branch will be soon available on widelands alpha site (@kapputnik, is it possible to test it there? Can you remember link to that page?)

Huh, that would be cool, although maybe complicated because you need to be admin in order to add games.

But I have a question: how input is sent to the ranking engine? Do you have proper page or so? face-smile.png

Proper? What does that mean? I take the request and create from there. Something like:

# data html handling
def process_data_from_html(r):
    results_list = clean_list(r['result'].split(','))
    tribes_list = clean_list(r['tribes'].split(','))
    players_list = clean_list(r['players'].split(','))
    data = {}
    data['participations'] = []

    for num, player in enumerate(players_list):
        print (player, num, tribes_list[num], results_list[0])
        participation = {}
        participation['user'] = player
        participation['team'] = num #to change for bigger team than 1vs1
        participation['submitter'] = False
        participation['tribe'] = type_to_int(tribes_list[num])
        data['participations'].append(participation)

    data['win_team'] = results_list[1] #to change for bigger team than 1vs1
    return data

But I don't use the form directly. I see you guys did that on other modules. Like here:

class ArticleForm(forms.ModelForm):

    summary = forms.CharField(widget=forms.Textarea)

    comment = forms.CharField(required=False)

    content_type = forms.ModelChoiceField(
        queryset=ContentType.objects.all(),
        required=False,
        widget=forms.HiddenInput)
    object_id = forms.IntegerField(required=False,
                                   widget=forms.HiddenInput)

    action = forms.CharField(widget=forms.HiddenInput)

    class Meta:
        model = Article
        exclude = ('creator', 'group', 'created_at', 'last_update')
.......

I guess that's the clean way to do it. I would need to study how that works a bit before implementing. But yes, ultimately, at the very least for code consistency, that's what I should do.

EDIT: by imitating tabs, go to your profile page here, in Widelands: https://www.widelands.org/profile/ . You will see tabs, but all of them are just different pages, reloaded on user needs. So they are not "real" tabs. That is the easiest solution for making tabs. face-wink.png

Yes yes, I see what you mean. You're right, but maybe there is another UI solution?

The tables for 'Ratio Score' and 'Glicko Score' can be side by side i think.

That might be the easiest solution, but I'm afraid people will get confused as to which score is the official one. If we separate the pages, we would redirect the user to the 'glicko rank directly.

Another option could be to merge the two and just put the winrate in the same table. We don't really need a ranking using winrate maybe?

But i am a bit confused about why we need two different calculations here.

At first it was for tests yes.

But, I also see a place for it in the future. Afterall we need to find a place where the winrate is close to 50% for most people. So showing the winrate of most players would be a good indicator if we get closer to our goal or not.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1761
Ranking
One Elder of Players
Location: Germany
Posted at: 2019-09-02, 08:07

The form to enter the values for game can just be done through the admin interface. So you don't have to struggle with forms, because django does it for you. All you need is to create a new file called admin.py and put some small piece of code in it:

from django.contrib import admin
from wlrating.models import PlayerRating

admin.site.register(PlayerRating)

Now the model PlayerRating can be accessed through the admin page. Of course this view can also be adapted to your needs, see https://docs.djangoproject.com/en/1.11/ref/contrib/admin/

This admin view can then be made available to people who have the corresponding permission. We do this e.g. with our news app: Each person who has the permission 'can_add_news' + 'is_staff = True' is able to enter the admin page for the news.


Top Quote
trimard
Joined: 2009-03-05, 22:40
Posts: 194
Ranking
Widelands-Forum-Junkie
Location: Paris
Posted at: 2019-09-02, 17:12

huh. So now I wonder. Should I rather remove the current page I made for adding games? Knowing I already added some more buttons to calculate score etc.

Maybe we could have both, but I'm afraid that would be much more confusing


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1761
Ranking
One Elder of Players
Location: Germany
Posted at: 2019-09-02, 17:26

trimard wrote:

huh. So now I wonder. Should I rather remove the current page I made for adding games? Knowing I already added some more buttons to calculate score etc.

Calculating the score should be done in the save() method of the model, imho. So no need for a button?

Maybe we could have both, but I'm afraid that would be much more confusing

We can have both face-smile.png Access through the admin page is useful for deleting or editing an existing row in the model. F.e. we can't delete a map if we hadn't an admin page for this.

I would suggest to add the admin page and then you can play around with it. But honestly i think using the admin page directly is much easier than adding another view face-smile.png


Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1082
Ranking
One Elder of Players
Location: Poland
Posted at: 2019-09-02, 19:55

kaputtnik wrote:

Calculating the score should be done in the save() method of the model, imho.

For the beggining - yes, but since we want to have more possibilities (examples!):

  • adding new rank system (seasonal, secondaries for any needs, maybe tournaments too)
  • handling / using multiple rank systems at once
  • recalculating any of them on need (button?)

Putting all calculations on save() method would be enough for now, but in the future it would cost us. BUT we don't have to do everything face-wink.png .
The best solution is to create an asynchronous calculations, but it will be quite hard for maintenance (I used celery for that purposes, but I haven't done it on pure server, just on localhost).

Maybe we could have both, but I'm afraid that would be much more confusing

We can have both face-smile.png

I agree - let's make both ways and decide which one will be better face-wink.png . Finally we can stay with the simplest version face-smile.png .

I would suggest to add the admin page and then you can play around with it. But honestly i think using the admin page directly is much easier than adding another view face-smile.png

I agree in 80% of cases. And this is one of them.


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/

Top Quote
trimard
Joined: 2009-03-05, 22:40
Posts: 194
Ranking
Widelands-Forum-Junkie
Location: Paris
Posted at: 2019-09-03, 16:11

For the beggining - yes, but since we want to have more possibilities (examples!): * adding new rank system (seasonal, secondaries for any needs, maybe tournaments too) * handling / using multiple rank systems at once

Yes. I am thinking the simplest system would be to count by group of maybe 10 games. And at each of these 10 games we also update the deviation from all other players. Maybe it will be 20 or 5 or 100, but I think we should keep this system ASAP. And also, it's almost already implemented face-tongue.png

  • recalculating any of them on need (button?)

Yeap, that's why I started building a page in the first place.

We can have both face-smile.png Access through the admin page is useful for deleting or editing an existing row in the model. F.e. we can't delete a map if we hadn't an admin page for this.

I was gonna say to you guys "Yes let's do only the admin page, it'll be great." But after trying to customize a bit the admin panel I realized it might be harder than current solution.

I would like to have the ability to add participant on the same page that I add games. Otherwise it become very tedious.

I tried to override the admin template, and already at the simple stage of making the override works I fail. If anyone has experience with that? I see someone did for the wiki. I tried the exact same method but it doesn't seem to work for me... (putting a file in templates/admin/wlrating/game). I don't want to abandon this solution too fast. If it's a deadend we would have both options, as basic admin is very easy to create, and is indeed useful when no direct access to the db.

The best solution is to create an asynchronous calculations, but it will be quite hard for maintenance

I don't understand the problem here, either we calculate the game by group, easy to integrate, or we use some crontab with a script that tells to calculate every x?

edit: NERVERMIND, I managed to override the wlrating template but not the precise page, weird

Edited: 2019-09-03, 16:54

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1761
Ranking
One Elder of Players
Location: Germany
Posted at: 2019-09-04, 08:00

Don't forget to merge the latest changes in your branch face-smile.png


Top Quote
trimard
Joined: 2009-03-05, 22:40
Posts: 194
Ranking
Widelands-Forum-Junkie
Location: Paris
Posted at: 2019-09-07, 18:16

Ok @Einstein I think your implementation of step 5 works. I added an iteration limit of 15 for both loops (they use iteration of 2 as an example in the paper). And it seems to give coherent results with what the papers face-smile.png .

And after reading it I finally realized that "<--" means "=" in algorithms...

@kaputnik, I will do that after refacto. I don't think anyone else has really the desire to read the code before that anyway :P.

About the arbiter interface

current_status

I now see 3 solutions for the implementation but each has it's own problems:

  • I keep my standard page and use search the request for the data I want. Problem 1: I can't seem to be able to add input dynamically with js. Maybe I could just put directly 8 slots for each games? Widelands doesn't support much more players yet anyway AFAIK. Problem 2: It's kind of dirty in comparison of what was done in other modules, or more precisely, it's not done the same way as the all the other modules

  • I use the form options from django. Problem1: Never used it. And it seems I wont be able to reuse much of my old page Problem2: Can't find data on how to add input dynamically, maybe use same options as problem 1 above?

  • I use the admin page. Same problems as django forms + I can't manage to override the template which is needed for alll that.

Thoughts?

Edited: 2019-09-07, 18:17

Attachment: Screenshot_2019-09-07_18-05-23.png (1013.1 KB)

Top Quote