[HELP]chasecamera flickering. weird problem with standard game update method

ok, i had this weird problem that every time my game starts, my chasecamera flickers for a sec, then it becomes normal.



i found a way to solve this problem but the way i found doesnt make any sense.



i think there might be something wrong with the update method in standard game or gametaskqueuemanager.



plz help me explain this~



this is my game queue method.


GameTaskQueueManager.getManager().update(new Callable<Object>() {
         // This method creates the Callable object for inserting.
         public Object call() throws Exception {
            float interpolation = timer.getTimePerFrame();

i traced the camera's location, and every update changes its location to a random value like -458954.326.



but after several flickers, it then acts normally as it should.



omg im sooo confused now :? :? :?

Sounds like it might have something to do with timer smoothing.



http://www.jmonkeyengine.com/jmeforum/index.php?topic=3386.0



and



http://www.jmonkeyengine.com/jmeforum/index.php?topic=4264.0

so i should be using nano timer? :?



but i didnt have this problem when i was using basegame implementation.

just cant fix it



i had to switch back to basegame + gamestates implementation… :cry:



standardgame doesnt like me

Hey, if you upload complete code, I promise I will try to trace the bug!  :wink:

duenez said:

Hey, if you upload complete code, I promise I will try to trace the bug!

btw, i did traced the chasecamera object.



all the passed in values are fine. its just when its calculating the new cam position, it calculates random huge values.



i guess coz the opengl thread is running already, so its messing up with it for some reason

Where are you calling update on ChaseCamera?

My only idea given the info is that you are initializing and updating some of the objects before all of your game is fully loaded and functional. This is consistent with your mouse clicking issue.  :frowning:

darkfrog said:

Where are you calling update on ChaseCamera?


im updating the chasecamera in the game state update method, since i extended basicgamestate.
duenez said:

My only idea given the info is that you are initializing and updating some of the objects before all of your game is fully loaded and functional. This is consistent with your mouse clicking issue.
neakor said:

and the update method in each game state is called when the gametaskqueue update method is called every frame.


Give a snippit of code for this...I don't believe you are doing what it sounds like you are doing.  :P
darkfrog said:

neakor said:

and the update method in each game state is called when the gametaskqueue update method is called every frame.


Give a snippit of code for this...I don't believe you are doing what it sounds like you are doing.

Have you tried changing around the order of the calls in update to see if that makes a difference?

darkfrog said:

Have you tried changing around the order of the calls in update to see if that makes a difference?


yeah, i tried pretty much all the possible oders.

they dont really make any differences at all  :(

Honestly, I'm not sure what the problem is, but if you figure out what is different between StandardGame and your other implementation that is causing the problem I'm happy to get it fixed for you.  Sorry I'm not more help.

darkfrog said:

Honestly, I'm not sure what the problem is, but if you figure out what is different between StandardGame and your other implementation that is causing the problem I'm happy to get it fixed for you.

But it shouldn't have anything to do with multi-threading since you're not actually doing anything multi-threaded at update time.  If you have the time to do so, it would be very beneficial if you could try to track this down further since you have a working and non-working example now.  Seems obvious there is some problem related to StandardGame, so we need to fix it.

ill be really happy if i can help. but right now i dont know what to do… :lol:



i traced the chasecamera, the problem occurs in the updateCameraPosition() method.



so can u give me some advices on what i should be looking for?