[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Big Scrolling Surfaces
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Big Scrolling Surfaces
- From: Rene Dudfield <renesd@xxxxxxxxx>
- Date: Mon, 28 Nov 2005 16:35:52 +1100
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Mon, 28 Nov 2005 00:35:55 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ovYMzZ/7uWinrVxGdS3SFP0OdjjN3oY/I9iG0dejSqNgk3A7T/KkiWbfWYEni9DpEtV7oat9DjvPhb6LNZDK0V8bYpViIa2enT/IuhhziAfdVjAHlJwysuY8/iY6mk82sTRd/ilXriBk2cL1WxSCf2K08Pnzg7kR/6vWDwqW6cU=
- In-reply-to: <438A7EEA.8090601@xepher.net>
- References: <438A7EEA.8090601@xepher.net>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Are you reusing surfaces in any of these? Or is each tile unique?
On 11/28/05, Kris Schnee <kschnee@xxxxxxxxxx> wrote:
> My project now involves an "infinite treadmill" of map zones, so that
> the player can walk forever in any direction. The game loads 25x25 areas
> of 64x64-pixel tiles (ie. 1600x1600 pixels), and loads _nine_ of these
> areas at a time so that the next zone is always visible beyond a zone
> boundary. (That is, the eight zones around the current one are visible.)
> This whole 3x3-zone region is drawn on a single Pygame surface.
>
> But this is a memory hog of a graphics system! 1600x1600x9 = 23,040,000,
> times 3 bytes per pixel should = 69,120,000 bytes for the surface!
> Windows' Task Manager reports "only" about 109,000 KB memory usage for
> my whole program, which uses not only this gigantic surface, but the
> main blitting surface (800x600) and various other loaded graphics etc.
>
> Am I nuts for using such a big surface, or should I expect it given what
> I'm trying to do? I eventually want to have an "overlay" layer for
> objects that the player can walk behind (like the tops of trees); am I
> going to need another huge surface, or should I handle them like
> sprites, blitting them directly to the drawing surface even though most
> will fall outside it? Would it make sense to trim the 3x3-zone area to
> more like half-a-zone in each direction, including only the areas the
> player can see without leaving the zone -- even though it'll then be
> less practical to save parts of the drawn image on loading a new zone?
>
> Kris
>
>