Closed maziluradu closed 1 year ago
@maziluradu thank you for the detailed report.
That is WAI. In other words "SavedGameSelected" status and null ISavedGameMetadata means that user tapped "+" button (create new). "SavedGameSelected" status and non null ISavedGameMetadata means that user selected existing saved game. Sorry that the documentation doesn't state this explicitly.
Reasoning:
@smile616 Could you please provide an example of how we can create a saved game with the most recent plugin version? I have tried creating a class which implements the ISavedGameMetadata interface, however I get an error in the console stating that the saved game was not created by the current client.
@maziluradu Please take a look at the README.md:
you need to open a saved game using savedGameClient.OpenWithAutomaticConflictResolution or savedGameClient.OpenWithManualConflictResolution. See: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/README.md#opening-a-saved-game This will create a new saved game if it didn't exist.
you need to write the game state. See https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/README.md#writing-a-saved-game
@smile616 Thank you very much for the explanation. It felt a bit confusing at first, thought creating a new save would create an ISavedGameMetadata with a blank state.
I finally got it to work; however, when using CommitUpdate, it always closes the saved game, and I need to reopen it right after. Is this the intended behavior? I would also like to save the game when some critical change is being done, not only when the application closes.
@smile616 Yes, it's intentional to close the saved game with CommitUpdate.
Ideally game should open the saved game right before it intends to update the saved state and call CommitUpdate right after the update. Your example "when some critical change is being done" fit that case. Other common case would be update saved state on user's demand.
Please note: if game is closed before it had a chance to call the CommitUpdate, the saved state will be lost.
Describe the bug I am using PlayGamesPlatform.Instance.SavedGame.ShowSelectSavedGameUI() in order to create a new game save for the player. The app compiles just fine, the authentication works. The player can see the menu for selecting an existing saved game or create a new one, but as soon as the "+" icon is pressed nothing happens on the device, the menu gets closed and that's all. After the menu gets closed, the callback returns a "SavedGameSelected" status with a null savedgame.
To Reproduce Steps to reproduce the behavior:
Expected behavior ShowSelectSavedGameUI() should return a valid game save instead of null.
Observed behavior ShowSelectSavedGameUI() returns a null ISavedGameMetadata
Bug Report https://drive.google.com/file/d/1bP0lzPFdTR5va6uYLZC1sQAeQeDjvfiJ/view?usp=sharing
Versions