#2D Tilemap usubg bevy_esc_tilemap with Tiled

18 messages · Page 1 of 1 (latest)

chilly ibex
icy horizon
#

how are you doing "render" now? cqn you post code?

have you tried bevy's TextureAtlas + rs-tiled alone? (not using bevy_ecs_tilemap)

I am also having trouble but maybe we can figure out together?

#

||sorry im drunk, (but also you spelled usubg wrong)||

chilly ibex
#

I have only attempted using the bevy_ecs_tilemap crate for both LDtkand tiled but cant seem to get it to work following their official examples. I think I'm moving away from any third party libraries for the map generation and sticking to native bevy combined with noise to create some type of basic map generation bevyjobs

chilly ibex
icy horizon
chilly ibex
#

I see. What are you plans moving forward? Discarding the use of tiled maps or looking into creating a new crate? As I have not yet invested a lot of time into creating a complete map in tiled I'm inclined to stick to manually generating my map with native bevy along with the noise crate.

https://github.com/razaekel/noise-rs

GitHub

Procedural noise generation library for Rust. Contribute to Razaekel/noise-rs development by creating an account on GitHub.

icy horizon
#

I think I'm going to look a little more at existing issues in the repo, and see if anyone else has like a fork that they are doing some work around with. I honestly don't quite understand why the helpers/tiled.rs (https://github.com/StarArawn/bevy_ecs_tilemap/blob/main/examples/helpers/tiled.rs) code was provided if it only serves as a kind of "proposal"?

Looking through issues about tiled, I think that StarArawn is very clear on their intent to not fix the helper example because its not what they want the library to be used for.

So far ive found some open and closed issues in addition to the one i posted above

https://github.com/StarArawn/bevy_ecs_tilemap/issues/485#issuecomment-1937759656

https://github.com/StarArawn/bevy_ecs_tilemap/issues/522 <- this one somehow they get the tiled.rs example to work?

https://github.com/StarArawn/bevy_ecs_tilemap/issues/483#issuecomment-1863769189

I feel kind of bad because lots of people are having this issue, so I am wondering if there is something that can be done about it...

I want to take a deeper look at the issue i am personally having (some weird .tmx parsing issue that occurs in the rs-tiled crate itself: https://github.com/mapeditor/rs-tiled/issues/265

I am still learning bevy and rust in general (and my game barely even runs lol) so i think this would be a cool thing to spend time on to learn more bevy fundamentals

But i will need to figure out if its already being solved? So for now i will just keep things in this thread.

also i might post a little more in this channel too: https://discord.com/channels/691052431525675048/1034547455032832021

#

StarArawn also mentions that there is similar approach for a new crate being made with ".ldtk" tilemaps.

where the helpers/ldtk.rs was originally a proposal for loading, with its usage in the example: https://github.com/StarArawn/bevy_ecs_tilemap/blob/main/examples/ldtk.rs

and then in the comments of this example there is reference to a more comprehensive solution to it via thie repo that expands from bevy_ecs_tilemap: https://github.com/Trouv/bevy_ecs_ldtk

So I think this might be a starting point

icy horizon
#

oh frick, i think i found out the fix...

#

but StarArawn will not merge it (https://github.com/StarArawn/bevy_ecs_tilemap/pull/429) , so I have frankenstiened together some of this guys solution from his fork (https://github.com/Bushstar/bevy_ecs_tilemap) to work with bevy 0.13 and the most recent version of bevy_ecs_tiled

Very suprised it worked, but it somehow does for me.

essentially this guy made a PR, that was refused, but its been almost a year since his PR so his code doesn't work with the newest bevy_ecs_tiled or bevy.

so i took his commit from this https://github.com/mapeditor/rs-tiled/issues/265#issuecomment-1537380025 comment, and updated it to work with the current https://github.com/StarArawn/bevy_ecs_tilemap/blob/main/examples/helpers/tiled.rs

and it worked for me loading in my tmx now.

#

its probably a really bad solution currently, but i will spend some more time trying to figure out if its something that can be simplified down for my own understanding.

here is my version of that helpers/tiled.rs : https://github.com/meisei4/yakuzaishi/blob/bevy_migration/src/helpers/tiled.rs

Its not fully aligning on my screen but i think thats some of my games logic that is at issue, rather than the tiled stuff

#

maybe dont directly use my file, since it is highly specific ugly way to load the paths and stuff. I plan to kind of cut out all the stuff i dont understand in this helpers/tiled.rs, and see if i can rewrite it in a way that is much easier to understand and use in a generic way.

chilly ibex
#

Good job making it work! I will have a look at it and see whether it is something I can use bevyjobs

dawn moon
#

I'm also going through this journey, the big problem comes from the way that tiled wants to load files and the way the bevy asset system works, and the example code/fix is pre-asset server rework. I think your example of just directly loading the file bytes in the tiled reader is about the best we can do

icy horizon
# dawn moon I'm also going through this journey, the big problem comes from the way that til...

Yeah, I have hacked away all the things that don't apply to my practice project specifically (I only have a single map file that I load into the my game only once) and so I have removed a lot of stuff from the helper to the point where I just use it as a system at startup.

I hope to learn more about how it works once I maybe start trying to add more generic map loading. But from how far I've gotten, it's very clear to me that I am not at the skill level yet to work on a full fledged crate that this might require?

Hopefully rs-tiled and bevy people are working on it somewhere but idk