Resource loading, best practice?

32 views
Skip to first unread message

FVANtom

unread,
Dec 6, 2009, 1:16:56 PM12/6/09
to PulpCore
Hi everyone,

I've played around with Pulpcore yesterday to try to write a Java
version of my current MMORPG client for TerraWorld Online
(www.terragaming.net) This is the first result:
http://www.terragaming.net/javaclient/

I have a few problems though. My game client uses about 2.5 meg
(zipped) of tile graphics for map rendering.

- What is the best way to load these resources?
- Is it possible to cache these resources so the players don't need to
re-download them every time? (in browser cache maybe?)

I have tried to add my resources to the resource zip file, but it
seems to become to large or something. When I try loading my applet on
the production machine I get following error. When I try it out
locally it works fine though. My code is based on the pulpcore example
and loading a smaller resource zip seems to work fine.

load: class pulpcore.platform.applet.CoreApplet.class not found.
java.lang.ClassNotFoundException:
pulpcore.platform.applet.CoreApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass
(Applet2ClassLoader.java:117)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode
(Plugin2ClassLoader.java:445)
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:
2880)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run
(Plugin2Manager.java:1397)
at java.lang.Thread.run(Thread.java:619)
Exception: java.lang.ClassNotFoundException:
pulpcore.platform.applet.CoreApplet.class

Then I tried Downloading all images via the Download class. This seems
to work, but takes a lot of time. That however isn't my main issue
with this method. The problem is that whenever a player closes the
browser, he needs to download the images all over again.

Any advice?

Best,

Tom


David Brackeen

unread,
Dec 6, 2009, 1:37:49 PM12/6/09
to pulp...@googlegroups.com
Place all your images in res/ and let PulpCore create the zip for you. It will also optimize some of the PNGs if it can.

Java 6 does pretty good local caching for remote files. Open Java preferences, and you should see the jar and the zip in the list of cached files.

That java.lang.ClassNotFoundException is probably caused by a missing jar. It has nothing to do with any zip files; at that point PulpCore hasn't loaded, so it hasn't attempted to load the zip yet.




--

You received this message because you are subscribed to the Google Groups "PulpCore" group.
To post to this group, send email to pulp...@googlegroups.com.
To unsubscribe from this group, send email to pulpcore+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pulpcore?hl=en.



FVANtom

unread,
Dec 6, 2009, 3:48:58 PM12/6/09
to PulpCore
Thanks for the fast response. I've cleaned some caches etc and it
seems to work now.
Best,

Tom
> > pulpcore+u...@googlegroups.com<pulpcore%2Bunsubscribe@googlegroups.c om>
> > .
Reply all
Reply to author
Forward
0 new messages