blitz custom pack help!!!

Blitz3D Forums/Blitz3D Programming/blitz custom pack help!!!

Caton(Posted 2014) [#1]
how did midnight make a code in blitz that can read resources from a datafile?


Caton(Posted 2014) [#2]
midnight games wonderland,secretworlds,return to wonderland can read sound,music,gfx,voices,files from a resource file.
but how?


RemiD(Posted 2014) [#3]
For images, meshes, textures, it is doable because you can create them inside Blitz3d.
For sounds, music, voices i don't know.


Rroff(Posted 2014) [#4]
Requires temporarily unpacking the files really or some funky memory stuff if your really hot on that.

I keep meaning to look at the B3D source now its out to see if there is a relatively simple way to modify it to load assets from a bank as an alternative to a file but I've been stupidly busy with work and not had time to familiarise myself with the source.


Pakz(Posted 2014) [#5]
You could put every resource file into one file. load the file using your code. every file is a range in the datafile. then you save the files to disc and load them with blitz as b3d and mp3 and so. then you delete them. Thats one way of doing it.


Caton(Posted 2014) [#6]
how do you do range in file? in code? because I don't think there's a command to do it.


Floyd(Posted 2014) [#7]
He means that one large file would consist of many smaller files. Each "subfile" would be at a known location, with a known size. You would know the details because you created the large file.

The file handling commands let you position the file pointer to any specific place in the file, and load a given number of bytes.


Matty(Posted 2014) [#8]
As Floyd says....However for large files you are almost better off loading the whole lot into a bank and accessing the data in memory rather than seeking all over the disk.


Rroff(Posted 2014) [#9]
You'd normally create a custom format for the package file with an index of files included - waste of time really though far better to make use of a standard zip/tar/zlib format.

Loading an entire package file into memory is a bad idea especially as usually you won't need the entire contents (depending on your game design) at one time.

This is one area B3D falls down on as its not easy to stream many assets from anything other than standard file IO.


Caton(Posted 2014) [#10]
but it is not a zip/tar/zlib format just a format pack files only.


Caton(Posted 2014) [#11]
I pack 2 files and save as one full file of thoes two how do I load thoes files in blitz?


Caton(Posted 2014) [#12]
REMOVED