Simple Tiled Implementation - STI v1.2.3.0

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Karai17 »

the isometric code should be fine (since your tiles are in the correct position). The issue seems to either be in box2d.lua or utils.lua.

Edit:

What confuses me, is that my test maps seem to work just fine (including isometric). What version of Tiled are you using? Try exporting from 0.16.0 and see if that fixes it, it could very well be a bug in Tiled!
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Jimlarck
Prole
Posts: 14
Joined: Wed Sep 14, 2016 10:30 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Jimlarck »

Karai17 wrote:the isometric code should be fine (since your tiles are in the correct position). The issue seems to either be in box2d.lua or utils.lua.

Edit:

What confuses me, is that my test maps seem to work just fine (including isometric). What version of Tiled are you using? Try exporting from 0.16.0 and see if that fixes it, it could very well be a bug in Tiled!
I hadn't updated, I just did and re-exported it and everything and it's still broken. I'm gonna try building another test map, could you send me yours so I can see if it works and compare?

EDIT: Nope, made a new map and it's still not working
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Karai17 »

My test maps are in the STI repo, just download the repo and run it in love. main.lua has 4 different maps you can toggle.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Jimlarck
Prole
Posts: 14
Joined: Wed Sep 14, 2016 10:30 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Jimlarck »

Karai17 wrote:My test maps are in the STI repo, just download the repo and run it in love. main.lua has 4 different maps you can toggle.
So I looked at the test map and the only difference between the two is that your tiles are squares and mine aren't. Your tiles are 184x184 and mine are 32x64. The way you're drawing the map is kind of a top view isometric instead of an angled isometric(if that makes sense, my map looks more stretched whereas your map looks like a square diamond) where your sprites are squares and mine are rectangular. So that's probably what's messing it up. Is there a fix? Or would I have to use square sprites for the tiles?
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Karai17 »

That shouldn't affect it, the math is generic and should work for any shape and size.

But for posterity, try adjusting your tileset in Tiled so that the tiles are 32x32 and place them the same way they are currently placed (so use twice as many tiles so it looks the exact same) and see if that fixes it.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Jimlarck
Prole
Posts: 14
Joined: Wed Sep 14, 2016 10:30 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Jimlarck »

Karai17 wrote:That shouldn't affect it, the math is generic and should work for any shape and size.

But for posterity, try adjusting your tileset in Tiled so that the tiles are 32x32 and place them the same way they are currently placed (so use twice as many tiles so it looks the exact same) and see if that fixes it.
It works but it drastically changes the entire view of the map(it looks more like a flat diamond ortho map). I'm pretty sure isometric tiles are supposed to be 16x32, 32x64, 64x128, etc. I haven't ever seen an isometric map that uses a 4x4 tiles. Are you sure it's not something to do with the math you're using to render the isometric collisions?

Because it seems like STI is handling the collisions as a diamond ortho instead of an actual isometric map.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Karai17 »

Can you show me a screenshot?
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Jimlarck
Prole
Posts: 14
Joined: Wed Sep 14, 2016 10:30 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Jimlarck »

Screen Shot 2016-09-22 at 11.41.45 AM.png
Screen Shot 2016-09-22 at 11.41.45 AM.png (391.47 KiB) Viewed 4352 times
This is what tiled looks like. The collisions would work sure but it would stop being an isometric map and be more of an ortho map on its corner.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Karai17 »

I am baffled, but I'll take another look at it today after work.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Jimlarck
Prole
Posts: 14
Joined: Wed Sep 14, 2016 10:30 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Jimlarck »

Karai17 wrote:I am baffled, but I'll take another look at it today after work.
Okay, weird. I made a new tiled map on a different computer, and now it works.

I'm so confused, but it's okay because it works.

Thank you for helping me debug, sorry for bugging you about this (I am so confused as to why this happened).

Anyway, follow up question. Is there a way to check when I'm inside a tiled object and set a property (that was created in tiled, for example a boolean) and change its value.

For example set down an object and draw a rectangle near a door so that when you're in that rectangle you can press a key to change the map. I'm looking through the docs and Map:getObjectProperties (layer, object) seems like it might help. Is there a tutorial somewhere? Or do you have an example of this somewhere? This should be the last thing I'll bug you for (hopefully)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests