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!
  • Наука та технологія

КОМЕНТАРІ • 8

  • @CarbsCode
    @CarbsCode 6 місяців тому

    Amazing! This is very helpful! Thank you for creating this video!

  • @mikekrow
    @mikekrow 11 місяців тому

    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!

    • @UnitOfTimeYT
      @UnitOfTimeYT  11 місяців тому

      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!

  • @dibyojyotibhattacherjee897
    @dibyojyotibhattacherjee897 2 роки тому +1

    What's your emacs theme?

    • @UnitOfTimeYT
      @UnitOfTimeYT  2 роки тому +2

      Hey! Right now I'm using tango-dark, and I use Source Code Pro as the font.

    • @dibyojyotibhattacherjee897
      @dibyojyotibhattacherjee897 2 роки тому

      @@UnitOfTimeYT It would be great, if u went through your emacs config in a video.

    • @UnitOfTimeYT
      @UnitOfTimeYT  2 роки тому +2

      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!