Frage

I'm currently developing an RPG game using C++ and SFML on Windows. Currently it is working well but when I was checking over everything I realized that since all data such as items, inventory, creatures, battles, NPCs, shops, etc. is stored in text files that they would be very simple to manipulate with any text editor.

I want to prevent this data from being manipulated easily at the very least. Obviously whenever data is stored with the release someone will get through and be able to edit it.

I was wondering what the best route to go about protecting this data would be while still maintaining the ability to edit it with tools that will be built in the future such as map editors, item editors, NPC editors, etc. as well as the engine itself.

I would highly prefer writing my own and to just get some ideas on how this would be best to accomplish it because I am mainly using this to learn the languages better. If anyone truly believes that this is foolish please let me know so I may consider optional libraries to use.

If you do the later I would appreciate anyone that could recommend a good one for me to use.

War es hilfreich?

Lösung

I was wondering what the best route to go about protecting this data would be while still maintaining the ability to edit it with tools that will be built in the future such as map editors, item editors, NPC editors, etc. as well as the engine itself.

I don't think there is a best solution. The simplest one could be encrypt the files, hardcoding the key to decrypt them inside your game. This won't prevent a reverse engineering of your binaries to recover the key though.

Andere Tipps

Have your game engine read the files both as text and in a binary format. The binary format could be as simple as just using zip compression on the file directory. Then you could implement a checksum on the binary files.

For development you would use the text versions, but in the live game you allow only reading of the binary format, and you reject files that fail the checksum.

This isn't super secure as someone would reverse engineer the checksum. But it will prevent the casual user from editing your game data. You could make this more secure by having the game client validate the game data checksums against known good checksums on the server.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top