Mini 3D FPS in an Applet Update 9

I watch this in JConsole:

Name: Thread-58
State: BLOCKED on java.lang.Object@1b94ea2 owned by: Direct Clip
Total blocked: 1  Total waited: 0

Stack trace: 
com.sun.media.sound.DirectAudioDevice$DirectDL.flush(DirectAudioDevice.java:672)
com.sun.media.sound.JavaSoundAudioClip.stop(JavaSoundAudioClip.java:205)
   - locked com.sun.media.sound.JavaSoundAudioClip@13dc4d5
sun.plugin.viewer.context.AppletAudioClip.stop(AppletAudioClipFactory.java:340)
   - locked sun.plugin.viewer.context.AppletAudioClip@161def0
sun.plugin.viewer.context.PluginAudioClip.stop(AppletAudioClipFactory.java:181)
game.spiderExperiment.FPSSampleMain.playerControl(FPSSampleMain.java:789)
game.spiderExperiment.FPSSampleMain.doGameLogic(FPSSampleMain.java:521)
game.spiderExperiment.FPSSampleMain.render3DWorldSpace(FPSSampleMain.java:435)
net.dzzd.core.ap.render(Unknown Source)
net.dzzd.core.ap.run(Unknown Source)
java.lang.Thread.run(Thread.java:619)
Name: AWT-EventQueue-2
State: WAITING on java.awt.EventQueue@90ed81
Total blocked: 2  Total waited: 1 391

Stack trace: 
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:485)
java.awt.EventQueue.getNextEvent(EventQueue.java:479)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:245)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

java.io.FileNotFoundException: http://demo.dzzd.net/FPSSample8//LIB/gluegen-rt-natives-linux-i586.jar
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1296)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1290)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:944)
	at net.dzzd.extension.jogl.JOGLLoader.a(Unknown Source)
	at net.dzzd.extension.jogl.JOGLLoader.load(Unknown Source)
	at net.dzzd.extension.loader.ExtensionLoader.loadExtension(Unknown Source)
	at net.dzzd.DzzD.newRender3D(Unknown Source)
	at net.dzzd.core.r.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: http://demo.dzzd.net/FPSSample8//LIB/gluegen-rt-natives-linux-i586.jar
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1239)
	at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2052)
	at java.net.URLConnection.getHeaderFieldInt(URLConnection.java:579)
	at java.net.URLConnection.getContentLength(URLConnection.java:474)
	... 6 more

After some minutes, the game is no more frozen but when I try to walk again, it gets frozen :frowning:

I succeed in going forward when I press the right button on the mouse without releasing it. When I touch the floor, it gets frozen again.

Looks like the cause is the first exception; its a problem with the sounddriver… or your sounddriver and jvm not liking eachother. Can you play sound (using AudioClip) with other Java apps/applets on that config?

I’m not sure about the second, the stacktrace doesnt seem to trace back to the applet, it seems related to the first exception.

The last exception is because you tried to switch to hardware rendering, but we havent placed the necesary jar online for your jvm (gluegen-rt-natives-linux-i586.jar) :-X

The controlling is indeed bad and when i was trying to make a FPS-like game in Flash i had the same issue. I solved it by using WASD to move and turn around and using the mouse to aim. Here is an -unfinished- example of what i’m talking about.

I remind you that I worked on the Java Game Tome some months ago at the beginning of the project and I tested lots of games successfully (hundreds). My sound driver is fine, it works fine with TUER (webstart) and Tesseract (applet) that are both open source and use both AudioClip.

I don’t have to place it, it is up to the author to do it and I see that he copied some jars on my machine when I activate the hardware rendering.

Well, something seems to break down with the AudioClip, especially since you say it happens when you try to walk; Thats when the footstep audioclip is played. We’ll put a nosound version online to test.

I never said you’d have to, I said we forgot ???

Nice game! I just love these oldskool raycasted type of games. Those controls work very well for that type of game indeed, but I guess it’d work less intuitive in full 3d where 6dof mouselook is important. I’m working on a option that uses the robot class for mouselook, but it will require the user to accept a certificate when they chose that option. I guess it’s the same dilema as console gamers vs pc gamers. Maybe we can give the non robot-mouselook players a slight advantage using limited auto-aiming or something.

Add autosloping (camera that automatically has a look-at direction parallel to the surface the player is on) and auto aiming. With some clever level design this shouldn’t be a problem (although it is still a workaround for a silly limitation - Shockwave can lock the mouse and i see nobody that took advantage of this… also the runtime can always provide means to unlock the mouse - which shouldn’t exist and its the reason i use LWJGL in my Java project).

