How to Organize & Style your Code in Roblox Development (and when to use OOP)

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024
  • Every open up a project and then just sit there, trying to figure out where to start? Roblox Studio is very powerful, but with great power comes great responsibility. This video tries to show some of my tips and tricks on how to set up your Roblox codebase, talking about where to put scripts, when to use Object Oriented programming, and more! Hope you enjoy!
    You Ain't gonna need it: en.wikipedia.o...
    Object Oriented Programming Roblox: bit.ly/2XQfWcG
    Color Chaos: The next generation (example game): www.roblox.com...
    Starship's Fail Fast mentality: arstechnica.co...
    Knit: sleitnick.gith...
    Matter ECS (Entity Component System): eryn.io/matter/
    OOP is bad (kinda extreme but great video): • Object-Oriented Progra...
    Socials:
    Discord Server: / discord
    Twitter: / b_ricey763
    Popular Playlists:
    Roblox Scripting: bit.ly/35Nz7Is
    Roblox Showcases: bit.ly/2LVIPS2
    Object Oriented Programming Roblox: bit.ly/2XQfWcG

Комментарии • 123

  • @rickjr426
    @rickjr426 Год назад +113

    I struggle with a lot of impostor syndrome when I code and the topics you talked about at the end really gave me a boost of confidence, you're awesome man ty

    • @ikqqslate_
      @ikqqslate_ Год назад +22

      sus

    • @YourNumberOneRated1997Salesman
      @YourNumberOneRated1997Salesman Год назад +5

      Impostor what????

    • @kthulu2
      @kthulu2 Год назад

      ^^

    • @holywater2977
      @holywater2977 Год назад

      @@ikqqslate_ Impostor syndrome, also known as impostor phenomenon or impostorism, is a psychological occurrence in which an individual doubts their skills, talents, or accomplishments and has a persistent internalized fear of being exposed as a fraud.[1] Despite external evidence of their competence, those experiencing this phenomenon do not believe they deserve their success or luck. They may incorrectly attribute it to the Matthew effect, or they may think that they are deceiving others because they feel as if they are not as intelligent as they outwardly portray themselves to be.[2] Impostor syndrome can stem from and result in strained personal relationships and can hinder individuals from achieving their full potential in their fields of interest.[3]
      When impostor syndrome was first conceptualized, it was viewed as a phenomenon that was common among high-achieving women. Further research has shown that it affects both men and women, in the collective sense that the proportion affected are more or less equally distributed among the genders.[1][4] Individuals with impostor syndrome often have corresponding mental health issues, which may be treated with psychological interventions, though the phenomenon is not a formal mental disorder.[5]

    • @vermilion4215
      @vermilion4215 Год назад +25

      @@YourNumberOneRated1997Salesman Feeling like you call yourself a programmer when you aren't really one

  • @imthebestmayne122
    @imthebestmayne122 10 месяцев назад +14

    Your channel really gives me the motivation I need. I think I have commented this once before, but you actually have the best tutorials for LUAU programming on RUclips.

    • @BRicey
      @BRicey  10 месяцев назад +2

      I appreciate that!

  • @KiriNini
    @KiriNini 10 месяцев назад +8

    You're probably the most underrated youtuber I have ever stumbled upon ever

    • @BRicey
      @BRicey  10 месяцев назад +1

      Lol thanks

  • @MGMac_
    @MGMac_ 2 года назад +33

    Thanks, these tutorials have really helped me understand how to implement my Lua knowledge into actual game design

    • @BRicey
      @BRicey  2 года назад +9

      I'm glad I could help!

  • @Entihave
    @Entihave Год назад +9

    I've been developing Roblox games for 4 years now, this is the big problem for my game development, thank you so much!

  • @absolutelybagel2218
    @absolutelybagel2218 Год назад +4

    definitely some underrated scripting tutorials

  • @Marcus001
    @Marcus001 Год назад +6

    You are hands down THE BEST Lua tutorialist on RUclips, you are Lua version of Corey Schafer

  • @groundbreakerexplore
    @groundbreakerexplore Год назад +4

    Thanks, I learned new ideas. This will help me for my next project. Stay safe bro.

  • @lukeewhy
    @lukeewhy 2 года назад +7

    thanks, helped a lot with OOP, will try to implement it in my game

    • @BRicey
      @BRicey  2 года назад +3

      Glad it helped!

  • @refusalstudios
    @refusalstudios 2 года назад +6

    I know it's my birthday when b ricey posts

    • @SortaIrish
      @SortaIrish 2 года назад

      I don’t think those correlate not gonna lie

    • @refusalstudios
      @refusalstudios 2 года назад +4

      @@SortaIrish they sure do this guy is literally ahead of the technology while all these other youtubers and explaining how to make a kill brick

    • @BRicey
      @BRicey  2 года назад +7

      Well with my upload schedule it might as well be...

    • @Marcus001
      @Marcus001 Год назад

      @@refusalstudios This This This This This This This

  • @Tettzz
    @Tettzz 12 дней назад

    As you said my biggest problem is trying to make everything perfect.

  • @nineveh17
    @nineveh17 2 года назад +8

    Love the vids keep helping us young devs

    • @blizzard4551
      @blizzard4551 2 года назад +1

      Go play more apex legends

    • @Chickengbs
      @Chickengbs 2 года назад +4

      @@blizzard4551 go watch anime

    • @nezzled
      @nezzled Год назад +2

      ​@@blizzard4551 bros salty because it's above his level of comprehension 🗿

    • @blizzard4551
      @blizzard4551 Год назад +1

      @@nezzled you guys got it all wrong he has the same name with a famous apex legends content youtuber lmao

    • @blizzard4551
      @blizzard4551 Год назад +1

      @@nezzled and he hasn't uploaded apex in a while 💀💀💀

  • @LeapInno
    @LeapInno 10 месяцев назад +1

    Really cool explanation to this.

  • @cluelesscactus2098
    @cluelesscactus2098 11 месяцев назад +2

    Extremely helpful tutorial, thank you!

  • @alexlipcorn7367
    @alexlipcorn7367 Год назад

    awesome tutorial, good explanation of basic OOP in roblox

  • @WanoFax
    @WanoFax Год назад

    fax, people do really advanced and complicated things but like at the end of the day thats nice but it makes it over complicated and at the end of the day the game just needs to be released...

  • @kjanahan3776
    @kjanahan3776 Год назад +2

    i think im getting very close to taking up a commission or part-time job that includes multiple scripters

  • @trashmanjoe3193
    @trashmanjoe3193 Год назад

    🙏 you are great. thank you for making this. i really needed it.

  • @memes_gbc674
    @memes_gbc674 2 месяца назад

    PSA: use "--!strict" at the start of a script, it enforces lua type safety and shows you errors before they happen

  • @Dark-zt2ok
    @Dark-zt2ok 2 года назад +3

    IT’S ALIIVVVEEEEE!!!!

  • @gordogonk8068
    @gordogonk8068 5 дней назад

    I'm pretty new to roblox studio and I'm getting tripped up on when you use a . Vs a : it seems like . Is properties and methods, when : is event related

  • @AmRobloxDev
    @AmRobloxDev Год назад

    You are so cool.
    Thanks for the very helpful tips.

  • @isopodder
    @isopodder Год назад

    wow, I can't believe I didn't know about this

  • @CloverKismet
    @CloverKismet 2 года назад +3

    How does this happen..
    I literally just had my first college lecture on OOP this morning! xD

  • @endproGM
    @endproGM 10 месяцев назад +1

    Is all of this just for organization and ease of access purposes or does it have performance benefit?

  • @FastDuckProgrammer
    @FastDuckProgrammer 3 месяца назад +1

    Clean code kills performance just use functional or procedural programming

    • @BRicey
      @BRicey  2 месяца назад

      I wouldn't say that... also functional code (although I absolutely love it) doesn't mean better performance (I guess unless you have like 80 CPU cores for parallelization). It's always tradeoffs, but oftentimes if performance isn't an issue clean code is better

  • @Smurfis
    @Smurfis 2 месяца назад

    Interesting to see how you would do it if you rewrote the 1000 line code into refactored code and showed us
    I always find my modules then don’t work and everything stops working and I have no errors reporting so I’m clueless

  • @treker41ify
    @treker41ify 10 месяцев назад

    What do you mean at 9:59 that java forces you to keep classes to their own scripts(I assume you mean methods)? Do you mean like every method we want for the object we have to keep in the same class? Cuz in java we could work around that by just creating a class with static methods to call at any time and use these methods for the other classes if we wish to do so. An example would be the Math class in java or creating for example a custom sorter class with static methods that sorts collections with user-defined methods.

  • @kevingamer2337
    @kevingamer2337 Месяц назад

    what are the benefits of using private variables?

  • @roliuu
    @roliuu 6 дней назад +1

    As a C++ dev, UML diagrams help with having to do refactoring way less in lua too. Just plan out the components as input and output boxes, then think about how they are modularly grouped.
    Though I learned in this video that there are technically constructors and destructors in luau.
    Ofcourse planning stuff out requires experience and I like to use roblox to practice overall structure of games, since there is less I have to worry about
    Refactoring the inside of the component makes sense though, but also having the proper structure preplanned means less changing of directories and etc, though sometimes an oversight might happen, which mostly is an easy fix, since the structure already is very modular
    I also am that dev that thinks that if you have to comment something, there is a good chance the naming of variables and methods is bad, abbreviating is what causes code to be harder to read for example. Its good to comment out meaningful debug prints if you ever comeback to that point in code to modify it. Comments before the function are useful if you can write something meaningful that isn't already in function's name, like the unit for example - seconds, or what it can return - number or nil for an error, just the average C++ comments before a more complex function that clearly needs it
    Ofcourse this is all assuming this is a bigger project, otherwise if the naming is good, there might be no comments needed or anything complex
    This comes from smbd who did the refactoring approach on a SDL2 C++ game engine, and thats just too time consiming. Actually taking the time to plan it out on a big project makes sense, it costs less time in the future, like with NASA taking their time to make sure it will work in the end, instead of paying it with time when its refactored every time.
    Not saying this is a bad approach for a begginer learning new stuff though! Refactoring/rebuilding the project can help aton. But after a lot of practice, its way better to plan ahead on bigger projects.
    Everyone codes different though, so im not forcing anything, thats how I do things, as long as something works for smbd, thats perfect. I do have bottom up thinking, so that may be another reason why I preffer my method.
    I hope I gave proper arguments to why I think planning it out might have benefits in the long run! ^^

  • @qxxrd
    @qxxrd Год назад +3

    Hey, B Ricey, I mainly came here to ask you if you could make a tutorial or let us know how to use the keyword "do" by itself. I've seen it being used a couple of times before and was wondering what purpose it really has.

    • @ImUkoo
      @ImUkoo Год назад

      it means what it says.. while true "do" which means DO it ! lol. like for _,v in ipairs(workspace:GetChildren()) do ... end

    • @artex_112
      @artex_112 Год назад +1

      It literally does something and then ends nothing more, it can be used to separate scopes so you don't accidentally reuse them when they are not needed.

  • @ayoubtherobloxian2155
    @ayoubtherobloxian2155 Год назад +1

    I have a quick question, How do i open the output cause for me it does not show it for some reason

  • @justaguy4575
    @justaguy4575 3 месяца назад

    this helped my spaghetti code, thanks

  • @tburns3611
    @tburns3611 2 года назад

    This was very good

  • @BamboozledLS
    @BamboozledLS Год назад

    Is there a possiblity that you update ur Tycoon Series some stuff you did there doest work or just Outdated just cerious

  • @googoogaagaayt
    @googoogaagaayt 7 месяцев назад

    "We don't talk about java"
    also him:"I have a lot of experience in Java"

    • @BRicey
      @BRicey  7 месяцев назад

      Thus is the greatest paradox of life: when school and your robotics team force you to learn a language u hate, you must master it or be mastered

  • @theman7318
    @theman7318 7 месяцев назад

    thanks now i can code like gnome code

  • @EntityDeveloper
    @EntityDeveloper Год назад

    can you make a tutorial on how to make a unique tycoon game like restaurant tycoon?

  • @ReptilesEat
    @ReptilesEat 28 дней назад

    i don't know what i learned watching this

  • @BSSMacroless
    @BSSMacroless Год назад

    why is your icons on roblox studio different than mines

  • @MrLubbs
    @MrLubbs 8 месяцев назад

    Good advice

  • @piky-rt4vn
    @piky-rt4vn 2 года назад

    Hey could you make a video on state machines and how to implement one into roblox studio

    • @BRicey
      @BRicey  2 года назад

      Good idea!

  • @kthulu2
    @kthulu2 Год назад

    amazing video

  • @despwned_PL
    @despwned_PL 2 года назад

    When will you show how to make animation in vector3?

  • @Rkyiel
    @Rkyiel 5 месяцев назад

    thank you man

  • @hoopiskey3661
    @hoopiskey3661 20 дней назад

    Does roblox have auto boxing and wrapper classes?

    • @BRicey
      @BRicey  13 дней назад

      It's not strongly typed so it doesn't have a need for either. I mean you can manually make wrapper classes if you want

  • @TheGreenNinja_14
    @TheGreenNinja_14 2 года назад +3

    Can someone get banned for leaving commentaries with swear words on a script?

    • @IncryptDubstep
      @IncryptDubstep Год назад +2

      This was something roblox talked about implementing, however, its unsure if they ultimately will.

    • @ICM9
      @ICM9 9 месяцев назад +1

      I would lean toward not doing so just to be safe. Either way, I’m not sure why you’d ever *need* to leave explicit language within your code anyways lol. Good professional practice anyways.

    • @treyg5265
      @treyg5265 3 месяца назад

      They might do it now that they are monitoring developers' code.

  • @grgroyale
    @grgroyale 2 года назад +2

    Do you have any tips to improve my logic and scripting skills?

    • @BRicey
      @BRicey  2 года назад +2

      Practice, but honestly more importantly, look at other's code, browse good github repos, and just overall learn from the best.

    • @grgroyale
      @grgroyale 2 года назад +1

      @@BRicey I am looking at other's scripts I am having hard time when it comes to math. I don't know if you know about those fighting games that have rocks after an impact, but basically I searched up on yt how to make one of these effects and they used math but not in the way I learnt at school. I can't seem to understand the math behind effects and other stuff. Another example about lighting effect using cylinder, I just can't understand what they are doing and that is really demotivating.

    • @grgroyale
      @grgroyale 2 года назад +1

      I guess the real question is how I use math in game development

    • @notimportant1542
      @notimportant1542 2 года назад

      @@grgroyale eyy same the math is where I struggle at the moment

  • @rasyajusticio
    @rasyajusticio Год назад

    How can I solve my problem with OOP. I created my object (also creating an Instance), return that object (maybe call it metatable), and then store that object inside "Main" table. And when the Instance attached to that object (metatable) for some reason got destroyed, the object (metatable) for that doesn't get removed from "Main" table. I have tried checking if Instance is nill or not when I tried to do something with the object (metatable), but that didn't work. Do not ask me why the Instance can be destroyed not by the assigned object (metatable).

    • @XaneMyers
      @XaneMyers 10 месяцев назад

      This reminds me of one of my OOP classes. I made a UI button class which replaces a placeholder instance with a set of styled instances (background, label, transparent layer to brighten the button when it's highlighted, etc.), then it destroys the original button.
      The button itself works and responds to clicks, but for some reason, it can't detect when the new button instances get destroyed (using the Destroying event). I tried to program it so it would destroy the button object if that happened, but that doesn't happen.
      My hackish fix was to add an array to my Window object class, which it iterates through when it closes, forcing any buttons in it to destroy themselves. I don't know why the Destroying event ignores what it's supposed to react to like this, but I have a feeling this issue will affect me again with later objects…

  • @AdamAdam-kx4fs
    @AdamAdam-kx4fs Год назад +1

    Quick Question: Can you explain to me how you can teleport your camera to a part but also freeze it when it has been teleportded, this happens when you touch a part.

    • @maltisme
      @maltisme Год назад +1

      press F when u have the part selected

    • @artex_112
      @artex_112 Год назад

      Do you mean like in-game? Use a local script inside the script change players camera type to Scriptable then take the parts CFrame value and set it as Cameras CFrame. When you dont need it anymore just reset the camera type

  • @texttospeechexplanations5986
    @texttospeechexplanations5986 Год назад

    yo can you make a tutorial on the tycoon series where you can reset your data or as in restart your tycoon progress i really need that so far
    also nice video

  • @BayRBLX
    @BayRBLX Год назад

    7:00 it launched by the way

    • @BRicey
      @BRicey  Год назад

      Omg your right its a miracle... eh whatever the metaphor still stands

  • @JohnPaul-v2f
    @JohnPaul-v2f 2 месяца назад

    yeah

  • @ritsu9837
    @ritsu9837 2 года назад +1

    hello bricey, I used oop for my gun client is that good?

    • @BRicey
      @BRicey  2 года назад +2

      Yea sure if you needed it

  • @maltisme
    @maltisme Год назад

    Could you please make a video explaining how to make buttons that will only appear after a rebirth? (also buttons that appear after multiple rebirths please). It would help me a ton! :D

  • @JohnPaul-v2f
    @JohnPaul-v2f 2 месяца назад

    ill need diz

  • @jeremiahholm4982
    @jeremiahholm4982 2 года назад

    how do you have custom editor ui??

    • @BRicey
      @BRicey  2 года назад +1

      They just recently updated all of the icons for the editor

    • @jeremiahholm4982
      @jeremiahholm4982 2 года назад

      @@BRicey really?! Mine didn't update

  • @KageNoDragon
    @KageNoDragon Год назад

    5:01 yeah make 101 places like me until you get an idea, Btw i still got no idea ; - ;

  • @eddiehazard3340
    @eddiehazard3340 4 месяца назад

    I really like your videos, but had to quit on this one.. too much spit in your mic technique.. sorry bro.. you gotta work on mic technique.

  • @liam2795
    @liam2795 Год назад

    how old are you ?

  • @Venopon
    @Venopon 2 года назад +1

    I don't use Knit so uhh.

    • @steroid2884
      @steroid2884 2 года назад

      What do you mean Knit isn’t even used in the video 💀

    • @SPOOKEXE
      @SPOOKEXE 2 года назад +2

      @@steroid2884 at 18:15, he does bring it up

  • @resh-1
    @resh-1 Год назад +1

    👀

  • @insaneicle
    @insaneicle 11 месяцев назад

    "LUAU"??? DAWG ITS LUA-U

    • @wav8518
      @wav8518 8 месяцев назад

      Wtf???

  • @windowswastaken
    @windowswastaken 11 месяцев назад +2

    Funny how i didnt understand shit

  • @HasTheTimeGone
    @HasTheTimeGone 2 года назад

    Yooo

  • @Gegoo
    @Gegoo Год назад

    Lawless 🤣🤣😂😂

  • @not_eagleye
    @not_eagleye 5 месяцев назад

    skibiditoilet.__index = skibiditoilet