Sorting and Organizing Modules

This is something I have trouble doing or managing.

I want wondering on how should I be sorting or Organizing my Modules, because when using them, I usually have one for a separate task, but some modules are inside modules, so now I’m kind of concerned on how I should be doing it at the moment as right now, It feels like I’m looking through so many areas for modules.

I usually sort them as this:

MainModules -> "Folder
GameHandler
MobSystem
DataStores
CollisonGroups

But with others its:
ModuleScript
10+ Modules

So How should I be doing it?

1 Like

What do you mean with

? Sorry I’m a little confused, also for what I know ModuleScripts are made to store information that more than one Script will need more than once, like the Owner’s ID, or Gamepasses IDs, I think I would use them for different tasks, like on to store Gamepasses IDs, one for keeping Exploiters IDs, one for keeping Variables that a lot of Scripts will need multiple times, even though I never effectively used them :rofl::rofl::rofl:, thsi is only how I think they would and should be used, I’m not a Programmer so take thsi withh a grain of salt

I meant Modules within other Modules

1 Like

Wait, that’s even a thing? You mean like a ModuleScript that has a Child that is a ModuleScript? If you mean that I think taht if you sue it like:
AI Script:
Flee Or Fight Script
Pathfinding Script
Attack Script
Etc…
You should only sue thsi method if you are having a lot of different Variables taht are used a lot and are not just a few

1 Like

yeah, I should sue

2 Likes

This is what I do:

If I have subclass modules that extend the original module,I put them parented under the superclass module script. It helps with sorting and visualization. If not, they go under the origin main script in ServerScriptStorage. That way, it makes it much easier to share module environments between modules, and a lot easier to manage.

1 Like

I get that, but how should I be sorting if I do this?
Like what Module for what purpose to be more specific?

1 Like

Whenever you want to make a new feature, such as enemies or npcs, make a new module script. If it needs another module to function, put it under the module it needs. If it requires more than one, put it under the main script.

2 Likes

How I’m currently sorting it (from memory is something like this)

In serverscriptstorage there’s a “modules folder”
I’m that folder I have the following folders:

Util,
Core,
Player,
Gameplay

It’s nice and simple. And in these four categories I can almost fit everything. Sometimes for totally unrelated stuff I either make a “other folder” or just parent it to the modules folder

Also what @Sniperkaos mentioned is a good idea to further enhance the “workflow” of your modules

This is how I’m Currently Sorting my Stuff:
Sorting

I opened a place to get an Idea of what I should do, But I’m not sure on what I’m doing tho.

(god my english sucks)

1 Like

From the structure in your picture it sort of looks as if you were using a Framework, such as Knit or AGF (AeroGameFramework), but if you aren’t I would recommend looking into them as you can learn how to structure and organize games effectively.

I personally recommend learning Knit as its one of the most popular options

I personally prefer not to use Other Peoples stuff.

Its just something I rather do as I prefer to learn things like Methods

1 Like

Thats okay, I was recommending these frameworks so you could check out how other well reputable people organize their games to give you an idea if itd benefit you or not

1 Like