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

Re: [pygame] resources for edge tile algorithm



My transitions are split into 4 sides, 4 corners, and 4 curves. If I set forest to be 'higher' than dirt, it draws as expected - See screenshot: http://bloodcurse.axedcode.net/images/1.png . However, if I swap the order so that dirt draws over forest, I'd expect the circular dirt patches to be completely over the dark green forests. Instead, you can see that the sides of the forest are always drawn over the dirt, making it pretty ugly looking. See screenshot: http://bloodcurse.axedcode.net/images/2.png . Here is what I did in pseudo-code:

for depth in range(4):
    if depth > tile.order:
        for type in terrain_types:
            draw_sides()
            draw_corners()
            draw_curves()

orders are:
water (not shown): 0
plains (lt. green grass pattern): 1
dirt (circular lt. green patches): 2
forest (dk. green): 3

Does anyone have any idea why the sides are drawing in the wrong order?

On Tue, Jun 30, 2009 at 5:41 PM, Michael Fiano <michael.fiano@xxxxxxxxx> wrote:
Fawkes,
Yes, my rock is actually on a separate layer that is supposed to be drawn after the base terrain, but it seems it has to be reorganized as somehow the transitions are drawn after the 2 layers with my recent changes.


On Tue, Jun 30, 2009 at 9:52 AM, Fawkes <fawkesgarde@xxxxxxxxx> wrote:
Michael,

Please correct me if I'm not interpreting what you're trying to do right.

For things like your rocks, rather than handling them within the terrain map, we just made a separate "Landmarks" layer for things like rocks, houses, statues, etc that was drawn on top after the terrain stuff got drawn.

~Fawkes