He's probably talking about not doing allocations in his game. He can't stop GC from being triggered in other processes, and thus stuttering his game.
On Tue, Mar 31, 2009 at 10:35 AM, Agus <[email protected]> wrote: > To Quartz: How do you prevent triggering of the GC? > > > On Mon, Mar 30, 2009 at 7:33 PM, Quartz <[email protected]> wrote: >> >> I did an android game using just the SurfaceView and it performs >> fairly decent (it averages 50-to-60 fps). It was a simple game I put >> together to benchmark the VM. It is certainly not the best rated game >> out there--actually it is one of the worst come to think of it-- :), >> but it does have smooth vertical scrolling. If I had done it in OpenGL >> it would easily scroll vertical or horizontal. Either way the game is >> called "Spout" and it is free if you want to check it. It has >> particles, collisions and scrolling; and if you code wisely with the >> GC in mind, you can even manage to keep the GC from triggering (that >> took a bit of experimenting and profiling but I eventually calmed the >> GC way down). >> >> There is a article somewhere in the newsgroup mentioning the hardware >> specs on the graphics side. I think it mentioned that a low-end mobile >> ATI GPU is embedded in the Qualcomm chipset. I ran several of the >> OpenGL demos are they run very smooth indeed. >> >> On Mar 30, 3:45 pm, "[email protected]" >> <[email protected]> wrote: >> > Thanks Stoyan - I look forward to trying out your code. Very much >> > appreciated. >> > >> > On Mar 30, 8:30 pm, Stoyan Damov <[email protected]> wrote: >> > >> > > I will try to code a demo which does side scrolling tonight, but I >> > > don't know opengl, so I won't use it. >> > >> > > My phone is getting worse every day (I haven't used it as phone as a >> > > matter of fact for a while) but in case it does manage to show smooth >> > > scrolling, in the 5 seconds idle period, when it's not attempting to >> > > send an MMS to the GOD DAMN myFaves service (and thus trigger GC), >> > > I'll post the code. >> > >> > > Cheers >> > >> > > On Mon, Mar 30, 2009 at 11:36 AM, [email protected] >> > >> > > <[email protected]> wrote: >> > >> > > > Many of you will have read or contributed to the very long thread I >> > > > started a week ago on '[android-developers] Re: Anything on Android >> > > > that can do smooth scrolling?' >> > >> > > > That was a very useful discussion between devs and engineers on >> > > > whether additional performance could be made available to >> > > > fast-moving >> > > > games by lowering priority or disabling other background threads. >> > >> > > > However, I wanted to create a separate thread to discuss what can be >> > > > done TODAY in existing games to solve this problem. >> > >> > > > Why is it a problem? Because there is not a single game in Android >> > > > Market that features smooth scrolling backgrounds. Games may not be >> > > > the only app needed, but they certainly need to be visually >> > > > impressive >> > > > for the platform to survive. >> > >> > > > Why do I think there is a solution today? Because all components >> > > > using >> > > > GridView and ListView in most cases feature very smooth scrolling - >> > > > if >> > > > you don't believe me, go to the thumbnail scrolling view in the >> > > > native >> > > > picture viewer. >> > >> > > > So what I am saying is there is some magic in the GridView / >> > > > ListView >> > > > code which allows for smooth scrolling which games on Android >> > > > platform >> > > > desperately need. Despite going through the source code extensively >> > > > I >> > > > cannot discover what is needed to apply this to a game engine. >> > >> > > > Please could someone with a good low-level knowledge of the GridView >> > > > and ListView API's please please please provide a very simple demo >> > > > of >> > > > how this smooth scrolling could be applied to scrolling an oversized >> > > > image either horizontally or vertically. >> > >> > > > Otherwise developers are all going to try and most likely fail to >> > > > figure this out themselves. Believe me I have spent many hours on >> > > > this >> > > > looking at Android source code, surfaceviews, onDraw, dispatchDraw, >> > > > memory allocation, and nothing so far has given me anything close to >> > > > smooth scrolling. >> > >> > > > And I also know game developers are competing with each other and >> > > > want >> > > > to guard their tricks of the trade. But ultimately, we are ALL >> > > > competing with rival mobile platforms and unless this issue can be >> > > > resolved, all android game developers will lose out. >> > >> > > > And the whole platform loses because there will be no quality games. >> > > > Why shouldn't our games look like this after all : >> > > >http://www.youtube.com/watch?v=Y4795KVt_kw >> > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

