Single Script Architecture and what does it mean?

I am attemping to use single script architecture since I have been told all the front page games use it and am a bit confused what it means. I assume it means having a single script just require all your modules but that seems to defeat the purpose of using module scripts. If you guys could shed light on what they mean by that and how it helps that would be cool. I apolgize if this is in the wrong channel I cant think of where to put it.

1 Like
1 Like

I read that before and am still confused

You have a single server script and a single local script. They each require a small number of modules. Those modules require the modules they need. It’s a hierarchy of module scripts, where the deeper you go, the more specific the functionality gets.

6 Likes

In general terms that sounds very nice, but functionally how would that work? For example, consider a first person shooter, what would the most basic module script be? I want to implement this kind of architecture, but I have no idea where to start.

I’m not sure, I’ve never personally tried this architecture on ROBLOX and I’d bet its pretty specific to your game.

I found another good writeup here.

Honestly though, don’t get stuck because you think that this is the “right way” to do things. If you don’t understand why you would want this type of architecture, I don’t think you should try to cram your game into it.

Get something working, try to keep your code relatively modular, and you can always refactor later if you start to recognize the advantages.

4 Likes

I know this topic is old but can you give an example of why I would use this script hierarchy I’m just trying to figure why this would be necessary and why should someone like me use this?