The brute force method of coding! 💪

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

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

  • @widrolo
    @widrolo 3 วันที่ผ่านมา +41

    I once heard a programmer on discord say: "Its better to dig around coal until you find a diamond, than spending years trying to turn coal into diamond", and i think its pretty fitting.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  3 วันที่ผ่านมา +2

      that's a very inreresting quote, I like it 💪

    • @giovand6354
      @giovand6354 2 วันที่ผ่านมา +1

      Ain't gonna lie, it sounds kinda stupid to me

    • @ZzzZzz-yd2je
      @ZzzZzz-yd2je 2 วันที่ผ่านมา +1

      doesn’t make any sense

    • @ibemper1850
      @ibemper1850 2 วันที่ผ่านมา +2

      its better to go to a known diamond mine that isnt fully mined out
      similarly its better to see if someone has solved a problem or a similar one much more efficiently

    • @stickguy9109
      @stickguy9109 2 วันที่ผ่านมา

      We all know diamonds grow near lapis lazuli not coal

  • @anispinner
    @anispinner 3 วันที่ผ่านมา +8

    If one if/else block isn't enough, add another one

  • @ussuratoncachi
    @ussuratoncachi 2 วันที่ผ่านมา +3

    1:59 "It might be haa~😩-alf~ a block up..."

  • @francyi-d
    @francyi-d 3 วันที่ผ่านมา +2

    Yeah, I think that code performance, and good architecture is important, but I learned at some point that especially when you trying to solve a complex problem, especially when you haven't solved similar problems, you can't make it good immediately. And this is what slowed me down. And even sometimes I just gave up because I was trying to make something impossible for the first try.
    When you at least have an already working implementation, you can see more clearly how you can improve it. Sometimes you anyway can't know how to do this, but you just need some time. Better continue working on other parts of your project, and, what's happened to me a lot of times, one day you understand how to make it really better.

  • @bluesillybeard
    @bluesillybeard วันที่ผ่านมา

    The raycast example reminds of me a block game I was working on. I knew I could transform points from world space to camera space, do a triangle point intersection, and sort intersections from closest to furthest.
    What I created was a horrific algorithm that took every block in a certain radius of the player, got the mesh data of that block (it was already available for the chunk meshing algorithm), transformed it to screen space as if it was going to be drawn, tested each triangle if it's inside the block, and added the intersections into a list be sorted and the closest one chosen. I was actually pretty proud of it at the time. That entire codebase was full of nonsense algorithms like that, but in my defense it was my first ever substantial coding project.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  วันที่ผ่านมา

      yeah the algorithm sounds horrible indeed 😂, btw you can implement mouse picking more easily by rendering into an offscreen buffer. It is cool that you managed to make it tho

  • @lets_get_dev
    @lets_get_dev 3 วันที่ผ่านมา +5

    man i love your videos ❤

  • @mcxMakerx
    @mcxMakerx 2 วันที่ผ่านมา

    Brute force is the method I use when I can't stop overthinking things. If I turn my brain off and just have something tangible it makes a world of difference

  • @Someone16248
    @Someone16248 3 วันที่ผ่านมา +2

    Sometimes it just goes all above my head but indeed I like to watch 😊

  • @akianaray651
    @akianaray651 3 วันที่ผ่านมา +4

    I was working on my own Minecraft clone recently for fun, and ran out of steam when I started working on the raycasting. There were a lot of possible optimizations and other considerations to make, which just made my head spin. I did implement a simpler 2D raycasting algorithm that worked, but extending it to 3D was tedious and complex. I might use this brute-force approach though in my own code, if I ever get back to it.

    • @friedrichmyers
      @friedrichmyers 2 วันที่ผ่านมา

      Can't you just make an equation of a 3d line that satisfies two points where one point is on the player and the other being done with bruteforce?

    • @akianaray651
      @akianaray651 2 วันที่ผ่านมา

      ​@@friedrichmyers Yes, I was thinking of implementing the Bresenham line algorithm. This would work fine for simple block placement and removal, but what about intersecting slabs, fences, and other special block shapes? What about intersecting entities? How should I handle chunk borders? I should've just settled for something simple, but overthinking is my worst habit. I was making considerations like this for the entire codebase, so I burned out.

  • @pawe721
    @pawe721 2 วันที่ผ่านมา +1

    in your clone make optimizations so that blocks visible further away that have a light level of 0 are not rendered.
    Or display these blocks as a black box with no texture.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  2 วันที่ผ่านมา +1

      yoo, I read your comment, unfortunatelly it's not that easy. First of all there is always ambient light so those blocks aren't completely black, also you would introduce an if in the shader thar can be an optimization or do harm depending on some things. Also there wouldn't be that many pixels on the screen to save on

  • @AntonioNoack
    @AntonioNoack 3 วันที่ผ่านมา +1

    I wish that was possible at work :/
    But our iteration times are 4-5 min locally, and 2-4h in the cloud

  • @diabloolivero73
    @diabloolivero73 12 ชั่วโมงที่ผ่านมา

    My men be working on his own Bedrock 😂😂

  • @ahmedwafi2171
    @ahmedwafi2171 2 วันที่ผ่านมา

    Bro we need OpenGL tutorials!🗣️

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  2 วันที่ผ่านมา +1

      yooo, on it 💪 the next tutorial is on OpenGL debugging 💪💪💪

  • @Koc-l8j
    @Koc-l8j 2 วันที่ผ่านมา

    What would you recommend for beginner in programing? I was thinking about learning c as first language.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  2 วันที่ผ่านมา +1

      yo I started with cpp, others start with python, honestly I think c is a great option, just go for it don't overthink what tutorial to choose, just start learning and making projects 💪

    • @Koc-l8j
      @Koc-l8j วันที่ผ่านมา

      Ok thanks​@@lowlevelgamedev9330

  • @BobChess
    @BobChess 2 วันที่ผ่านมา

    Me on my way to write 1,000,000 if/else for my A.I. project

  • @MrAlus3
    @MrAlus3 3 วันที่ผ่านมา +3

    I would event extend to say that optimization is least imporant of important things. Even with live products you optimize when somebody complains and you might lose money/reputation, not just for the sake of it. Ofc sometimes you need to optimize at the point in your code beyond which it would be a bigger hassle later on.