I Made a Scuffed Minecraft Clone

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2024

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

  • @Lrofmaulol
    @Lrofmaulol ปีที่แล้ว +18

    "To make a square, you just add another triangle, it's really hard to mess this up" *messes it up*
    I felt that. I did this first year of my apprenticeship as a software dev (germany, there is such a thing) when I was bored.
    Although back then I didn't use an engine, I tried going from very-scratch using LWJGL, ended up eventually bluescreening the PC because I never freed up any of the ressources I allocated :'D

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

      Lol that's programming in a nutshell

  • @ChaosAttorney
    @ChaosAttorney หลายเดือนก่อน +10

    the reason why the grass and leaves textures are gray is because Minecraft uses a foliage texture for biomes, and it makes it easier for Mojang to change the leaves and grass color based on biomes

  • @stysner4580
    @stysner4580 ปีที่แล้ว +34

    Your rendering issue with transparent is that transparent objects shouldn't write to the depthmask, so Unity (wisely) enforces this. Meaning triangles may now render even if they're behind triangles closer to the camera.
    This is a well known issue. That's why Unity has the queue implementation for shaders. Rendering all opaque objects (with depth testing and masking) then rendering all transparent objects (with depth testing but WITHOUT depth masking) is the simplest and most common fix for that.
    If you would've made 2 different shaders (/materials) and implemented them properly, you wouldn't have had to create 2 mesh layers in C# yourself.

    • @wsalevan
      @wsalevan  ปีที่แล้ว +7

      Thanks for the explanation! I'll look into making 2 different shaders.

    • @EluayeYT
      @EluayeYT ปีที่แล้ว

      @@wsalevan sometimes you can fix it by 0.99 transparent (prob only works for lua tho)

  • @YoqDzewa
    @YoqDzewa ปีที่แล้ว +3

    It's not super efficient to update an entire chunk every time you place/break a block. Also if it's on the corner it will need to update 3 chunks at once.
    When a block is broken, only the block itself and the six neighboring blocks need to be updated. You also can exclude the faces of the block that were already generated along its surface by marking contact with air cubes. This will make caves interior render even if the player isn't in them but Minecraft already does this. It's why cave outlines are visible when lag spikes.
    Have you already optimized with occlusion culling? Once the camera turns away, you can stop rendering everything outside the cone of vision.
    Something really extra you could try 😅 is LoD: a single texture for distant blocks and condense them into a single polygon with a simplified pattern of the blocks with shading. I don't know Java but you could append the textures of very distant blocks into a single map then add it like a horizontal skybox wall in that direction.
    Looking forward to this series!!

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Clearly you are way smarter than me lol. LoD was one thing I was thinking about but I have no idea how to implement it. As for only changing the blocks that need to be changed, I was also thinking about that but that might be quite difficult. I'll look into it though. Thanks for the suggestions!

  • @samuelmunro555
    @samuelmunro555 ปีที่แล้ว +3

    Dude I got half way through the video before realizing that you only have 320 subs, I was convinced this was from a bigger channel. Keep it up :)

  • @whac1c
    @whac1c ปีที่แล้ว +2

    somewhere out there notch is like: "Hey I've seen this one! It's a classic!"

  • @Ahmadm48
    @Ahmadm48 ปีที่แล้ว +17

    I like how you have gone from maze generator video tutorial into remaking Minecraft

    • @wsalevan
      @wsalevan  ปีที่แล้ว +2

      Yup

    • @Axodus
      @Axodus ปีที่แล้ว +3

      being a programmer in a nutshell.

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Yeah pretty much lol

  • @Khano94
    @Khano94 ปีที่แล้ว +6

    I thank the TH-cam algorithm for allowing me to find this awesome channel, keep up the wicked work my guy!! you've got yourself another subscriber

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

    7:48 ah, yes... the development cycle

  • @ProSureString
    @ProSureString ปีที่แล้ว +2

    Very underrated channel! Let’s get this guy to 1M quick

  • @ajiii6858
    @ajiii6858 ปีที่แล้ว +2

    Nice video dude!! Thoroughly enjoyed it :D

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Thanks! I'm glad you enjoyed it

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

    Can't wait for the next part!!

  • @LarryRich-ly2ej
    @LarryRich-ly2ej ปีที่แล้ว +6

    underrated, much!?

  • @aryszin
    @aryszin ปีที่แล้ว

    It's so funny how similar some functions are from a drawing programm to Minecraft!

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

    at the start i was like "wait why did he make a cube from scratch???" soon it made a load of sense

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

    how do you not have more subs, this is awesome. keep up the work my guy👍

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

    For generation of the leaves on trees, you can make a function in the `World` class which sets a block directly if the target chunk is loaded, or queues it to be set after the target chunk generates.
    Like
    ```
    public void SetBlockQueued(long x, long y, long z, Block block) {
    Chunk chunk = GetChunkFor(x, z);
    if (chunk == null || !chunk.IsGenerated()) {
    QueuePlacementAfterGen(/* chunk coords */ x / 16, z / 16, x % 16, y, z % 16, block);
    } else {
    chunk.SetBlock(x % 16, y, z % 16, block);
    }
    }
    ```

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

      Yeah that's kinda what I was thinking about doing but I wanted to find a more permanent solution and the problem with this one is that if I were to try to generate really big structures, it might be setting blocks inside of chunks that the player already did stuff in

    • @orbyfied
      @orbyfied ปีที่แล้ว

      @@wsalevan oh yeah true

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      @@orbyfied though maybe the solution is somehow splitting up structures into small parts and generating them this way

    • @orbyfied
      @orbyfied ปีที่แล้ว

      @@wsalevan you could also do like a second generation pass where you place the structures after generation but before the player can do anything by doing the structure noise beyond the terrain generated
      or you could take a look at how minecraft does it

  • @Kuro-GD
    @Kuro-GD ปีที่แล้ว +1

    1+ subscriber, good job dude your vids are amaizing!

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

    Oh this is my jam

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

    Wow, youd think this video would have 10 million views, not 309, hope it blows up

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

    I got to the same point but now I'm making a system that is not as much hardcoded by using scriptable objects to store each block's appearance. Also blocks can be on the same location if authorized to.

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      That sounds interesting. Does your method increase performance as well?

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

      @@wsalevan No I don't think so. But its more prown to modding in theory. I had mistakenly wrote "chunks" instead of blocks. But baking chunks could be potential frame saving if they can become low-res at high distance from the camera, or even static render on flat plane. But that sounds complicated to do.

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Ohh the blocks. That makes more sense. Yeah you're right, that would increase modding capabilities quite a bit. I do have scriptable objects for blocks too, but then I convert it to a non-scriptable object block type. I do it this way to make it easier to add blocks because all I have to do now is put the textures in instead of having to find the coordinate positions in a tilemap. Though I could probably just make the resource loader work for rendering the blocks and put everything else in the scriptable objects.
      As for textures becoming low res, I'm not sure how much that would help since the textures are already only 16x16 but maybe I'm underestimating the performance boost because I never tried it. I think the biggest performance boost would be removing triangles from chunks when at a far distance, but I'm not sure how to determine what triangles to remove.

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

      @@wsalevan My idea was to bake a render of the chunks at far distance into a flat texture wich would maybe be mapped on to a surface generated using a marching cube algorithm. This way your not trying to decide which triangle to remove but changing the way that blocks are added to the final mesh in such way that reduces polygon count. You could eventually use marching cube but instead of iteration through each blocks you can make an average of 8 blocks into bigger cubes. To be fast I've watched videos explained generations of procedural terrains using a compute shader. But its far beyond of what I'm currently working on. (Still at the stage of managing my code and organizing it so I'm happy with)

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      That's a cool idea. I'll have to look into it since I just started figuring out basic terrain generation so that is far beyond my current skillset lol

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

    Nice video, keep doing this

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Thanks! I will!

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

    Nice tutorial

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

    You could use Scriptableobjects for the blocks

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      That's what I am doing

    • @SkyLP
      @SkyLP ปีที่แล้ว

      @@wsalevan huge

  • @oglothenerd
    @oglothenerd ปีที่แล้ว +2

    Could you please make a tutorial on how you actually use 3D Perlin Noise? I can't find good tutorials anywhere! My begging question is how you know a block underground should be air or something else!

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

      To be honest, I didn't know how to use 3d noise so I just copied a 3d noise algorithm from the internet, but yeah I can make a tutorial about how to use it. To determine the block type of underground blocks, I use the 3d noise function and if it's below a certain value, the block will become air or whatever other block I set it to. Otherwise, it'll be solid. I hope this helps!

    • @oglothenerd
      @oglothenerd ปีที่แล้ว +2

      @@wsalevan Okay! Yeah sorta! Still, a tutorial would be a godsend!

    • @mogaming163
      @mogaming163 ปีที่แล้ว +2

      @@wsalevan can you link your sources?

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

      Yup!
      Creating Meshes: catlikecoding.com/unity/tutorials/procedural-meshes/creating-a-mesh/
      Using Perlin Noise: th-cam.com/video/MRNFcywkUSA/w-d-xo.html
      Using 3D Perlin Noise: th-cam.com/video/Aga0TBJkchM/w-d-xo.html
      Transparent Block Fix: th-cam.com/video/IdBCYScJn5o/w-d-xo.html

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

      @@wsalevan Awesome! Thank you!

  • @minecraftwaffleman5112
    @minecraftwaffleman5112 ปีที่แล้ว +2

    I'm gonna be sas and ask for the project source :> so I can create minecraft clone without the hard step of block and terrain generation. Anyway this looks great, u are smart

    • @wsalevan
      @wsalevan  ปีที่แล้ว +2

      Sure! github.com/EvanatorM/ScuffedMinecraftUnity

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

      @@wsalevan sheesh, thanks man, making minecraft clone is now less irritating 🏆

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Yup. Though I'm warning you my code isn't the greatest lol

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

    you are underated af

  • @smythfamily8321
    @smythfamily8321 ปีที่แล้ว +2

    Why didn’t you just use the built in cube function in the 3d objects menu. Great video btw you are amazing at programming you just gained a sub

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      I'm glad you enjoyed it! As explained in the video, not all sides of each block are shown, and rendering those extra sides takes a lot of time. With Unity's built in cubes, we cannot remove faces from it, so they cause a lot of lag

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

    cool

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

    perfect recreation of bedrock

  • @awesomesauce1157
    @awesomesauce1157 11 หลายเดือนก่อน

    haven't we all

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

    how do you only have 300 subs??

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Probably because of my upload schedule lol

    • @D.W.OGamezz
      @D.W.OGamezz ปีที่แล้ว

      @@wsalevan at least you have video ideas lol (I don’t)

  • @Francisco1234Cruz
    @Francisco1234Cruz ปีที่แล้ว

    You know, I think a download link would be neat.

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Yeah I might make a download link in the next video but the project changed so much since this one that it wouldn't make much sense right now

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

    6k views where's part 2 😅? (Unless it's in progress in which case take your time 😅)

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      My motivation to make videos is very inconsistent lol

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

      @@wsalevan I'm sure it's not as inconsistent as my will to live 🤣- if it's any easier you could Livestream for a couple hours and stitch edits like a pro- (*cough* code bullet *cough*), nevertheless mental is vital to any progress. If you need a break, take one, even if it's a couple years, you'll come back with 10x, nah 1000x more spectacular things to share with us. Can't wait for part 2 🖤

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Streaming does give more entertaining content but does make it harder to edit so I might do a mix of both like I did in this video. Thanks for the encouragement!

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

      @@wsalevan post script- as despicable as they are, short form content has taken the world by storm, if a 10-30 min devlog is too much, maybe try 60sec progress updates 😁

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      That's a good idea!

  • @itsmeheplbot
    @itsmeheplbot 2 หลายเดือนก่อน +1

    buildingscarft

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

    wait is this unity why you making shapes through code

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Efficiency

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

      @@wsalevan but how you doing that tho cuz I’ve never seen that before I have only been using unity for a few months

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      You're able to create meshes in scripts and then create a shape with it. I'm doing that here because if I just used Unity's cubes, there would be a ton of extra faces being rendered that will slow the game down. I can remove those extra faces when I generate them in a script

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

      @@wsalevan thats smart

    • @wsalevan
      @wsalevan  ปีที่แล้ว

      Thanks. I'm certainly far from the first person to come up with it though lol

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

    can I play the game?

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

    i have more subs then you but your somehow better then me
    i respect that you got a sub from me
    also this video is cool