Levels as jar files

Is it possible to create a level system that would dynamically load a single level from a jar file?  Such that each level was different jar file and when selected from a some sort of level chooser it would download that jar file.  This is so that for my applet based game they wouldn’t have to download everything, just the game code, necessary content, and a level of their choosing.



I know loading and unloading content is a little difficult as per: http://www.jmonkeyengine.com/forum/index.php?topic=13048.0;topicseen, but my question is more about the java distribution aspect of it.



Btw: I thinking of moving from my current game JME2 to JME3 to solve the dynamic loading issue.



Thanks in advance,

SomethingNew  :wink:

That is entirely possible. I would recommend doing it via the classpath rather than unzipping the jar though. If your game just loads one level the way jme2 handles textures is not really an "issue", is it?

normen said:

If your game just loads one level the way jme2 handles textures is not really an "issue", is it?

I was just thinking about unloading an already played level and loading up a new one.  That would take JME2 to destroy the old level content data.

Definitely possible, for jme2, just add a resource locator to the jar's url, for jme3, use j3p and add a J3P locator.

You can even stream resources from the internet from a large jar.