Right. The single biggest issue is GC. I guess if vectors and all
other objects, which are frequently created, get pulled out of an
object pool, and reused (that's quite tricky though, because of the
explicit "returnToPool" call) all engines will shine. In several
places, temporary/scratch objects can be used for results, e.g.:

Vector2f v = someComputation(...) can be rewritten as

Vector2f v = someComputation(mScratchVector, ...);

but there are still places, where objects need to allocated, and an
object pool (preferably an intrusive one, which requires classes to
have prev/next links/nodes) would be the only way.

Cheers

On Tue, Mar 31, 2009 at 5:28 PM, shaun <shashepp...@gmail.com> wrote:
>
> I am the author of simpull.
>
> Sorry guys for the demo being out of whack for Simpull to the Core.
> The version of PulpCore that I integrated simpull with did not support
> Chrome, but you should be able to see it in IE, FF Safari.  It is nice
> to take a look at that demo to get a feel for what the engine is
> capable of, but the performance does not translate over to the fixed
> point branch/version of simpull when running on Android.
>
> I ran tests on both the emulator and the actual device and there was a
> significant increase in performance because of the fixed point
> implementation, but I got very frustrated that it still did not
> support the amount of objects in a scene that I considered good for a
> physics-based game.  It seemed to handle ~10 objects moving and
> colliding OK.  It has been a while since I was playing with it, so I
> do not really remember the exact number of objects or the frame rate.
> I mostly remember being upset with it.
>
> I am leaving the physics ideas for games out of the picture when
> thinking Android for now.  Someone would have to write a ground up
> engine with all the performance and memory concerns of Android in
> mind, which was not the case with Simpull.....I created it for
> applets, then thought to port over to fixed-point for Android.  It
> works well with small scenes, but certainly not the staple engine to
> use in my opinion.
>
> Also, Phys2D will not run worth a damn on Android.  I tried it and I
> even went through some heavy performance tuning.  Garbage collection
> is the major issue even after all I did.  I seriously doubt JBox2D
> will run well either.  I'll stick to what I said earlier, a ground-up
> solution by someone smarter than me is probably required.
>
> On Mar 31, 9:49 am, "admin.androidsl...@googlemail.com"
> <admin.androidsl...@googlemail.com> wrote:
>> Not tried but if you can provide us with some example source code or
>> put something on the market, I'm sure we could take a look.
>>
>> G1 performance is significantly faster than emulator, but there are
>> limitations.
>>
>> Particularly with garbage collection and memory allocation on code
>> that gets run continuously in loops, so I don't know how optimised
>> these physics engines are for this purpose.
>>
>> Would be interesting to find out though.
>>
>> On Mar 31, 12:52 pm, mscwd01 <mscw...@gmail.com> wrote:
>>
>> > Oh I forgot to re-ask...
>>
>> > "Has anyone tested Phys2D or JBox2D on an actual device to see if they
>> > run better than on the emulator?
>>
>> > I have a feeling the performance will better on a G1 than the emulator
>> > for some reason!
>>
>> > On Mar 31, 12:51 pm, mscwd01 <mscw...@gmail.com> wrote:
>>
>> > > I did take a look at Simpull, however the demo application failed to
>> > > run as it relied on some library which wasn't supplied or referenced
>> > > to - I just got annoyed after spending two days failing to get Phys2D
>> > > and JBox2D to work in Android and didn't bother trying to work out the
>> > > problems!
>>
>> > > I might give it another look though...
>>
>> > > On Mar 30, 10:41 pm, Streets Of Boston <flyingdutc...@gmail.com>
>> > > wrote:
>>
>> > > > I wonder how well this one works on Android:
>>
>> > > >  http://code.google.com/p/simpull/
>>
>> > > > -- Anton Spaans
>>
>> > > > On Mar 30, 4:58 pm, Anton <socialhac...@gmail.com> wrote:
>>
>> > > > >     I have a simple 2D physics engine written and running.  It uses
>> > > > > the now famous Jacobson physics tricks (Verlet integration and hard
>> > > > > constraints).  I can manage 40 balls on the screen, with fill n^2
>> > > > > interaction between balls.  I am working on spatial data structure
>> > > > > optimizations now to improve the computational complexity of the
>> > > > > collision detection code.  I run the constraint update loop five 
>> > > > > times
>> > > > > per frame and get 30 frames per second.  Once the engine is up and
>> > > > > running there are no memory allocations done in my program.  And once
>> > > > > the system settles down from the app launch there are very few GC
>> > > > > events from other programs.  Though they do still happen.  Viewing
>> > > > > LogCat I see a GC every 10 or 20 seconds because of some background
>> > > > > application.  But between those events I get a consistent frame rate.
>> > > > > I am using OpenGL for my rendering.
>>
>> > > > >     -Anton
>>
>> > > > > On Mar 30, 1:14 pm, mscwd01 <mscw...@gmail.com> wrote:
>>
>> > > > > > Does anyone know of, or have implemented, a physics engine which 
>> > > > > > runs
>> > > > > > smoothly in Android?
>>
>> > > > > > I have spent the last couple of days trying Phys2D and JBox2D, 
>> > > > > > however
>> > > > > > both perform very poorly - I am struggling to get even a few 
>> > > > > > objects
>> > > > > > to simulate smoothly as frequent garbage collection spoils it.
>>
>> > > > > > One question I do have is will these run smoother on an actual G1
>> > > > > > device or is the performance of the emulator accurate?
>>
>> > > > > > Thanks- Hide quoted text -
>>
>> > > > > - Show quoted text -
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to