Hey guys,
Im new to this forum and want to thank first of all for this Nice engine.
Currently Im busy doing tutorial 2: HelloNode
But I have a problem, I used exact the same code but the game doesn’'t start and is empty.
It still opens Main.java, But when I rename HelloNode to Main.java for example it immediately shuts down after executing.
Hopefully I can get help with this! thanks
Hello!
What was the stacktrace/error log from the run? That will help immensely.
~FlaH
Hi,
Thanks for the respons
init:
Deleting: C:UsersmynameDocumentsjMonkeyProjectsGamebuildbuilt-jar.properties
deps-jar:
Updating property file: C:UsersmynameDocumentsjMonkeyProjectsGamebuildbuilt-jar.properties
compile:
run:
11-mrt-2011 17:45:00 com.jme3.system.JmeSystem initialize
INFO: Running on jMonkey Engine 3 Alpha 0.6
11-mrt-2011 17:45:01 com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #1: file:/C:/Program%20Files/jmonkeyplatform/jmonkeyplatform/libs/
11-mrt-2011 17:45:01 com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #2: C:UsersmynameDocumentsjMonkeyProjectsGame
11-mrt-2011 17:45:01 com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #3: C:UsersmynameDocumentsjMonkeyProjectsGame
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglAbstractDisplay run
INFO: Using LWJGL 2.5
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglDisplay createContext
INFO: Selected display mode: 640 x 480 x 0 @0Hz
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Display created.
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Adapter: nvd3dum
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Driver Version: 8.17.12.5721
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Vendor: NVIDIA Corporation
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: OpenGL Version: 3.3.0
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Renderer: GeForce 9800 GT/PCI/SSE2
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: GLSL Ver: 3.30 NVIDIA via Cg compiler
11-mrt-2011 17:45:01 com.jme3.system.lwjgl.LwjglTimer
INFO: Timer resolution: 1000 ticks per second
11-mrt-2011 17:45:01 com.jme3.renderer.lwjgl.LwjglRenderer initialize
INFO: Caps: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, OpenGL20, OpenGL21, OpenGL30, ARBprogram, GLSL100, GLSL110, GLSL120, GLSL130, GLSL140, GLSL150, VertexTextureFetch, TextureArray, TextureBuffer, FloatTexture, FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer, TextureCompressionLATC, MeshInstancing, VertexBufferArray]
11-mrt-2011 17:45:01 com.jme3.asset.DesktopAssetManager
INFO: DesktopAssetManager created.
11-mrt-2011 17:45:01 com.jme3.renderer.Camera
INFO: Camera created (W: 640, H: 480)
11-mrt-2011 17:45:01 com.jme3.renderer.Camera
INFO: Camera created (W: 640, H: 480)
11-mrt-2011 17:45:01 com.jme3.input.lwjgl.LwjglMouseInput initialize
INFO: Mouse created.
11-mrt-2011 17:45:01 com.jme3.input.lwjgl.LwjglKeyInput initialize
INFO: Keyboard created.
11-mrt-2011 17:45:01 com.jme3.audio.lwjgl.LwjglAudioRenderer initialize
INFO: Audio effect extension version: 1.0
11-mrt-2011 17:45:01 com.jme3.audio.lwjgl.LwjglAudioRenderer initialize
INFO: Audio max auxilary sends: 2
11-mrt-2011 17:45:01 com.jme3.material.MaterialDef
INFO: Loaded material definition: Default GUI
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Gui Node)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
11-mrt-2011 17:45:01 com.jme3.scene.Node attachChild
INFO: Child (Statistics View) attached to this node (Gui Node)
11-mrt-2011 17:45:01 com.jme3.asset.DesktopAssetManager loadAsset
WARNING: Cannot locate resource: Common/MatDefs/Misc/Unshaded.j3md
11-mrt-2011 17:45:01 com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException: Material definition cannot be null
at com.jme3.material.Material.(Material.java:146)
at com.jme3.material.Material.(Material.java:152)
at mygame.HelloNode.simpleInitApp(HelloNode.java:27)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:186)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:134)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:183)
at java.lang.Thread.run(Thread.java:662)
BUILD SUCCESSFUL (total time: 4 seconds)
Btw the build not only closes at when starting HelloNode, but also HelloJME3
( started these by going to properties -> run -> mainclass: mygame.HelloNode
Hello again!
The part I’m seeing that’s important is:
[java]SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException: Material definition cannot be null
at com.jme3.material.Material.(Material.java:146)
at com.jme3.material.Material.(Material.java:152)
at mygame.HelloNode.simpleInitApp(HelloNode.java:27)[/java]
NPE woooo. What this means is that either it couldn’t find the definition or that you assigned a material to a geometry that was null.
If you’re following the tutorial verbatim, I’d check your lines around:
[java]Material mat1 = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
mat1.setColor(“Color”, ColorRGBA.Blue);
blue.setMaterial(mat1);
[/java]
Come to think of it, update your jMP if you’re using that, or get a recent nightly build. Recently there was a shift from SolidColor.j3md to Unshaded.j3md. Now, if this is the case and you don’t want to update for some reason, try replacing “Common/MatDefs/Misc/Unshaded.j3md” with “Common/MatDefs/Misc/SolidColor.j3md” and change “Color” in your setColor call to “m_Color”.
If that works, then you are indeed running the older version that still uses SolidColor and m_ prefix’d variables to the shader.
Cheers!
~FlaH
The tutorials in the wiki are for the svn version, the tutorials in the Manual of jMP (press F1) are for the release version you download.
Thanks both,
Its indeed that mine isn’t the newest and the Main.java that does work uses that other method.
But I downloaded only yesterday this version? I thought that it was the newest.
Also I tried to update it, but this isn’t the newest version neither? hmm
Read the manual section on updating.