Getting the position of a key in an OrderedDataStore

I would like to see this be implemented.

It is still currently impossible to do a hiscores like this with the current ordered data store. This feature is present in hundreds of other games and apps; encouraging competition between friends, or periodically checking your ranks as they climb, setting milestones to get within 100k, 10k, 1k, and top 10 etc.

I’d love to have the ability to do this in my game with datastores. OrderedDataStore:GetPosition(key) or the OP’s suggestion would be awesome!

image

(from bee swarm simulator:)

Corecii explains the current limitation here: OrderedDataStore get ranking? - #5 by Corecii

9 Likes

I want to show players their rank, not just their score.

OrderedDataStore:GetOrderIndex(bool isAscending, string key)

As a Roblox developer, it is currently impossible to get the order depth that a key is sorted in an OrderedDataStore.

If Roblox is able to address this issue, it would improve my game by showing players what rank they are on a leaderboard.

Example: Players play a game and earn points. Each player’s score is saved in an OrderedDataStore. The game can currently display the top ranked players on a leaderboard by using GetSortedAsync(). I also want to display to any user their rank so that they can watch as they progress or see where they stand.

10 Likes

@VitalWinter I do like this implementation adding the ascending bool, good addition for sure.

2 Likes

This feature would still be mega useful.

2 Likes

This is still missing in the API, and we’d find it incredibly useful in SCP: Roleplay. One of our roadmap goals is to implement a detailed list of stats per player, so that they can get information such as their total quests completed and how far off they are from the top of the leaderboard. Another scenario where we might need this is if we implement monthly events, with position-based rewards. A lot of popular outside-roblox games have this, and it’s kind of a bummer that Roblox does not have it (it’s impossible as it is right now for any popular game).

I’d really be looking forwards for something like this. Having to rely on an external database for data saving is not exactly ideal and having this implemented in Roblox itself would be the best way to go.

13 Likes

It seems like a pretty useful, and obvious method that should already have been thought of being implemented with the push of ordered data stores(also i don’t think it’d take an intern more than a few hours to implement either). Practical uses for such would be displaying individual ranks without the use of external databases.

4 Likes

This would be very useful, it should come as a feature and stop developers having to max out requests searching pages

As a Roblox developer, it is currently too hard/extremely inefficient to find the position of a certain key in an OrderedDataStore. Right now, you would need to use a for loop to go through every single key top to bottom until you reach the desired key, and then use the loop’s index variable for the position.

Something like :GetPositionAsync() would be extremely useful for stuff like say a global rank display, that tells the player what rank they are without being near the top.

16 Likes

Support, however maybe to lessen DataStore requests, it would be better if we had a GetAsync function that returned the value and the position, e.g:

local Value, Position = OrderedDataStore:GetAsync(Key)
19 Likes

Many developers still need this feature; we have to resort to third party services for this. Here is an explanation of the current limitations: OrderedDataStore get ranking? - #5 by Corecii

The importance of knowing where you are on the board is incredibly important for player retention and feelings of progress.

8 Likes

As a developer, getting the rank of a key is a core feature and expected functionality of OrderedDataStore.

8 Likes

This is essential for the experience I am building in which global leaderboards are a key part of the experience. I implore Roblox adds this functionality as soon as possible.

4 Likes

Given that DataStores are getting updated and changed frequently now (and especially with the Addition of MemoryStore,) I decided it would be okay to revive this topic instead of just hearting a comment.

As a Roblox Developer, I find that this feature is very useful, and would help improve my experience a lot as it gives other players an understanding of where they stand.

We have not gotten a response related to this feature, it would be neat if an implementation like VitalWinter’s was added.

3 Likes

This is long overdue, many games outside of Roblox utilize this.
I’d like to see a response/update to this, as this is very difficult to implement currently.

3 Likes

Working on a module for this as it’d be useful to my needs as well, releasing in a couple of hours.

I’ve been working on a Datastore system for in-game analytics tracking and came across various methods as to retrieving a position or page of an entry containing data. Sorry for the revival, but if one doesn’t do it, another must.

Edit: My version can be found here

2 Likes

just what i needed. thanks, also epic revive…

1 Like

This is so crucial. It would simplify our job and reduce amount of requests being made to roblox’s servers since we’d only need one. Since clearly many people are already implementing some sort of loop to try and find a certain user’s rank, I can’t imagine large scale server health with all this load.

Not to mention that the for loop has to be made in a linear scaling algorithm. Binary search or other better searching algorithms can’t be used as we can only iterate through 1 page at a time. It would also be nice for OrderedDataStores have basic paging information that things like Spring Boot for java has. So, whenever you made a request you knew what page you were in, how many pages there are and be able to request one of those pages at any given moment.

Again, I don’t know how Roblox implemented the OrderedDataStores, but this shouldn’t be difficult

3 Likes

Vouch for this being a feature. It would save a load of development time and definitely make competitive games better. Tracking a player’s position in the ranking system is a crucial feature for player engagement, and right now the only way it’s possible at large and reliable scale, is externally.

2 Likes

bumbity, bumpy.
devs be getting jumpy