[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] sprite groups and tilesheets



On Wed, Nov 19, 2008 at 7:59 PM, Charlie Nolan <funnyman3595@xxxxxxxxx> wrote:
>> A good thing to do in a tile based game, is to blit all of the tiles
>> to a single surface, so you aren't doing a bunch of blits every frame,
>> and then just redraw the whole screen each frame using the rendered
>> map.  If you have animated tiles of course, depending on how many
>> tiles on screen are likely to be animated, this optimization will not
>> be helpful.
>
> It's also not going to be helpful if your map is large.  Assuming SDL
> is willing to create a big enough surface (I've hit the limit with a
> few bugs), you'll be using a ton of memory.
>
> -FM
>

In this case I hope you aren't drawing all of the tiles at once either
:)  Either way you will have to set up a region, but setting up a
region will of course be much simpler with raw tiles.

Off topic, what's with SDL surface sizes being so restrictive?  That
has bitten me in the past with loading animation strips.  It's not
just a memory limit, but a dimensions limit.  I had to convert my
animations to grids to get around it, even though the amount of memory
for the load is the same.  I feel like I should be able to load the
maximum sized image that will fit in available memory.