java - Monitor variables of a running program? -
i'm working on small multiplayer game has tick method kind of logic things moving, creating , checking game elements.
the tick method called every 100 milliseconds. things go wrong due bug. these bugs hard track down because things being called many times second. when add debug log entry @ points log gets overcrowded , not easy understand.
is there way monitor variables while game keeps running?
i tried jmx time setup jmx monitor variable quite long due complex nature of jmx. in addition when tracking don't know variable monitor, means need switch variable variable quickly.
this big problem game design draws called 30/60 times second.
i found outputting values on screen helped lot doesn't save previous values can see when things change.
you can add breakpoints when value changes range shouldn't be, allowing inspect code further such as
1 if(val>1000){ 2 debugger; 3 }
Comments
Post a Comment