We are working on a multiplayer party game about cats . It will be both local and network/online.
I have a simple question about where to store player data over multiple levels (because our game comprises of a series of mini games). We would have thought that the āplayer stateā would have been the ideal place to keep player score (Itās used as an example in the description of player state), but we noticed this data isnāt retained across levels like we need in our genre of game. Does that mean we should be storing player score stats in the āGame instanceā instead to retain it across levels? Also we noticed the āUse seamless travelā checkbox and thought perhaps that would help us hold onto this data, but itās not giving results as expected.
Can anyone give us a little guidance here or point as to a good place to learn more about these particular situations?
I donāt know anything about game states and game modes (great thing when youāre developing a game alone) but I think game mode can work. Why not jsut try it?
In the MP game Iām working on, I use GameModes to set up rules for the current game and all stats are stored in my game state for that game mode. Example: A game of Team Death Match uses my TDM game mode to set the rules and the TDMState to track all the information such as points, score, players, teams, win conditions, etc. iirc, the game mode is only accessed by the server but the clients can access information from the game state.
So you should be able to save all your information in the game state and use it between levels as long as the levels use the same mode and state.
Also you could try using Game Saves to store to retrieve certain when needed. In my game, I use game saves as well to store a players total number of kills, deaths, losses, etc. and that information can be pulled from the Game Save at any time.
Patrickās solution is probably best. The game instance should be the best place to store and retrieve information on a per level basis. Other methods but this would be the most efficient solution
I also think the game instance is the place to store your stats across levels. You can pass these variables from the player state to your game instance as well.
As far as saving the info for when you close the game and reopen, save game is gonna be the easiest place to save that info. Its not fool proof though.
As far as I have been able to find the only way to keep people from tinkering with it is a server system that stores player information on a php/mysql database. I myself would love to chat with someone with info on that.