Many graphics cards have upper limits on how large a texture can be, and all have finite amounts of video ram to cache textures. A good rule of thumb for good compatibility is that a single texture should not be more than 1024x1024.
However, that should not stop you from painting your whole level as a single image. You could pretty easily tile the image at runtime into 1024x1024 tiles. Another approach would be to preprocess your level image into separate tile images using a separate script. Assuming there is enough video memory to keep all of the tile textures present, you would simply need to draw quads textured with the visible tiles given the player's position. With 1024x1024 tiles at most four would be visible assuming today's monitor resolutions and no scaling on the textures when drawing. To do parallax you would just need to have more than one layer of background tiles that scroll at different rates. Supporting png transparency for the "nearer" tiles would work here, though depending on the number of layers and the game resolution, you may have to worry about too much "overdraw" on slower graphics cards. I would not worry about that at first though. It seems likely to me that someone has already implemented this sort of thing, if not for pyglet, at least for pyopengl/pygame. Would be worth some time investigating existing projects (try pygame.org). Also libraries like cocos2d might make your life easier as well. -Casey On Wed, Feb 3, 2010 at 9:10 PM, Asacolips <[email protected]> wrote: > Pretty soon I'll be starting a side scroller in Python, using the > Pyglet and Pymunk libraries. Anyways, my game's room's will probably > average between 4 and 6 screens at 1280x720, so a big room would > probably be around 7680x4320. It would also probably use multiple > layers for parallax backgrounds. > > In summation, if everything works out well, I'll probably have > backgrounds of that size, up to 4 layers perhaps, and any > transparencies would probably be handled via a png image. That said, I > may take care to not use very many layers for larger rooms. > > My question is would it be a huge performance hit to use hand painted > background images of the entire room size? I don't know anything (yet) > at making a tile engine, and it would save me some overhead, at least > I'm assuming so, by using a solid background. I also think it would > look really interesting, versus the constantly repeated tiles. Would > it be a performance hit for an OpenGl enginge like Pyglet that renders > everything onto a polygon and then uses that as it surface, versus > older rendering such as in PyGame? > > Thanks for any help! > > -- > You received this message because you are subscribed to the Google Groups > "pyglet-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/pyglet-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
