Author Topic: Version updates!  (Read 177818 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #45 on: May 31, 2010, 09:13:21 pm »
Another update that adds the option to create Textures out of Drawables instead of Bitmaps, improves loading speed of serialized objects and reduces memory usage during the deserialization process. I've also updated the JavaDOCs.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #46 on: June 01, 2010, 10:34:47 pm »
And another small update that reduces memory usage of deserialized instances of Animation and that is more aggressive when calling Object3D.strip(), i.e. it frees more memory.

Edit: And working with lights is a bit cheaper now due to some internal instance recycling, i.e. less gc occurs. There still seems to be some part that creates some garbage related to lights, but i still have to find it... ???
« Last Edit: June 01, 2010, 11:34:53 pm by EgonOlsen »

Offline Darkflame

  • int
  • **
  • Posts: 55
    • View Profile
Re: Version updates!
« Reply #47 on: June 02, 2010, 06:47:03 pm »
Nice work :)

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #48 on: June 02, 2010, 08:09:43 pm »
Hi, with the last JPCT I've out of memory errors on magic & spica.

Does it consume more memory ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #49 on: June 02, 2010, 08:13:16 pm »
No, actually it consumes much less than before. When exactly do the errors occur?

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #50 on: June 02, 2010, 09:03:52 pm »
When I compile the model  -> call of -> WORLD.compileAllObjects

The objects are really small.
~2,4ko the first 3ds file and another of 2,8ko

but I do clone the first one 7 times and the other one 23times.
Perhaps it comes from there.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #51 on: June 02, 2010, 09:31:07 pm »
If the models share the same mesh, you should also do a Object.shareCompiledData(<Object3D>); on all the clones to make them use the same compiled data. That will increase compilation time and decreases memory usage. However, i don't see why this should take more memory than before. Actually it should require less to compile them now. I'll look into it anyway to make sure that i haven't introduced something that may cause this problem.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #52 on: June 02, 2010, 10:22:36 pm »
Maybe you were calling strip() after calling compileAllObjects()? In that case, the stripping doesn't happen. I've uploaded a new version that fixes this. In addition, it reduces object creation for bill boarded objects and reduces memory usage of compiled object by a negligible amount. Apart from that, i don't see any change that i've made that could cause the compile to fail where it formerly succeeded...quite the contrary.

Edit: Decreased memory usage while compiling some more....
« Last Edit: June 02, 2010, 10:51:28 pm by EgonOlsen »

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #53 on: June 03, 2010, 12:49:28 am »
Okay thank you :)

I'm going to test it on emulator for now and on magic tomorrow, It's a friend phone
so I don't always have it.

Oh I forgot to mention, you can search on market for " ARescue " It's my application.

I'm not sure it will run properly, sounds are deactivated at moment.
It's quite slow, and collisions make the game freeze (FC) sometimes so don't flood the bees or the superBees.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #54 on: June 03, 2010, 08:08:04 am »
It crashes from time to time at startup on my Galaxy. I can't tell the reason, i've no access to the logs right now. Maybe that's that memory thing? When it runs, it's really really slow. Why is it so slow? Is the time spend in the engine or in your code?

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Version updates!
« Reply #55 on: June 03, 2010, 08:32:44 am »
Quote
I can't tell the reason, i've no access to the logs right now.
The application "Android System Info" has a nice log function. Its free.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #56 on: June 03, 2010, 09:13:34 am »
Cool little app!

One issue with the game seems to be that you are not using the

Code: [Select]
mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
// Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
// back to Pixelflinger on some device (read: Samsung I7500)
int[] attributes = new int[] { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
EGLConfig[] configs = new EGLConfig[1];
int[] result = new int[1];
egl.eglChooseConfig(display, attributes, configs, 1, result);
return configs[0];
}
});

part like the demo code does. This means, that it runs in software emulation on my phone, which it obviously does (judging from the log its using Pixelflinger, which is Androids software renderer).
In addition, it spams the log with "superbee0died" or similar albeit i haven't done anything except moving the phone. I'm not sure if this is an issue, i was just wondering about it.

Haven't got the crash yet...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #57 on: June 03, 2010, 09:52:16 am »
Ok, it's out of memory indeed...try to convert your files to OBJ-format instead. The 3DS loader is pretty stupid and consumes too much memory while parsing. I have to work on this. Until then, please give the obj-format a try if possible.

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Version updates!
« Reply #58 on: June 03, 2010, 06:15:07 pm »
Cool, I'm going to test all the things you told me.

But I can't use this init (see the attached file):
Code: [Select]
mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
// Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
// back to Pixelflinger on some device (read: Samsung I7500)
int[] attributes = new int[] { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
EGLConfig[] configs = new EGLConfig[1];
int[] result = new int[1];
egl.eglChooseConfig(display, attributes, configs, 1, result);
return configs[0];
}
});

Because it show something very odd, I attached a screenshot to this

[attachment deleted by admin]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Version updates!
« Reply #59 on: June 03, 2010, 07:32:15 pm »
Looks strange indeed. Does it happen without using the camera too? If this init code isn't there, you'll never get hardware acceleration on the Galaxy...might not be much of an issue though, because it's not very popular.