I don’t understand that one.
When ran from the IDE, my game runs fine, but if I want to run it using the latest build, it just CTD. AFAIK there are no crash logs created.
Here’s what’s happening:
Start the game.
Game loads, menu displays. Click on “New Galaxy”. The process starts but crashes at “Pinning stars”. Nothing else. And, as I said, in jMP, it loads and runs fine.
What could cause this?
I have no error (obviously) and no warning when building, even with -Xlint:unchecked.
I’m not sure it might be linked, but once in a while it will crash in jMP…
The message I get is:
[java]Nov 23, 2010 4:21:39 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalStateException: Scene graph is not properly updated for rendering.
Make sure scene graph state was not changed after
rootNode.updateGeometricState() call.
Problem spatial name: +Ship2-geom-1
at com.jme3.scene.Spatial.checkCulling(Spatial.java:227)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:466)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:462)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:462)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:655)
at com.jme3.renderer.RenderManager.render(RenderManager.java:684)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:216)
at stellarconquest.Game.update(Game.java:244)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:141)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:198)
at java.lang.Thread.run(Thread.java:662)
BUILD SUCCESSFUL (total time: 6 seconds)[/java]
But the oddest thing is, the method doing the above is in a app.enqueue. Here it is:
[java]
private void createShip() throws InterruptedException, ExecutionException {
Future fut = app.enqueue(new Callable() {
@Override
public Object call() throws Exception {
//playerShip.createShip();
pShipModel = assetManager.loadModel(“Models/Ships/PlayerShip/Ship2.mesh.j3o”);
stateGalaxy.getRootNode().attachChild(pShipModel);
pShipModel.scale(0.004f);
return this;
}
});
fut.get();
}
[/java]
Since running it from the desktop is much faster, I imagine that the above problem could crop up more often. I might get it once every five or more times in jMP.
So, what am I doing wrong?
I dont know what you are doing when you click “New Galaxy” in your game but the only differences between in-jMP and distribution are
a) ogrexml and obj files are excluded from the dist build (you are expected to use j30 but you can configure that in the project settings)
b) The distribution assets paths are cAsE sEnSitive while in-jMP it depends on your systems case sensitivity if you can load assets with wrong case
Checked the assets jar, the code and everything seems in order…
At that point I either continue working on it from the IDE and fix it later, or spend time trying to find out what`s the problem. It used to work but that was a “long” time ago and things were very different.
Whats the error output when you run the application from command line (java -jar MyGame.jar)?
Nice! I didn’t know I would get the error message from the command line! Thanks.
Here’s the result:
[java]
C:UsersDanyjMonkeyProjectsSCdist>java -jar “Stellar Conquest.jar”
Starting the game…
Event Manager Thread Started.
Used startIt()
Fixing the GUI.
Defining the galaxy.
Make Spiral
Octree building.
Total stars in nodes: 497338
Total stars.size(): 497338
Total stars NOT in nodes: 0
Pinning Stars.
Creating player ship.
Pinning ship.
Setting camera.
Outlining current node.
Nov 23, 2010 9:14:59 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalStateException: Scene graph is not properly updated for renderi
ng.
Make sure scene graph state was not changed after
rootNode.updateGeometricState() call.
Problem spatial name: +Ship2-geom-1
at com.jme3.scene.Spatial.checkCulling(Spatial.java:227)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:466)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:462)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:462)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:655
)
at com.jme3.renderer.RenderManager.render(RenderManager.java:684)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:216)
at stellarconquest.Game.update(Game.java:244)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDispl
ay.java:144)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:141)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.j
ava:198)
at java.lang.Thread.run(Unknown Source)
[/java]
Well, it seems that what I thought was happening really is happening.
Since I’m already using enqueue, I’m unsure what to think of all this.
You think maybe the model could be the problem? I don’t have another one handy. I’ll try to find another model to test. Although, I doubt it. It was working fine before I started threading the whole thing… Hm.
If its not deterministic its probably some threading thing. Maybe at some point you still modify an object outside the render thread?
Not that method anyway. It’s called only once and it’s at start up.
There’s only 3 little methods called after the ship creation, so I’ll just put those three in an enqueue and see what happens. At that point, I think it’s the best way to go. If that doesn’t work, I’ll swap model (maybe the tank/hovertank model would look nice flying in space!)
I’ll post the result.
Well, that seem to have done the trick. 12 run, not a single crash.
My guess is, something happened after createShip() was called but for some reason the rendering thread thought it was that method instead of whichever was doing the damage.
Another bug squashed.
If anyone reading this would like to run the preview let me know (it’d be nice to know it works on other systems) I can upload it to my web server in Mac, *nix or winblows version.
i’d be glad to test it tonight
I suspect the attach method was the one. (or a rotation similar, everything that modifies the scene graph in any way.
@EmpirePhoenix Whatever it was, it’s gone now. The rest after createShip() is pretty much only setting objects’s properties. Like, max camera distance, that sort of things. Nothing in there telling me right off that whatever it does will modify the scene graph. But there’s a lot of them, so I might have overlooked something obvious.
@nehon Which version you want to check?
Like, max camera distance,
imagine this is done while rendering a frame… it modifies a opengl object and so is only valid from opengl thread
oh sorry : window’s.