Nex Gen LWJGL Applets!

I’m fairly sure those obfuscating apps can reverse those stacktraces into the ‘real’ ones. At least 1 did the trick, I dunno about ProGuard

I have updated the betashot applet to a none proguarded version, should be easier to follow those exceptions (although has added a 100kb to it :slight_smile: ), Riven could you try again please and post the console output?.

Also for those that had the problem with it only working the first time and thereafter failing, I have uploaded a no cache version, can you try it and see if you still get the same problem http://kappa.javaunlimited.net/betashot4/betashot-nocache.html
I have not been able to reproduce the error, so still unsure why it works for some computers and not yours, doesn’t seem to be any link with jre versions although does look like it only happens on windows, if the above no cache applet starts working for you than it should get me a step closer to figuring out where the problem is.

Fine applet but there is frequently a very short slowdown, the display gets frozen during a fraction of second.

I don’t see what is so “new” in the fact of using applets with an OpenGL binding in Java as GL4J (partially) and JOGL made it before.

Sorry, I’ll have access to that computer next week - works fine on my home computer.

Fine applet but there is frequently a very short slowdown, the display gets frozen during a fraction of second.

Eclipse running in the background? Other than that… are you using an up to date JRE? (Some of the earlier JDK6 builds were somewhat bad.)

I don’t see what is so “new” in the fact of using applets with an OpenGL binding in Java as GL4J (partially) and JOGL made it before.

Detail improvements for the most part. No AWT stuff anymore (slightly faster and less error prone), various bug fixes, a loader, and an applet swapping technique on top. Together with the matching placeholders and the “shared” progress bar (I outlined in the diagram above) it’s now pretty seamless and user friendly. It’s actually very usable right now (for the first time that is) thanks to kappa’s hard work.

Before all those improvements it was just proof of concept or gimmick stuff. It wasn’t really something that made a good impression nor something you could use to earn money. But with all those improvements in place it finally starts to look like an option.

Hangs the second time I try it in the same browser session. If I restart the browser it works one time, then the second time it hang again. Stack trace:

org.lwjgl.LWJGLException: Could not find a valid pixel format
at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
at org.lwjgl.opengl.WindowsDisplayPeerInfo.initDC(WindowsDisplayPeerInfo.java:54)
at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:158)
at org.lwjgl.opengl.Display.createWindow(Display.java:299)
at org.lwjgl.opengl.Display.create(Display.java:848)
at org.lwjgl.opengl.Display.create(Display.java:800)
at org.lwjgl.opengl.Display.create(Display.java:782)
at utils.AppletGameContainer$ContainerPanel.start(Unknown Source)
at utils.AppletGameContainer$1.run(Unknown Source)
Exception in thread “Thread-26” java.lang.NullPointerException
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:489)
at utils.AppletGameContainer$Container.runloop(Unknown Source)
at utils.AppletGameContainer$ContainerPanel.start(Unknown Source)
at utils.AppletGameContainer$1.run(Unknown Source)

GeForce 7900 GS

The no-cache version works great now on my work machine (which was the one I was having problems with earlier). Tried it in both IE and FF (don’t have Opera on this machine).

Great work, looks and sounds very neat. Unfortunately it didn’t work on my work computer (windows XP, FF, java 6 update n). I saw the LWJGL loading bar and then it went black. Here’s the console output:

Thu Apr 24 21:12:10 EST 2008 INFO:Slick Build #173
org.lwjgl.LWJGLException: Could not find a valid pixel format
at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
at org.lwjgl.opengl.WindowsDisplayPeerInfo.initDC(WindowsDisplayPeerInfo.java:54)
at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:158)
at org.lwjgl.opengl.Display.createWindow(Display.java:299)
at org.lwjgl.opengl.Display.create(Display.java:848)
at org.lwjgl.opengl.Display.create(Display.java:800)
at org.lwjgl.opengl.Display.create(Display.java:782)
at utils.AppletGameContainer$ContainerPanel.start(Unknown Source)
at utils.AppletGameContainer$1.run(Unknown Source)
Exception in thread “Thread-11” java.lang.NullPointerException
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:489)
at utils.AppletGameContainer$Container.runloop(Unknown Source)
at utils.AppletGameContainer$ContainerPanel.start(Unknown Source)
at utils.AppletGameContainer$1.run(Unknown Source)

No. JDK 1.6 update 4, I had only opened the browser when I tested it. I have tested more than 70 Java games and it was the first time I saw this.

