When i start my game from the sdk (while installing it on the phone) everything behaves as expected (All the time).
But when i start the installed game directly from the phone most of the times it behaves strange. Some collisions did not seem to have any effect, for example no powerups were collected anymore.
Sometimes everything also behaves as expected. It seems totally unlogical for me.
I knew the problem description is very fuzzy but all i have at the moment and I have absolutely no idea what could be the cause for this.
Did anyone noticed something similar, has an idea what goes wrong or has any hints how to debug this situation?
When you run the app from the SDK you get more logging etc. so the game might actually run faster when started from the phone. Maybe your threading model is a bit messed up and you get “heisenbugs”.
My usuall aproach for this kind of problems is, millions of system outs on one side, and Thread.currentThread() == expectedThread wheras expected thread is the one that called simpleInit, aka the renderer thread.
First of all thanks for the answers and ideas.
But i still have the proplem, even when i slow down the app with a lot of system outs.
Also i did not start any threads on my own, so there are only the jme and the bullet threads running.
So you do run bullet in parallel? Then the question is how and when you check for collisions.
Yes i created a BulletAppState and attached it to the statemanager.
Collisions were checked inside the collision method of an GhostControl which implements the PhysicsCollisionListener interface.
Thanks normen, your last post got me on the right track.
I used the collision-listener only on one GhostControl and checked all the collisions for all other GhostControls also in the the corresponding collision method (I did that because checking multiple times for the same seemed like a overhead to me, and it was working as long as i did not try to start from phone directly). Giving all the GhostControls its own listener now works. I still dont know why, but that is ok.
Well phones use native bullet, as else the performance would be really bad, might be that your sdk uses jbullet, they have a few internal differences.
Anyway sharing a control was never specified, so you get unspecified behaviour.