Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Low Frame Rate. How to deal with this problem?!?!?!?!?

  1. #1

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    okay i know that this has been asked and before but how can i improve my frame rate.
    The game i am making (turn based strategy) is going with a fps 50-60 on a 2000 mhz cpu, and i don't think it will run good enought at slower pc-s 300-400 mhz.
    I will test it in a couple of days on a slower machines but until then i hope someone can help with tips/tricks to improve the fps in my game.

  2. #2

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    DelphiX may give you lower results than theoretically possible if WaitVSync is set to true (which is a parameter of the Flip method). So you may get a frame rate around 60 FPS even if your engine is actually capable of much higher frame rates. This doesn't mean you should disable VSyncing, it just means that your game may run at the same framerate on slower machines.

    There are of course ways to optimize the speed of your game:
    1) Avoid using alpha blending as this will significantly slow down blitting.

    2) Make sure you only draw what's actually visible (if you have sprites, check their X and Y coordinates to see if they're currently visible on the screen)

    3) Draw things that don't get updated a lot on a separate surface and then just blit that onto your backbuffer.

    Hope that helped.
    Ask me about the xcess game development kit

  3. #3

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    Seems to me that a turn based game doesn't need a high fps. :roll:

    In any case, here's a few general things you might want to look at:
    - using 256 colored graphics will help some.
    - using 8bit color mode will help even more
    - limit the drawing to the visible parts of your game.
    - don't use alpha blending
    - don't use canvas.fill(0) if your screen is already filled with tiles
    - don't use standaard texts (ie. canvas.textout)
    (- decrease the resolution, 1024x768 is too much for DelphiX)

    Perhaps you can post a few screenshots. It might help a little to see where the problem areas are.

  4. #4

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    Hmm,. seems you posted before me Harry

    I really should write faster

  5. #5

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    You are right it doesnt but i just want to know why its slow

    thanks to both for repling i am going to do some changes in the code

    by the way Traveler

    - don't use standaard texts (ie. canvas.textout)

    what should i use to display text ??

  6. #6

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    i will compile and upload the game so you can test it guys
    soon will post the url

  7. #7

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    http://members.lycos.co.uk/dhsoft/game.rar
    the game is in bulgarian language so dont wonder why you cant read
    please test it and post any problems you find
    ou and ignore the text displayed after 2 units fight its still under construction

  8. #8

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    Looking pretty good hammer! Reminded me somewhat of civilisation
    The fps is pretty good as well, but like you said, around 55~60. (1.3mhz, 256mb ram)

    One odd thing I noticed was the flickering when the screen with all the text appeared. It stopped (fortunately), when the game actually started.

    To answer you question about the text, a few words here and there, like what you did with the numbers next to the icons won't hurt that much. But large amounts, I've noticed, do. Better use graphical text (pictures)instead. Perhaps a bit more work, but it will pay off, and it looks much nicer in the end as well.

  9. #9

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    nice game , but need better graphics
    http://www.programuotojas.com

  10. #10

    Low Frame Rate. How to deal with this problem?!?!?!?!?

    Well writing the text the way you do is using the normal Canvas (GDI) which is pretty slow in comparisson to DirectX/DelphiX, what you could use instead is bitmap fonts, which basically means that each letter is a bitmap.

    When you want to draw text you simple traverse through the string and draw the corresponding bitmap at the correct position! It's faster than the canvas method and gives you a greater variaty of fonts!


    P.S. For a 2D game 60 FPS is pretty good and some books even advise you to limit your frames at 60 FPS in 2D games.
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

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