Version updates!

Started by EgonOlsen, March 28, 2010, 09:47:50 PM

Previous topic - Next topic

EgonOlsen

Nope, nothing is threaded there. If it returns, the model is already loaded.

dl.zerocool

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 :
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.


EgonOlsen

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.

dl.zerocool

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?

EgonOlsen

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.

dl.zerocool

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 !)

dl.zerocool

#36
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.
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.


dl.zerocool

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 :(

EgonOlsen

#38
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).

EgonOlsen

Quote from: dl.zerocool on May 27, 2010, 10:10:18 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.

dl.zerocool

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.

EgonOlsen

Quote from: dl.zerocool on May 27, 2010, 11:09:37 PM
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

dl.zerocool


EgonOlsen

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.

EgonOlsen

Another small update that adds the compiler optimizations for animated objects.