About spirulence


Ludum Dare 37
Ludum Dare 31
Ludum Dare 30

spirulence's Trophies

spirulence's Archive

How to package your Java-based game

Posted by
Wednesday, December 12th, 2012 3:35 pm

Howdy, Ludum Darers!

Last Ludum Dare, I wrote a little guide to using Launch4j to package your Java game so that people don’t need Java installed to play it.

I’ve only got Windows instructions, but they’re not old (yet), and you can find them here: http://www.ludumdare.com/compo/2012/08/24/how-to-package-your-java-game-this-ld/

I understand that Linux and OSX are also supported by Launch4j (albeit you need a Mac to package on a Mac, and some variety of Linux to package for Linux), but I can’t vouch for how well they work.

There are other ways of doing the same thing: our team recently got a license of Excelsior which does this, in the comments on the linked post there was mention of Processing, and apparently there are some well-supported OSX applications which do the same thing.

If you don’t already package your game this way, I hope that you seriously consider it: erase every “I really wanted to play this game, but I don’t have Java installed” comment from the possibility of existence!

Happy holidays and Merry Ludum Dare. :)

(Maybe) I’m in!

Posted by
Friday, August 24th, 2012 4:19 pm

If it turns out that it’s perfectly within contest rules to participate with a team in the Jam and also as a soloist in the Compo, then I’m in! Already counted for in the Jam.

Will be trying to use some combination of server-side Python, powered by Bottle + gevent, and HTML5 Canvas, likely using the ImpactJS library client-side. I have no basecode, but will likely be inspired by tutorials available for both Bottle and ImpactJS.

Should be interesting! :)

How to package your Java game this LD

Posted by
Friday, August 24th, 2012 5:01 am

Howdy, folks!

If you’re using Java to create your game, please take mercy on the people who want to play your game and consider using Launch4j or some other kind of packaging tool to package it. Launch4j makes it relatively easy to package together game code, game art, Java libraries, native libraries and a JVM.

The catch? Launch4j didn’t make immediate sense to me when I started using it, and it might not to you either. So here’s a tutorial on how to go from a JAR file and assets to a nice package. (Here’s an example of an end result for Windows users)

News Team, Assemble!

  1. Go get Launch4j.
  2. Make a new directory to assemble your package in. I’ve called mine “Recall”.
  3. Put your game code in a JAR file. In this example, my game’s JAR file is called “transient.jar”. Most development environments can do this for you. Eclipse calls this “Export”, I believe, and Netbeans builds a JAR as a part of normal building of your project.
  4. Put that JAR file in the root of the directory just created.
  5. Put all your game’s Java libraries inside a folder in the newly created directory called “lib”. It’s best to name it whatever it’s called inside your source project, but technically you can name it something else if you want.
  6. Hopefully, when you were developing your game, you had a folder in your project called “res” or “data” or something similar where you put all the game’s assets. Stick that folder in the root of the directory. Multiple folders introduce some clutter but should work as well.
  7. Put any native libraries your game uses, like the native components of the LWJGL, in the root of the directory.
  8. Put any other files that your game expects to be in the directory with it (logging configuration, splash screen, etc.) in the root of the directory.
  9. If you’re bundling a JVM, which I heartily recommend, copy that folder from elsewhere on your computer into place at the root of the directory as well.
visual overview of files in the packaging directory

Hot Pocket Drop It

  1. Open up Launch4j.
  2. On the Basic tab, select your game JAR file using the folder button to the right of the “*Jar” field.
  3. On Windows, Launch4j creates an EXE file. Click on the folder button to the right of the “*Output file” field and give your output a name, making sure it’s in the folder we’ve been working in all this time.
  4. If your game JAR file is awesome, you won’t have to do anything on the Classpath tab. However, I did. I had to enable the Custom Classpath option in order to specify a different main class than the one specified in my game JAR’s manifest, and also in order to verify it was looking in the right places for the Java libraries.
  5. On the JRE tab, specify the folder where we put the JRE from step 9 of the file assembly process. In my example, it would be “jre7”
  6. Save your Launch4j configuration file somewhere using the diskette button on the top left of the Launch4j window.
  7. Build your wrapper using the gear button on the top left of the Launch4j window.
  8. Test it using the play button.

Victory Shall Be Yours

You now have a functional packaged game that relies on no outside JVM, libraries, or other things that a player would have to set up!

I’ll be hanging out in the IRC channel for the working hours of the competition if you have any questions or problems using Launch4j – alternatively, I believe there’s a mailing list for Launch4j you can use. You can also drop me a line with the gmail at the spirulence if you like.

Good luck!

Musician looking for Jam Team!

Posted by
Monday, April 16th, 2012 12:48 am

Hey,  everybody!

Is there a Jam team out there in cyberspace that is looking for a musician to join their team? Here’s a link to some of my previous video-gamey music: http://soundcloud.com/spirulence/sets/video-game-music-18/

[cache: storing page]