Author Topic: Version updates!  (Read 177782 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #30 on: May 10, 2010, 11:57:21 pm »
Nope, nothing is threaded there. If it returns, the model is already loaded.

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #31 on: May 27, 2010, 01:53:35 pm »
You told me that nothing was threaded, but it's strange, because I've a method initialize that I do use to load all objects

The first one from the Loader.Load3DS
then I reuse the Object3D meshes in my classes that inherit Object3D with the calling of super(obj, true);

I'm know looking at logcat, I just printed a System out in the end of my initialize method.
and it ends before all meshes are compiled.

On spica :
Code: [Select]
05-27 13:45:16.488: INFO/jPCT-AE(6389): Object 8/Bee2 compiled to 5 subobjects in 580ms!
05-27 13:45:16.778: INFO/jPCT-AE(6389): Subobject of object 9/Bee3 compiled to fixed point data using 1236 vertices in 157ms!
05-27 13:45:16.828: INFO/jPCT-AE(6389): Subobject of object 9/Bee3 compiled to fixed point data using 306 vertices in 49ms!
05-27 13:45:16.893: INFO/jPCT-AE(6389): Subobject of object 9/Bee3 compiled to fixed point data using 600 vertices in 65ms!
05-27 13:45:16.893: INFO/jPCT-AE(6389): Subobject of object 9/Bee3 compiled to fixed point data using 12 vertices in 3ms!
05-27 13:45:16.953: INFO/jPCT-AE(6389): Subobject of object 9/Bee3 compiled to fixed point data using 204 vertices in 56ms!
05-27 13:45:16.953: INFO/jPCT-AE(6389): Object 9/Bee3 compiled to 5 subobjects in 464ms!
05-27 13:45:17.618: INFO/System.out(6389): End initialisation
05-27 13:45:17.953: INFO/jPCT-AE(6389): Subobject of object 10/Bee4 compiled to fixed point data using 1236 vertices in 823ms!
05-27 13:45:18.428: INFO/jPCT-AE(6389): Subobject of object 10/Bee4 compiled to fixed point data using 306 vertices in 459ms!
05-27 13:45:19.333: INFO/jPCT-AE(6389): Subobject of object 10/Bee4 compiled to fixed point data using 600 vertices in 861ms!
05-27 13:45:19.338: INFO/jPCT-AE(6389): Subobject of object 10/Bee4 compiled to fixed point data using 12 vertices in 2ms!
05-27 13:45:19.723: INFO/jPCT-AE(6389): Subobject of object 10/Bee4 compiled to fixed point data using 204 vertices in 343ms!
05-27 13:45:19.838: INFO/jPCT-AE(6389): Object 10/Bee4 compiled to 5 subobjects in 2884ms!

And other objects continue compiling after that.

So apparently there's a thread compiling them.

I don't understand T_T

Thank you in advance.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #32 on: May 27, 2010, 03:41:53 pm »
That's because compilation happens on first access in onDrawFrame...and onDrawFrame runs in another thread than the rest of the Activity. jPCT-AE doesn't spawn any threads.

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #33 on: May 27, 2010, 04:38:26 pm »
Ho... thank you and sorry to disturb.
But so, is it possible to know when compilation is over? Or is it possible to compile before drawing?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #34 on: May 27, 2010, 09:25:15 pm »
The decision to compile at draw time was based on the desktop version, that requires this. The AE version doesn't, which is why i've uploaded a new version that adds a compileAllObjects(<FrameBuffer>); to World. Hope this helps. In addition, i've improved the object compiler itself, so that compile times are down to 30% on my phone.

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #35 on: May 27, 2010, 09:40:28 pm »
Awesome, thank you so much ! :) You are always responding to my questions.

I needed this because I wanted to have a loading screen.

It's quite annoying to have the user/player seeing a simple ui without any models shown because not yet compiled.
And the IA of the objects where started too soon due to the same problem.

So yes, that was exactly what I needed. :)

I'm sorry that I haven't ask this sooner but this was not my job in the project... But apparently one of my teammates didn't worked at all.
And what he did was totally wrong, calling Loader.Load3DS each time he created a new object !!!
That's why I never saw the problem coming... So I'm quite stressed lately to have something functional.

Thank you for your help again :) (Very precious !)

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #36 on: May 27, 2010, 10:10:18 pm »
It worked like a charm !
Just had to make the game wait until frameBuffer is made available.
(I create frameBuffer inside the onScreenChanged, because I need w,h for buffer as phones do not have the same w,h screen :P )


[EDIT]
WOOOO !!!
I didn't look at compiling time.
Code: [Select]
05-27 22:12:04.297: INFO/jPCT-AE(12492): Subobject of object 89/Bear9 compiled to fixed point data using 12 vertices in 0ms!
05-27 22:12:04.308: INFO/jPCT-AE(12492): Subobject of object 89/Bear9 compiled to fixed point data using 732 vertices in 8ms!
05-27 22:12:04.328: INFO/jPCT-AE(12492): Subobject of object 89/Bear9 compiled to fixed point data using 1674 vertices in 23ms!
05-27 22:12:04.338: INFO/jPCT-AE(12492): Subobject of object 89/Bear9 compiled to fixed point data using 228 vertices in 4ms!

1 full object took around 30-40 ms ! on the nexus.
with the last version of course it was really fast compare to spica but around 50-100ms.

« Last Edit: May 27, 2010, 10:16:21 pm by dl.zerocool »

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #37 on: May 27, 2010, 10:20:29 pm »
Another question is it really necessary to run strip on models after build ?
I would like to know if there's an improvement, I can't find where to see how much RAM my app is allocating so I can't really test if it's better or not :(

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #38 on: May 27, 2010, 10:24:57 pm »
It should be better and it's actually pretty cheap, so there's no reason not to strip unless you need access to the stripped data (some methods in PolygonManager do).
« Last Edit: May 27, 2010, 10:34:22 pm by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #39 on: May 27, 2010, 11:02:12 pm »
WOOOO !!!
I didn't look at compiling time.
....

1 full object took around 30-40 ms ! on the nexus.
with the last version of course it was really fast compare to spica but around 50-100ms.
Dalvik's slowness and aversion to object creation and especially garbage collection sometimes makes you think of some very strange solutions to improve things. That's what happened to the compiler here.

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #40 on: May 27, 2010, 11:09:37 pm »
I do agree Dalvik do react very very strangely.

[Edit]
Okay so I'll use strip since I don't use any of the polygon methods on my objects.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #41 on: May 29, 2010, 12:44:49 am »
I do agree Dalvik do react very very strangely.
I'm still working on the compiler, because its performance is crucial for startup time. The old version compiled my high polygon beethoven on the Samsung Galaxy in 30 sec., the uploaded version needs 13 secs, my current development version is down to 6 secs... ;D

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #42 on: May 29, 2010, 07:31:07 am »
Sound really nice !

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #43 on: May 29, 2010, 01:16:01 pm »
Uploaded a new version that includes some additional optimizations for the compiler. It's around 5-6 times faster and uses much less memory and creates much less garbage than before the optimizations. However, there's still some work to do for animated objects to compile faster.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #44 on: May 29, 2010, 08:39:01 pm »
Another small update that adds the compiler optimizations for animated objects.