I am looking for a Data Pack Library or any kind

BlitzMax Forums/BlitzMax Programming/I am looking for a Data Pack Library or any kind

Takis76(Posted 2012) [#1]
Hello ,

I am looking for some library or mod , which you are able to add your game data files , as sprites , images , sounds , musics , texts , fonts , etc... in one data file and then when the game starts you can load or even save them in the data pack file.

Also if some data pack file creator is included will be nice.

If you are able to create the data file on runtime will be greate , because you can put your game saved maps in the data file protected.

The pack files will be separated from the .exe not compiled in exe.

Is there any kind of such a library?

Thank you. :)


*(Posted 2012) [#2]
Takis why not write all your data into the one file as they are in the files then extract the data into a bank then load the back in, for example:
MyFile:TStream = readfile( "Image.PNG" )
MyBank:TBank = createbank( FileSize( "Image.PNG" ) )
ReadBank( MyBank, MyFile, 0, FileSize( "Image.PNG" ) )

MyImage:TImage = LoadImage( MyBank )

ResizeBank( MyBank, 0 )
CloseStream( MyFile )


Basically you open the stream to the data file, locate the data you want, read that into a bank the load the bank instead of the image/sound or whatever. This way you can keep your media safe and secure :D


Takis76(Posted 2012) [#3]
I will check your idea , but I don't know how to implement it with as many images or data yet.
I will need to create my own Bank creator tool with MaxGui or any other Gui.

Do you have anything ready in your mind , to bypass the bank creation for now , because I am very new of creating the tool yet and I will save a lot of time creating things from scratch for now.

I am in early stages of learning the language and ready made tools will help to create something and in the future when I learn more things and gain more experience , I will experiment creating my own tools.

I am collecting ready made (Able to compile tools,libraries and mods) and I will create my game with them and when I finish something , then I will go to the hard core programming :P

Thank you very much , your information was very valuable.


*(Posted 2012) [#4]
I dont have any reusable source code off the top of my head one way would be to write the file like this:
1) length of filename string as a Int
2) the filename string
3) length of file
4) files data

this way when you access your data file you read the length of the filename string read the string and the length of the file and if its the file you want you can read in the data, otherwise you can skip the file part and read in the next one.


SLotman(Posted 2012) [#5]
Koriolis ZipStream is the best. Zip everything up, password protect the zip, rename it to something else (like .data) and presto!

You can load just about everything, no hassle.


SystemError51(Posted 2012) [#6]
I also use the ZipStream module as described just now. People will still be able to look... but they can't touch that way :)


Captain Wicker (crazy hillbilly)(Posted 2012) [#7]
I just learned how to use the 'IncBin' command and it is probably the easiest to use data packer + it's already built into blitzmax!!


Midimaster(Posted 2012) [#8]
You can combine ZIP and INCBIN:

SuperStrict 
Import koriolis.zipstream
Incbin "TT1.ZIP"
DataPath="ZIP::Incbin::TT1.ZIP//"
Ball=LoadAnimImage(DataPath + "ball.png",11,11,0,15) 



SystemError51(Posted 2012) [#9]
I just learned how to use the 'IncBin' command and it is probably the easiest to use data packer + it's already built into blitzmax!!


True - but it will also unnecessarily increase the final size of the .exe file.


Midimaster(Posted 2012) [#10]
In a combination of ZIP and INCBIN the sum of sizes of all necessary files will be the same. But there is only one file for the user! And the loading of sounds/images after th EXE started will be very fast! I think upto 30MB you dont have to think about bigger EXE size.


*(Posted 2012) [#11]
The thing about incbin also is DLC, its nice to be able to change things by changing the external data.


xlsior(Posted 2012) [#12]
You can work around that though: Look in the local folder for the presence of a particular file first, and only if you can't find it use the incbin version. That way you can still add updates/DLC, although of course you wouldn't reclaim the diskspace used by the now unnecessary original incbinned version.