Windows EXE does not build after switching to 3.1 alpha

Hello Monkeys,

I just transfered my large project from 3.0 to 3.1 and got a few surprizes.

I use the 3.1 librairies.

When I used to build the exe it would create a very large exe and the standard librairies.

Now, it creates a tiny EXE with the standard librairies AND all my assets and classes visible.

After doing the jar, MACOSX and WIN EXE, I think it tries to create the standard (large) EXE but I get the following error:

Windows EXE Creation
C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\nbproject\launch4j-impl.xml:6: taskdef class net.sf.launch4j.ant.Launch4jTask cannot be found
using the classloader AntClassLoader[]

So… how get I get my large EXE back ??

Here is the full output:

ant -f ā€œC:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGameā€ -Dnb.internal.action.name=rebuild clean jar
init:
deps-clean:
Updating property file: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\built-clean.properties
Deleting directory C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build
clean:
Building jar: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\assets.jar
init:
deps-jar:
Updating property file: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\built-jar.properties
Created dir: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes
Created dir: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\empty
Created dir: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\generated-sources\ap-source-output
Compiling 276 source files to C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes
warning: [options] bootstrap class path not set in conjunction with -source 1.7
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\sky\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\navigation\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\nifty\test\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\xml\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\controls\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\nifty\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\physics\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\debug\test\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\sky\test\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\math\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\ui\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\sky\textures\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\debug\package-info.class
Creating empty C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\jme3utilities\package-info.class
Copying 1 file to C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes
compile:
Created dir: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\dist
Copying 1 file to C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build
Created dir: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\META-INF
Copying 1 file to C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\classes\META-INF
Copy libraries to C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\dist\lib.
Building jar: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\dist\MyGame.jar
To run this application from the command line without Ant, try:
java -jar ā€œC:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\dist\MyGame.jarā€
Copying 1 file to C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build
jnlp:
Windows 64bit Application Creation
Copying 1 file to C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\resources\desktop-deployment\windows-x64
Building zip: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\dist\MyGame-Windows-x64.zip
Deleting: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\resources\desktop-deployment\windows-x64_package.cfg
Expanding: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\resources\desktop-deployment\jre-windows-x64.tar.gz into C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\jre
Updating zip: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\dist\MyGame-Windows-x64.zip
Deleting directory C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\jre
MacOSX Application Creation
Copying 1 file to C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\resources\desktop-deployment\macosx-x64
Building zip: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\dist\MyGame-MacOSX.zip
Deleting: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\resources\desktop-deployment\macosx-x64_Info.plist
Expanding: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\resources\desktop-deployment\jre-macosx-x64.tar.gz into C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\jre
Updating zip: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\dist\MyGame-MacOSX.zip
Deleting directory C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\build\jre
MacOSX Application Creation
Copying 1 file to C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\resources\macapp
Building zip: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\dist\MyGame-MacOSX.zip
Deleting: C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\resources\macapp_Info.plist
Windows EXE Creation
C:\Users\Eric Bourque.Ghost\Documents\Workspace\Jme3.1\Current\TheGame\nbproject\launch4j-impl.xml:6: taskdef class net.sf.launch4j.ant.Launch4jTask cannot be found
using the classloader AntClassLoader[]
BUILD FAILED (total time: 6 minutes 41 seconds)

Open the project in 3.0, disable desktop publishing, open in 3.1 re-enable the (new) desktop publishing. Generally I’d suggest making a completely new project and simply copying the src and assets folder over.

The fact that the new desktop publishing has a separate (small) exe is normal though.

Ok, I will try creating a new project

FYI

Had to remove the following from all my materials files that use lighting:

vtangent
usealfa
minnert
lowquality
highquality

Opening a j3m file and making a change so that it saves should get rid of the invalid parameters.

Ok, almost back on track…

I get collision exeptions when I collide bounding box.

I there a new way to do this?

CODE:

Spatial obj = s.clone();

    CollisionResults results = new CollisionResults();    
    obj.setLocalScale(0.99f);
    BoundingVolume b = obj.getWorldBound();
    
    planet.nodeCol.collideWith(b, results); 
    if(results.size() > 0) 
        return false;
    return true; 

ERROR:

Sep 06, 2015 5:44:41 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
com.jme3.collision.UnsupportedCollisionException: With: BoundingBox
at com.jme3.bounding.BoundingBox.collideWith(BoundingBox.java:822)
at com.jme3.scene.Node.collideWith(Node.java:579)
at game.planetPack.Collision.buildingCanBeConstructed(Collision.java:155)
at game.planetPack.Constructor.processBuildMode(Constructor.java:88)
at game.Main.mainUpdate(Main.java:282)
at game.Jme.update(Jme.java:182)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:152)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:192)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:233)
at java.lang.Thread.run(Thread.java:745)

Looking at the code, it looks like BB to BB collisions were never supported… not even in 3.0

Sure about this?

I know :rage:

It’s non-trivial because JME collisions are ā€˜single point’ collisions and there is no single point collision between to BBs. A full up collision system can deal with edge->edge, vertex->edge, and so on… this is simpler than that.

