Falling Sand Simulation Development Log 4 - Boids and More

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 19

  • @LogicEu
    @LogicEu 4 роки тому +3

    This is incredible!! Would love to see that tutorial on how to code this stuff!! Very nice!

  • @Hart8
    @Hart8 3 роки тому +1

    I love it! Keep up the good work

  • @bwuhbwuh
    @bwuhbwuh 4 роки тому +3

    Looking forward to the tutorial.

    • @marf1610
      @marf1610  4 роки тому +1

      Have you seen this video by John Jackson? ua-cam.com/video/VLZjd_Y1gJ8/v-deo.html
      It is similar to what I was intending to make in that it covers the general concepts but without any live coding or walking through functions. I'm trying to decide if I should take a similar approach but cover more things like splitting the world into chunks, adding randomness to the elements piling up, class structure, multithreading, and explosions, etc.
      Or should I do a simpler condensed live-ish coding session where follow along to make a very basic falling sand simulation in JavaScript and HTML canvas?

    • @mathijswy
      @mathijswy 4 роки тому +1

      @@marf1610 Make the complicated one! Would be more appreciated!

    • @marf1610
      @marf1610  4 роки тому +1

      @@mathijswy Ok thanks! That's what I wanted to do but wasn't sure if there was an audience for it.

    • @SolDizZo
      @SolDizZo 4 роки тому +1

      Yes! Subbed!

    • @marf1610
      @marf1610  3 роки тому

      Video is up on my channel!

  • @poganka45
    @poganka45 3 роки тому

    Wonder what the main loop looks like, Noita creators said they were checking positions of the particles starting from the bottoom moving up, once right to left, and then the opposite direction. For my simulation i used 4 different kind of for loops, from the bottom right, left and then from the top right and left

    • @marf1610
      @marf1610  3 роки тому +1

      Currently the main loop splits the matrix into 12 columns and a thread is created for each column. Even numbered threads are launched and perform the step functions for elements in their column from the bottom up. The order in which elements in each row are stepped is random. Once even numbered threads are complete the odd numbered threads are launched.
      I found there was some strange behavior of elements stacking up near the borders where the columns are defined so I add a random offset to the starting 'x' of each column every frame. This multithreading has significantly improved performance.

    • @marf1610
      @marf1610  3 роки тому

      github.com/DavidMcLaughlin208/FallingSandJava/blob/master/core/src/com/gdx/cellular/CellularAutomaton.java#L132-L145

  • @mathijswy
    @mathijswy 4 роки тому +1

    Starting to look really good! You're coding in Java right? How are you rendering the pixels at the moment? Are all the particles a different shape object? Or is it like one giant texture? Aka, how many draw calls are you making because it looks quite fast!

    • @marf1610
      @marf1610  4 роки тому +1

      Thanks!
      Yes currently using LIBGDX and Java. I do want to switch to c++ and OpenGL but currently don't know how to do that and would have to spend time switching over. If you have any recommendations let me know!
      I am using the ShapeRenderer object in LIBGDX to make the drawing calls. After performing all the movement logic for all elements I will again iterate through all rows and draw a square for each element. I have one optimization where I will check if the following element (and so on) has the same color as the current one and will then make one longer rectangle which reduces the amount of calls by a lot. But doesn't provide any help if a large portion of the screen is occupied by different elements. And I do see slowdown because of that.
      I have plans to try and make a single texture out of the whole matrix and try drawing that just once but have not tried it yet
      Here is the current code I use: github.com/DavidMcLaughlin208/FallingSandJava/blob/master/core/src/com/gdx/cellular/CellularMatrix.java#L124-L151

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

    rad

  • @Teodosin
    @Teodosin 3 роки тому +1

    Hey! How's the tutorial video progressing? You seem to be busy with other things, naturally, but it would be nice to know if that project is still alive! This is very impressive stuff, I'm sure we'd all love to learn from you :)

    • @marf1610
      @marf1610  3 роки тому +1

      Yes! I will have a lot more time in the coming months to work on this. I have the script for the tutorial video mostly completed and in a week or two will begin recording it. The video will be more conceptual with code samples. But I am also considering a code-along video series for this if I have time.
      I am also currently learning c++ and SFML to port this project and then will continue exploring new features.
      Thank you for the kind words.

    • @Teodosin
      @Teodosin 3 роки тому

      @@marf1610 sounds awesome! Looking forward to it.

    • @marf1610
      @marf1610  3 роки тому +1

      Video is up on my channel!

    • @Teodosin
      @Teodosin 3 роки тому

      @@marf1610 awesome! Bless ya