I am using / have used Particle emitters for most of my in-game effects. On all platforms I have it works perfectly.
Then I got hold of a Android 2.3.7 HTC Desire (Adreno 200 GPU). It was very clear to me that particle emitters, caused the game / phone to completely freeze, to such an extent that the phone is completely unresponsive. One has to completely reset the device for it to become functional again. When I do not use particle emitters, the game runs very well and smooth without any issues.
(triangles mesh is what I am using)
I have updated to latest build and I am still getting this issue.
Solutions:
Is there a way for me to detect if the device will be able to run Particle Emitters?
Is this a fixable issue (Will I have to replace all my effects with non-particle emitter nodes?) or a dead end for 2.3.x?
@meeshter said:
1. Is there a way for me to detect if the device will be able to run Particle Emitters?
Is this a fixable issue (Will I have to replace all my effects with non-particle emitter nodes?) or a dead end for 2.3.x?
Thank you
The problem is with Adreno 200 GPU, maybe you can detect it on the android side.
That’s not fixable as far as JME is concerned. This is an android version vs hardware issue as explained in this post http://hub.jmonkeyengine.org/forum/topic/freeze-on-adreno-200-gpus-sharedbufferstack/#post-208107 . I doubt Google will fix it anytime soon.
Your only way is to work around it, getting you back to your 1. question.
That’s a shame really, but I don’t see what we can do about it.
@mifth said:
It's better to send money to @nehon so that he bought the device..
LOL , no please don't do that.
@meeshter what you could try though is to set the unshaded material to all your particle emitters. It will look like crap, but at least if it still fails we rule out the particle shader (unshaded seems to work fine on any device)
I guess these are valid solutions! But I will have to spend some time to convert and rework all the existing effects though. Will definitely look into these for future.
@wezrule said:
Is it just Particles that are the main issue? is there nothing we can change about them to make them compatible?
From the testing I have done it is quite conclusive - the app freaked out when supposed to attach / detach / play / stop particle emitters on nodes. All other devices were fine. (I’m not sure which of those actions triggers the problem)
Have tested on: S2, S3, SamsungTab2 10, Prestigio PMP5580C and finally HTC Desire ( :-o )
@meeshter what you could try though is to set the unshaded material to all your particle emitters. It will look like crap, but at least if it still fails we rule out the particle shader (unshaded seems to work fine on any device)
@nehon I will definitely do this… but I have a bit of a problem… Windows7 trashed my linux partition… on which all my JME stuff was, I have a backup but will have to restore it, together with my whole dev env… This was a bad day -feeling loss-
I will get back to you asap.
Thanks for all the feedback, it is much appreciated!!
@meeshter , @nehon i tried this APK file. It has MovingParticle emitter example. And the emitter worked on my device with Andrero 200 card. But there was only one particle emitter.
@mifth said:
@meeshter , @nehon i tried this APK file. It has MovingParticle emitter example. And the emitter worked on my device with Andrero 200 card. But there was only one particle emitter.
@mifth, strangely when I tested with one particle emitter the app did not crash, like I have said before - I am not exactly sure which part of the particle emitter causes the crash yet - so it could be when: more than one is attached / more than one is started / when they are detached.
All the effects did always show up, but for some reason the phone freezes a few seconds into the game. There is a static PE (Particle Effect) which is always on in the background, and then your weapons will attach additional PEs and detach after the lifetime of the effect is expired.
Typically I used 2x2 textures mostly. 128x128 size.
As far as I can remember - the freezing happened on a click / touch event when I do all the attaching of PE and play sounds. These effects were played at least once before freeze too.
These are faint memories - but might be worth looking into.
Hi there one and all.
I did some playing around on the settings of the particle emitter and getting it not too crash on the andreno and I can now say with success that it has to do with the colors(start/end color). It seems that when I set the start or end color’s alpha channel to 0 it freezes that device.
Can someone confirm this please?
Confirmed, this is the issue, it seems that only alpha (color) values above zero work, I use 0.1f now and the particle effects works perfectly on all my testing devices. e.g. particleEmitter.endColor(x,x,x,0.1f);
I played the game on the device for a few minutes, with no freezing. Particles were attached and detached dynamically with no negative side effects. All particle effects are now running as expected.
Think a fix for this should be included in the SDK to prevent future problems on similar devices!!!