My favorites | Sign in
Project Logo
                
Search
for
Updated Nov 16, 2009 by brackeen
DeploymentAdvice  
Advice for deploying PulpCore apps

Deployment

To deploy, copy the seven files to a path on your webserver, where "app-1.0" is the name of your app:

  1. index.html (or edit your existing HTML)
  2. pulpcore.js
  3. splash.gif
  4. app-1.0.jar
  5. app-1.0.jar.pack.gz
  6. app-1.0.zip
  7. play.gif (optional: only if you want your app to show a play button before loading)

The HTML file will contain something similar to the following:

<script type="text/javascript"><!--
pulpcore_width = 640;
pulpcore_height = 480;
pulpcore_archive = "app-1.0.jar";
pulpcore_assets = "app-1.0.zip";
pulpcore_scene = "MyScene";
//--> 
</script> 
<script type="text/javascript" src="pulpcore.js"></script>
<noscript><p>To play, enable JavaScript from the Options or Preferences menu.</p></noscript>

Special pulpcore.js params

These PulpCore params can be added to the HTML:

Basic Advice

Optimization for size

Shrink the jar file

Java 6 is good with caching, so the jar download only happens the first time. However, the jar should be as small as possible so that new users can get to your app as fast as possible. Also, if you want to test the "dial-up experience", try Sloppy. More advice:

  • Use ProGuard. Set the proguard.path in your build.properties file and it is automatically used when pulpcore.build = release is set. ProGuard will reduce the the size of the jar by 50% or more. Milpa is 364KB before Proguard; 168KB after.
  • Use the release mode jar (by setting pulpcore.build = release in your project's build.properties file). Release mode cuts out debugging statements and extra stuff like the ConsoleScene and the SceneSelector. For Milpa, it reduces the jar by 12KB.
  • Don't include JOrbisAdapter.java if you're not using Ogg Vorbis files - the JOrbis library is a big chunk of a code.

Shrink the assets file

PulpCore's asset tool creates PNG sizes comparable with other PNG optimizers like OptiPNG. However, there are still tricks you can do to make your assets smaller:

  • Use Ogg Vorbis instead of WAV files.
  • Reduce the number of colors in your PNGs
  • Avoid dithering in your PNGs. Large flat areas of color compress better.
  • Only include one font, and use font.tint(myColor) to create colored versions of that font.

Ensuring Java 1.4 compatibility

Java 1.4 is still used on 5-10% of machines out there, so it's important to keep Java 1.4 compatibility by not using any Java features found in Java 5 or newer. Using Generics and other Java 5 languages features is okay - Retroweaver can make those classes Java 1.4 compatible.


Sign in to add a comment
Hosted by Google Code