Deffered library loader for Applets?

I’ve been thinking about Applets a lot lately, since I’m going to make some Applet games in the near future.
My main worry is the user experience, like waiting for the Applet to start. This is of course much better in Flash, as you all know.

It is good to have a deffered loader for the game assets, such as images, sound etc., but I’ve been wondering if this is also possible for JAR library files my game might use?

Any ideas?

Bruno and I have been working on exactly that lately: http://www.java-gaming.org/forums/index.php?topic=17835.0

About the deferred jar (code) loading, yes its possible with some JS magic. Basically you have one main loading applet that does liveconnect calls to a JS script, which loads other dummy applets with the specified jar as the archive param in the background (invisible to the user). This will also make the jars get cached by the plugin… by using serversided scripts you could even display progress in your loading applet (by making the jarfile actually a script that feeds the actual jar, or its progress when you specify a GET parameter).

All in all its kind of a hassle… But maybe its worth the trouble when your code jars are >500K. This technique is already(?) / will be supported out of the box by the js script bruno posted.

The alternative is signing your applet and make a custom classloader that does this.

PulpCore does something like this - it has a JS loader that shows an animated gif splash while the VM starts up and the jar loads.

Once the jar loads, it can show your own LoadingScene (with animations and such) while the asset zip is downloaded. In practice, though, people are just using the default LoadingScene, which is a progress bar.

Java 6 is smart enough to cache the asset zip - which is good for repeat players.

Either way, for deployment, use ProGuard or something similar to shrink down your classes!