File packing methods

Blitz3D Forums/Blitz3D Programming/File packing methods

RifRaf(Posted 2009) [#1]
My current method for keeping media secure is to have one media database that the game can poll(packed/encrypted and loaded all via molebox paking), this is easy enough. But im toying with the idea of letting mapmakers use their own media.. Wich means thier maps would need a pak file, that contains that media.. No problem there, but the only way I can come up with so far to allow this is similar to the terapak wich has to write to disk, load and return that, then delete the data from disk.

I would love b3d to have a loadfrombank for models(included assosiated textures) .. has it been determined so far that there is no way to acheive what I want in B3D ? I cannot think of a way unless I write my own media loaders for every format supported, and thats just not going to happen.

Thanks for any advice or tips you may have. Doing it the above way will not be the end of the world I suppose.


Yasha(Posted 2009) [#2]
Well you've got CreateMesh and AddVertex and EntityTexture. How complex are the models that you can't store that information in a bank easily?

What I would do, is devise a hugely simplified format that simply saves meshes, surfaces, vertices and whatever other attributes you need in list form (with known numbers or listed numbers, rather than "chunks"), which is easy to read back, and instead of packing up existing formats, write a conversion utility that can load a list of models in any format for which loaders already exist, and then save them to the archive in your simpler format. That way you only need to include one loader in your game; users wanting to make custom media run their models through the converter.


RifRaf(Posted 2009) [#3]
Yasha,

I like the idea but its not an available option for me at this point, the project is just too far along to revert to a proprietary format. It would raise to many issus such as users converting any asset they have over to the new format and that would mean I would have to either

A. make loaders for every format mapmakers may initially use , so that it could be converted to my format. Blitz3D only loads a small portion natively.

B.point them to a variety of programs like UU3D that can convert many formats to B3D(or format blitz3d can load), then use my converter on the loaded model ... a process that is imo a bit sloppy.


I think its best for me to support the known formats that B3D already allows, and keep the steps required down a minimum.

Thanks for the suggestion though.. If I were starting a fresh project I would consider my options using that approach.


Nate the Great(Posted 2009) [#4]
I agree with yahsa that it would be easiest to make your own file format. I would guess it would only take an hour tops since you know what you do and dont need for the models to support and making models in blitz isnt that hard either... then all you have to do is make a converter in your map editor that auto converts the models and your done right?


RifRaf(Posted 2009) [#5]
ya, placing the converter into the map editor would be rather seamless. Ill give it some thought. I usually find things arent as easy to implement as they first appear to be. I'll let you know how it works out / if it works out.


AJ00200(Posted 2009) [#6]
How secure do you need the media, because just some simple encryption would stop most people from evenntryinng unless it is REALLY AWESOME media.


RifRaf(Posted 2009) [#7]
well that system is going to work very well , thanks for the suggestion.

I have the exporter hooked into the map editor so a scenery pak file is created. I could pak the textures on there too, but that would add alot of map load time I think, as I would have to dump them to file first and reload them

Im not worried so much about texture tampering though.


RifRaf(Posted 2009) [#8]
update,

using zlib ive gotten my test map down to a 4 meg custom pak file containing all models and textures.