question

attractstudios avatar image
attractstudios asked

Multiple entries per player on the same Leaderboard

Hi,

in my game players should be able to design multiple(maybe 3-6 or so) "maps" and save them serverside to make them accessible for other players. Each map's difficulty value should be stored in a leaderboard so that players can find maps on a specific level of difficulty.

I thought about creating one character per map because I think that is the only possibility to have multiple entries in the same leaderboard from one player. The details for the map could easily be stored in the characters key-value pairs.

1. Is this a possible and/or good way to do this?

2. I read somewhere that the limit on characters per player is 10. Is this still so?

Another problem is that there is no call that would give me part of the character leaderboard around a given statistic value. If I'm wrong please tell me. So I'm thinking about a workaround to get a similar result.

3. If I would use the call GetCharacterLeaderboard, then I would need to know the position in the leaderboard that has the value I'm searching for. I could make multiple calls to slowly find my way to the value, but that would get less practical with large numbers of players.

4. If I would use the call GetLeaderboardAroundCharacter, I thought about having an extra character per player with the statistic value that I want to find, but this would have the disadvantage, that the result I am getting back, would include real maps and also these "false" maps that indicate other players difficulty values. As long as there aren't too many "false" maps close together, I could work around that, but since this is not guaranteed this could be an issue.

I also thought about giving the extra character another Type than the maps. Let's say maps are from type "0" and the extra ones are type "1". Then I could specify the type on GetLeaderboardAroundCharacter to only get the maps. This doesn't work though.

I tried to GetLeaderboardAroundCharacter with the CharacterId of the type "1" character and the CharacterType of "0".

I mean this doesn't crash, but the result is a bit weird. But I don't think this helps me anyway.

Maybe there is another way of doing what I want that I haven't considered yet?

5. One last Question, why is the CharacterId required on the GetCharacterLeaderboard call?

For me, it seems like it would never impact the result. Throughout my testing, I figured out that this id doesn't even need to be real, which means you could use just always "123".

Thanks in advance for your answer.

Leaderboards and StatisticsCharacters
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Andy avatar image
Andy answered

I think you're running into the limits of the leaderboard system's ability to work as a stand-in for an ordered collection of user generated content. Even if you worked around your current set of problems, I bet you'd encounter more just around the corner. I don't think you're going to be able to get away from storing your collection in something like a database.

Also, thanks for pointing out the weirdness with GetCharacterLeaderboard and its CharacterId parameter. That's looks like a bug.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

attractstudios avatar image attractstudios commented ·

Thanks for your answer.

I'm am going to think about using a database.

0 Likes 0 ·
attractstudios avatar image attractstudios attractstudios commented ·

I was thinking about another alternative. Since each player would have at least one map anyway, I could just:

1. update the statistic value of one map character to the value I'm looking for

2. get the leaderboard around that updated character

3. update the stat back to where it was before

I tested this and it worked.

One problem could be, that when it would crash before updating the stat back to the original value that the data is lost.

Another problem is that, for a split second that another player could find the map with the wrong statistic value, but this case should be very rare and the impact on the gameplay not that bad either.

I think both of these problems are not too bad and this would be much easier for me to implement than an external database.

What do you think about this approach?

0 Likes 0 ·
Andy avatar image Andy ♦♦ attractstudios commented ·

I think it partially works around the immediate problems with the caveat that you mentioned (that will become a larger problem as you gain more players). It might be acceptable for the near term, but I'd flag it for revision in the future when you have the time.

I've made a note to talk to our economy team to see what their plans are regarding User Generated Content. Hopefully we have a better solution available for you before you need it.

0 Likes 0 ·
attractstudios avatar image attractstudios commented ·

Ok, thanks.

As you suggested I will go for this solution for the time being and keep an eye open for a better alternative in the future.

If there will be any updates or plans regarding User Generated Content I would like to know.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.