Compiling Resources

Monkey Forums/Monkey Beginners/Compiling Resources

Grim Gary(Posted 2014) [#1]
I've been doing some searching and I cannot find anything or I am not hitting the right keywords. I'm just coming over from BlitzMAX and transferring my game code into Monkey.

I'm curious if I can compile resources (images, audio, data) into the app itself like I used to be able to in BlitzMax by including the resource file. I've looked at the help under Resource Paths but it was not clear on whether this was possible, or if the .data folder does this automatically.

The main purpose is to of course protect my artwork and audio from being ripped out and used outside my own projects by 3rd parties (or at least make it more difficult).

Any light on this subject would be great! Thank you in advance


Gerry Quinn(Posted 2014) [#2]
What happens resources depends on the target. In Flash and Android they get compiled into the app, in HTML and I think desktop they don't.


Grim Gary(Posted 2014) [#3]
Ah. Makes sense. So I would have to use a 3rd party util like Smart Packer Pro or some such to do that for my Desktop releases.


Nobuyuki(Posted 2014) [#4]
yes, although you should consider not doing anything special -- people who really want those assets are going to get to them anyway, and you'll be spending precious resources trying to come up with a stronger lock on the gate when the fence surrounding the property is only 3 feet tall! Resource packers often make executables that are recognized as viruses by some AVs' heuristics. That's not exactly good for business, either.

If you're making a game where assets would provide significant spoilers to the game if they were viewed prematurely (like, I dunno, a hidden object game or visual novel), I would recommend implementing something that "scrambles" the images into tiles, instead, like something GMask does, then re-assembling the original image at runtime. This has the benefit of being compatible with all target platforms without having to write extern code for each one individually.

For plaintext data like savestates, a simple cipher with a decent-length key will do the trick. I use a XOR-based cipher for my games: http://monkeycoder.co.nz/Community/posts.php?topic=5061&post=55682


Grim Gary(Posted 2014) [#5]
Thank you for the insight.


Soap(Posted 2014) [#6]
To add to what Nobuyuki said, there are popular forums online where all they do is try to figure out how to rip/decompile resource assets from games. For whatever reason, people feel the urge to rip apart and look inside most popular games to see how they work.

Only reason I would like the option to pack everything into a single exe is ease of distribution. Luckily you can make installers just as easily which do the same for end users.

Some people will suggest using packer programs but they will likely cause your games to show up as false positives for virus scanners.

Another problem with some of the popular packers is that with Monkey the default filesystem for saves is to use the .monkeystate file in its directory.... Monkey really should be using appdata directories instead by default, but it's not so you would have to change your app to use a proper directory because otherwise the packed exe may not work right depending on the software you use.


Gerry Quinn(Posted 2014) [#7]
Do your own custom scrambler if you like and it makes you feel better - it's not hard, and it will at least annoy people who want to rip them. But in truth, just how great are your graphic assets? Is anyone really going to use them in a way that affects you?


therevills(Posted 2014) [#8]
I've produced a few commercial games over the years and I haven't seen the need to "protect" the art work I have paid for in my games, if people want to use the assets they will find a way anyway. My last game's artwork cost me over $10,000USD.


benmc(Posted 2014) [#9]
If you aren't bundling your games into a single EXE for PC Desktop releases, are you using an installer, or just distributing a zip?


therevills(Posted 2014) [#10]
are you using an installer, or just distributing a zip?

Both really... I supply a zip file to a games portal such as Big Fish Games and they bundle it up in their installer.