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.
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.