I’ve resurrected one of my abandoned projects, Arcane Tactics. The game is real time tactics with a fantasy setting. The game isn’t ready to play yet, but can you guys give the applet a try? It is here:
http://arcanetactics.com/applet/
The server isn’t running yet! I know “Play” doesn’t work. I’m specifically looking to make sure the applet works everywhere. Any feedback on the applet loader would be great.
So far, I have fleshed out a party creation UI and spent quite a bit of time on the applet loader (anything to keep me from finishing the game! wtf!?). It is based on LWJGL’s loader, but with a few changes for a hopefully better user experience. The progress bar is glowing and smoothly animated. It is constantly (or almost always) moving, so you never feel like it has hung. Also it is weighted toward the end. It artificially fills up too fast to give the user the feeling it is almost done sooner. It fades out for a more pleasant transition to the game. I dimly draw the applet version in the corner, to remove confusion as to whether then cache is being used.
I’ve tested it on Windows in Firefox, IE6, and Chrome and it seems to work well. It doesn’t work on OSX for some reason. I don’t have OSX myself, but others say the loader works but the game never starts, they just get a black screen. It’s a mystery, there are no exceptions thrown or any errors in the OSX console. Maybe someone here has some insight why?
I have OSX in VMware and I fixed problems until it fails due to some OpenGL problem. I thought it was because my VM doesn’t have hardware acceleration, but alas it still doesn’t work on real hardware. At any rate, here is the exception running in VMware:
[quote]java.lang.NullPointerException
at org.lwjgl.opengl.GL11.glGetString(GL11.java:1771)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.initiateGLInstances(LwjglGraphics.java:200)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setupDisplay(LwjglGraphics.java:156)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:138)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:130)
[/quote]
This doesn’t seem like a nice way for LWJGL to die. How should I modify libgdx to avoid an NPE and throw an exception if LWJGL can’t start up?
I mentioned in this thread a simple error collecting mechanism and I’m using it in the applet. So, if the applet doesn’t show up for you, likely we’ll be able to see your error here:
http://arcanetactics.com:8080/at/error?p=view
I’m sorry I wasn’t able to make my applet loader changes generic and contribute back to LWJGL. I burnt hours on it already and it would take some effort to get everything I want in a way that is also usable for any game. I do think some of what I did, like the smoothly animating progress bar, would be useful for all LWJGL applets. Maybe someone would port some or all of what I’ve done or write something similar from scratch? Here is my code:
http://arcanetactics.com/temp/AppletLoader.java
It has been formatted, so for your diffing pleasure, here is the original (which is from LWJGL 2.8.2) formatted with the same formatter:
http://arcanetactics.com/temp/AppletLoaderOriginal.java
I hardcoded all the settings, ripped out a couple things (eg, no animated gifs), and did what I needed for my progress bar, fading out, etc.
Beyond that, I think LWJGL would benefit from promoting an easy way to get running in an applet. Eg, put all your JARs in a directory, run something, and now you have everything signed and your applet is ready to be deployed. I don’t care how it’s done, but I can’t help mention that Scar could do it. It has an lwjglApplet method, but that only works out of the box if Scar is already building your project. Figuring out Scar ruins the whole idea with making it super easy to go from JARs -> working applet. Scar could still be used though, for its utility methods. Eg, here is part of my build script for Arcane Tactics:
String keystore = ...;
String alias = ...;
String password = ...;
keystore(keystore, alias, password, "Esoteric Software", "Arcane Tactics");
String distDir = ...;
String appletDir = ...;
new Paths(distDir, "**/*.jar", "*.html", "*.jpg").flatten().copyTo(appletDir);
for (String jarFile : new Paths(appletDir, "*.jar")) {
String fileName = fileName(jarFile);
if (fileName.equals("appletloader.jar")) {
sign(unsign(jarFile), keystore, alias, password);
continue;
}
if (fileName.contains("native")) {
lzma(sign(unsign(jarFile), keystore, alias, password));
continue;
}
sign(unpack200(pack200(unsign(jarFile))), keystore, alias, password);
lzma(pack200(jarFile));
}
Note this is all plain Java code, it just has a static import for Scar.*. As you can see, the whole generate keystore, unsign, pack200, unpack200 (to normalize the JAR), sign, pack200, and then lzma is pretty intense. Imagine trying to write an Ant script for that nastiness! It would also be nice if it could generate and/or update the JARs section in the HTML file. Is a tool like this worth the effort? Would the LWJGL cats promote and maintain it?