Author Topic: Start game timer once world is ready  (Read 473 times)

Offline behelit

  • byte
  • *
  • Posts: 4
    • View Profile
Start game timer once world is ready
« on: October 20, 2014, 03:03:39 am »
I'm hoping this is a common thing, I'm trying to start a game timer once everything has been loaded.

I've tried several places like the renderer creation, onsurfacechanged, ondraw (first frame) and after all the obj objects have been loaded but there's still a time difference on lower end devices, ie: 1 - 3 seconds on the timer once you actually are able to start playing the game.

Is there a JPCT function that I can use instead? I noticed even though I start the timer once I have loaded everything, JPCT actually does a lot of compilation afterwards eg:

Code: [Select]
Resetting game timers
Subobject of object 5/object7 compiled to flat fixed point data using 324/324 vertices in 23ms!
Object 5/object7 compiled to 0 subobjects in 71ms!
Object 'object7' uses one texture set!
Subobject of object 1/object3 compiled to indexed fixed point data using 6912/1352 vertices in 4082ms!
Object 1/object3 compiled to 0 subobjects in 4925ms!
Object 'object3' uses one texture set!
Subobject of object 7/object9 compiled to flat fixed point data using 30/30 vertices in 7ms!
Object 7/object9 compiled to 0 subobjects in 11ms!
Object 'object9' uses one texture set!
Subobject of object 9/object11 compiled to flat fixed point data using 72/72 vertices in 6ms!
Object 9/object11 compiled to 0 subobjects in 20ms!
Object 'object11' uses one texture set!
Subobject of object 11/object13 compiled to flat fixed point data using 72/72 vertices in 7ms!
Object 11/object13 compiled to 0 subobjects in 17ms!
Object 'object13' uses one texture set!
Subobject of object 13/object15 compiled to flat fixed point data using 171/171 vertices in 16ms!
Object 13/object15 compiled to 0 subobjects in 39ms!
Object 'object15' uses one texture set!
Subobject of object 15/object17 compiled to flat fixed point data using 72/72 vertices in 7ms!
Object 15/object17 compiled to 0 subobjects in 18ms!
Object 'object17' uses one texture set!
 GC_CONCURRENT freed 1624K, 34% free 8186K/12359K, external 19863K/20799K, paused 3ms+3ms
Subobject of object 3/object5 compiled to indexed fixed point data using 7290/1313 vertices in 4273ms!
Object 3/object5 compiled to 0 subobjects in 5145ms!
Object 'object5' uses one texture set!
Subobject of object 17/object19 compiled to flat fixed point data using 96/96 vertices in 9ms!
Object 17/object19 compiled to 0 subobjects in 25ms!
Object 'object19' uses one texture set!
Subobject of object 19/object21 compiled to flat fixed point data using 288/288 vertices in 21ms!
Object 19/object21 compiled to 0 subobjects in 57ms!
Object 'object21' uses one texture set!
Creating buffers...
VBO created for object 'object5'
Creating buffers...
VBO created for object 'object19'
Creating buffers...
VBO created for object 'object21'
Creating buffers...
VBO created for object 'object13'
Creating buffers...
VBO created for object 'object11'

Any advice appreciated~!

 

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Start game timer once world is ready
« Reply #1 on: October 20, 2014, 07:40:45 am »
Yes, by default, this happens on demand. You can precompile objects by using http://www.jpct.net/jpct-ae/doc/com/threed/jpct/World.html#compileAllObjects() and preload textures by using http://www.jpct.net/jpct-ae/doc/com/threed/jpct/TextureManager.html#preWarm(com.threed.jpct.FrameBuffer). Maybe that helps to minimize the hick-ups.