Thanks for your tips,

I'm fairly sure that the 30FPS limit I'm getting is due to the
rendering not being optimized.  I've tried turning off the network
thread and the logic thread with the same results.  This is my first
game using OpenGL, thanks for the info about sorting the objects
before rendering.  This will be the easiest to implement.

I'll definitely keep your suggestion of using a texture atlas,
although at the moment I have so many other things to work on that I
don't want to waste time over-optimizing it.


> By the way, another optimization that I have already implemented is to
> bake all the static objects in a single image. For example, all the
> platforms are baked into the background at game start, avoiding a lot
> of drawBitmap calls. Then, I just have a bunch of rectangles for
> collision detection with platforms. I understand that in your case
> this is a bit more difficult because the character can walk behind
> static objects, but at least you could bake one-cell objects or even
> bake everything and just redraw one object again when the character
> walks behind it. What do you think?
>

Hmm, I'm not sure if that'll work for me.  I've heard that rendering
large bitmaps/textures with OpenGL can also hurt performance.  So you
have to break those large textures into small ones. I'd have to find a
nice medium.  Not really necessary in my case.  But thanks though, if
I ever want to improve the framerate I'll keep your suggestions in
mind.

Good luck with your game!

> I have seen your map editor in HTML/JS, it is pretty awesome. I
> thought something similar for Egg Savior, but ended with plain old
> ASCII text for the maps :)
>
> Regards.
>
> On 24 nov, 00:01, Miguel Morales <[email protected]> wrote:
>> Thanks for the response, you are actually getting a better framerate
>> than I am and I'm using OpenGL.
>> However, my approach is pretty simple.  I load a bunch of png images
>> and just draw them (some sprites may be drawn twice) there is a lot of
>> room for improvement.
>>
>> However, my game is 2D with simple tile animations, the scene is only
>> updated when a character moves.
>> This is why I use 'RENDER_DIRTY' with OpenGL which means it doesn't
>> render the scene as fast as possible but only when the scene has
>> changed.
>> This made my app reduce about 50% CPU usage which means better batter
>> life.  Just something to put out there, framerate is not necessarily
>> the ultimate goal when making a game for Android.
>>
>> Even with some movement the framerate only goes up to 7FPS or so and
>> it looks the same as if I had it rendering as fast as possible (which
>> I get like 20 - 30FPS.)
>>
>> Handling input is a pain, I remember watching a talk on Replica Island
>> where the author mentions implementing an input queue.
>> I hadn't done this until I started having some issues with sleeping in
>> the onTouch() method and receiving callbacks from my service (which
>> runs in the same thread as the UI thread.)
>>
>> I'm just pretty much using queues now for both the network calls and
>> the onTouch calls to keep everything in order in the UI/render thread.
>>
>>
>>
>>
>>
>> On Tue, Nov 23, 2010 at 3:48 AM, Ruben <[email protected]> wrote:
>> > Hi Miguel,
>>
>> > I'm getting solid 60 fps on my Samsung Galaxy Spica (800 mhz
>> > processor) for most levels. I have heard that does not work so well in
>> > the HTC Magic...
>> > CPU load is quite balanced between updating the scene and rendering
>> > it, thus I could improve performance by optimizing the update phase
>> > (collision detection is a good candidate) without changing the canvas
>> > approach. I am an OpenGL lover, but unfortunatelly my phone has poor
>> > support for it :(
>>
>> > The biggest problem was the handling of input events. It hurts
>> > performance a lot by default. My solution is to save every motion
>> > event data in the same variable, and processing the most recent one in
>> > the main render loop/thread. This, incidentally, avoids some thread
>> > synchronization problems.
>>
>> > On 23 nov, 09:13, Miguel Morales <[email protected]> wrote:
>> >> Nice, I enjoyed the part of content creation.  I'm going to keep your
>> >> suggestion of using a single bitmap with all the sprites instead of
>> >> individual images.
>> >> Although it's not terrible it does indeed have a performance impact.
>>
>> >> Are you getting good performance using this approach with canvas alone?
>> >> In either case, good job.
>>
>> >> On Sun, Nov 21, 2010 at 2:51 PM, Ruben <[email protected]> wrote:
>> >> > I have just written an in-depth article covering the workflow of 2D
>> >> > game creation for Android with blender, based in my own experience
>> >> > with the game "Egg Savior". I hope you find it usefull.
>> >> > Feel free to share your knowledge and propose other alternatives to
>> >> > these ideas.
>>
>> >> >http://organicandroid.blogspot.com/2010/11/creating-2d-games-with-and...
>>
>> >> > --
>> >> > 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
>>
>> >> --
>> >> ~ Jeremiah:9:23-24
>> >> Android 2D 
>> >> MMORPG:http://developingthedream.blogspot.com/,http://www.youtube.com/user/r...
>>
>> > --
>> > 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
>>
>> --
>> ~ Jeremiah:9:23-24
>> Android 2D 
>> MMORPG:http://developingthedream.blogspot.com/,http://www.youtube.com/user/revoltingx
>
> --
> 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



-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://developingthedream.blogspot.com/,
http://www.youtube.com/user/revoltingx

-- 
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

Reply via email to