Godot Version
v4.5.1.stable.official
Question
I’m making a script for player data, and i’m wondering if I should use a resource for the player data or if I should use a global script for the player data. I’m thinking about using resources since they seem better than global scripts in terms of security. Im also wanting to use the option that would be the most secure for data. Thanks in advance!
Under what context? Do you have multiple players? Do many other objects need to access the player data without knowing about the controlled character?
What is “Security”? The game will run on other people’s computers, of which they have full control over, so you cannot guarantee control over this data. If you are making a online multiplayer game then you do have control over the server side, so you must always verify a client’s packets which may be faked.
1 Like
Thats a typo
I meant to have ‘secure’ there. And the game is going to be single player, but i’m talking about security as in the user attempting to edit player data to get farther in the game than they really are.
The question makes no sense. A resource can be a property of a global script. Those things are not mutually exclusive in any way. Use resources when you need serialization to disk. They make this very convenient.
Let them. Purpose of games is to have fun. If someone is having fun that way - let them do it.
There is pretty much no way around this, you could encrypt or obscure save files by using a binary format, but the data will be unpacked in-memory when the game is running so memory editors, such as the easy-to-use cheat engine, can poke around for values. Anti-cheat is a never ending story back-and-forth between the hackers and what you are developing, any advice will be outdated as soon as it’s in their hands. And what’s really the harm in a single player game, they aren’t going to cheat accidentally.
Alright, i’ll just mix using global scripts and using resources. Thanks for replying!
I’ll just do what i put as the solution, thanks though!