question

joaovalentini avatar image
joaovalentini asked

Storing and Getting Data

Hi,

In my game players can create maps (place objects, enemies, ...) and they can play on these maps with their friends, so I have some questions:

1 - Whats the best way to store the map data?

2 - How can I get a list of all the maps created? so players can play on other players creations

3 - It's a turn-based game and a map can be played in multiple sessions, basically I need to save the game state like every second when they are playing. Can I achieve this with Playfab or a SQL server is my best option?

Thanks!

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

·
brendan avatar image
brendan answered

1. It depends on a number of factors, like the size of the data and the frequency of updates and reads. In general, I'd probably recommend Entity File storage, but if you have specific requirements, feel free to let us know.

2. This sounds like you mean the list of maps for all players - is that the case? If so, what you want is our User Generated Content system, which is planned to be available in Public Preview in July (PlayFab Roadmap - PlayFab | Microsoft Docs). If you mean just the friends of a player, you could have each player store a list of maps in a metadata record (in User Data, for example), and read it from there.

3. If you mean updating user data every second, for every connected player, that would a) be very expensive, and b) it would exceed the rate limit for data updates, causing you to have a number of errors. Bear in mind that the service costs you generate are specifically based on usage. If you need all players to be able to access the realtime state information for other players, you'd be much better off making this a multiplayer server-based game, and have the players in a session together. Or, if you aren't worried about any clients cheating, you could use the Party service. If this isn't a multiplayer game, why are you trying to save that often? In general, games only periodically save their data to a backend service, when necessary (and they tend to have an immediate save when the player exits).

10 |1200

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

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.