question

Gokalp Cevik avatar image
Gokalp Cevik asked

Best approach for a city-builder?

We are developing a very early prototype of a small city-builder.Now, as back-end this is the first time we are using PlayFab but it's been really nice.Before this thing is no longer a prototype i would want to know what's the best approach for these situations?

a)Game has a store for buildings and players can buy buildings with VC and place them in the world.Where should i store what building was placed where?(I'm thinking i set up buildings as Items and in custom data i set their positions and rotations,population factors. etc. And from there each user can change the item's position and rotation when they place their buildings.)

b)Where should i store the player's info(Experience,City Population etc.)?I'm assuming should be in UserReadOnlyData and i should only set them through CloudScript.

Thanks.

Player DatadataPlayer Inventory
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

·
Seth Du avatar image
Seth Du answered

    1. There are many ways and the common methods will be these two: 1. Store the detailed location information in inventory item instances’ custom data via UpdateUserInventoryItemCustomData API calls; 2. Store the item ID along with location information in an object list as JSON data in Player ReadOnly Data. I will suggest using the later one for those frequent-changing data like position, location because it will be more convenient to manage. You can set the verification functions on both client side and server side(Cloud Script) to avoid improper settings from the players.

    However, in terms of some less-changing data, like self-properties of a building, you can use the first method. Meanwhile, in terms of static data, which will never change in the game play, you can define it in the item definition in Catalog and it is also the custom data.

    2. Yes, you are on the right track. Player Read-Only data is the best place to store those data.

    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.

    Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]