question

doronhn avatar image
doronhn asked

Managing Games levels - how to - best practice?

Hey,

Sorry about all the questions lately, you help me a lot!

i am developing mobile puzzle game on unity.

my game has a lot of levels (like 300), each level has few properties (same properties for each level).

properties such as: width, point to complete and etc.

i need few things:

1. get full list of levels - to create World map scene (such as candy crush or any other puzzle game)

2. after the user select level, get the full data of level - to draw this level to the screen.

3. the option to add level in few minutes - Nice to have.

4. if player complete a level, update the player data that holds what is the current level of the player and how much starts for each level.

thanks

Player DataPlayer Inventorygame manager
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. If you mean a static set of data that describes all the levels, and which is used the same way by all users, you could store that in a single key/value pair in Title Data https://api.playfab.com/docs/tutorials#landing-content (this tutorial applies to 1-3).

2. What is "the full data of level"? If it's a small amount of data, you might be able to use Title Data to store blocks of level data. If it's larger data, you could use the Content service, which is our CDN.

3. Whether you're using Title Data or Content, it's trivial to update that data to add a new level, and the update would propagate to all endpoints quickly. With Title Data, it would be minutes. With Content, the TTL for CDN data is one hour. So I would recommend having a "master list" of all the Content in Title Data, and update the filename of the new content data whenever you update it. That way, it's a new file each time, which would be immediately available everywhere.

4. You would use user data. https://api.playfab.com/docs/tutorials/landing-players/using-player-data

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

doronhn avatar image doronhn commented ·

hey,

Thanks brendan for the fast answer.

1. so if i understand you correctly, the best way is to store level data (text properies as a json) and upload it as a title data content.

- thats mean i need to create new title data for each level.

thanks alot!!!

0 Likes 0 ·
franklinchen avatar image franklinchen doronhn commented ·

@Doronhn Just want to emphasize Brendan's second point, please ensure your data size will not exceed the limitation of Title Data, you can find limits for your title under Settings -> Limits in the GameManager. For large data, CDN should be a good choice.

0 Likes 0 ·
doronhn avatar image doronhn franklinchen commented ·

Thanks it wont.

but i have problem with upload my json to the title data.

my json is not key-value its little bit more complex

like:

{

"Width" : 3,

"Height" : 3,

"StartPoint" :

{

"X" : 0,

"Y : 0

}

}

how can i upload that?

0 Likes 0 ·
doronhn avatar image doronhn commented ·

Thanks it wont.

but i have problem with upload my json to the title data.

my json is not key-value its little bit more complex

like:

{

"Width" : 3,

"Height" : 3,

"StartPoint" :

{

"X" : 0,

"Y : 0

}

}

how can i upload that?

0 Likes 0 ·
franklinchen avatar image franklinchen doronhn commented ·

@Doronhn If it's a valid Json string, it's supported to be uploaded or set to Title data, for example, I just set a unique key for each game level:

Could you please explain more about your problem?

0 Likes 0 ·
doronhn avatar image doronhn franklinchen commented ·

dont know what was the issue, but its working now.

thanks

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.