suggestions

Forum > Suggestions > Documentation
Reply To Thread (login)
Alan [80]
2010-12-19 13:54:58 🔗
[14 years, 9 days ago]

Average Level?

Total exp / total players
Put that in your level array or whatever.
:)


 
Ender [5]
Administrator
2010-12-19 14:34:59 🔗
[14 years, 9 days ago]

I can't compute this very easily, believe it or not. Your level isn't actually stored in the database, only the amount of experience you have.

So while I could scan the entire database (not out of the question, some of the stats already do this), convert each exp value to a level, and take the average of that, I'm going to try to keep the stats to things that can be computed within the database for now.

And I don't think converting average exp to a level is the same as average level.


 
Alan [80]
2010-12-19 16:55:37 🔗
[14 years, 9 days ago]

Don't you have a function getting peoples levels?
get_level(10000); // exp

Why wouldn't avg exp equal avg level?


 
Alan [80]
2010-12-19 16:57:56 🔗
[14 years, 9 days ago]

What about...
$get = mysql_fetch_array(mysql_query("SELECT get_level(AVG(exp)) as `avglevel` FROM `users`"));

echo $get['avglevel'];

\o/


 
Emanuel [41]
2010-12-19 17:09:33 🔗
[14 years, 9 days ago]

This won't work, and this is why:

A level 2 bot has 390 xp, a level 100 bot has 762,677,619 xp. Their average level is of course 51, while their average xp is 381,339,004.5, which is equal to a level 90 bot.


 
Alan [80]
2010-12-19 17:21:39 🔗
[14 years, 9 days ago]

SELECT AVG("SELECT get_level(exp) as `lvl` FROM `user`") as `finallvl` FROM `users`");
echo $get['finallvl'];

?


 
Ender [5]
Administrator
2010-12-19 17:50:39 🔗
[14 years, 9 days ago]

I suppose I could implement get_level() as a MySQL UDF, but this would be pretty low priority. I'm mostly focusing on bug fixes and major features at the moment.


 
Alan [80]
2010-12-19 18:08:30 🔗
[14 years, 9 days ago]

I'm not expecting it today or nothing endy poo. :)


 
MrChad [67]
2010-12-19 23:33:19 🔗
[14 years, 9 days ago]

How about something like "Most online"?


 
Alan [31]
2010-12-19 23:43:39 🔗
[14 years, 9 days ago]

To much work says Ender.


 
Forum > Suggestions > Documentation
Reply To Thread (login)