Advanced Tiled Loader - No longer maintained

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Advanced Tiled Loader

Post by adrix89 »

The problem with multiple batches is that you limit the number of tilesets you can have
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

How?
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Advanced Tiled Loader

Post by adrix89 »

A sprite batch uses one image,if you had a map with tiles from 10 tilesets you would have to have 10 sprite batches
So drawing the sprite batch changing the image then redrawing and so on is one solution but my guess is that the cpu would bottleneck it that way
So its probably just simple to have 2-3 spritebatches and if there is more to draw you can distribute it evenly among them
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

I apologize but I must be really missing something crucial. You would still have all 10 of those images loaded into memory. You would still have 10 draw calls. What is the difference in rotating out the assigned images and quads in a few sprite batches than having them already loaded in several?
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Advanced Tiled Loader

Post by adrix89 »

Never mind seems I had the wrong impression here.
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

No problem.

In other news, update! SpriteBatch support is working and does drastically improve performance. But as expected it also breaks a few things. Specifically, if you use multiple tilesets on the same layer and the dimensions of those tiles are bigger than the map's tilewidth and tileheight then the drawing order will likely be messed up. It's a specific case but it breaks complete compatibility with Tiled. Using TileLayer:drawAfterTile() is also not possible with sprite batches enabled.

To enable sprite batches set the tile layer's use_batch variable to true. This is set to false by default.

The automatic PO2 fix is also working. To use it set the loader's fix_po2 variable to true BEFORE you load the map.

Here is a full list of changes:
0.8.2 (5/11/11):
- Tileset images are now cached between maps.
- Added an option to automatically pad images for PO2. To do this set Loader.fix_po2 to true.
- Changed Map.tl and Map.ol back to Map.tilelayers and Map.objectlayers. Map.tl and Map.ol remain as aliases.
- Tile layers can now render using sprite batches by setting TileLayer.use_batch to true.
- Added an init.lua file.
- Removed hardcoded require() paths. Added in global TILED_LOADER_PATH to point to the library path.
- Renamed the TileSet functions getWidth() and getHeight() to tilesWide() and tilesHigh().

To download the version 0.8.2 click here.
User avatar
pudding
Prole
Posts: 6
Joined: Tue Jul 05, 2011 5:09 am
Location: Paris, France

Re: Advanced Tiled Loader

Post by pudding »

Not sure if this is just a problem with my computer or not but the desert example is being trimmed to what appears to be 1024x1024 pixels in 0.8.2 from the top left corner, that happens whether spritebatches are turned on or off. The obstacles still work even though they're invisible. The problem doesn't exist in 0.8.1.

The version numbers relate to the Advanced Tiled Loader.


Edit:
Sorry, I'm an idiot who doesn't know how to search.

Although it's not entirely clear (to me at least) from the thread, the fix Kadoba suggests in http://love2d.org/forums/viewtopic.php? ... 18&p=34493 resolves this problem.
Attachments
tileloader.png
tileloader.png (74.6 KiB) Viewed 7460 times
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

pudding wrote: Sorry, I'm an idiot who doesn't know how to search.
No that's really something I should fix but I've been lazy. BUSY! I mean busy.

The reason it's bugged is because it uses map.tilewidth and map.tileheight instead of map.width and map.height to limit maximum tiles. But map.tilewidth and map.tileheight are the dimensions of the tiles (in pixels) and map.width and map.height are the dimensions of the map (in tiles).

I'll put the fix in and reupload 0.8.2.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

Hey guys. A pretty big update.

Advanced Tiled Loader 0.9.0 is out! I wanted to clean the code up and make it more consistent. There's quite a few identifier changes which will probably break compatibility if you try and switch out an older version for it. Sorry about that. But I think the changes will help the overall health of the project and make it less confusing for new people to use.

Another big thing is that there is now a github repository. I'm also working on the wiki which will have documentation and some beginner tutorials. It's currently a work in progress though.

Here's a list of the changes:

0.9.0
- Advanced Tile Loader now has a wiki page and a github repository!
- Cleaned up the code quite a bit.
- Classes are now broken up into individual files rather than grouping similar ones into one file.
- Many identifiers have been changed to be less confusing and more consistent. Now camelCase is
used to separate words instead of underscores. Internal functions and data are now prefixed
with an underscore.
- Sprite batch mode can now be set through the map or through individual tile layers. Tile layer
settings take precedence.
- A bug with layer transparency has been fixed.
- Tile:draw() now accepts parameters for scaling, rotation, and offset.
- TileLayer:drawAfterTile() now works with multiple functions
- Forcing a redraw is now automatic when you switch sprite batch modes.
- Added support for flipped tiles that were introduced in Tiled version 0.7.0
Last edited by Kadoba on Tue Aug 23, 2011 9:10 pm, edited 1 time in total.
florian
Prole
Posts: 1
Joined: Tue Aug 23, 2011 8:28 pm

Re: Advanced Tiled Loader

Post by florian »

Thank you for this release and thank you very much for putting the code & wiki on GitHub!
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests