How do you organize your modules?

I released my first game, it was a really and simple game to script, but while updating it, it started to get really hard to manage the scripts bc i didn’t organize it well, and now i’m gonna make a game 10x harder and i’m scared of this again, how do you guys organize it ?

2 Likes

What I normally do is I just put the modules into the scripts that use them, and if they are used by multiple scripts I put them in a folder called modules inside of serverstorage or replicated storage. If you are looking for anything more advanced then I can’t say that I have done much of that. But try to group similar functions together and similar modules in folders together. That is all I can say as I normally work with sub 1000 line projects (more demonstrations actually). I hope you do well, I can always try to help.

3 Likes

Honestly the answer depends on why you found it hard to manage. Find that reason for a hint as to what you need to change. One thing you look into are design patterns which can help. Also keep in mind the single responsibility principal and don’t repeat yourself concepts.

3 Likes

I’m kinda midway organized I don’t nest my folders too deep but I do client and shared with categories and then all serverside modules in serverstorage/serverscriptservice. Thats whats been working for me atleast but theres tons of ways.

i just shove them in the same folder, hook them up and hope they work :grinning_face:

1 Like


nowadays this is usually how I organize everything, but its taken me like 3 years to get an organization style that feels comfortable lol.

All I’d say is just goof around with the layout, if it ever feels tedious to use, changing it usually isnt that bad (unless your project is like really big then you probably shouldnt lol)

in short, its just trial and error, just mess with it till it works!

1 Like

it rlly is js preference and what u feel comfortable with in ur game. i personally like setting up my module like this:

1 Like

There’s no single right way to organize modules; it really depends on what works for you. Some people keep them all in one folder to make things easy. Personally, I sometimes drop the module right into the script using it, even though it defeats the purpose a bit. When projects get complex, I rely on Ctrl + Shift + F to quickly search through scripts. Even experienced programmers still experiment with organization to find what fits best.

I’ve done this almost every way possible by now. Keeping everything in one group seems to work best. For example, if it’s for a car, everything goes in the car folder, or for a gun setup, everything goes in the gun folder. It is up to you how you do it.

The “package” approach is nice. Everything for a particular feature is in the same folder. Pretty much every example from Roblox is like this. They even put the remotes in the same folder, making the whole thing a drag and drop package. That is a really effective way of organizing.

This Guy depicts a good way to organize your game. I personally like the way he does it so maybe you’ll find it helpful as well!

1 Like

personally i think the best way is to put modules in folders in replicated storage/sss or objects/scripts that usually require them

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.