Displaying multiple tile maps

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
Djent
Prole
Posts: 27
Joined: Sun Jan 20, 2013 3:22 pm
Location: Rhode Island

Displaying multiple tile maps

Post 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.
Attachments
Pokemon Remake21 -f.love
(125.21 KiB) Downloaded 210 times
User avatar
adekto
Prole
Posts: 35
Joined: Thu Dec 06, 2012 11:42 am

Re: Displaying multiple tile maps

Post 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
Attachments
map.png
map.png (8.83 KiB) Viewed 3519 times
User avatar
Djent
Prole
Posts: 27
Joined: Sun Jan 20, 2013 3:22 pm
Location: Rhode Island

Re: Displaying multiple tile maps

Post 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.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Displaying multiple tile maps

Post 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.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
adekto
Prole
Posts: 35
Joined: Thu Dec 06, 2012 11:42 am

Re: Displaying multiple tile maps

Post 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
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 6 guests