It may be time to rethink what you are doing as it’s somewhat rare to need BB to BB collision outside of the physics engine.

In fact, now I’m checking collisions with 2 or 3 alternative ways.

That’s what worked for me. Open the j3m, toggle a checkbox twice so the editor thinks it’s ā€˜dirty’ and saves the j3m.

Wonderful! :smiley:

The code for creating j3m files is a bit ugly but pretty smart :wink:

Nehon: no, that did not work, I had to redo all the materials

I can assure you that BB to BB worked in 3.0.

Anyhoo, what I need is to collide my ā€˜ā€˜ghost buildings’’ to my main collision node to see if anything is in the way. I have a loop where you can build one or multiple objects with a ghost of the building(s) in a red or green transparent material depending on the collision result. I also used this to check collisons on my player cylinders.

Have I been doing it wrong all this time? What should I use???

That would be quite the trick since the code has not changed there in a long time:
https://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/bounding/BoundingBox.java#761

^^ 3.0 code that throws an exception for anything but ray and triangle.

You only care about boolean intersection so do intersect tests. Depending on how many objects you have, you might want to organize them into a fixed cell size grid for easy reduction of tests.

Hey pspeed sorry I made a mistake. I was using a sphere for the collision.

I found this in my code :wink: :

    bv = null;
    if(bv == null){
        Mesh mesh1 = new Sphere(10, 10, radius);
        Geometry geom1 = new Geometry("TestCol", mesh1);
        geom1.setLocalTranslation(p);
        bv = geom1.getWorldBound();                   
    }  
    
    CollisionResults results = new CollisionResults();        
    planet.nodeCol.collideWith(bv, results);

I forgot I put bv = null; at the top so I actually thought I had a bounding volume parameter lol

nodeCol is of type Node. It’s where most of my collidables are.

This works fine (for spheres) in 3.0 but not 3.1. I used it to know when my character runs into an object and make him freeze when he hits anything that is in the physics realm.

So like, how can I make my character not go through walls and stuff?

I also don’t get how I can make him strafe along the walls instead of blocking when he hits one. In games, the player usually just moves slower when he is running against the wall, and only stops if you are 100% perpendicular right?

My idea for this would be to get a ray collision after the hit, get the normal vector and use that along with the players dir vector to figure out wich way he should move. Rigidbody physics makes that a bit hard??

If you are using physics then it should already be doing it for you.

If you are not using physics then you push the character back along the collision normal by some factor of the penetration.

Edit: but using JME Spatial collidesWith() this only works for sphere to BB… meaning all of your walls would have to be axis-aligned or it would look stupid.

Ok, great thanks for that.

Edit: I tested the ā€œTestTriangleCollisionā€ from JMETest with a sphere instead of the box and it works…

I compared that to what I do and the only difference is that instead of colliding with golem I collide with a node that has a bunch of stuff in in.

Is there anything that my node could have in it that would spark this exception below ? All I did was transfer my code and assets from 3.0…

    Sep 08, 2015 9:27:33 PM com.jme3.app.Application handleError
    SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
    com.jme3.collision.UnsupportedCollisionException: With: BoundingBox
at com.jme3.bounding.BoundingBox.collideWith(BoundingBox.java:822)
at com.jme3.scene.Node.collideWith(Node.java:579)
at game.planetPack.Collision.checkObjMapForCollision(Collision.java:276)
at game.player.PlayerCollisions.handleCollisions(PlayerCollisions.java:33)
at game.player.PlayerMovement.moveCamera(PlayerMovement.java:120)
at game.input.Keyboard$1.onAnalog(Keyboard.java:132)
at com.jme3.input.InputManager.invokeAnalogs(InputManager.java:245)
at com.jme3.input.InputManager.invokeUpdateActions(InputManager.java:215)
at com.jme3.input.InputManager.update(InputManager.java:909)
at com.jme3.app.Application.update(Application.java:690)
at game.Jme.update(Jme.java:166)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:152)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:192)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:233)
at java.lang.Thread.run(Thread.java:745)

It crashes right when I do this:

planet.nodeCol.collideWith(bv, results);

bv i got from: geomOfSphere.getWorldBound()
nodeCol is a node with a few other nodes and spatials in it.

Please help this is driving me mad :frowning:

Edit: I have a leed!

I replace bv with null in 3.0 and 3.1

please look at the difference in the stack trace:

In 3.0

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
com.jme3.collision.UnsupportedCollisionException
at com.jme3.collision.bih.BIHTree.collideWith(BIHTree.java:461)
at com.jme3.scene.Mesh.collideWith(Mesh.java:908)
at com.jme3.scene.Geometry.collideWith(Geometry.java:408)
at com.jme3.scene.Node.collideWith(Node.java:494)
at game.planetPack.Collision.checkObjMapForCollision(Collision.java:274)

In 3.1

Sep 08, 2015 9:55:32 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.NullPointerException
at com.jme3.bounding.BoundingBox.collideWith(BoundingBox.java:822)
at com.jme3.scene.Node.collideWith(Node.java:579)
at game.planetPack.Collision.checkObjMapForCollision(Collision.java:276)

Hope this helps!