How to Organize Your Roblox Game!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody this is going to be my first video on YouTube uh today I'm going to be talking about a topic that probably hasn't been discussed already in the space and uh it's something that I think is important and I see a lot of questions about is how do I set up my project uh you know are my scripts in the right place are my Assets in the right place what do you want to do in my opinion this is the way I do it and I'm going to be showing you some ideas and how you can generate your own process of thinking and generate your own uh framework and mod loader type uh Concepts and see how you can apply these ideas to your game so the first thing we're going to need is a game idea and so I've already written up a game idea here uh basically it's a mad murder Style game and there's some simple things that we might want to include uh a round system a shop system a player manager for handling uh roles and tools and interface Handler which uh shows all this information on the client um then some information that we're going to have to represent on the client and that we'll need uh to show for items and stuff knives knives guns and crates and so when I say information this is stuff that you'll store in the replicated storage that holds all the information on items you'll have in the game that you'll access later and this will help fill out all of your shops and your inventories and stuff um so first of all the first thing we're going to want to do is either in our minds or on paper we're going to want to do something similar to this where we list out all the things that we think we might need and how we might want to structure it as you can notice I've grouped these higher level uh Singletons with each other and this is what's going to be kind of the core of our system and then I've grouped this information that we access when we need it uh Al together and so that's the there's kind of a difference there between information and then a single tin and so uh if we hop in studio here we can start by saying uh and I won't be writing any code but I'll just be generally outlining we'll say this is our server loader and uh perhaps we could add some modules in here for uh this one will be player Handler shop Handler uh round Handler and then similarly on the client we'll do a local script and we'll add a module script and so we're looking at something like this and I've quickly thrown it together the concept is that the server will load any modules under it and uh each of these modules contains its own functions and actions uh similarly with the client I like to put my interface under the starter player scripts instead of the starter GUI and then I just pass the GUI into the interface um module script a practice that I find that is also pretty nice is if we have a module scripting here and let's say that this is we call this display round information and so this shows stuff like theoretically it shows things like um the time duration of the round or your role or what ited intermission and so then we'll say something like this where we pass in our GUI base which could be a screen GUI under here so the idea of this framework is that the interface module will require this module and it'll return this function and this module has the core purpose of displaying the round information and then of course you can add as many of these as you like for uh you know handling a team uh not team selection handling a inventory and shop and um things like sound and settings you know all that all that client information that we need to display so put that under interface additionally if we have something on the client um maybe it's like a trade Handler that handles the background Logic for trades on the client uh you can put that here at this level and uh you'll start to see this uh idea form where we have handlers under a loader and then uh sub modules that are uh interfaced with by the Handler so that's all great and good we have code but how can we talk to each other so something I like to do for our events is just make a folder called event and inside we'll put a few more folders and I just store all my events in replicated storage um I don't have an issue with players seeing the server events or the client events really they can't do anything with those if you put a bindable event in here the client can't do anything with it and uh even on the client if they have this bindable event usually this is just to get some information from another source usually it's the remote events which where um real information is transacted transitioned and um that's where players can exploit the most in your game so this is where we'll be putting our remote functions remote events and unreliable remotes and usually I'll name it something along the lines of if it's for the round Handler I'll say like round start round and then I'll use a notation like this so that I can easily see um what what kind of grouping it is and what the action is and then if we go into our round Handler a notation that I like to use is something like this where we start by declin saying re for remote event and then underscore and then the name of the action and so when I'm programming uh I can easily know that if I'm in like a function say and I want to call and I want I know I want to do a remote event to start the round uh revore and we'll get the auto complete for all the remote events that we have and people don't realize this but the autocomplete is very powerful so I like to give very veros names for my function so uh round start send message Cas and you might think that's long but if we come in here notice it autocompletes it we barely even need to type we need to type roou and it fully autocompletes it for us we can type those verbose uh names in our handlers and this is the notation that I like to use for my events if I was going to do a remote function I'd do it I'd prefix it with rfn a remote a bindable event I just like to use EV and the bable function I just like to use FN uh the r denoting that it's a remote additionally along with our events and our scripts we're going to store a lot of assets so I like to keep an assets folder and replicated storage and usually an assets folder and server storage things you're going to want to put in your server storage assets are things that the only the server needs so maybe this is a map uh maybe this is a limited time item that spawns in the world only on the server side something like that things in the replicated storage both sides sides are going to need you should probably know this by now and so we can create I like to create folders in here for models particles sound um interface all the things that we might need and I'd like to put them under their own folders so everything can be nice and sorted and later down the line as you start to add more and more and more to your game uh it doesn't become this you know Big Mess this big spidery mess of uh assets something else that we like to have is a data folder and this is where we're going to put in all that data that we had back here for knives guns and crates and so we'll say knife info gun info info oops didn't mean to change the color on my keyboard I'll set it to the fire setting and under these I usually like to put something like default crate default knife and default gun so what we've got is each data type that we're looking at in our uh information that we think we're going to need to store we have a higher module that handles getting uh the information so in here you might have a module. getet ID and it'll return it'll return some value um basically it'll find this module and return it for you and so then as we add more and more crates we don't have to you know say require create whatever we just say create info get and along that line as we add more knives and more guns guns and more data uh we use one single source to interface the idea being that we start at our script it goes to our info and our info is what branches out and finds it and gives it back to you we don't want to be branching out and finding it in our script uh that'll clean up your main script and it'll be better for getting that information across from different sources because it'll be the same function which will be more reliable and say you make a change to the function like we want the create info to only return the contents we don't want to know anything else then we can make a doget contents function you know and we can give it the specific behavior that we want and in the future or the past when we want to change the way something happens say we just want to get the contents now we just call this module Ducket contents and we wouldn't need to write out something like require module default crate contents we wouldn't have to do that repeatedly and then if it's a variable you'd have to add like uh find first child you know and it expands and you don't want to TCH that multiple times so we'll have this one source that can get all these other sources for us and we haven't even written any code yet and you can already tell that our project is getting pretty big um granted a lot of this is placeholder but a lot of this stuff is key to the idea of managing and making sure that your project is wellmaintained and organized and the biggest thing about that is that when you create a game having these core ideas in place can help guide you with what things you might want to complete but you don't want to go in starting by creating all the handlers that you think you're going to need if you're making an RPG don't you know don't go in in like night class Mage class Rogue class and then XP Guild blah blah blah blah blah don't fill it in with all the things you think you're going to need um just understand what you think you might need to begin with the first three or four things and then as you come up with more ideas and plan to expand your game more that's when you start to add more handlers and more information and all that stuff but overall this is just the way that I set up my game I've seen a lot of comments saying how do I set up my game does this structure look good and nobody really has made a video about it so I wanted to do that if you guys enjoyed the video hit a like drop a comment if you have anything on you know comments about the video uh thanks have
Info
Channel: qweekertom
Views: 5,119
Rating: undefined out of 5
Keywords: roblox dev, roblox studio, scripting, organize scripts, roblox, tutorial, byteblox, devking, organize, game dev
Id: mGBuXbwIwc8
Channel Id: undefined
Length: 12min 47sec (767 seconds)
Published: Wed Jan 31 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.