Hi,
We have managed to get our JME project to run as an applet (we used to use webstart but we had to have it run "inside" the browser). Strange thing is though, once it has downloaded and runs, the Loading of the resources is incredibly slow. Does anyone have any idea why this would beband how to speed it up? The fat_jar is all downloaded so the files are local, why the snail speed???
Cheers
I had this problem as well, but haven't had any time to debug and solve it.
An applet or a jlnp (ie: embedded or a webstart app)?
An embedded applet. It worked fine as a Webstart app, loaded quickly. Slow as a bastard as an applet though.
CH
bump
maybe the resource / class path differs from applets to webstart.
Try to check if getting the URL or the actual reading from the file is slow.
Keep in mind that an applet uses the web browsers VM whereas a Webstart has its own JVM…
Not to mention that caching might be very different on a Webstart vs a browser. Also a Webstart application can suprisingly be compressed to 1/9 the size of a regular jar file…
Thats why Webstart loads faster (unless your big files are non-Java), but also why it might run faster.
Have you tried different browsers?
btw, if you do determine that it was a coding error and they run the same speed or that applets are indeed slower, I would love to know, very interesting.
We got around the lameness of Java by seperating out our assets into a seperate jar. We also zipped up all our assets in the jar, then we unzip them at runtime. Loads faster than a bastards hat now !
So all of your models are zipped in the jar or are zipped and downloaded later?
Great to hear that you got it working quickly! Sounds awesome, and thanks for the response, good to know.
I pulled our assets folder tree out of the fatjar and rebuilt the fatjar (the executable jar)
I took the contents of each of our asets folder (sounds, models, textures etc) and made a single zip file in each one.
I then took that asset tree and made a seperate jar called assets.jar.
The fatjar and the assets jar are then both signed the same
In the code the zip files are unzipped into a folder on the users machine and then accessed directly.
Works like a charm.
Great to know! Thank you very much for your info!
Do you know the FPS difference between applet vs webstart, is there one? Is it noticeable?
Applets run embedded in the browser. Webstart opens up a new window outside of the browser. If you want something that is "attached " to your html page go applet otherwise use webstart.