Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2008
    Kazakhstan, Almaty

    Red face Fastest draw operation and logic for Game engine

    Guys, I got a serious performance problem:
    when I watch emulated version of my app which is was built using my simple game engine, it runs pretty well.
    but when I deploy it on smarphone (nokia e63) it runs a bit slower.

    so I'd like to ask you about two things:
    1. which method will be faster and better for fast animation ? DrawImage or DrawRegion or your suggestion...
    2. where to put these methods? I use something like this(made it simple to understand):
    what I dont like is : sleep(). it means it cant count or do anything. so the whole game logic goes between sleep and draw methods which is not the best way(err?) to change this problem I'm thinking for second thread(game logic only).

  2. #2
    Registered User
    Join Date
    Nov 2009

    Re: Fastest draw operation and logic for Game engine

    what you could do, is another thread that is managing the repaint task, while you can count different things in the main thread

    this would also make the use of sleep unnecessary, as for example when you want to move sth in constant speed, you write the start time (System.currentTimeMillis()) of the animation in a long, and check everytime when in the while method repaint is happening how much the figure, etc moved in this time and set this as the new x and y...
    so the speed will be the same on every phone without thinking of the power of it...

    hope you understood what I tried to explain

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2012
    Surabaya, Indonesia

    Re: Fastest draw operation and logic for Game engine

    Because the processor speed of the mobile devices varies, perhaps your game will run smoothly in Nokia C3-00 or the latest phone.

    For your question:
    1. In my opinion, the speed of those 2 methods are quite similiar. Because when you draw an image, it will read each pixel in the image and copy the RGB value to your desired position.
    2. I think your order is correct and maybe you need to minimize the usage of image in your game, so it wouldn't take a lot of time.

    I hope it helps.
    Jeffrey Hermanto Halimsetiawan
    Game Developer | Mobile Apps Developer

  4. #4
    Registered User
    Join Date
    Jun 2012

    Re: Fastest draw operation and logic for Game engine

    How many frame per second do you need?
    Overall I think 12 FPS is the maximum that a mobile can achieve.
    More than 12 FPS are few devices that achieve that performance.
    Unfortunately I learned this in practice.

    Good luck in your game!!!

Similar Threads

  1. ***********Fastest way to draw to Image?
    By none800 in forum Mobile Java General
    Replies: 5
    Last Post: 2010-11-19, 11:47
  2. Logic for game character to move around in the field?
    By j2me_beginner in forum Mobile Java Games
    Replies: 0
    Last Post: 2010-02-23, 06:26
  3. Please test my logic game?
    By mifos in forum Mobile Java Games
    Replies: 5
    Last Post: 2009-10-06, 07:45
  4. Fastest way to draw stretched bitmap
    By neois in forum Symbian
    Replies: 5
    Last Post: 2008-03-10, 07:17
  5. where reside the logic of the game
    By pgdmovil in forum Mobile Java Games
    Replies: 1
    Last Post: 2007-06-11, 06:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts