How to code an AutoTiler (Easier than you think!)
Вставка
- Опубліковано 27 вер 2021
- Today we look at how I coded an AutoTiler for my base builder game Spruce - which is actually not that difficult. AutoTilers select the correct edge tile to render a blobmap of a specific tile type. Most engines like Unity and Godot support features just like this. To do something similar, we generate a bitmask based on tile neighbors and use that to look up the correct tile that we want to render.
⁍ Wishlist Spruce: bit.ly/SpruceOnSteam
⁍ Twitter: bit.ly/UnitOfTimeOnTwitter
Thanks for watching. Happy to answer any questions! - Наука та технологія
Amazing! This is very helpful! Thank you for creating this video!
Thanks! Glad you liked it!
I enjoyed the video, but i have just one question. How are you assigning which tile goes to what value? You have 16, 20, and 84. I can't say I quite understand it. Thanks for any help!
Hey. Glad you enjoyed it. I calculated those by doing the process that I described at 1:21
All you have to do is figure out which edges and corners should connect, set those to 1 in your 8-bit bitmask, and then get the resulting number. So for example, the 16 happens when only bit-position 4 is set. Hope that helps!
What's your emacs theme?
Hey! Right now I'm using tango-dark, and I use Source Code Pro as the font.
@@UnitOfTimeYT It would be great, if u went through your emacs config in a video.
Yeah I'd be happy to do that. I think a really old version of my init.el is here: github.com/unitoftime/config/blob/master/linux/init.el
It's in dire need of a cleanup though!