Advanced Modular Scripting

Going to be a long topic I want to discuss.

I’ve been developing on Roblox Studio for almost 3 years now, currently I’m just working on better methods to do things, which is how I’ve introduced modular coding;

TycoonService. }
PlayerService. } > Modules
CommerceService .. }

Boostrap → TycoonService:Init(), PlayerService:init()

Quite a step from what i was originally doing, helped in organisation, learned how to type check and build little by little my own systems (StateManager for example)

However as simple as a Statemanger or a Tycoon could be, I want to move foward into the depths of scripting, lets take a game for example; Blox fruits, widely popular game with good systematic handling, how would they handle their systems? Inventory, guns, or more specifically how would i construct a front page game?

Why would you do/need InventoryClient and InventoryServer? How would you validate Client to Server? (Except for cooldown validation. I already know how to do such)
For what reason would we need to use methods like bit32()

how would a person even code their own networking module, better frameworks etc, if i was coding a Pack a Punch system (if you are unfamiliar, it’s a system where you insert a gun into a machine, it changes color and its more powerful) how could we validate such things to Client → Server? How would I organise a framework like this?

Obviously what I’m asking is not easy, and it’s thinking outside the box, normal youtube videos wont actually show you how to script, rather on yourself you’re gonna have to learn how to do it, genuinely asking how to actually become a better coder, when to use a modular system, when to create scripts ( if your game was at 100k ccu for example and you want to add a new event)

I’m familiar with Modules like signal, janitor, bytenet, etc, however they are just helper units, with your code, asking how to build frameworks and become a “better” coder, them frontpage games are gatekeeping methods :joy:

best secret method is have everyhting be O(n³), its better then O(n) or even O(1)

Summary

This is a joke, dont try to have your code be O(n³)

Blox Fruits was made a long time ago, I wouldn’t be suprised if they run on 20 local & server scripts, lol.

Unless someone used a Dex Explorer, that is, but even then, you cannot see Server Scripts.

Talking frontpage games in general, theyd obviously know how to build some frameworks to keep the amount of players in a server intact

Yeah, you’re right—but not all front-page games are actually optimized. That’s what I’m getting at. A lot of those “brainrot” games, like Spin a Baddie, probably don’t even use proper modules or structure. I’ve noticed plenty of inconsistencies and performance issues while playing them.

But are they still popular? Yeah.

That’s mainly because the algorithm pushes them. A game doesn’t have to be perfect to reach the front page. You could throw together something with 20 server scripts and 20 local scripts, and it would still work well enough. Players wouldn’t really notice—it would be playable and do its job.

I didn’t explain it to well my fault, lets take an example of frotline, the forge or even something like garden horizons

It seems like you think you need to work in a certain way to be “advanced” and that you don’t understand the concept behind frameworks. The truth is that you don’t even need frameworks at all and it would do you good experimenting making a few games in vanilla style.

Frameworks exist to solve problems, and people have just realised that frameworks and modular coding is more flexible and easier to work with (at the expense of performance). But you should use or make frameworks to solve your own problems, not because it’s industry standard.

Splitting a system into server and client (and shared) modules is the norm now. All I can say is try making a system with that architecture and you’ll realise the benefits/downsides. As for networking, a ton of libraries exist. I personally use Packet.

I’m not sure what you mean by “How would you validate Client to Server?” but the following examples will give you an idea of different framework structures.

Examples

  1. Look at existing resources! Knit, etc.
  2. CrusherFire made a video explaining the benefits of agnostic systems and gives you a ton of insight into his framework. You could also look around YouTube for more videos.
  3. And here’s a little snapshot of my own framework in action to give you some more insight:
Summary

1 Like

I think the best thing to do is switch to a different game engine since they give you more low level control (jk)
Even though it’s “deprecated”, Knit is a great framework option and is used by many frontpage games and it makes it easy to create Services and Controllers (client services).
It is a truth that nobody wont teach you how to actually script a game, at least a good one, all of that is up to you. But in practice, you don’t actually need well-organized code to make a good game—at least not if you want it to be easy to maintain in the future.

validating parameters from client to server so that its not exploitable, i was thinking for exampel chekcking if the passed value is of the expected class (type)

Sure, type checking all Remote parameters should always be done. Though networking libraries already do this so you don’t have to. I think your question is on the different topic of server validation and not framework development. Either way, server validation doesn’t change:

  • Type checking
  • Nil checks
  • NaN checks
  • Validation checks (i.e., crrency balance, if player is in a table)

There are a lot of topics you can find on this, and you ask AI about it too.

1 Like

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