firedigger

Gatari clan rating formula draft

Nov 10th, 2017
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. Computation flow:
  2. userID sumbits a score -> recalculate clan rating with that user
  3.  
  4. Input: userID, score_data, map_data
  5. 1) Get clanID
  6. 2) Calculate rating
  7. 3) Save rating to the db
  8.  
  9. Formula:
  10.  
  11. I. By calculation type:
  12. 1) Additive parameters = sum(avg) of individual parameters of the members
  13. 2) Non-additive parameters = non-additive aggregated parameters of the members
  14.  
  15. II. By persistency type:
  16. 1) Persistent bonuses = bonus from tournaments and charts
  17. 2) Score data = inherits the persistency of the score
  18.  
  19. III. By content type:
  20. 1) PP
  21. 2) Top places on maps
  22. 3) (Lifetime?)Charts
  23. 4) Peak rank
  24. 5) Medals(Achievements)
  25. 6) Tournaments
  26. 7) Playcount (any other profile stat)
  27.  
  28. The result score should be balanced over the number of clan members (2-10)
  29.  
  30. Testing clan rating:
  31. 1) A clan with max/min members
  32. 2) A clan with balanced/unbalanced player skill
  33.  
  34. New tables:
  35. 1)clan_permanent_bonus:
  36. clanid,bonus
  37. 2)users_peak_rank:
  38. userid,rank
  39. 3)clan_medals:
  40. clanid, medalid
  41.  
  42. SQL:
  43.  
  44. //ADD peak rank recalculation
  45.  
  46. clanID = executeScalar(select clanid from clan_users where userID = @userID)
  47. score_rating = executeScalar(select 1 rating from users_stats WHERE ID IN (select userid from clan_users where clanid = @clanID))
  48. bonus_rating = executeScalar(select bonus FROM clan_permanent_bonus WHERE clanid = @clanID)
  49. top_scores = execute(select max(pp) pp from scores WHERE userid IN (select userid from clan_users where clanid = @clanID) group by userid order by pp desc).mean()
  50. top_places_rating = execute(select max(difficulty_std) stars, max(pp) pp from scores JOIN beatmaps ON beatmaps.beatmap_md5 = scores.beatmap_md5 WHERE userid IN (select userid from clan_users WHERE clanid = @clanID) GROUP BY scores.beatmap_md5)
  51. peak_ranks = execute(select rank FROM users_peak_rank WHERE userid IN (select userid from clan_users where clanid = @clanID))
  52. peak_ranks_rating = ....
  53. final_rating = w1 * bonus_rating + w2 * top_places_rating + w3 * peak_ranks_rating + w4 * top_score_rating
  54. sql(UPDATE clans SET performance = 0 WHERE clad = @clanid)
  55.  
  56. Medals: custom manual, automatic; non-points, points.
  57.  
  58. Point medals:
  59. 1) tournament(clanwars) places = 1,2,3 places
  60. 2) CLAN charts places
  61. Non-points medals:
  62. any shit
  63.  
  64. Medals are vulnurable to clan switch abuse.
Advertisement
Add Comment
Please, Sign In to add comment