LWJGL Applet Loader

In a previous post we talked about Java Games deployment options, in this post we want to talk about one custom solution provided by the LWJGL: the LWJGL Applet Loader.

The LWJGL Applet Loader is an Applet which performs a lot of common deployment tasks:

  • It shows a nice and customizable loading screen when deployment is being processed, with detailed messages for each task: downloading file.jar, extracting file.jar.gz, etc.
  • It downloads all required dependencies. If they are compressed using gzip, LZMA or Pack200, it extracts them.
  • It has a cache for all your dependencies so if one dependency is not modified on the server, then it is not downloaded again.
  • It configures the Java library path to load all your native dependencies.
  • Finally, it runs your game's applet.

A feature in mind when developing the LWJGL Applet Loader is that it should start as fast as possible, for that, the jar of the Applet Loader should be really small. The idea is to speed up all the Java loading screen so it can show quickly your custom loading screen.

It provides a lot of parameters in order to let you customize deployment stuff, like which natives dependencies you need for a specific platform, the logo and progress bar, etc. Full documentation of the parameters is on the API docs and you also have a great tutorial at LWJGL Wiki.

This is how it looks when loading an Applet using the LWJGL Applet Loader with the default loading screen:

note: Even without customization, it looks much nicer than Java default loading screen.

Pros

  • It lets you customize loading screen, and create Applet using natives support in an easy way.
  • It starts fast. This avoids some browser freeze bug when starting a Java Applet, like Firefox on Linux platforms.
  • It handles different compression options like gzip and LZMA, it also handles Pack200 jars.
  • It works on Mac OS, that is a big difference versus running New Generation Plug-In Java Applets, because they are disabled on Mac OS.
  • It is open source and the guys maintaining it are always open to receive patches and improvement ideas.

Cons

  • Pack200 and compression stuff is not done automatically, you have to specify exactly which file you want to download (example: you have to specify that you want to download somedependency.jar.pack.gz instead of having the Applet Loader to detect automatically which version to download by receiving the content encoding from the server).
  • Assumes you need native dependencies, so you need to fill some Applet parameters even if you don't need them. (we want to add an RFE for that)
  • It doesn't use the same cache other Java Applets or Java Web Start use. That means you have to download twice one Applet distributed using LWJGL Applet loader and Java Web Start, and it will cost you double space.

To see LWJGL Applet Loader working you can try one of our games here (warning: link could be broken in the future) or you can try a working and stable version of a game using LWJGL Applet Loader here, its name is Minecraft, don't know if you know about it.

In one of the next posts we want to talk in detail about another deployment option we mentioned before, now that we have some experience using it: getdown.

References

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: , , ,

  • Anonymous

    One significant downside about Applets is that they're currently quite dysfunctional on Ubuntu, and possibly every other GNU/Linux distribution. The default "IcedTea" plugin usually doesn't work at all (I've tested about 5 different applets, including minecraft). Afaik the only alternative is the sun-java6-plugin (search sun java plugin in Synaptic) which works out alright, though while testing the Minecraft applet I ran into a nasty issue where my entire keyboard became disabled. Though my mouse still worked I couldn't click on anything besides the game since Escape was inresponsive. Had no choice but to restart...

    SO, if there are any good pointers out there to get Applets working smoothly on Ubuntu, I'd very much like to hear them!

  • Anonymous

    Well, we are using mainly sun-java6-plugin and we have no troubles to run applets.

    Try Chrome browser over Firefox since the last one tends to freeze when an Applet is loading (not always, dunno exactly why).

    We have tested some Applets where the keyboard focus was buggy (no response from the Applet never) and others where mouse did crazy things (Minecraft for example, but they have fixed that bug on private releases). Some of them are development bugs.

    Have you tried one of our games? are they working for you?

    Thanks for the comment.

  • Pingback: JNLP Applet Loader « Gemserk

  • Viktor (morkov4e)

    Fatal error ocuried(4)Unable to get input steam for lwjgl_applet.jar.pack -.- please help me what to do

  • arielsan

    If you were trying the zombierockers example, it is fixed now.

  • EpicDerp

    @a58c24fdf1670bdc3a039340a7b953a7:disqus 
    I agree. eUe

  • Derp Derp

    I meant, I know right?