LDtkToUnity icon indicating copy to clipboard operation
LDtkToUnity copied to clipboard

Runtime AutoRules

Open lhyqy5 opened this issue 2 years ago • 4 comments

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.

lhyqy5 avatar Apr 02 '23 13:04 lhyqy5

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 🙂

Cammin avatar Apr 04 '23 01:04 Cammin

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

colinwilcox avatar Jul 05 '23 16:07 colinwilcox

@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! :)

max-critcrew avatar Nov 14 '23 10:11 max-critcrew

@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.

colinwilcox avatar Nov 14 '23 12:11 colinwilcox