AI Demo (Mifth)

Hi guys.

I started new AI demo for MonkeyBrains guys.
Some Notes about the demo:

Here is my simple project https://github.com/QuietOne/MonkeyBrainsDemoGames/tree/master/MonkeyBrainsDemo_Mifth

[video]aidemo - YouTube

1 Like

Ok I added physics and BetterCharacterControl. But it seems the BetterCharacterControl still has flickering even if i have pretty detailed grid. I guess this can be because of flap floor. @normen could you check it?

Here is my test:
[video]http://youtu.be/bzZDkuTdqmM[/video]

Your character weighs only half a kilo…

@normen said: Your character weighs only half a kilo...

No it weighted 1 kilo. Ok i set mass=50 and i get the same flickering. I also tried to set mass=500.
Here is my commit [MifthDemo] set Mass=50, added gui libs. · QuietOne/[email protected] · GitHub

Please, could you try to run the demo?

What am I supposed to do about it?

@normen said: What am I supposed to do about it?

Could you check why flickering happens? Is it possible to fix? As this is pretty big issue.
All pro engines have no any flickering for character controls i guess.

@mifth said: Could you check why flickering happens? Is it possible to fix? As this is pretty big issue. All pro engines have no any flickering for character controls i guess.

You keep coming back to this issue, just stop @mentioning me with it.

@normen said: You keep coming back to this issue, just stop @mentioning me with it.

Well, you were the author of this control. If you don’t want to get bug report and dunno want to fix it - then sorry. I stop bothering you with this issue.

@mifth said: Well, you were the author of this control. If you don't want to get bug report and dunno want to fix it - then sorry. I stop bothering you with this issue.

Thanks. I announced that I don’t have time much time for jME anymore almost a year ago already.

@normen said: Thanks. I announced that I don't have time much time for jME anymore almost a year ago already.

Oh, i thoght you revived! :slight_smile: Ok i take into account.

@mifth is it only a problem when you aren’t moving? If so then you should probably disable it (make it inactive). Like bullet does for other objects. Every tick bullet applies gravity and then re-corrects it when there is a collision. So you end up with some floating point errors on the position.

@wezrule said: @mifth is it only a problem when you aren't moving? If so then you should probably disable it (make it inactive). Like bullet does for other objects. Every tick bullet applies gravity and then re-corrects it when there is a collision. So you end up with some floating point errors on the position.

I should or BetterCharacterControl should sleep? If you disable it you will get many issues too. Well you can make a test and find a solution.

Some progress. Added movement.

[video]http://youtu.be/KVaJxv_SWqM[/video]

1 Like

Ok, Shooting and SwordStrike is finished. I think i finished my part.

[video]http://youtu.be/hUPFpBOwKtc[/video]

1 Like

@nehon , @normen , @pspeed . Hello guys.

I found a strange issue when I close the application i get an Exception:

WARNING: RigidBody [email protected] does not exist in PhysicsSpace, cannot remove.
июн 02, 2014 1:35:53 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
at com.jme3.bullet.PhysicsSpace.removeGhostObject(PhysicsSpace.java:524)
at com.jme3.bullet.PhysicsSpace.removeCollisionObject(PhysicsSpace.java:421)
at com.jme3.bullet.control.GhostControl.setPhysicsSpace(GhostControl.java:153)
at com.jme3.bullet.PhysicsSpace.remove(PhysicsSpace.java:409)
at org.aitest.character.AICharacterControl.destroyCtrl(AICharacterControl.java:224)
at org.aitest.character.AIMainCharacterController.destroy(AIMainCharacterController.java:135)
at org.aitest.character.AIMainCharacterController.cleanup(AIMainCharacterController.java:151)
at com.jme3.app.state.AppStateManager.cleanup(AppStateManager.java:323)
at com.jme3.app.Application.destroy(Application.java:635)
at org.aitest.AIMain.destroy(AIMain.java:90)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.deinitInThread(LwjglAbstractDisplay.java:196)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:233)
at java.lang.Thread.run(Thread.java:744)

Exception: java.lang.RuntimeException thrown from the UncaughtExceptionHandler in thread “LWJGL Renderer Thread”
AL lib: (EE) alc_cleanup: 1 device not closed


The bug says i get Null in line 224 here:
https://github.com/QuietOne/MonkeyBrainsDemoGames/blob/master/MonkeyBrainsDemo_Mifth/src/org/aitest/character/AICharacterControl.java#L224

But “physics” and “swordModel” are not Nulls. I guess this issue is in PhysicsSpace when it tries to remove GhostObject.

Also, if I uncomment these 3 lines - i get no Exception: https://github.com/QuietOne/MonkeyBrainsDemoGames/blob/master/MonkeyBrainsDemo_Mifth/src/org/aitest/AIMain.java#L87-L89

Guys, could you test the issue? Possibly this is a bug.
I run jMonkeyEngine 3.0.5.

PS. “swordModel” is attached to a boneNode.

Thanks.

The demo is finished. Now AI guys will add AI soon. :slight_smile: My part is over.

[video]http://www.youtube.com/watch?v=A0ibo4qlLV8&list=UUZ9_DJk6Ot-_xiTcKb8cJ8g[/video]

1 Like

Very nice :slight_smile:

The error message is pretty explicit, ain’t it? You try to remove a physics object that has already been removed. Maybe you first control.setEnabled(false) and then try to PhysicsSpace.remove(control).

@normen said: The error message is pretty explicit, ain't it? You try to remove a physics object that has already been removed. Maybe you first control.setEnabled(false) and then try to PhysicsSpace.remove(control).

Yes, it’s understood that exception is because of physics object that has already been removed.
But! If i try to remove RigidBody which already was removed i’ll get WARNING:
WARNING: RigidBody [email protected] does not exist in PhysicsSpace, cannot remove.
And the application gets no Exception.

And if i try to remove GhostObject - i’ll get such an Exception.

So, the issue happens only with GhosObjects.
Question: is it possible to make Warning instead of Exception when GhosObject already was removed?

My question would be if you can make your application so that it doesn’t remove things twice?