Game Development Community

Seam between tileLayers

by Phil Shenk · in Torque Game Builder · 02/19/2006 (11:18 pm) · 4 replies

I'm just trying something new here, and that's placing tileLayers exactly next to each other to make a larger "level". I'm working on a random level scheme, so I'm assembling smaller "sections" of the map as tileLayers, into a big map. That's the plan anyway.

So what I'm seeing, esp when moving the camera, is a very tiny seam or crack between the tileLayers. I'm guessing that this might be due to the clipping of the individual tileLayers, or perhaps some drawing precision issues. It doesn't really surprise me, but it is ugly looking. Wondering if there is any way to address this?

If there isn't, I'll probably have to try something else, and I have some ideas, but they aren't as simple :/

#1
02/20/2006 (12:13 am)
Overlap the tile-layers slightly?

- Melv.
#2
02/20/2006 (12:57 am)
I had this problem too. It has to do with camera's position which is a floating point value (2 floats). This also leeds to swimming effects even if you turn off bilinear filtering (filterpad solves this). The seams disappear if all objects and the camera are at an integer position (eg 10 4 instead of 10.23 4.413) and the camera's view area is set to the actual pixel size of the scenewindow.

I just left everything as it was, but you could modify the rendering code of sprites and tilelayers to round the vertex coordinates to the next integer without modifying their physical position.
#3
02/20/2006 (3:25 am)
@Phil: I've done something similar, but adopted a slightly different approach.
I created level building blocks by creating separate TileMaps for each block. Then at level loading time I created a large TileLayer and copied all tiles from each block into it. It worked really good.
#4
02/20/2006 (10:22 am)
@ Melv: Overlapping them works, but seems messy to me. I like having them hold to nice, regular spacing. For instance, if I wanted to later find the width of my level, I'd have to account for all the overlapping instead of just adding up the width of the tileLayers.

@Michael: Thanks for shedding light on the situation! I'll play around and see if that helps. I doubt that I'll change the rendering code though :/

@Johan: that was what I was thinking I'd have to do. In some ways, this will be better for me to do it this way... more of a pain in others though. I was hoping to have parts of the level (corridors) rotated at 45 degree (or other) angles, without making special angle tiles. Not that big a deal though...

Thanks guys!