Retrieve Files stored on Cloud Save according to criteria

I am making a racing game as solo dev, am only self taught “kinda newb” coder.
Game runs smooth so far, but it’s all local device storage for now. I want to start moving things online, but am pretty unexperienced with it.
I can save and retrieve player status from CloudSave ok.

Next step would be, have a repository of ghost saves on the server.
When a player completes a race, a ghost file (10-20kB) is produced, which I plan to store on Cloud save. There’s always some thousand of these files stored.
I can save them to CloudSave, but struggle to retrieve individual files according to criteria.

When a player starts a race, I want to load 3 of these files according to criteria set by the player (e.g. similar time like his best, not the same car like him, same team etc…). The criteria can be picked from the file name strings only, no need to open the files.
I want the client to send some criteria, and the server to return 3 random files matching those criteria.

Easy to do on local storage, but I don’t know how to do this on “the Cloud”.

What is a clever approach to do this with Unity?
Is it possible to have a CloudCode script accessing the CloudSave files, chosing the files and returning the chosen ones to the player?

  • if yes, how is that roughly done??
  • if no, what’s a good approach? Some database tracking the stored files? Sending list of files to client and chosing there which ones to load??

I’m a pretty lost here, and would appreciate any hint.

1 Like

Hi @Pflosch, From your description, it sounds like you should check out the Cloud Save querying option Cloud Save Queries to see if that will fit your use case. You should be able to save your “file”/ record/ data with additional fields that can be indexed and queried. Combined with Cloud Code, you can then query and access other player’s ghost saves.