Media encryption and minor updates to games

BlitzMax Forums/BlitzMax Programming/Media encryption and minor updates to games

Qweeg(Posted 2006) [#1]
There are two ways I have used to add image media to a game. Either include them as part of the game and reference their path in the game code. Or use incbin and bundle the media into the executable.

What I want is to have the option to improve my game over time by supplying patches without the user having to download the entire game. For example if I allow my user to choose the clothes his character wears and then later on I design some new outfits I will want to add them to the game as a patch release.

If the media is included in the executable I can't see how this could be done without me recompiling the game and the user downloading the entire executable.

If I ship the media seperately then I could just supply new images to be downloaded to the correct directory and then read into the game. But the problem then is that I am not encrypting my images so they can be used by anyone.

So is there any way round this?


Dreamora(Posted 2006) [#2]
Using a byte updater that compares the old version and the new one and then creates a patch that will morph the old to the new one.


Qweeg(Posted 2006) [#3]
Wow that was quick! I've never heard of a byte updater before, but a quick google and voila "Smart Updater" by PB software.

Thanks a lot Dreamora.


N(Posted 2006) [#4]
I don't use encryption, but my scheme is probably applicable to what you do.

Basically, I throw everything in a custom format based on the Quake 1 PAK format (only difference is it's compressed and uses unicode strings). Now when the paks are loaded, if the pak file has a higher affix number (e.g., "pak5" is greater than "pak2", where 5 and 2 are the affix numbers) and if a resource in pak 5 that has the same name as a resource pak 2, then the resource from pak 2 is replaced with pak 5's because it's considered to be more recent (I don't trust the FS dates since they can easily be changed, so this works better).

So as long as you have a sort of resource manager like the way I've done it you should be able to reference newer versions of game scripts, graphics, etc. easily without changing the executable. However, if you've hardcoded everything, then it might get harder and you may want to just consider redistributing complete reinstalls of the updated version.


ImaginaryHuman(Posted 2006) [#5]
You don't have to use an image file format that people are familiar with or have the ability to read. You can create your own cryptic format and use that as a datafile.


Qweeg(Posted 2006) [#6]
Thanks Crow and Angel. Angel, how would you go about using a cryptic format as a datafile (apologies for appearing a bit thick)?