Improbable Icon

SpatialOS Forums

How to save and load my game?

How to save and load my game? For example, each player can build buildings. And I built a building(Others were built too). And then I quit and re-login the game. How could I figure out that which building is mine?
I found EntityID, but it changes each time I login the game.
I also searched in UnityClientConnector / WorkerConnector, ConnectionParameters, and many other classes, wish to find some thing I can use, but I found nothing.
I tried to find any ID that belongs to me and never changed during logins, but I found nothing too.
Is there any way that I can put data into my building that can remember which player it belongs to? Important, the ID should not change during each logins.

Hi @Footman

When it comes to persisting ownership between login sessions you can’t rely on EntityIDs generated by SpatialOS as these are not consistent, as you’ve observed. You’ll need to use your own external account system to manage player identity and make the necessary ownership associations when they log back in each time. You can create your own entity component to store this external identifier on any entities that need to record their owner in this way.

Thank you!
I am relieved to know that this road is unreasonable.
And do you have any suggestions about which backend DB should I use?
I’ve heard of PlayFeb, Is that OK?
Is there any tutorial for PlayFab and SpatialOS?

Hi @Footman

PlayFab should be fine. Our Online Services Quickstart Tutorial actually uses PlayFab to demonstrate the integration process so hopefully that will prove useful.

Thanks alot!