Standard Game assist

I’ve been using jME for a while and for some strange reason all of my jME1.0 files suddenly stopped working after a couple of days of mesing around with it i decided to just delete it and change all the files I made to support jME2.0 since I was using both and started to gradually use 2.0 more. I had a standardgame and it worked for a couple weeks, but for some strange reason it just stopped working yesterday,it displays a black screen and freezes. Could it be something wrong with the code i changed it to see if it was somehting i was doing wrong but it still didn’t work so i decided to change the helloskybox and helloterrain however it still didn’t work. However when I made it using simplegame it worked can anyone assisst me on what I may have done wrong I get

Aug 1, 2008 5:04:34 PM com.jmex.game.DefaultUncaughtExceptionHandler uncaughtException

SEVERE: Main game loop broken by uncaught exception

com.jme.system.JmeException: Bad display mode (w/h/bpp/freq): 640 / 480 / 24 / 60

   at com.jme.system.lwjgl.LWJGLDisplaySystem.selectMode(LWJGLDisplaySystem.java:496)

   at com.jme.system.lwjgl.LWJGLDisplaySystem.initDisplay(LWJGLDisplaySystem.java:407)

   at com.jme.system.lwjgl.LWJGLDisplaySystem.createWindow(LWJGLDisplaySystem.java:143)

   at com.jmex.game.StandardGame.initSystem(StandardGame.java:271)

   at com.jmex.game.StandardGame.run(StandardGame.java:185)

   at java.lang.Thread.run(Thread.java:619)







actually sometime its a different error message but that’s what i got just now



the code i used for standard game is http://nopaste.info/4dc4f221dd.html and the SimpleGame that worked was http://nopaste.info/f427590f09.html



ALSO i dunno if this is anyimportant but HelloLOD in jME2.0 and another test i can’t think of right now refuses to work displaying the message

Aug 1, 2008 5:22:50 PM class jMETests.HelloLOD start()

SEVERE: Exception in game loop

java.lang.NullPointerException

   at com.jme.scene.lod.ClodMesh.<init>(ClodMesh.java:105)

   at com.jme.scene.lod.AreaClodMesh.<init>(AreaClodMesh.java:101)

   at jMETests.HelloLOD.getClodNodeFromParent(HelloLOD.java:154)

   at jMETests.HelloLOD.simpleInitGame(HelloLOD.java:75)

   at com.jme.app.BaseSimpleGame.initGame(BaseSimpleGame.java:527)

   at com.jme.app.BaseGame.start(BaseGame.java:71)

   at jMETests.HelloLOD.main(HelloLOD.java:49)

Aug 1, 2008 5:22:50 PM com.jme.app.BaseSimpleGame cleanup

INFO: Cleaning up resources.

Aug 1, 2008 5:22:50 PM com.jme.app.BaseGame start

INFO: Application ending.





but everything else works is it something I did wrong when setting up jME2.0?

Can anyone elaborate on the problem also this is the ExampleGameState i used basically a copy of debugGameState

it seems the recent change to GameTask causes a deadlock.



You can reproduce the problem easily:



import java.util.concurrent.Callable;

import com.jme.util.GameTaskQueueManager;
import com.jmex.editors.swing.settings.GameSettingsPanel;
import com.jmex.game.StandardGame;
import com.jmex.game.state.DebugGameState;
import com.jmex.game.state.GameStateManager;

public class TestStandardGamelock {
    public static void main(String[] args) throws Exception {
        System.setProperty("jme.stats", "set");
        StandardGame game = new StandardGame("HelloExample");
        if (!GameSettingsPanel.prompt(game.getSettings())) {
            return;
        }
        game.start();
        GameTaskQueueManager.getManager().update(new Callable<Object>() {
            public Object call() throws Exception {
                GameStateManager.getInstance().attachChild(new DebugGameState());
                return null;
            }
        }).get();
        GameStateManager.getInstance().activateAllChildren();
        System.out.println("Hey, you only reach me, if you use revision 3837");
    }       
}

Looks like the changes made assume that the result of a GameTask will != null.  I will change to using a finished boolean for now.  If someone has a better way, that's cool too.

I updated jMEv2.0 several times in the past week is however standardgame still doesn't work for me is their something wrong with my code??

For the bad display mode exception: if you use Vista as OS, 24 color bits dont work (at least with current nVidia drivers) use 16 or 32 bpp.