Im making a SSA for my game and I’m wondering if its normal to separate modules into their own separate modules like this:
The CharacterController module does nothing else besides initializing the CharacterPhysicsController module (and any other character-related modules I decide to add in the future)
local CharacterController = {}
function CharacterController:init()
require(script.CharacterPhysicsControllerServer):init()
end
return CharacterController
Idk if what im doing is wasteful or if its good practice since there are some modules that do nothing but just initialize other modules inside them (since they are broken down)
I don’t really see point requiring module to require another module to use single function (unless just),
roblox just returns the required module and allows you to use it without needing go to another using findfirstchild (probably bad and good at same time but)
when you have localscript and script and just require needed module
This structure already looks pretty good for future-proofing organizations. Personally, I like to organize things with structures like:
| Primary module which initializes things and expose
functions, useful for when you want to put it in a folder
with other modules
| Folder containing submodules that handles functions
the primary module requires
| Submodules
| Default config
| Folder containing objects like UI blocks, parts, etc
| Folder containing dependencies
Other people might prefer to make the primary module only require the main module, using the primary as a canvas for credits, version, and other information.
What matters for you is whether it looks good to you and whether if you can understand the hierarchy.