The short pauses could be the garbage collector, since this type of game creates a lot of objects (every bullet and ship is an object), could probably be optimised to reduce the amount of garbage but right now focus is on getting it working everywhere. Also the ship movement splines are calculated just before they appear on the screen, changing that to be preloaded should take of a lot of it cpu usage (might even be the reason for the pauses).

As for performance in comparison with lwjgl 1.0 applets, it has improved a lot, the rendering in 2.0 completely bypasses the AWT rendering thread (AWT painting is disabled and not used). Keyboard and Mouse Input delay was another issue with previous lwjgl applets which is now gone as it is handled totally by the native LWGJL Display, AWTInputAdapter has been removed from LWJGL. In theory the performance should be almost as good as the native LWJGL Display.

What video card are you running? If its a radeon, like mine (ATI x1400). i get short pauses when i call alot of display lists in one cycle. i had to change everything over to vbo’s and now the spikes are gone. i think its more of a memory leek, than garbage collection, well was for me anyway. was driving me nuts, thought the game was hopeless till i changed over, and everything became soooooooooo smooth :smiley:

Have uploaded a new version, first attempt at the oNyx loading method, personally lack good artistic skills, so its just a simple loading screen but should give an idea of whats possible, could do a bit more tweaking two reduce the gap between appletloader finishing and game starting.

The exception “org.lwjgl.LWJGLException: Parent.isDisplayable() must be true” has been fixed and shouldn’t happen again.

Have also attempted another fix which might fix the “org.lwjgl.LWJGLException: Could not find a valid pixel format” error, would appreciate if you ppl can try once again.

http://kappa.javaunlimited.net/betashot4/betashot.html

http://kappa.javaunlimited.net/betashot4/betashot-nocache.html

Looks good. ;D

It goes black for a bit when it switches from java2d over to lwjgl (as predicted), but I guess there isn’t anything one could do about that.

I still get the same exception, even though other lwjgl/slick games work fine.

org.lwjgl.LWJGLException: Could not find a valid pixel format
at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
at org.lwjgl.opengl.WindowsDisplayPeerInfo.initDC(WindowsDisplayPeerInfo.java:54)
at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:158)
at org.lwjgl.opengl.Display.createWindow(Display.java:299)
at org.lwjgl.opengl.Display.create(Display.java:848)
at org.lwjgl.opengl.Display.create(Display.java:800)
at org.lwjgl.opengl.Display.create(Display.java:782)
at utils.AppletGameContainer$ContainerPanel.start(Unknown Source)
at utils.AppletGameContainer$1.run(Unknown Source)
Exception in thread “Thread-54” java.lang.NullPointerException
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:489)
at utils.AppletGameContainer$Container.runloop(Unknown Source)
at utils.AppletGameContainer$ContainerPanel.start(Unknown Source)
at utils.AppletGameContainer$1.run(Unknown Source)

The first one still gives me the pixel format exception on the second run.


org.lwjgl.LWJGLException: Could not find a valid pixel format
	at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
	at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
	at org.lwjgl.opengl.WindowsDisplayPeerInfo.initDC(WindowsDisplayPeerInfo.java:54)
	at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:158)
	at org.lwjgl.opengl.Display.createWindow(Display.java:299)
	at org.lwjgl.opengl.Display.create(Display.java:848)
	at org.lwjgl.opengl.Display.create(Display.java:800)
	at org.lwjgl.opengl.Display.create(Display.java:782)
	at utils.AppletGameContainer$ContainerPanel.start(Unknown Source)
	at utils.AppletGameContainer$1.run(Unknown Source)
Exception in thread "Thread-25" java.lang.NullPointerException
	at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:489)
	at utils.AppletGameContainer$Container.runloop(Unknown Source)
	at utils.AppletGameContainer$ContainerPanel.start(Unknown Source)
	at utils.AppletGameContainer$1.run(Unknown Source)

Works like a charm here (Opera 9.24, nVidia Ti4200, 1.6.0_05).
Awesome work!

Noob question here, but what tool are you guys using to obfuscate your applet loader code?

I’m just starting from the sample which comes with the lwjgl distribution and going from there…

Many humble thanks!

I’m using ProGuard, but needs to be tweaked a little to get it working properly with lwjgl.jar, just set proguard to ignore the org.lwjgl.* and org.lwjgl.opengl.* packages.

Very interesting! Thanks a lot Kapta! bow

On Ubuntu 8.04 (Firefox 3 beta 5, Java 1.6.06, Intel 82865G) :

  • each time, i click on the applet there is a black flickering
  • no keyboard in applet mode (there is the keyboard in full screen mode)
  • when i return in applet mode, it mess up the screen

Well, since it is on a beta of Firefox, it may not be important. I should retest it when the final is out.