Page 1 of 1

Displaying multiple tile maps

Posted: Fri Aug 02, 2013 1:48 pm
by Djent
I'm making a game and using Tiled to create a .lua file. I get rid of the irrelevant data and leave myself with just the table containing the map tiles and another table containing information about the tiles (walkable/solid/etc). I also have information tiles that are towards the edge of the map that I want to use to start loading the next area.

This is all going fine, but I don't know how to display the transition between the current tile map and the next tile map efficiently. I don't want to expect different tile maps to be the same height and width (in tiles, not pixels).

I know that offsetting the current map will probably be part of the solution, but I don't really know how to make the next map line up with the current one.

I've included the .love file - I'm trying to make a general tiled RPG engine and a Pokemon Emerald clone along side it. When I finish the clone, I assume that once I strip all the Pokemon related stuff from the engine, it should be suitable for any type of tile RPG.
My Github repository is https://github.com/Djent-/Pokemon-Lua. I'd make a thread in Projects/Demos, but I don't think this project is worthy yet.

Re: Displaying multiple tile maps

Posted: Sat Aug 03, 2013 7:27 am
by adekto
interesting what you are trying to do.
the way u can do it is little bit like this, have a your maps(red and yellow) inside a overall map(green)
and every small part of the map needs a header of its x and y position and its length and height
so when you're outside the map then read from the overall map what comes next

idk if this will help, i haven't tried it in practice

Re: Displaying multiple tile maps

Posted: Sat Aug 03, 2013 12:18 pm
by Djent
adekto wrote:interesting what you are trying to do.
the way u can do it is little bit like this, have a your maps(red and yellow) inside a overall map(green)
and every small part of the map needs a header of its x and y position and its length and height
so when you're outside the map then read from the overall map what comes next
This is a really great idea, thank you. I still have a nagging feeling that there is a more efficient way of orienting the maps, but this sort of grand scale table will probably be the most portable.

Re: Displaying multiple tile maps

Posted: Sun Aug 04, 2013 8:53 pm
by davisdude
You can check an article I made about Layering tile maps (http://www.love2d.org/wiki/Layering_Tiles). Then you can make the tiles you don't want to see see-through.

Re: Displaying multiple tile maps

Posted: Mon Aug 05, 2013 4:28 pm
by adekto
:ehem:
since u are using tiled, u can also just copy past all your maps into 1, my understanding love will perform exactly the same, maybe better since it wont need to calculate one map in relation to another