[quote]Add autosloping (camera that automatically has a look-at direction parallel to the surface the player is on) and auto aiming.
[/quote]
could be a good option especially for casual game, even if it will give less freedom (like shooting upper itself) but anyways as casual gamer like simple control… why not.

Update 9 :
FPS like mouse control (use M key to switch)
better spiders AI

http://demo.dzzd.net/FPSSample9/

every body who asked for FPS like mouse controls can say thanks to Thijs as he made a smooth solution !

ps: still no player life/death

Great addition. I think you should add a crosshair in the middle.

Now you need to make some interesting levels :smiley:

+! for cross-hair with the new mouse-look.

By the way, how did you do mouse capture without using Robot and all permissions? (or did you use Robot?)

Amazing, amazing work, the graphics are phenomenal. You guys just need some artists to help you out with models and you can churn out flash-style 3d games.

Cross-hair is on the way, together with some menu’s to help the user tune all settings.

The mouse capture is done using the Robot class, but I ask for permission before doing so, using the extensionloader I posted some while back. This means the applet can start within the sandbox, and ask for special rights at runtime when the user request a special feature like hw rendering or mouselook etc. The user only has to trust the applet once, from then on the applet is granted all privileged rights just like a normal signed applet.

Well if you happen to know an artist who’s willing to work for free we’d be glad to hear :wink:

[quote]I remind you that I worked on the Java Game Tome some months ago at the beginning of the project and I tested lots of games successfully (hundreds). My sound driver is fine, it works fine with TUER (webstart) and Tesseract (applet) that are both open source and use both AudioClip.
[/quote]
about the sound issue, it probably come from a wrong format for the walk sound, I try to correct it but unfortunatly it always crash Audacity … so if someone is able to correct it as I am unable to merge stereo sounds tracks to mono… you can grab it here

folder: http://demo.dzzd.net/FPSSample9/FPSSample/

direct link : http://demo.dzzd.net/FPSSample9/FPSSample/WALK.au (it is 8k stereo and it should be mono/8k)

Really great work! This software renderer is absolutely amazing.
I did get some flicker in hardware mode though (but that might not be your fault).

Some points:

  • Switching between hw and sw takes quite some time. At least a progress bar would be nice.
  • It would be nice if mouse-look could also be exited with the ESC key (with some on-screen feedback similar to Flash when it goes in fullscreen mode). That would be much more natural for the casual user as mouse look is kind of invasive.

unfortunatly progress monitoring is a little broken … as we made a conception error => so we cannot add it (or rather it will imply work for nothing) until we review the whole progress monitoring gesture of the API.

+1 => Done & Updated here http://demo.dzzd.net/FPSSample9/

I finally add the native requiered libraries, not sure about version ( especially gluegen-rt-natives-linux-i586.jar),

@gouessej : could you give it another try ?

http://demo.dzzd.net/FPSSample9/

It works better now :smiley: but after some minutes, I get some huge slowdowns :frowning: I’m trying to understand why.

Edit.: I get this sometimes after switching the mouse mode:

[quote]java.lang.IllegalThreadStateException: forbid thread creation in disposed TG
at sun.plugin.security.ActivatorSecurityManager.checkAccess(ActivatorSecurityManager.java:155)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:288)
at java.lang.Thread.init(Thread.java:332)
at java.lang.Thread.(Thread.java:433)
at java.awt.EventDispatchThread.(EventDispatchThread.java:58)
at java.awt.EventQueue$1.run(EventQueue.java:822)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.EventQueue.initDispatchThread(EventQueue.java:819)
at java.awt.EventQueue.postEventPrivate(EventQueue.java:194)
at java.awt.EventQueue.postEvent(EventQueue.java:175)
at java.awt.EventQueue.invokeAndWait(EventQueue.java:991)
at sun.applet.AppletPanel.run(AppletPanel.java:567)
at java.lang.Thread.run(Thread.java:619)
[/quote]
and this:

[quote]java.lang.ClassCastException: net.dzzd.extension.loader.a cannot be cast to sun.plugin.security.ActivatorSecurityManager
at sun.plugin.security.PluginClassLoader.release(PluginClassLoader.java:463)
at sun.plugin.AppletViewer.release(AppletViewer.java:1279)
at sun.plugin.viewer.LifeCycleManager.releaseAppletPanel(LifeCycleManager.java:253)
at sun.plugin.viewer.MNetscapePluginObject.destroyPlugin(MNetscapePluginObject.java:707)
at sun.plugin.navig.motif.Plugin.doit(Plugin.java:233)
at sun.plugin.navig.motif.Plugin.start(Plugin.java:104)
[/quote]
but keep cool, it often works reliably.

the seconde one seems ok for me (maybe) it seems that it happen while releasing the applet maybe you initiate a switch just befor exiting or you reload the page

any MAC user feedback on hardwar and mouse switch ?