Hey there, I've been using STI for a top-down game of mine for awhile now and just updated today, but I noticed there is an issue with rotated animated tiles not properly rendering. Rotating in Tiled displays the animation fine, but when loaded through STI the animation displays as non-rotated.
For now I can work around the issue, but I figured I'd report the bug in case it hasn't been noticed yet.
Simple Tiled Implementation - STI v1.2.3.0
- Uncle_Bones
- Prole
- Posts: 1
- Joined: Wed Aug 12, 2015 11:24 pm
Re: Simple Tiled Implementation - STI v0.12.3.0
Is there currently any way of integrating y-Sorted entities into a Tiled map?
Re: Simple Tiled Implementation - STI v0.12.3.0
Stick 'em in a Custom Layer.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.12.3.0
Sorry for not replying sooner! This is definitely an oversight, I'll see if I can maybe fix it soonish?Uncle_Bones wrote:Hey there, I've been using STI for a top-down game of mine for awhile now and just updated today, but I noticed there is an issue with rotated animated tiles not properly rendering. Rotating in Tiled displays the animation fine, but when loaded through STI the animation displays as non-rotated.
For now I can work around the issue, but I figured I'd report the bug in case it hasn't been noticed yet.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.12.3.0
That's what I have been doing, but I don't mean z-ordering, I mean y-ordering.Karai17 wrote:Stick 'em in a Custom Layer.
with a perspective like this, there's all sorts of hackery involved to allow the player to go behind the walls, but also overlap them when in front of them; there are half-high tiles on a layer above the entity layer here.
What I want is that the entities get drawn based on their y-coordinate, whilst the rest of the map is drawn. So instead of drawing the layers bottom-to-top, y=0 to y=max, one at a time, I would like to draw
Code: Select all
for yTileIdx=0,max do
for i,layer in ipairs(layers) do
if layer.type == "tiles" then
layer:drawRow(yTileIdx)
elseif layer.type == "entities" then
layer:drawEntitiesBetweenY(yTileIdx*tileHeight, (yTileIdx+1)*tileHeight)
end
end
end
Re: Simple Tiled Implementation - STI v0.12.3.0
Is there any way or any plan to add the ability to change tile data on the fly?
I'm making a game and I'd like to do destructable ground. For now I'm using objects and going into my collision tile layer and changing a flag for my collision detection. This isn't a problem for the moment because my collision layer is invisible, but it would be cool to be able to remove and add visual tiles.
Ideally, I'd like to be able to call a function, maybe STI:modifyTile(layer,tileX,tileY,newGID), that would edit the sprite batch and the tile instances on the fly.
Thanks for the library though, it's made working on my game much easier
I'm making a game and I'd like to do destructable ground. For now I'm using objects and going into my collision tile layer and changing a flag for my collision detection. This isn't a problem for the moment because my collision layer is invisible, but it would be cool to be able to remove and add visual tiles.
Ideally, I'd like to be able to call a function, maybe STI:modifyTile(layer,tileX,tileY,newGID), that would edit the sprite batch and the tile instances on the fly.
Thanks for the library though, it's made working on my game much easier
Re: Simple Tiled Implementation - STI v0.12.3.0
Man, I found this just at the right time. I just logged onto the forums because I was feeling burnt out over outdated tutorials for Advanced Tiled Loader, and then I found this! Thanks for making this
Re: Simple Tiled Implementation - STI v0.12.3.0
Skeiks wrote:Is there any way or any plan to add the ability to change tile data on the fly?
I'm making a game and I'd like to do destructable ground. For now I'm using objects and going into my collision tile layer and changing a flag for my collision detection. This isn't a problem for the moment because my collision layer is invisible, but it would be cool to be able to remove and add visual tiles.
Ideally, I'd like to be able to call a function, maybe STI:modifyTile(layer,tileX,tileY,newGID), that would edit the sprite batch and the tile instances on the fly.
Thanks for the library though, it's made working on my game much easier
Code: Select all
id = batch:add(tile.quad, tx, ty, tile.r, tile.sx, tile.sy)
self.tileInstances[tile.gid] = self.tileInstances[tile.gid] or {}
table.insert(self.tileInstances[tile.gid], { batch=batch, id=id, gid=tile.gid, x=origx or tx, y=origy or ty })
I do admit I need to update the documentation to provide more information about these sorts of features...
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.12.3.0
https://github.com/excessive/rpgS0lll0s wrote:That's what I have been doing, but I don't mean z-ordering, I mean y-ordering.Karai17 wrote:Stick 'em in a Custom Layer.
with a perspective like this, there's all sorts of hackery involved to allow the player to go behind the walls, but also overlap them when in front of them; there are half-high tiles on a layer above the entity layer here.
What I want is that the entities get drawn based on their y-coordinate, whilst the rest of the map is drawn. So instead of drawing the layers bottom-to-top, y=0 to y=max, one at a time, I would like to draw
in ugly, urealistic pseudocodeCode: Select all
for yTileIdx=0,max do for i,layer in ipairs(layers) do if layer.type == "tiles" then layer:drawRow(yTileIdx) elseif layer.type == "entities" then layer:drawEntitiesBetweenY(yTileIdx*tileHeight, (yTileIdx+1)*tileHeight) end end end
https://github.com/excessive/rpg/blob/m ... y.lua#L222
https://github.com/excessive/rpg/blob/m ... y.lua#L257
Linked above is a project I worked on a while back, it might provide you with some interesting ideas on how to do what you want to do. Basically, everything is an object and only the unchanging terrain is in a tile layer (or several layers). Each frame does a table.sort to sort the list of objects by its Y axis and then draws them accordingly (within the custom layer's draw function). This gives you massive flexibility when dealing with world objects. You could even use a sprite batch to draw them faster (clear it every frame and re-add the newly sorted objects).
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.12.3.0
Thats the approach that I am using, but it doesn't fix tile-object sorting. In my tiled map there are tiles that have a z-height (like walls and trees). I want the player to be able to walk and overlap them in front, but to also allow the player to be hidden behind them. The classic approach, and the one I am using right now, is to split these tiles into two pieces, one that is above the object layer, and one that is below it, and to draw the entities inbetween.Karai17 wrote: -snip-
https://github.com/excessive/rpg
https://github.com/excessive/rpg/blob/m ... y.lua#L222
https://github.com/excessive/rpg/blob/m ... y.lua#L257
Linked above is a project I worked on a while back, it might provide you with some interesting ideas on how to do what you want to do. Basically, everything is an object and only the unchanging terrain is in a tile layer (or several layers). Each frame does a table.sort to sort the list of objects by its Y axis and then draws them accordingly (within the custom layer's draw function). This gives you massive flexibility when dealing with world objects. You could even use a sprite batch to draw them faster (clear it every frame and re-add the newly sorted objects).
This is how curved curse currently works, but it is not a very clean way as it requires a lot of additional tiles and extra attention from the mapper (and errors are not easily spotted).
Who is online
Users browsing this forum: No registered users and 3 guests