I am a beginner C++ programmer. I am creating a custom Open Tibia Server and I use the alternative Tibia client (OTClient).
I want encode game files (image, sound, lua, etc.) or pack all files into one. Can anyone help me with this?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
There are already multiple similar questions, that should give you some pointers to get stared:
One option is to use an archiving tool to pack all game assets into an archive and encrypt it with a key. Then in your application use a library such as "zlib" to load and decrypt the contents from that archive.
From a security standpoint, those contents could of course still get extracted, if someone manages to get the key from your application. But there are some tricks around to make that harder, e. g. by not storing to complete key string in one place in your application.
You of course also need to be aware, that those packing approaches also have some drawbacks, e. g. when you later want to replace a single asset file in an patch, you either need to ship again the complete game data archive again or create some sort of intelligent updater tool, that can add/remove/edit assets within your game data archive file.