Page 1 of 1

Help loading Tiled map with STI

Posted: Tue Aug 25, 2015 6:39 pm
by TheScout18
I've been working on a small game for a while, and have ran into an issue with my Tiled file that I've exported in a Lua format for Simple Tiled Imp. to load attempting to load the file always results in the error "STI does not yet support Tile Collections" I've searched around for answers to what this means exactly, or possible solutions, but have found nothing... Any help would be greatly appreciated. :)
(I'm really new to Love and Lua in general, sorry if this a bit of a noob question)

Link to a .love of my game: (removed)

Re: Help loading Tiled map with STI

Posted: Tue Aug 25, 2015 10:27 pm
by Karai17
You need to make a tile atlas instead of having individual tile images.

Re: Help loading Tiled map with STI

Posted: Tue Aug 25, 2015 11:27 pm
by TheScout18
Ahhh, ok, how might I go about doing that? Besides manually stitching them together?

Re: Help loading Tiled map with STI

Posted: Wed Aug 26, 2015 12:05 am
by Karai17
I believe there are tools online you can use to stitch them together. Alternatively you can write a love program that reads in images form a folder and creates a texture out of them via ImageData.

Re: Help loading Tiled map with STI

Posted: Wed Aug 26, 2015 12:10 am
by TheScout18
Out of curiosity... Wouldn't Tiled see combined pictures as just one picture, rather than many? Also, could you maybe link a site of that description? I'm having trouble finding one that doesn't look 100% sketchy...
(or if it's easier, show me how I'd do that ImageData thing? Sorry, I'm quite a noob..)

Re: Help loading Tiled map with STI

Posted: Wed Aug 26, 2015 12:16 am
by Karai17
Tiled sees them as individual images, it does not convert them to an atlas. The problem with using individual tiles instead of an atlas is that sprite batches use a single image for each batch and if we were to draw a map without batches then drawing would be very slow. I want STI to remain lean and fast so I've decided against implementing Tile Collections since I'd either need to ignore batching or add a bunch of code to dynamically create a texture.

Texture Packer seems to be the go-to program for these scenarios.

Re: Help loading Tiled map with STI

Posted: Wed Aug 26, 2015 1:06 am
by TheScout18
Thanks a million! Everything's working now! :awesome: