Are there any tutorials on how to properly set up a game?

I have a game with 200k visits ([BETA!] Hoop Paradise™ BETA - Roblox), but I decided to re-script the entire game because the code is very cluttered and messy but I’m struggling actually finding any useful tutorials. I understand use of OOP is important but all the tutorials on YouTube are usually tailored towards a certain aspect of the game, I was wondering if anyone could help me out with any tutorials that helped them out.

1 Like

I mean, as far as tutorials go I doubt that there’s any straight up guides that’ll show you how to structure your game’s code. You can try and look for non-Roblox specific ones, which may give you what you’re looking for, however the bulk of it probably isn’t in videos and is more likely on websites. Object Oriented Programming (OOP) is what you’re seeing a lot of due to what it does. Essentially, it’s a paradigm which lets your code take on a modular and clean approach to problems. This means everything is nicely structured and helps prevent repeating code, however if you don’t understand it then I’d recommend starting with some small side projects to build your understanding of it.

I’ll give you an example where using OOP and modules would be more suitable rather than just a bunch of scripts. If you have multiple doors in your game, which may open in different ways, you could either give all of them a script and have a very disorganised workspace or a class for doors. Some would say this is overkill but essentially that is the debate of OOP compared to other paradigms.

Back onto the topic of structuring your game though, realistically you’ll want to have a few major managers, one for the server and one on the client. These “manager” scripts should host all of your moduleScripts and allow for a centralized hosting. This helps keep things neat. As far as the explorer goes, I’d recommend making use of Folders. You can never have too many of them and they help keep things orderly.

2 Likes

I have a question, would you store all variables that are used globally in the main server controller script?

I learnt a lot from seeing how Roblox makes their example games:
https://developer.roblox.com/en-us/resources

1 Like

https://create.roblox.com/docs/scripting/scripts/script-architecture

1 Like