Weird crash

so i cleaned up my project in eclipse a bit but now i get this error when I try to run my game,



com.jme.system.JmeException: Display System must be initialized before Timer.

at com.jme.util.Timer.getTimer(Timer.java:104)

at com.jme.app.FixedLogicrateGame.start(FixedLogicrateGame.java:108)

at com.RoT.main.RoTGame.main(RoTGame.java:128)

Jun 9, 2006 12:04:28 AM com.jme.app.FixedLogicrateGame start

INFO: Application ending.

Exception in thread "main" java.lang.NullPointerException

at com.jme.app.FixedLogicrateGame.start(FixedLogicrateGame.java:154)

at com.RoT.main.RoTGame.main(RoTGame.java:128)





any ideas?

Nothing before that? Any errors regarding display initialization?  (hmm, I already saw that exception but can't remember why and where, dammit)

Timer stuff has changed since 0.9, a DisplaySystem.getDisplaySystem() must have been called before trying to get any timer instances…(to setup the displaysystem systemprovider). so, solution is to do a getDisplaySystem before that or move your timer init to a later stage in your startup…



had some talk with mojo about this, and i think that we should have some DisplaySystem.initialize method cause it feels kind of odd to do an empty getDisplaySystem just cause you want to get your timers early in the code…

true, but he uses FixedLogicrateGame. Which does not seem to work any more.



Looking at the tests no test actually uses FixedLogicrateGame - seems to be broken…

yes apparantly it is not updated against the new systemprovider and timerthings…the same bug holds for FixedFramerateGame and VariableTimestepGame too…



the easy fix i just moving timer = Timer.getTimer(); in those classes to after the assertDisplayCreated method call…

So, can you put that in CVS? Duh

Hehe, his first checkin and you nearly missed it :slight_smile:

yay it worked!!! :slight_smile: didnt have the guts to post anything about it until i got it confirmed from llama hehe…lets just hope the fix works too s

ohh heheh yeah i updated from the cvs too when i did the clean up, something i hadn't done in a while



thanks for the fix!!



whooops still not working now i get this error



java.lang.NullPointerException

at com.jme.app.FixedLogicrateGame.setLogicTicksPerSecond(FixedLogicrateGame.java:98)

at com.RoT.main.RoTGame.initSystem(RoTGame.java:64)

at com.jme.app.FixedLogicrateGame.start(FixedLogicrateGame.java:109)

at com.RoT.main.RoTGame.main(RoTGame.java:128)

Jun 9, 2006 11:54:16 PM com.jme.app.FixedLogicrateGame start

INFO: Application ending.





something wrong with this line…

tickTime = timer.getResolution() / logicTPS;

are you calling setLogicTicksPerSecond in your initSystem method? cause the timer is not initialized until after that…so you would have to call that method from your initGame method instead…

right on the money as usual MrCoder, thanks for everything!

no prob!  8)