Saving player stats

Hey all,

I’m just looking for some advice for saving player stats like total time played, how many times things have happened in game etc? I’m using playerprefs at the moment but I’m thinking another solution would be better, perhaps json?

It’s a fishing game so I need to store individual fish species information like how many the player has caught, the biggest caught, how many times it’s been lost etc.

I was thinking of something along these lines but I’m not sure:

[Serializable]
    public class FishSpeciesRecord
    {
        public string name;
        public int timesCaught;
        public int timesLost;
        public int MaxSizeCaught;
    }

Primarily this is for tracking game progress for achievements/trophies.

Any advice would be great. Thanks

You can write stuff into files within: Application.persistentDataPath.

Using whatever format you want, pretty much.

Thanks. What format would you suggest?

Whatever you’re comfortable with.

Personally, I’d probably use unity’s JsonUtility to dump stuff, and in case I need to obscure contents, I could try to compress/encrypt it.

But most likely I’d stick with something human-readable and easy to debug.