Control update() performance

I recently updated to the latest SVN using jMP. When running my game, I noticed that the performance of all my events and effects driven from the update() method have effectively worsened by 100%.



As an example, when I attach one of my controls to a spatial, I commonly have something like this defined:



[java]

private static final float EFFECT_DURATION = 3f; // 3 seconds

private float elapsed = 0f;



// then in my update method of the Control…

public void update(float tpf) {

elapsed += tpf; // tpf should be in milliseconds time and where 1.0f == 1 second

if (elapsed > EFFECT_DURATION) {

// do other stuff here, blah blah

}

}

[/java]



After the update, I noticed my whole game’s effects durations doubled. I even got out my trusty stop-watch app and timed it. Sure enough, my effect that was previously 3 seconds duration was running for 6 seconds real time.



Was there some update recently that would have caused this strange behavior? I really don’t want to go through and update my entire game to account for this change. Any help would be appreciated.



Thanks!

Yeah sorry, apparently some update() function was called twice causing everything to be twice as fast.

My fault and should be fixed now thanks to the great Remy/nehon :slight_smile:

Actually Normen fixed it…i was just…around when he did :smiley: (does this grant me the great status anyway? :stuck_out_tongue: )

1 Like

Awesome. Thanks for the quick reply and fix guys.