question

pixeljump avatar image
pixeljump asked

After a bit of guidance concerning a server and Playfab.

The last game I released utilitied both Playfab and a server+database on the side. I would LOVE to avoid that if at all possible and just stick with Playfab.

Now... players will be able to create their own levels which can be string compressed to about 100 bytes each. Sure, I can store these levels on player data but it seems like it would be a problem to filter these in cloud script. For example, if I wanted to present the most recent levels created to players would this even be possible?

If the answer is that I need a server, is there any downside to using cloudscript as a proxy authentication? Client -> cloud script -> http request to server. Is there a better way?

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

·
Citrus Yan avatar image
Citrus Yan answered

Hi,

>> if I wanted to present the most recent levels created to players would this even be possible?

It’s possible, however, I need to confirm something with you first. How many levels can one player create totally? Or is it limitless? If the number of levels is limited, for like 50, then it would need about 5000 bytes to store all the levels. The Player Data value size by default is 10000 bytes (you can customize it later on), hence you can totally save the data of all the levels in JSON format as the value of the key “PlayerLevels” in Player Data. Then in Cloud Script, parse that data to determine the most recent levels and return them.

Keeping the data as an object in the title player account entity is also a feasible way: Entity Objects

3 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.

pixeljump avatar image pixeljump commented ·

When I say the most recent levels created to players, I don't mean that specific players levels, I mean worldwide. So it'd need to scan all players data to find the most recent. Does this change the feasibility?

It'd be cool if cloudscript had access to a stateful list or something. Not sure of the complexity/price implications of such a thing though.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan pixeljump commented ·

So, every player creates their own levels in their own player data and then scans these players to find the most recent. This is problematic since iterating across all the players would surely hit our service with far more calls that are allowed by our Terms of Service. A better way to do this would be via the "Client -> cloud script -> Http request to server" flow you suggested. Cloud Script can be used in conjunction with virtually anything, not to mention as a proxy authentication.

0 Likes 0 ·
pixeljump avatar image pixeljump Citrus Yan commented ·

Just as I suspected. Was just wanting to make sure I wasn't missing some super-secret strategy or something. It would be very cool if we were given access to a small amount of memory for stateful data though, it'd solve a lot of issues which require servers I'd say.

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.