Is it possible to make some files hidden/encrypted?

Not favoritedFavorited Favorited 0 favourites
  • 5 posts
From the Asset Store
Convert multiple Excel files into JSON files and import them into construct3.
  • For example let's say I make a tiny game and I add sounds and sprites in it. When I export anyone can easily open the game's folders and take a look at the sounds and sprites, something that I don't really care about, but let's say I wanna hide these and do something so people cannot open the files and see everything. Is there any way to do it? This is about the sprites and music not the code

  • You could load an image from a dataurl to get an image without a file. You just have to do that in events. A data url has the file encoded as a base64 text string. The main drawback is base64 is 33% larger than a normal file. It could similarly be done with audio files.

    In a more complex fashion you could load a file you previously encrypted with some js or into the binary object. Then you’d decrypt it and convert it into a dataurl to then load into the sprite or audio plugin. That would avoid the size increase but you’d add to the loading time to do the decryption and conversion.

    Probably you’d only do that for a few spoiler images. It would be laborious for doing that with a full sprite animation. Not to mention you’d lose the optimization of images being sprite sheeted together.

    Bear in mind you can’t load images into all the plugins at runtime. For example spritefont and tilemap don’t have that capability. Also loading images into tiled backgrounds load it per instance so that would be inefficient.

    Probably look at the cryptography object.

  • Could you show an example? Since I am very new with some of this stuff I did not really understand the proccess even if i understood the logic, thank you

  • I don’t have an example. The way to load a data url is simple. For example use the “load frame from url” action of the sprite object.

    Start of layout

    — Sprite: load frame from url "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAwFBMVEUcdLVRaKWfbHD5VlL9WFX/W1H1T2igEeOwUn2naGL8VFL/WlXbUU9mO0ZrQT+lPmjlp6r0cnP/VU/uT0tFPkoWNkcSLT8eMz3rdne0rLjJnqaTWF8vSVlGUV8gLTwgLz37UEv9XVnFkpqPpLNzgY83RlYlM0JHX3XDTlDqUk/2UExZVmN1hpeTpat2fpR0GOe4Sk3pVVLqVlMoLDsZLjo9RmSPPPaFAP/TUFD7WFP0VlNEOEYSMDtQLlCLAOd6AP8xRjMWAAAAH0lEQVQIW2NkYIQCDhhDAMaQgDEUYAwNGMMAxrCA0gAgEAEhAJ4eUwAAAABJRU5ErkJggg=="

    That replaces the current frame with an 8x8 version of your avatar.

    You can convert an image into a dataurl with tools online, or in construct with the drawing canvas, or with JavaScript I suppose.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • With the latest release (r424 which just went out today), you can choose 'Bundle assets' when exporting for Windows, macOS or Linux. That will bundle all your exported project files in to a single file named assets.dat which prevents anyone being able to browse the files. It's not encrypted, but it's probably enough to stop casual inspection of the game files.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)