Data Files in Blitz3D?

Blitz3D Forums/Blitz3D Programming/Data Files in Blitz3D?

FourtyTwo(Posted 2006) [#1]
Is there a way to hide the image files used by a Blitz3D program, so that the end user won't be able to view them directly?


Bobysait(Posted 2006) [#2]
Use a dataPacker . Like PowerPacker or Molebox.


FourtyTwo(Posted 2006) [#3]
Thanks for the quick reply!

Are there free dataPackers out there?

Not that 12 Euros is a bad price, but why pay for something if one can get it for free? ;-)


kevin8084(Posted 2006) [#4]
In the Toolbox under File utilities.

Kevin


markcw(Posted 2006) [#5]
or use data labels and restore/read commands and internalize the images yourself.


GfK(Posted 2006) [#6]
I'd recommend Molebox, despite the cost.

Most if not all Blitz 'native' methods (as far as I'm aware of) decrypt/decompress and store data as temporary files. This is pretty worthless as far as protecting your media goes, and they're generally very slow with larger files, too.


Damien Sturdy(Posted 2006) [#7]
Only problem with Molebox is anyone on an old Windows98 box will have problems.


GfK(Posted 2006) [#8]
Only problem with Molebox is anyone on an old Windows98 box will have problems.
It also doesn't work on Windows 3.1.

Things move on. Go with it or get left behind.

A lot of hardware drivers don't work on the first edition of Win98, either. But you don't see the big players holding back for a minority market.


Damien Sturdy(Posted 2006) [#9]
Heyhey, We use molebox, it's just something to be aware of :)


@rtur(Posted 2006) [#10]
There is packer for Blitz3D written by one of our "Russian Blitz3D Community" member- Maxus.
It is unpack resources directly into memory, without creating temp files on HDD.
Here is link:
http://amt-lab.com/index.php?page=paprew


markcw(Posted 2006) [#11]
he never said he wanted to encrypt them, just hide them.

look, here's a simple example of how to use Data/Restore/Read.




GfK(Posted 2006) [#12]
Can you post a version that will work with a WAV/MP3? Or a 3DS model?


markcw(Posted 2006) [#13]
ummm... but he *did* only say images.

but, yes i agree it is a hardcore way.


big10p(Posted 2006) [#14]
Packing images into Data statements is probably not a good idea, unless you are using very few/small images. There's a significant overhead with Data statements - well, when you have loads of them anyway. It'll also cause your source to take ages to load/parse. Plus there's a limit on the number of Data statements you can use, I think.

I use Blitz Media Linker (in toolbox) - it's free.


FourtyTwo(Posted 2006) [#15]
Wow... Thanks for all the responses.

So far, Molebox seems to be the best option. I tried it and it works like a charm.

It is a bit expensive, though.

I would have used Blitz Media Linker, but it is a bit sluggish at runtime. It's only a few seconds delay, but that's all it takes for a player to scratch their head and think something is wrong with the program.

Pretty picky, ain't I? ;-)

Guess I'll just have to reach deep into my pocket and register molebox. If you're picky, you must be willing to pay for it, heh?


markcw(Posted 2006) [#16]
well, you've heard it all now, try this out. :)




Damien Sturdy(Posted 2006) [#17]
Blitz Media Linker is great :) I would have used it but it didnt like the project and we never figured it out :)


big10p(Posted 2006) [#18]
Cyg: A new version was released about a week ago. Maybe give that a try? :)


Damien Sturdy(Posted 2006) [#19]
I tried it, specifically for you ;) but no luck. not sure what the problem is with it- it works on absolutely everything except the racer :)


jfk EO-11110(Posted 2006) [#20]
Cygnus: Molebox works ok with Win98. (?!?) At least on my machine.

The only blitz file io command that isn't supported by molebox is checking for the existance of folders (if filetype("fol")=2).

When a game is (example given) CHDIR into a folder to load things, then you maybe first want to check if the folder exists at all. With molebox you need to place an empty placebo folder of the same name in the directory of the packed exe, that's the work-around. That's also useful if the game will save data in the same folder.

Warning: some Unzippers seem to ignore empty folders and refuse to unpack them. So at least add a dummy textfile in every of these placebo folders.


Damien Sturdy(Posted 2006) [#21]
We moleboxed the racer and when used with molebox, it refused to work on any win98 machine.


jhocking(Posted 2006) [#22]
I don't know why people are all so keen to encrypt their data files. I can understand wanting to pack everything neatly; I do that too. But the free packers are fine for that. Sure, the media isn't protected, but who cares?

I suppose I haven't inspected many recent PC games, but it's not like AAA pros encrypt all their data.


Damien Sturdy(Posted 2006) [#23]

Sure, the media isn't protected, but who cares?



Media is valuable. It has taken time to create, and we don't want any old blitzer using the media they ripped out of an archive in their games.


big10p(Posted 2006) [#24]
I tried it, specifically for you ;) but no luck. not sure what the problem is with it- it works on absolutely everything except the racer :)
Ah, well. :/

Cygnus: Molebox works ok with Win98. (?!?) At least on my machine.
Odd. Moleboxed apps refuse to run on my win98SE machine.

Warning: some Unzippers seem to ignore empty folders and refuse to unpack them. So at least add a dummy textfile in every of these placebo folders.
Yeah, I discovered this the hard way. I originally packed Juicy Fonts with an empty folder, but I got a few MAV reports which turned out to be caused by this. Yep, I just stuck a txt file in the folder to fix the issue. :)

I don't know why people are all so keen to encrypt their data files. I can understand wanting to pack everything neatly; I do that too. But the free packers are fine for that. Sure, the media isn't protected, but who cares?
I agree 100 percent, personally. ;)


jfk EO-11110(Posted 2006) [#25]
>>it's not like AAA pros encrypt all their data.

The reason why is they are the official owners of the rights. If you're a nobody, there's a higher risk for somebody will steal your work and claim he made it.

Additionally, it may prevent people from editing config files. Imagine cheats are stored in a config file. It's really much easier to use something like molebox than to encrypt things internally.


Damien Sturdy(Posted 2006) [#26]
jfk, could you check this demo?:

http://www.blitzbasic.com/Community/posts.php?topic=58713


It refuses to run on any Win98 based systems, if you say molebox is working for you i'd be interrested in seeing if it does :)


jfk EO-11110(Posted 2006) [#27]
big10p - did you try to run one of my recent fps engine demos?
If you didn't, could you please? I' really love to know this:
http://www.melog.ch/dropper/v60/csp_ngn_60_demo.zip (14 mb)

thank you!


jfk EO-11110(Posted 2006) [#28]
Cygnus - I will asap. Got to copy it from linux to win, then to an other win, trough several firewalls :) But I will asap.


jfk EO-11110(Posted 2006) [#29]
Cygnus - ok I tried it, crashes. An Api error msg saying something about an invalid module in race.exe.

Maybe Molebox is a little sensible when it comes to packed DLLs. Or maybe it's the folder problem I mentioned.

Still waiting for somebody to test my packed demo on a win98se box other than mine. Although - only about 1% of the responses where crash reports - so far.

Whatever you do, there's always a small number of machines that will refuse to run it no matter what.


Damien Sturdy(Posted 2006) [#30]
well, the machine i ran it on in win98 worked after it got upgraded to XP.

it's not the folder problem :)Cheers for testing mate.

Maybe its a molebox version thing...


FourtyTwo(Posted 2006) [#31]
well, you've heard it all now, try this out. :)


Very Cool.

Unfortunately, when you have 15 megs of images and sounds, this cool solution is also completely impractical. The WritePixel() function is much much slower than LoadImage(), and the game would take forever to load. I also suspect (although I'm not sure of this) that a million line source code will heavily hamper the preformance and the size of the executable.

It would be a great way to internalize small images, though. And with a little tweaking, it could be a useful way to internalize level maps and other "smallish" game information.


FourtyTwo(Posted 2006) [#32]
I don't know why people are all so keen to encrypt their data files. I can understand wanting to pack everything neatly; I do that too. But the free packers are fine for that. Sure, the media isn't protected, but who cares?


I agree.

Personally, I have no need for "encryption". I would have happily used BlitzMediaLinker, if it didn't delay the Splash screen of my game by a few seconds. It seems that when we're dealing with large chunks of data, the free packers are slower than MoleBox.


big10p(Posted 2006) [#33]
jfk: tried the demo which ran but locked up when the loading bar got to near the end. I had to re-boot.


jfk EO-11110(Posted 2006) [#34]
Really? Are you sure it locked up? It really takes a couple of time when the bar is around 85%. It may happen on a machine with little vram (128 or less that it will take a long time, because the engine will try to cache everything to prevent post-uploading that is done by directx by default (and results in ugly pauses in the first minutes of the game)

So when you let it "sit" for several ,minutes, does it still hang? The reason why you had to reboot would then be directX doesn't allow to run the task manager in this situation. (Seen several ugly crashes when you interrupt directx in the middle of a job)

I have no other explanation for this kind of behaviour. Additionally: One guy already told me he first tought the game crashed, but when he used to wait long enough, it was running finally.
I know, I owe you something, sorry for the crash!

The fact that it used to run the intro proofes however Molebox (pro 2.55 or something) may work properly on Win98se (with the mentioned limitations)

So, thanks a lot for testing. Maybe try one more time :)

BTW I will add this to the requirement notes: 256 MB. Or maybe the next releases will run in 64MB nicely due to DDS ! kewl.


big10p(Posted 2006) [#35]
Well, I only have 256MB RAM and only 32MB VRAM. Should the demo still work with this? If so, I'll give it another go but I did wait quite a long time. There was a long pause at about 85%, as you say, but I got passed this - it got to more like 95% when it seemed to lock up.

I assumed it had crashed because I couldn't even get the task manager up.


jfk EO-11110(Posted 2006) [#36]
Thanks for the info. It would best run with 256 MB Vram. But DX is able to use shared RAM as VRAM, if required. The Graphicscard then has to swap things continously, depending on what must be rendered. This is why 128 or less MB VRam is almost unplayable: slow and jerky.

I have no idea why it crashed at 95%. The critical Jobs are performed earlier (eg. using video codecs). All files are there, assuming it's unzipped correctly. I guess it simply needs more than 32 MB Vram.

Thanks a lot for testing. Now it's clear Molebox works with Win98se, but there may be features that are supported only by XP/2000. Noless it's possible to pack the whole thing.