Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Distribution of game - media as memblocks?

Author
Message
Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 24th Oct 2011 17:41
Hello all

Well, my masterpiece(!) is just about finished and I'm about ready to distribute it. I have a question, if anyone can offer advice.

The assets for the game currently exist as .wav, .png, .jpg and .mp3. Obviously I'd like to protect them from casual tinkering. I have looked at these options:

1. Turning the wavs, pngs and jpgs into memblocks, which I then save and reload at game time. Wrote a program to work through the media saving a memblock copy of each file. Trouble is, as I found out, the memblocks are uncompressed, so the size of my media folder went from 45MB to 140MB! Hmm!

2. Building the project as exe + pck or exe + media. I couldn't get this to work ('file not found').

3. Trial of SmartPacker Pro. Seemed to take the program ages to run. Also, AVG started dancing around claiming that my program was a virus, once it had been packaged. I don't want end users to experience that.


How do you distribute your apps? I could really use some advice!

Thanks in advance

James
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th Oct 2011 17:59
Well there's no way to totally protect anything but the quick way you posted on #2 is the easiest. The only way for it to work properly though is to add the media to the project then compile. Which IDE are you using?

Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 24th Oct 2011 18:42
Hi Grog

I'm using CodeSurge. Trying to load assets in the usual way:

load image "media\black.jpg",1

etc. etc.

I have tried:
media\*
media\*.*
media\black.jpg

in the media files section, but it still doesn't work

Stupid thing
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 25th Oct 2011 04:59
Unfortunately that's one I don't have installed. The first thing you may try is get the latest version of CodeSurge:

http://forum.thegamecreators.com/?m=forum_view&t=112681&b=5&p=0

If you are using the latest CodeSurge already you may have to try the latest IDE that comes with Darkbasic Pro to compile with the media.

Mr Bigglesworth
18
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 25th Oct 2011 05:53
Compress your files in a encrypted .zip (or similar). I am not sure if there is a plugin for this, but it is a decent way.
mrniceguy
20
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 25th Oct 2011 09:43
Hi,

If you send an mail with the details of your project I can take a look at it.

Smart Packer Pro - Distribute games and applications
V-Packer for Games - Compress your game files into one executable
Flash Packer - Pack your Flash movies
Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 28th Oct 2011 13:44
Thanks for all the replies. I think I'm going to get the most recent version of the DBP editor and see if that will sort it.

I'd still like to be able to load media when I need it tho, rather than all at once as part of the exe. Some of the assets I'm using cannot be stored in their native form (e.g. jpg) as it's against the terms of the RF licence which I bought them under.

I'm not looking for mega compression or encryption - just something to stop the casual person tinkering!
mrniceguy
20
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 28th Oct 2011 13:46
Maybe interesting.

The new version of Smart Packer Pro supports ondemand file extraction and will be available next week!

Smart Packer Pro - Distribute games and applications
V-Packer for Games - Compress your game files into one executable
Flash Packer - Pack your Flash movies
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 28th Oct 2011 15:32 Edited at: 28th Oct 2011 15:32
Give me a few days and I'll come up with something for zip compression in a simple plugin. A few people have brought up the subject of encrypted and possibly compression. I do know there is a zlib library out there in the GNU license so I'll have a look at putting it into a plugin.

Any ideas then let me know. I just want to make it as simple as possible. ie. Extract a file into a memblock then use something like, MAKE IMAGE FROM MEMBLOCK().

I'll also have a look at Smartpacker in the meantime...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 28th Oct 2011 16:16
Quote: "I'd still like to be able to load media when I need it tho, rather than all at once as part of the exe. Some of the assets I'm using cannot be stored in their native form (e.g. jpg) as it's against the terms of the RF licence which I bought them under."


The DBPRO pack media with EXE option, outputs the media when it runs; and gets rid of them when it closes. It is practically a self extracting zipped package.

File Blocks; pack a series of files into one file; or a series of files in a series of files. Have you checked out the File Block commands in the file section?

There are many .zip based DLLs out there that you could also use, but fileblocks, memblocks and filemaps seem efficient enough to me.

Media could also be stored in a 'protected location' although Windows administration rights may prevent your program for doing so.

However,
Quote: "there's no way to totally protect anything"
as Grog says; but at least you can make life a little more difficult for nosy brats and poachers.

JRNTexas
15
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 4th Nov 2011 09:28 Edited at: 4th Nov 2011 09:49
Dark Basic Pro has a couple of built in functions that make protecting your "assets" pretty easy and straight forward.

I wrote an article in the latest (Nov '11) newsletter that answers this very question.

http://www.thegamecreators.com/pages/newsletters/newsletter_issue_106.html#5

If you have any questions about the article, just post them here and I will follow up.

Login to post a reply

Server time is: 2026-07-10 21:41:25
Your offset time is: 2026-07-10 21:41:25