Bad Coding Practices | The WORST Game Dev Crimes in OneBit Adventure

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

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

  • @GlassesAndCoffeeMugs
    @GlassesAndCoffeeMugs หลายเดือนก่อน +5

    A very useful tip I always tell juniors is "Don't write bad code. If I read any bad code during a code review, you will be fired instantly."

  • @kapharjr
    @kapharjr หลายเดือนก่อน +12

    And it's still less buggy than RotMG, another pixel game with an entire dev team

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

      "if" is better than an entire dev team🤔

  • @motasamf5608
    @motasamf5608 15 วันที่ผ่านมา +1

    Bro i was plying this game and i said lets watch some videos and this channel popped up

  • @TheABC.
    @TheABC. หลายเดือนก่อน +11

    I've been recording several videos of this game for years. I'm Brazilian and I promote this game directly on my TH-cam channel. It's an amazing game.

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

      I appreciate your help in promoting the game!

  • @0R_M4YB3_N0T
    @0R_M4YB3_N0T หลายเดือนก่อน +4

    I need to strat playing Oba again, also great video

  • @gam_ours
    @gam_ours หลายเดือนก่อน +5

    Now show us how hellish is the Void code. 😂
    Well, good luck on optimizing that when you'll get motivated (and have time for it).

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

      Will see if I can survive that. If I break more than I fix, it is staying the way it is lol

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

    it's actually good practice to have 'case' breakouts for knowns and allow 'default' to catch the unknowns in an error.
    As for the functions, I tend to program in such a way that if it is only called by one other function, then it doesn't become a subfunction (I put in-line), it's that simple. Yes, sometimes it leads to "huge" functions, but it's far too difficult to track what is going on if you have to jump through 20 sub functions (you can also 'region' out the pieces to collapse them anyway). When I refactor, I may find a way to reduce the code later or find multiple uses of snippets. I also don't usually let my sub functions called other sub functions, I literally want them to do a single task and be done.

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

    im learning to make games and seeing the dev of one of the games i love talking about his mistakes and things like reffering to tutorials is great, make the whole game making thing looks less " otherwordly", thanks for share your experience o/

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

    Despite the organization, you do good work on the game. It's gotten me through a few long car rides 👌

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

    5:26 How do you optimize ifs?
    They're like the most basic language construction, isn't it like trying to optimize addition or division?

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

      Utilize others built-in functions before comparing values. When if else and switch are overly used, it will leave you wasting time trying to find the right condition if you needed to come back to it.
      I'll make my next video about if else and switch as well as how 5:26 can be optimized.

    • @ThePC007
      @ThePC007 22 วันที่ผ่านมา

      > isn't it like trying to optimize addition or division
      Divisions are slow. If you’re dividing by a power of two, bit shifts are the way to go. In cases where the divisor is a variable the compiler won’t save you, so divisions are something that absolutely can be optimized.

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

    I watched Jonathan's brother go to the bathroom once

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

    How do you keep that skill switch statement straight if it's all ints? There's no way you memorized all of those hundreds of skills in the game... right?

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

      I only remember the ones for the update I currently work on. After that, I CTRL+F my profession script as I have all skill names commented along with the id below it lol

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

      ​@@onebitadventure If i had to venture a guess as to why those were there is if they were to avoid a default case somewhere else in that switch statement. If that's a bad coding practice, I suppose I'm guilty too. lol

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

      @@ScottyRichMusic That switch code was made before I even knew about default lol. No defaults in that switch statement so simply being that code I thought I knew what I was doing, but didn't X)

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

      @@onebitadventure well if it ain't broke

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

    Oh, nice game. Ive played it for quite a while, been running as glass cannon blood knight, much fun

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

    Keep up the good work Jon, good vid

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

    Lasagna is good code because it's structured.

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

    You think the if else statements in the code is where the sins are committed... Actually you using magic numbers constantly and using strings in switch cases is 100x the crime. Just create variables for the numbers you use in functions and for god's sake use enums. Case "Breakable" and Case 92 isn't the correct way to do it, sure it works but many mistakes will appear while using strings in your code and you won't understand (just like in this video) what case 92 was.
    But I guess you know all of this now because this game was made 5 years ago. You must have grown as a game developer. I just felt the need to say it. Your game looks quite good, have a nice journey!

    • @S0LIXUS
      @S0LIXUS 27 วันที่ผ่านมา +1

      i would agree that using enums would be sufficient .. but what i'm more confused about is why he didn't use ScriptableObjects for his Skills .. it would be alot easier to add and remove skills using them.

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

    Thanks for this video. I have a few scripts that I thought were getting a little bloated. I was starting to be concerned about at what point am I going to start seeing some performance issues.
    After watching this , I'm thinking I'm good to go add a few more things to those scripts with out a bit of fear lol.

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

    Thank for your game its so good

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

    Hey, just started learning programming and I don't quite understand why if statements are bad. How would you do it without if statements? Is there another option? I know about switch cases but they can't be used everywhere no?

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

      They're not bad if you need them, but sometimes they're just unnecessary.
      For example, you could replace the code at 5:15 with the following:
      Create a Vector2 from horizontalMove and verticalMove
      zero the smaller component (and save the larger one)
      if abs(saved_component) > threshold:
      call MovingPlayer with vetor2.normalized and saved_component
      It's 2 if statements instead of 10. And there's a lot less code to read and figure out.

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

      If statements are a necessity in game design as many situations requires comparison, but when there are duplicate statements that leads to the same result, there is likely a way you can combine them. There are times where other built-in functions can be used to narrow down statements like what @johnsmith34 provided is a perfect example. Don't worry too much on optimizing if and switch statements when starting off as there are other heavy functions that affects performance way more than that.

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

      thanks guys;)

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

      Code readability should also be a consideration. It's easy to read if statements. If it takes me multiple minutes to deduce what your code is doing because you used syntactic tricks to write shorter lines of code instead of using if statements, that's not good code

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

    Hopefully my game isn't warcrimes

  • @eduardonee7734
    @eduardonee7734 10 วันที่ผ่านมา

    warzone dev should learn from you 5:33

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

    I am making a mobile game where i need to check tile for info i just named the tiles by the id number and check gameobject name and compare to a for loop lol.

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

    im the coder police, you are charged with fixing the code of onebit adventure >:(
    do you understand

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

      You will never catch me! 🏃‍♂️

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

    You may have screwed up code wise but you more than made up for it in the monetization system of your game. I don't play as much as i used to, but it's one of the few mobile games ive actually gone and spent money on simply because it was so user friendly that i felt compelled to support the game regardless
    Bonus points for having a super addictive gameplay loop. It got pretty stale after a few hundred hours and when i ran out of characters to max, but honestly the fact that it captivated me for that long is crazy compared to all the slop saturating the mobile scene right now.
    Keep winning brother

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

    Can anyone help me like tips how to get all achievements and wat is the best class and all u know i love this game but its little hard

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

      Join the official Discord. The link is in the description, and there are forums for all sorts of builds. Players there can help you know all the achievements 👍

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

    Hmm I recognise this voice 🤔

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

      Definitely sounds familiar 🤔

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

    Yeah probably strings used in switches are not the best and you ended up with over 9000 lines scripts, provbably more single responsability scripts or some basic inheritance classes or custom interfaces whould ended more "clean", but hoenstly aside that, thats not that bad, i mean, when you need something to happens, the logic behind that could end up very messy and there is maybe a galaxy brain way to make it one line of code, but if it works it works...
    I'm making a deckbuilder roguelite, and you'll need to see how messed up are my scripts that handle how the UI for the card in hand behave...
    If i need to modify something in there i need atleast 2 hours to try understand how i made things works kekw

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

      Thanks for the info on this. I ended up researching more on it and now know how to make switch use Enums instead of strings. Makes a whole lot more sense and makes it impossible for typos because of Enums 👍

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

      @jonathanconcepcion8215 nice to hear, good job!

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

    I would love a beta version of dungeo of greed for android
    OBA is very fun. But it is becoming stale.

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

    10/10 video

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

    Yeet! Killa Video!