Optimizing background tiles

Hi there, I’ve been developing a small sidescroller game engine, and I’m
trying to find the best way to draw background tiles. Is it better to have
many small tiles vs. few larger tiles being drawn? Or, is there an optimal
width which will give best performance?

Thanks

During tests that I conducted I discovered that drawing n intire screen in
small tiles or in one big one made very little to the time it took to blit
the screen. It seems that the important thing is how MUCH you blit, not how
many times. Ofcourse there is a little overhead for the functioncalls but
it’s not so big that you drop out of your chair. Test it your self. My
biggest test was with an animated roulettewheel that I cut up into over 50
small pices and it then contained over 200 frames. A total of over 8000
pictures where generate. I got a difference in frametime of about 1-2
milliseconds.
Just remeber to convert the images loaded into the same type as the screen
surface. Otherwise you would see a bigger difference when using several smal
ones due to all the convertions going on.

Best regards
Daniel Liljeberg> ----- Original Message -----

From: ptuckey@uvic.ca (Patrick Tuckey)
To:
Sent: Sunday, September 28, 2003 4:23 AM
Subject: [SDL] Optimizing background tiles

Hi there, I’ve been developing a small sidescroller game engine, and I’m
trying to find the best way to draw background tiles. Is it better to
have
many small tiles vs. few larger tiles being drawn? Or, is there an
optimal
width which will give best performance?

Thanks


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Thanks Daniel; I tried some tests and found similar results to what you
describe. I was not aware that it is possible to use formats other than
bitmaps; could you please tell me where to go to read about this?>===== Original Message From “Daniel Liljeberg” <damien_ at hotmail.com> =====

During tests that I conducted I discovered that drawing n intire screen in
small tiles or in one big one made very little to the time it took to blit
the screen. It seems that the important thing is how MUCH you blit, not how
many times. Ofcourse there is a little overhead for the functioncalls but
it’s not so big that you drop out of your chair. Test it your self. My
biggest test was with an animated roulettewheel that I cut up into over 50
small pices and it then contained over 200 frames. A total of over 8000
pictures where generate. I got a difference in frametime of about 1-2
milliseconds.
Just remeber to convert the images loaded into the same type as the screen
surface. Otherwise you would see a bigger difference when using several smal
ones due to all the convertions going on.

Best regards
Daniel Liljeberg

----- Original Message -----
From: “Patrick Tuckey” <@Patrick_Tuckey>
To:
Sent: Sunday, September 28, 2003 4:23 AM
Subject: [SDL] Optimizing background tiles

Hi there, I’ve been developing a small sidescroller game engine, and I’m
trying to find the best way to draw background tiles. Is it better to
have
many small tiles vs. few larger tiles being drawn? Or, is there an
optimal
width which will give best performance?

Thanks


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I think he means to make sure your bitmaps are the same colour depth as
the screen you’re displaying them on. SDL is quite happy to take a
24-bit colour bitmap and display it on a 16-bit colour screen, but it’s
far slower than taking a 16-bit colour bitmap and displaying it on a
16-bit colour screen.

Look up SDL_DisplayFormat() to see what I mean.

— Patrick Tuckey wrote:> Thanks Daniel; I tried some tests and found similar results to what

you
describe. I was not aware that it is possible to use formats other
than
bitmaps; could you please tell me where to go to read about this?

===== Original Message From “Daniel Liljeberg” <damien_ at hotmail.com>
=====
During tests that I conducted I discovered that drawing n intire
screen in
small tiles or in one big one made very little to the time it took
to blit
the screen. It seems that the important thing is how MUCH you blit,
not how
many times. Ofcourse there is a little overhead for the
functioncalls but
it’s not so big that you drop out of your chair. Test it your self.
My
biggest test was with an animated roulettewheel that I cut up into
over 50
small pices and it then contained over 200 frames. A total of over
8000
pictures where generate. I got a difference in frametime of about
1-2
milliseconds.
Just remeber to convert the images loaded into the same type as the
screen
surface. Otherwise you would see a bigger difference when using
several smal
ones due to all the convertions going on.

Best regards
Daniel Liljeberg

----- Original Message -----
From: “Patrick Tuckey”
To:
Sent: Sunday, September 28, 2003 4:23 AM
Subject: [SDL] Optimizing background tiles

Hi there, I’ve been developing a small sidescroller game engine,
and I’m

trying to find the best way to draw background tiles. Is it
better to
have

many small tiles vs. few larger tiles being drawn? Or, is there
an
optimal

width which will give best performance?

Thanks


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

That makes sense; thanks!>===== Original Message From Paul Smith <googoodolls_uk at yahoo.com> =====

I think he means to make sure your bitmaps are the same colour depth as
the screen you’re displaying them on. SDL is quite happy to take a
24-bit colour bitmap and display it on a 16-bit colour screen, but it’s
far slower than taking a 16-bit colour bitmap and displaying it on a
16-bit colour screen.

Look up SDL_DisplayFormat() to see what I mean.

Patrick Tuckey wrote:

Hi there, I’ve been developing a small sidescroller game engine, and
I’m trying to find the best way to draw background tiles. Is it
better to have many small tiles vs. few larger tiles being drawn?
Or, is there an optimal width which will give best performance?

I wouldn’t go below 16x16 or above 256x256, but beyond that, it’s (mostly) a
question of what will give you the least number of unique tiles.–
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com