Delete this delete this delete this
I do too, like organizing code in modules, but I think spitting it by âsystemsâ might be easier to manage when you have a handful of code to handle
Delete this delete this delete this
Itâs really what you personally benefit from; if you would benefit from a system that was split into many separate parts then have that system in many parts.
I personally would have it all in one script but that is just my preference.
Delete this delete this delete this
I may be wrong, but i think that falls into the micro-optimizations which you shouldnât worry about
Delete this delete this delete this
Itâs really up to you in the end, if you feel like having the functions split into modules like you currently do is working and youâre happy with it keep doing it, donât worry about people telling you its a bad practice everybody codes in their own ways.
What I meant was that handling lots modules in a module might be hard to manage over time
Delete this delete this delete this
I wouldnât split too much because itâs easier for me to scroll than switch between scripts. I think that these are functions of one category and should be in one module.
Delete this delete this delete this
Maybe in the future you will need to use a global variable and these functions will not have access to it or you will be requiring a certain module in all of these scripts and when you decide to change the name of the module or replace it with a different one, whatever, you will have to edit every of these small modules.
So keep that it mind, because you donât have to give up the idea of splitting the code like that but try to prevent these situations from happening.
Delete this delete this delete this
Looks like youâre over-engineering. In my experience, unnecessary abstractions and over-modulation leads to less robust code, which is harder to modify for new features. This is because your existing system will not necessarily meet the future demands of what you have in mind for your game, forcing you to work around the way youâve set it up already rather than implementing changes which would be trivial for a less complicated/âabstractâ system.
I canât see your actual code, but I would never put EndBlock and StartBlock into different modulesâto me, that would be hard to manage and unnecessary. I would presume both use similar logic, so thereâs no reason to modularise them.
I like to modularise my code according to âsystems,â and only modularise further when absolutely necessary. Hereâs some examples:

- There are several different âmodesâ of pathfinding, but theyâre all bundled into one module because they follow the same general logic. This greatly reduces development time when I want to make changes.
- NB CharacterData handles positional and other data for the zombieâs target
Or hereâs my client-side modules:

If a module sounds like itâs just one function, like StartBlock, it shouldnât really be a module. There are exceptions to thisâlike in my Effects module, both Shoot and Sound simply return functions. This is because Shoot (handling both local and replicated bullet effects) and Sound (handling all sound effects) are called from many different places, so it wouldnât make sense to bundle them together.
The roblox Chat scripts are a very bad example of this, because theyâre over-engineered to hell. As a result, itâs practically impossible to modify the default chat scripts to your preference beyond a few provided settings (and the code is hard to understand). The amount of modules in the Explorer window literally doesnât fit my screen, and it just wastes everybodyâs time.
1 module = 1 system is what I do
having to open several modules just to make changes to one system seems more like a hassle to me
in your case I would personally have one module per combat type (Melee, Magic, Ranged, etc)
as for this you can Collapse All Folds in the script actions menu which will make all inner functions/tables collapse (you can also click the arrow next to functions to collapse them completely which is what I usually do for functions Iâm not currently editing)
to
and these are small functions, itâs even more useful when the functions are larger
Delete this delete this delete this
Holy, I had no idea about that folds thing. Makes code way easier to navigate.



