Hello Guest

Grey lines in tile map

  • 2 Replies
  • 5354 Views
Grey lines in tile map
« on: November 23, 2010, 04:37:40 »


I'm getting strange grid-like lines through my tiled map in my game when I translate my map's verts to certain values, (e.g: ~ %.66667).

I'm not using any blending or filtering, the map's tiles are 32x32 and are using a bitmap that is laid-out in 32x32 tiles.

I don't want to add extra empty space in my bitmap to cover the edges of the UVs if that's the problem...

Anyone have a quick-fix for this?
« Last Edit: November 23, 2010, 04:39:34 by Draco9898 »

*

Offline kappa

  • *****
  • 1319
Re: Grey lines in tile map
« Reply #1 on: November 23, 2010, 09:22:35 »
looks like small floating point errors, are you using float or int to store/draw your tile positions?

Re: Grey lines in tile map
« Reply #2 on: November 23, 2010, 13:37:53 »
Because all the top of the dark squares are always dark blue and the left sides are always tan, I would say you have a size problem. It looks to me that you're texture coordinates are off by one texture pixel or your tiles are one pixel too big. Make sure you aren't creating the tiles 33x33 pixels on an accident (if you start at 0 and end at 32 for instance). Also make sure that the size of the tiles in the texture is actually 32x32 and not 31x31 (if you start at 1 and end at 31 for instance). These are common mistakes that I've done many times.
« Last Edit: November 23, 2010, 13:40:57 by Fool Running »
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D