Re: [pygame] Tile Size

2006-12-17 Thread Farai Aschwanden

Inside...

Am 17.12.2006 um 03:29 schrieb Kris Schnee:


Farai Aschwanden wrote:

Inside...
Am 17.12.2006 um 01:32 schrieb Kris Schnee:
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.

= What blocks you to put higher tiles on the existing tiles?


http://kschnee.xepher.net/pics/shiningsea060630-0.jpg
I tried doing that in isometric tiles to get a 3D-style effect. The  
problem was that since characters could go behind higher tiles  
and I wanted a water layer, I ended up drawing every tile in sight  
each frame, which was slow (15 FPS at best). For each tile I would  
draw the top, then side pieces, and water if appropriate. For  
plain 2D (not isometric) tiles, I would be drawing a top and a set  
of front pieces for the vertical surface. I would still need to  
decide how to draw/redraw parts of the landscape that are in front  
of a character.
= I wasnt aware of going behind but you were absolutely right. Not  
that I've tried it out but you can cheat here as I described for the  
water: In a 3D style area while the character is walking you could  
remove the lower body part of the character before blitting if he  
stands behind a higher obstacle or higher area in front of him.




= 8k x 8k is probably not that big but why creating the whole  
area as image? Why not adding tiles when the player is moving to a  
certain direction. Lets say the player is moving left, so you  
should add tiles on the right side while removing tiles on the  
left side. This would allow you to create big worlds and not  
limited on huge images.


This might make sense, as it involves only drawing individual tiles  
rarely, and not a whole screen's worth per frame.
= Sure thing! ;) How about weather effects like fog? Would give a  
more creepy athmosphere for certain areas.
Btw Im working on a similar project just in 3D. Next thing I have to  
do is enemy AI (following player when sighted). I dont know if you  
are interesed in but could give you the code when its so far. Due my  
project is also tile based you might use it as well.


Farai



Kris




Re: [pygame] Tile Size

2006-12-16 Thread Farai Aschwanden

Inside...

Am 17.12.2006 um 01:32 schrieb Kris Schnee:

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.

= What blocks you to put higher tiles on the existing tiles?



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?
= 8k x 8k is probably not that big but why creating the whole area  
as image? Why not adding tiles when the player is moving to a certain  
direction. Lets say the player is moving left, so you should add  
tiles on the right side while removing tiles on the left side. This  
would allow you to create big worlds and not limited on huge images.




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.)
= Same way you could add areas at higher positiones. They are  
rectange oriented you can check that the player cant pass them (maybe  
way up to them?)




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 (
= Sure would like nice! Instead of this you could use animated water/ 
land combo areas


http://kschnee.xepher.net/pics/niss-05.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.

= How about you can add the type of water like: 1 = low, 2 = deep
low: cut a part of the charaker off (would also work for monsters  
following the characters or any NPC standing in the water)
deep: The character is painted in deep blue or anim turns into  
swimming animation.


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?
= Huh? Doubling RAM? I, personally, recommend you completly try to  
build the visual world in the tile size you planned. Many things to  
mention about this but all over: easier to program than handling  
different tyle size types and mechnisms.


Just my 2 cents
Farai




Kris