ServerManager FrameWork

I am starting to make my own game/gamemode manager for a game.
But I have no Idea where to start in terms of framework.
What I have in mind is a simple MainScript that contains pcalls and plenty of libraries for gamemodes.
Here is what I have so far:
image
Anyone has tips to give me about this framework?

P.S: The Temp folder would contain the teams points to determine when a game is finished. After so, it would clear and create new Values for whatever gamemode it picks.

I’ve created a game system with multiple game modes twice before. Here’s my design:

  • A script that manages the majority of the game. This script does stuff like manage damage from remotes.

  • A “BaseGame” module inside the script that is a utility module for the game mode modules. Stuff like BaseGame.setTeams are utilized to reduce code in the game mode modules. It also can pick a map systematically by determining if the game mode is compatible with it. It also stores values like the team’s score in the game, can update text on all the players’ screens, and more.

  • The game mode modules. These modules interact with BaseGame and they are the essential game mode.

  • The server script has a while loop that always loads a new map/game mode using BaseGame.

  • BaseGame.reset will reset the game to default values, so you don’t have to in each game mode.


A design change I made recently to this is a gameMode.stop variable. If set to true, the game mode will stop its timer and will unload. This is useful if you want to change the game manually using admin commands (if you have not set this up, it is a very good practice).

1 Like

Is this what you mean?
image

Then I just add plenty of useful function in BaseGame to keep my GameScript simple and safe?

Yes, but this is how I set it up:
image
The folder consists of other utility modules as well.

Here’s the other slightly different design I have:
image
“lobbyRunner” is just intermission. “settings” currently is just the time the intermission is.

I also have a table of available game modes.

1 Like

Alright I get it.

And last questions: How should I handle server restarts…
Is it automatic by roblox or do I have to set a timer for servers to shut down and cool off?

That isn’t needed. Some very old frameworks that have memory leaks need to forcefully restart, but if you unload the game module properly you shouldn’t have any issues.

1 Like

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