Hello Guest

Applets, Web Start and Caching

  • 2 Replies
  • 7081 Views
Applets, Web Start and Caching
« on: September 02, 2012, 10:13:32 »
Hi all,

I'm new here, so apologies if I'm asking this question for the thousandth time!

I'm a serverside Java developer (primarily Spring, SOA and big data), but I spent a few years as an indie games developer, writing in XNA. I want to make games using my primary language, not least of all because of the possibilities afforded by deploying games as applets.

I'm assembling cost models of a browser-based game, so I can start considering seeking investment. One quite big question I have is: is there any implicit caching of resources loaded via URL at runtime in an applet? Bandwidth would be the largest cost of my game, so it's quite important I get to grips with the costs of distributing assets at runtime. By this I mean user-generated content, so loading other users' levels at runtime, not just jars required to play the game.

When I asked this question on Stack Overflow (http://stackoverflow.com/questions/11575076/caching-resources-loaded-by-java-applet), a helpful chap talked about Web Start. I thought Web Start was for launching apps on a desktop JRE, so I don't understand how Web Start, JNLP and Applets relate to each other. Can anyone recommend good resources for learning about all these technologies?

Thanks in advance for any replies!

*

Offline kappa

  • *****
  • 1319
Re: Applets, Web Start and Caching
« Reply #1 on: September 02, 2012, 15:03:44 »
Java Web Start is a stand alone Java Application designed to deploy Java Applications. It is bundled with the JRE and will download and run files as specified in special type of XML files (known as JNLP's). The Java Applet plugin runs in the browser and is another deployment tech where you specify jars files via html however it now also optionally supports JNLP files.

Both technologies support caching downloaded content, i.e. jars are only redownloaded if they change on the server. Both however are a little quirky and IMO not the best way to go for mass distribution. A better JWS alternative is GetDown (more info on its site).

LWJGL also comes with its own mini sub plugin called the AppletLoader which runs on the Java Applet plugin and tries to address some of its short falls. The AppletLoader is described in more detail here.

As for loading resources at runtime its something which you'll probably want to handle and manage yourself in your own application, i.e. manually download the content to some directory on the computer and only update it when you need to.
« Last Edit: September 02, 2012, 16:27:55 by kappa »

Re: Applets, Web Start and Caching
« Reply #2 on: September 03, 2012, 07:11:23 »
Thanks, that's a great help!