Taken from NUMA's released source:
Code: Select all
map.rating = (map.rating * map.votes + rating) / (map.votes + delta)
map.votes += delta
map.rated = (map.votes >= Map.RATING_THRESHOLD)
new_bar = None if not map.rated else min(int(round(map.rating)), 4)
map.float_num += delta * Map.FLOAT_DELTAS[rating]
1: Adds the new vote to average in with the map's current rating.
2: Delta's almost always one, so all this does is increase the map's vote count by one.
3: Determines whether or not the map has a public rating based on Map.RATING_THRESHOLD, which is five.
4: Sets those ninja guys, 1-5. Basically takes a rating like 3.6_ and turns it into 4.
And now, for the magic line (the theory is by b_t, if I'm not mistaken):
5: This spectacular line is what arranges the maps on the hot maps page. The float_num starts off as the map's ID (i.e. 150000, mintnut is well cool :3). Every time someone votes, it alters this float_num by a certain amount. Based on Arachnid's release of the source, the alterations are as follows:
RATE, CHANGE
0, -2
1, -1
2, 0
3, 0
4, 1
5, 2
The maps are then listed by this float_num, descending. So say you rate a map 5... In a controlled environment where no other rates are going on, the map will appear before (above) the next 1 or 2 (I haven't read the maps listing enough to tell which) map(s) that are posted. Therefore maps that receive fifty 5's end up staying up much, much longer.
Blackson's idea for a limit could be implemented as such (change line 5):
Code: Select all
map.float_num += (delta * Map.FLOAT_DELTAS[rating]) if map.votes < Map.FLOAT_LIMIT else 0
Where Map.FLOAT_LIMIT is a number determining the amount of votes that affect a map's float_num. This, of course, might end up being a detriment to a map's overall stance, but if FLOAT_LIMIT were high enough, it wouldn't matter; if a map is getting more than 20 votes, it obviously has stayed on the hot maps for more than enough time as it has received its fair share of attention.
Anywho... I dunno if the hot maps has been explained before, but here it is again, and the possible limit that blackson was talking about.
My two cents :3