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

[pygame] Tile Size



I think that a 2D, flat scrolling tile system in Pygame would be a decent compromise between graphical quality and ease of programming, for my project. I can live with the game's islands being a constant height, for simplicity. One question I could use input on is about tile size.

Right now the game world has 100x100 "zones" representing chunks of terrain I imagine as 1 Km^2, ie. each data point represents a 10m^2 area. I'd like to show human-sized figures, meaning you can see maybe ten times the player's width at a time -- maybe 10 meters across. For an 800x600 screen, that would mean tiles maybe 80 pixels wide for each data point. Pre-drawing a whole zone then would mean blitting from a picture 8000x8000 pixels in size! Is that impractical?

I'd like to use square tiles of some reasonable size, erring on the side of using a few big tiles. Maybe I should treat a zone as being just 100x100m? The level of detail on the terrain itself doesn't need to be high, because objects like trees can be added separately at any exact coordinates. (That is, I could describe an island's shape with a small number of data points saying "water here, sand here, grass here" and then a list of exact positions for objects.)

Since the game has an island theme I would also like to draw water translucently, which would mean blitting a water texture (or at least translucent blue/cyan) over parts of the terrain, rather than just using blue tiles as I once did ( http://kschnee.xepher.net/pics/niss-051111.jpg ). That also means having some way to draw water "in front of" or "behind" sprites or even some of both depending on their vertical position, right? Even if the landscape is a constant height for drawing purposes, I'd still like to have a character able to go underwater, being drawn "behind" the water, but also able to be above it or at the surface. Drawing water could be done on the fly each frame, or given its own drawing plane -- doubling the RAM needed for the pre-drawing -- or even given a much smaller drawing plane and then somehow scaled up each frame. What method makes sense?

Kris