Caves Generation that ANYONE can do! (Cellular automata caves in P5js)

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 มิ.ย. 2024
  • Rogue Basin Article: www.roguebasin.com/index.php/C...
    Code from video: editor.p5js.org/BarneyCodes/s...
    Procedural Terrain Generation can sound incredible daunting and the scary name can put you off, but I promise that anyone can make these caves! This method uses cellular automata to turn random noise into lovely looking caves in an incredibly satisfying way.
    The caves we generate in this video could easily be used for some great levels in a game, and we even show you how to turn the raw tile data into really great looking levels using textures.
    Enjoy!
    Follow me:
    Support the channel: www.youtube.com/@BarneyCodes/...
    Twitter: / barneycodes
    Reddit: / barneycodes
    Chapters:
    0:00 How it works
    2:12 Generating random tiles
    5:39 Counting wall neighbours
    7:28 Next generation of tiles
    9:27 Values outside the grid
    10:29 Notes about the article
    11:13 Loading textures
    13:19 Converting to tile IDs
    15:31 Adding floor variations
    16:58 Wall variations
    18:45 A note on bit masking
    19:18 Final Product
    #creativecoding #p5js #javascript

ความคิดเห็น • 10

  • @BarneyCodes
    @BarneyCodes  3 หลายเดือนก่อน

    If you'd like to see what else I'm working on, it would be great if you could wishlist my game Star Mining Co. on Steam! s.team/a/2584800/

  • @clongoram
    @clongoram ปีที่แล้ว +1

    This was fun. Bit masking vid would be great!

    • @BarneyCodes
      @BarneyCodes  ปีที่แล้ว +1

      Thanks, glad you enjoyed it! I'll add bit masking to my list ;)

  • @zervidas
    @zervidas ปีที่แล้ว +5

    Let's make a collision and camera movement then add enemies and weapons, your game is finished

    • @BarneyCodes
      @BarneyCodes  ปีที่แล้ว +5

      Could be a fun little series to make a simple shoot em up!

    • @zervidas
      @zervidas ปีที่แล้ว +1

      @@BarneyCodes if it were art worth a fortune. Yeay art generator :p

  • @AmaroqStarwind
    @AmaroqStarwind 4 หลายเดือนก่อน +1

    Could this be expanded to 3D?

    • @BarneyCodes
      @BarneyCodes  4 หลายเดือนก่อน

      I think it could, you would just have to tweak the rules since a cell would go from having 8 neighbours to 26!
      You might also need to look into voxel rendering techniques to render the result efficiently, from memory the things to look up would be greedy meshing and maybe marching cubes

  • @averagesnail
    @averagesnail ปีที่แล้ว +4

    wow

    • @BarneyCodes
      @BarneyCodes  ปีที่แล้ว +1

      Hopefully this is a good wow haha, thanks for the comment!