FatFractal customer forums



Author Topic: Advanced leaderboards and positions  (Read 1484 times)

dev

  • Newbie
  • *
  • Posts: 15
    • View Profile
Advanced leaderboards and positions
« on: August 15, 2014, 10:39:28 AM »
Hello,

We want to build a rather advanced leaderboard system on the server-side.

In our game the user plays different hashtags and earn points when they win. The user can create own hashtags and play with them as well.

The user should also be able to see unique leaderboard for each hashtag and find their own position in this leaderboard.

So I guess the collections would look something like this:

Hashtag
name

UserHashtag
user (REF to a FFUser)
points
hashtag (REF to Hashtag)

Can this be done? We realize it can get pretty heavy for the server with a lot of users, especially if you want to find your own position.



jonnycools

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Advanced leaderboards and positions
« Reply #1 on: August 15, 2014, 02:13:57 PM »
Hey you,

So I would have three objects

Hastag
- Name: String
- Plays: Numeric

Play
- Hastag : Ref:Hastag
- Name : String
- User : FFUser

Score
- user : ref: FFUser
- points : numeric

Basically you would create a play object client side with just the name and user filled in. In the create handler you can check if the hash tag exists or not. Then you can associate it with the play before save. You can also increment the pints for the user at that time.

Then you can track trending via the hag object or via the score object depending.

 

Copyright © FatFractal customer forums