Completed Java3D applet game, opening discussions about how it was made.

Hey everyone,

We just finished making a Java3D applet game, it’s found at www.sleeper-game.com

If anyone has any questions about how we did things, feel free to ask and I’ll answer them here. We used Java 1.4.2 & Java 3D 1.4, also I included a small applet that checks for these versions and sends the user to an appropriate download page if they are not installed.

The applet is unsigned, and doesn’t do anything it can’t. Also did NOT use any other API’s such as JOGL, JINPUT, JAKE2 etc.

Thanks,

Thirg…

Nice guys. Very polished looking.

Very nice game! I’m impressed with robot’s moves Did you use a loader? if so which one? any special animation technique like IK or Morphing?

Congratulations!!!

Thanks for your feedback ! Glad you liked the game ! ;D

We wrote our own loader code, the applet isn’t signed so we couldn’t load the classes separately only the JAR’s. If you have any specific questions on the loader code just ask.

The robot’s animation is using forward IK, rotation and translation key frames are blended between to get the current animation frame, using lerp and slerp (quaternion) functions. We used 3DSMax to animate the robot, and then exported the animations into our own format of key frames per joint.

Thirg…

On OS X 10.4.6 with Java 5 (latest DP) I get a message in huge yellow letters saying “*** INCOMPATIBLE VERSION OF JAVA INSTALLED on Mac OS ***”

This is after I see a Java applet start with the Java 5 VM. If i look quick I can see a progress bar with “please wait” get to about 2% before it flips to the bogus error screen.

Would it be possible to get a “dump” of your Java console when this error occurs please swpalmer ?

It should display the java versions strings in the console window it’s comparing to, I combine the string values to an int for the first 5 digitis, i.e. 1.4.2 = 142, 1.5 = 150 etc.

Thanks,

Thirg…

The log from several attempts (hitting the back button to go back to the applet when it fails)

v1004061738
Mac OS X
2
Sun Java not found.
Apple Computer, Inc.
1.5.0_06
150
Going to http://www.sleeper-game.com/index.php?html=no_mac_java
v1004061738
Mac OS X
2
Sun Java not found.
Apple Computer, Inc.
1.5.0_06
150
Going to http://www.sleeper-game.com/index.php?html=no_mac_java
v1104061429
v1104061429
v1004061738
Mac OS X
2
Sun Java not found.
Apple Computer, Inc.
1.5.0_06
150
Going to http://www.sleeper-game.com/index.php?html=no_mac_java
v1104061429
v1004061738
Mac OS X
2
Sun Java not found.
Apple Computer, Inc.
1.5.0_06
150
Going to http://www.sleeper-game.com/index.php?html=no_mac_java
java.lang.InterruptedException: sleep interrupted
	at java.lang.Thread.sleep(Native Method)
	at Sleeper.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:613)
v1104061429
v1004061738
Mac OS X
2
Sun Java not found.
Apple Computer, Inc.
1.5.0_06
150
Going to http://www.sleeper-game.com/index.php?html=no_mac_java
java.lang.InterruptedException: sleep interrupted

Thanks for the log, we fixed the problem and uploaded another version.

Also we have moved to a trusted signed applet now.

If you would be so kind to try it on your Mac again it would be most appreciated.

Thanks,

Thirg…

Nice and fun game! :slight_smile:

Why Java3D instead of another 3D scene graph? I’m just curious to know your technological choice reasoning.

Keep up!

Thanks for you input and for trying the game :slight_smile:

We used Java3D because we “thought” users would find it easier to install (on Windows), given the applet wasn’t signed and we couldn’t load libraries. It has caused a lot of users problems though installing Java3D (it doesn’t seem to over write a previously installed version cleanly). Anyhow we have now moved to a signed applet and will be loading the Java3D libs at runtime. We may now consider moving to another 3D API, depends on the platform suitability as we want the product to work on Windows, Linux & Mac.

Thirg…

Its the first Java3D game I see that is smooth and has a GUI. How did you realize the latter?

  • J

The GUI is a number 3D triangles (2 tris per font character for example), projected using an Otho2D projection matrix (camera view matrix ) just infront of the camera.

We initially used TGA files with alpha for the UI graphics , but we found TextureLoader wouldn’t load in compressed TGA’s. So we opted for using 2 Jpeg images, one containing the image, the other containing grey-scale alpha of the same image, as Jpegs can only contain 1 bit alpha. Our large font file went from being 2mb down to 90k for each of the 2 files.

We also use pure-immediate mode rendering, so we can control exactly what and when everything is being rendered.

If you need any more specifics I’d gladly oblige :slight_smile:

Thirg…

I’m thoroughly impressed! That’s a really great game you created. I’ve been basing my programming efforts around the idea that programming games in Java is not only possible but highly desirable, it’s great to see such a concrete, polished example of great game programming in Java.

I like the camera animation. What can you tell us about it’s implementation?

If by camera animation, if you mean the spinning at the start of each level, it is basically just manipulation of the camera’s matrix and target positions.

Spinning the camera around it’s target (only on the XZ plane) whilst lowering the target’s Y position achieves the spin, as well as dollying closer to the target (moving the camera position based on the target to camera position vector).

Hope this helps!

Thirg…

thnx, I was thinking more in the direction whether you’re using some funky custom interpolator or path following behavior.

I posted a question concerning picking in immediate mode, you might have a suggestion considering you went with immediate mode in your game.