Page 1 of 1

Tileset edge trimming

Posted: Fri Apr 02, 2010 5:48 am
by Zot
Hais! I'm new to both lurve and game development, but I've dedicated myself to learning. To that end I'm trying to construct a simple top-down 2D RPG, using tilesets.

I can thus far grasp the basics of tilesets fairly well I think, but I would like some opinion as to how to handle smooth camera movement when it comes to drawing new tiles and disposing of old ones. Two examples in the wiki that helped me a lot (Efficient tile-based scrolling and Fine tile-based scrolling) use differing means to construct a tileset that smoothly scrolls, rather than scrolling by tiles. Both also stop short of addressing the jarring popping of tiles into existence as the camera moves.

As far as I can see it, there are three ways of fixing this:

- Draw only portions of the edge tiles, strikes me as somewhat complicatory

- Draw a border to overlap and hide the edge tiles and thus the popping/disappearing tiles (this is my first choice)

- Enlarge the visible game area and draw the edge tiles off-screen

Just wondering what other people have done :)

Re: Tileset edge trimming

Posted: Fri Apr 02, 2010 7:13 am
by Thursdaybloom
Zot wrote:... and draw the edge tiles off-screen
I've not done any scrolling yet but does the Fine Tile-based Scrolling tut not recommend to draw at least 1 tile so it's doesn't just pop into view?

Code: Select all

  map_display_buffer = 2 -- We have to buffer one tile before and behind our viewpoint.
                               -- Otherwise, the tiles will just pop into view, and we don't want that.
(from the tut)

Re: Tileset edge trimming

Posted: Fri Apr 02, 2010 10:03 am
by Zot
I take the viewpoint to mean the visible portion of the map displayed on-screen. I could buffer till the cows come home but until they're buffered so much they go off the borders of the window, they'll still pop into view. That'd be solution #3 in my OP, which I figure most people would use. In my case, however, I intend to have the game world only take up a fraction of the window... so I need to look at #1 or #2 (or whatever other solutions people may have come up with)

Re: Tileset edge trimming

Posted: Fri Apr 02, 2010 2:46 pm
by Robin

Re: Tileset edge trimming

Posted: Sat Apr 03, 2010 1:33 am
by Zot