Custom package files

Hi,

Basically i want to implement a sort of custom loader that loads my binary archive file (.RPK) (resource package) that contains .j3o files, audio , and custom data files.

So my custom loader will load these package files into memory and then i will be able to access them and load them into my scene.
How can i implement this into the engine ?

Kilian

You would probably need to make your own AssetLocator for your .RPK format.

though if RPK is actually just a zip file renamed to rpk, you could probably just use the built in ZipLocator class that comes with jme.

…so… something like an asset pack?
https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:asset_packs

the .RPK file is not a regular .zip renamed to something else , it’s a proprietary binary format that i designed.

Let me get this straight:

RPK is a container /package/archive file which contains sorts of files like models,textures,sounds,binary data , text files , etc…
The format is (for obvious reasons) closed.
The file uses compression and encryption(not relevant actually).

The only thing i need to know is if i need a model then my rpkloader will read the embedded .j3o file in the rpk and return it, so i can use the “load” function to load the model.
This is also for every other file.

Maybe it’s not possible to load a j3o file or other file from memory instead of just regular from the assets folder.

http://hub.jmonkeyengine.org/javadoc/com/jme3/asset/AssetLocator.html
http://hub.jmonkeyengine.org/javadoc/com/jme3/asset/AssetLoader.html

So basically the assetloader.load takes in a Stream ?

@kilianvde said: So basically the assetloader.load takes in a Stream ?

…yes, provided by some AssetLocator.

thanks for the info i will look into this !

I’m new to this community but i find it very good , the response is only several minutes !

@kilianvde said: thanks for the info i will look into this !

I’m new to this community but i find it very good , the response is only several minutes !

:slight_smile: Sometimes we respond pretty quickly. I think it depends on how much work we are avoiding at any particular time. :slight_smile:

1 Like

avoiding ^^

XD , i know what you mean.
I sometimes have that also.