Simple Tiled Implementation - STI v1.2.3.0

Showcase your libraries, tools and other projects that help your fellow love users.
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Simple Tiled Implementation - STI v1.2.3.0

Post by pauljessup »

coz wrote: Mon Oct 31, 2022 2:02 am Actually, after checking https://thorbjorn.itch.io/tiled I can tell that there are certainly features that are not supported. For example, I can't find a 'type' or 'class' property for objects. Likewise, the site tells that the terrain definition changed in Tiled 1.5, so I suppose that old terrains won't load.
Instead of assuming or supposing, why not try it out and see what happens? As I said above, types and classes are both supported. I use the latest version of Tiled with all my games, and make sure it's always up to date. I've only had a slight issue recently, and all I had to do was change how Tiled exports the map to Lua. That was it. The rest work just fine, including all the new features. I use classes extensively when I was making the maps in Catacomb Kitties (now on the Nintendo Switch!)
User avatar
coz
Prole
Posts: 4
Joined: Sat Sep 10, 2022 10:48 pm

Re: Simple Tiled Implementation - STI v1.2.3.0

Post by coz »

Oh believe me, I've been testing everything I use. I didn't test terrains because right now I'm not interested in them, but I might in the future, but I did look for the type and class properties. I specified what I assumed so that others know they have to check if they want to be certain.

To make sure we are on the same page, when I say that type/class properties are not supported, for I'm not talking about Tiled's lua export; that works fine. I'm talking about it being exposed on purpose by STI, you won't find a Map.tiles[gid].class property, and the Map.tiles[gid].type property will be nil regardless of what's in the .lua map. In the last release, the 'class' property was not even read by any of STI's code because it didn't exist at that time. However, since Map:tilesets (which is not documented) is just read from the .lua file, the tiles inside will have their type or class property set correctly.

Besides that, your game looks good. Hope everything turns out great! :neko:
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Simple Tiled Implementation - STI v1.2.3.0

Post by pauljessup »

Aha, I see! I completely misunderstood what you meant in your original post, then. The wording tripped me up a bit.

And thanks for the kind word about my game, it's available on the Nintendo Switch, too
https://www.nintendo.com/store/products ... es-switch/
knuxyl
Citizen
Posts: 52
Joined: Sat Aug 13, 2016 4:40 am

Re: Simple Tiled Implementation - STI v1.2.3.0

Post by knuxyl »

I am trying to migrate from Godot because of its terrible pixel accuracy.

I am trying to use STI but I'm having trouble.

I need a way to draw the map at a specific position while also scaling the map. The problem is, the scale argument also scales the position, which throws everything off for me. I looked through the source but I cannot find where the actual position on the screen is using the scale value.

I need this because I am trying to use a coordinate system so I can easily check tiles around the player. The player moves by tile, so complex collision and stuff isn't needed.

To simply everything, I'm trying to make the players x and y position be the tile on the map. So if I had 16x16 tiles, and 3x3 tilemap, position 16x16 would be coordinates 1,1. I can then easily reference adjacent tiles and handle objects and collision manually.

I set the players position to always be center of the screen. I have the mouse wheel set to control a global scale value. The map is determing its position from the players x and y coordinations, not the players actual position. Everything I have works as it should, but once scale is changed it's all thrown off. I tried dividing the maps position by the scale value to offset what STI is doing, but then I start getting floats and positions do not line up correctly.

I don't know what exactly STI is doing. I found the scale function, but I need this to just scale the canvas, not the entire coordinate system. Any ideas?
User avatar
GVovkiv
Party member
Posts: 686
Joined: Fri Jan 15, 2021 7:29 am

Re: Simple Tiled Implementation - STI v1.2.3.0

Post by GVovkiv »

knuxyl wrote: Fri Jul 07, 2023 9:08 pm I am trying to migrate from Godot because of its terrible pixel accuracy.
It's kinda interesting, that Godot is very used around indie devs. And indie devs often make pixel games. And yet, Godot still lacks any pixel perfect support.
No pixel perfect scrolling. And while there workarounds for this, they still sucks.
Rendering fonts properly with pixel perfect hacks might also be tricky.
No pixel-perfect scaling for game window content.
Even editor itself kinda doesn't really suited for dealing with pixel stuff.

Too bad!

Update after 1 year: Godot now has integer scaling and integer camera built-in! Hurray!
Last edited by GVovkiv on Sat Sep 28, 2024 2:58 pm, edited 1 time in total.
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Re: Simple Tiled Implementation - STI v1.2.3.0

Post by badfitz66 »

I know this is an old post, but I'm wondering if anyone has a fix for the convertScreenToTile function that still seems to be broken for staggered isometric maps? Current implementation doesn't work as can be seen here https://imgur.com/a/FEhQXlb (gif is showcasing an attempt to delete tiles at mouse position)

I'm not really smart enough to try and fix it myself.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests