Tileset edge trimming

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Zot
Prole
Posts: 4
Joined: Fri Apr 02, 2010 5:14 am
Location: Wellington, New Zealand

Tileset edge trimming

Post 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 :)
User avatar
Thursdaybloom
Citizen
Posts: 81
Joined: Mon Feb 15, 2010 3:43 am
Location: Australia

Re: Tileset edge trimming

Post 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)
User avatar
Zot
Prole
Posts: 4
Joined: Fri Apr 02, 2010 5:14 am
Location: Wellington, New Zealand

Re: Tileset edge trimming

Post 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)
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Tileset edge trimming

Post by Robin »

Help us help you: attach a .love.
User avatar
Zot
Prole
Posts: 4
Joined: Fri Apr 02, 2010 5:14 am
Location: Wellington, New Zealand

Re: Tileset edge trimming

Post by Zot »

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests