Forum

> > CS2D > General > The ranking system of CS2D
Forums overviewCS2D overviewGeneral overviewLog in to reply

English The ranking system of CS2D

17 replies
To the start Previous 1 Next To the start

old The ranking system of CS2D

Hajt
User Off Offline

Quote
I created a website with a list of the best players on the server but I have no idea how to sort the list in a proper way. So basically I'd like to know how sorting algorithm works for player ranking in Counter-Strike 2D. BTW how often userstats.dat is updated?
edited 2×, last 04.06.16 08:39:44 pm

old Re: The ranking system of CS2D

Yates
Reviewer Off Offline

Quote
Pretty sure it's updated every time something happens which effects it. I don't understand what you mean by sorting it, seeing as it's already sorted the best way possible.

old Re: The ranking system of CS2D

TrialAndError
User Off Offline

Quote
@user Hajt: The ranking goes after the score which is default in cs2d. If you want to make it after kills/deaths or whatever you want to do. You must create your own ranking system.

So basically, It automaticly sorts after the highest score.

@user Yates: I am pretty sure too that it updates after every action that causes it to change.

old Re: The ranking system of CS2D

Yates
Reviewer Off Offline

Quote
It sorts score. This means the total kills, flag captures, successful bomb deployments and defuses. If you want to sort it by for example the k/d ratio then you will have to do that yourself. I normally use data attributes and a little jQuery to create a new array of items and replace the html view.

That stats html of yours is weird. It may not have been updated correctly.

old Re: The ranking system of CS2D

Yates
Reviewer Off Offline

Quote
Very weird. This is something only DC would know the answer to.

The only thing I see by quickly looking at it is that it may be based on average score by time. But I'm pretty sure that's not the case.

old Re: The ranking system of CS2D

Nekomata
User Off Offline

Quote
You can (not self-promotion - okay maybe just a bit) use file cs2d [PHP] Stats:Extract [0.6] to directly parse the stats from userstats.dat There won't be an issue there as userstats.dat properly manages the stats unlike serverstats.html (Reason#1 I removed serverstats.html user ranking parsing).

It's easy to use if you know how to manage/loop arrays in PHP and you have enough data to make your own custom serverstats.html

old Re: The ranking system of CS2D

Nekomata
User Off Offline

Quote
I believed you wanted to sort player rankings by score thus the file I stated would do that for you.
edited 1×, last 03.06.16 10:17:59 pm

old Re: The ranking system of CS2D

DC
Admin Off Offline

Quote
The stats_update setting is for saving/updating all stats files. This includes the internal stat data as well as the HTML output. By default this is done every 5 minutes.

The sorting is NOT simply done by score but by this value which is calculated for each player:
1
sortValue = (score+frags) - deaths

score already contains frags (because killing someone gives you a score point as well). This means each kill is counted twice for the ranking.

old Re: The ranking system of CS2D

Hajt
User Off Offline

Quote
Okay. Thank you for help. Now ranking on my website works correctly. Here is query in SQL language to database if someone will need.
1
SELECT *, (score + kills) - deaths AS sortValue FROM stats ORDER BY sortValue DESC LIMIT 100

old Re: The ranking system of CS2D

Yates
Reviewer Off Offline

Quote
user DC has written
score already contains frags (because killing someone gives you a score point as well). This means each kill is counted twice for the ranking.

Doesn't that seem weird? score - deaths would be enough and make more sense.

old Re: The ranking system of CS2D

DC
Admin Off Offline

Quote
@user Yates: I did it like that to give long time players a higher ranking than short time players. So the ranking is actually not just about how good you are but also about how much time you invest (more or less - of course you still have to do kills otherwise you won't get a better ranking).

e.g.:
long time player: 100 kills, 100 deaths = 100*2 - 100 = 100
short time player: 10 kills, 10 deaths = 10*2 - 10 = 10

with simplified formula (score - deaths) they would have an equal ranking:
long time player: 100 kills, 100 deaths = 0
short time player: 10 kills, 10 deaths = 0
edited 3×, last 11.06.16 03:41:05 pm
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview