[android-developers] Re: Any way to animate a 2D Game Smooth without OpenGL ?

2010-09-15 Thread Andreas
Hi miguel, thanks for the response. Afaik. Every example game written by the google guys has a inner thread class in the gameview. But i think only for sharing variables of the gameview. Not quite sure if there where any other advantages gc wise. Normally locks a more a timesink and slowing

[android-developers] Re: Any way to animate a 2D Game Smooth without OpenGL ?

2010-09-15 Thread Jason
Hi Andreas, Sorry to jump in late, but I thought I'd share my experiences with non- opengl on Android. I have a game engine which uses both open gl and the canvas system depending on the device capabilities (some devices, like HTC Tattoo have software implementations of opengl which is actually

[android-developers] Re: Any way to animate a 2D Game Smooth without OpenGL ?

2010-09-15 Thread Andreas
Hey Jason, thank you so much for the Feedback. I would love to see your game skeleton, to see how you solve some common problems. Or how you store and iterate your gameObjects. In My case every GameObject, like a Missle or Enemy has update(long difftime) and draw(Canvas c) method implemented.

[android-developers] Re: Any way to animate a 2D Game Smooth without OpenGL ?

2010-09-15 Thread Jason
OK.. so the important point in the two-threads theory is that the work IS done concurrently. The GameThread does all the calcs for the next frame WHILE the render thread is rendering the previous frame. So that you don't modify game objects while the render thread is rendering, you separate the

[android-developers] Re: Any way to animate a 2D Game Smooth without OpenGL ?

2010-09-14 Thread Mark Wyszomierski
I had similar problems trying to get a smooth game loop going, I just couldn't get rid of gcs happening (I think some were occurring outside my app too). I think I had removed everything from the draw loop in frustration except for drawing a rectangle, but would still get the bumps. That was about

[android-developers] Re: Any way to animate a 2D Game Smooth without OpenGL ?

2010-09-14 Thread Andreas
to 1) Did that already. I ruled out everything that was creatinglike shadow Copies or String Concat. I re-implement my own FastList instead of any ArrayList oder Hashmap. To there is nearly nothing that is created intentionally. But the GC is anyway running every couple of seconds. Sometimes

Re: [android-developers] Re: Any way to animate a 2D Game Smooth without OpenGL ?

2010-09-14 Thread Miguel Morales
Are you using the emulator or a hardware device for testing? I'm sure there's gotta be something that's allocating in your code. In my personal experience, I've gotten the GC down to once a minute at the worst. A lot of the time you can't fully get rid of GC hiccups because of background

[android-developers] Re: Any way to animate a 2D Game Smooth without OpenGL ?

2010-09-14 Thread Andreas
How are you avoiding String Concatenation ? TextFields as a Example only take Strings And if you have a Score, or Time Element that Shows Some Numbers i wasn't able to get around creating a String implicitly. Currently i'am testing on my Motorola Milestone. On the Emulator it even runs slower

Re: [android-developers] Re: Any way to animate a 2D Game Smooth without OpenGL ?

2010-09-14 Thread Miguel Morales
How are you avoiding String Concatenation ? TextFields as a Example only take Strings I don't really use this myself because I don't really strings in inner loops. First, you want to make those time elements draw/update as least as possible. If not, you can use a string buffer: