Cammin / LDtkToUnity

Unity importer for the LDtk level editor
https://cammin.github.io/LDtkToUnity
MIT License
381 stars 38 forks source link

Runtime AutoRules #47

Open lhyqy5 opened 1 year ago

lhyqy5 commented 1 year ago

I want to change the tileset at runtime, such as changing the grass to dirt, is there a way to automatically change the neighbor tileset according to the autorules? Or any function I can call to get neighbor tilesets definition from my current changed one.

Cammin commented 1 year ago

Currently, the importer does not calculate any rules, and builds tiles based on what LDtk puts together in the json's layer instances. Though it would be awesome for certain genres of games to have tiles that allow some kind of rules convention in runtime (ala destructible terrain games like Terraria), but it's a low priority for me at the moment. Not off the table though 🙂

colinwilcox commented 1 year ago

One of the loaders listed on the LDtk site is this C++ one that does exactly that. Very interesting. https://github.com/AnomalousUnderdog/ldtkimport

max-critcrew commented 10 months ago

@colinwilcox Would it work to somehow manually combine this with LDtkToUnity? Have you or someone else tried this? We absolutely want/need runtime editing for LDtk and are currently wondering how we'll do it! :)

colinwilcox commented 10 months ago

@max-critcrew I haven't tried it myself, in fact I've stopped using Unity, but I don't see why it couldn't be done. It only solves one part of the problem which is the rules application though, so you'd still have a lot of work to do to make your in-game editor complete.