-
**What do you want to achieve?
Clarity about how the core structure of a game should be set up. -
What is the issue?
I have global value objects in workspace for my caves, Global value objects in my serverStorage, and Global value objects in my game controller.
I have scripts in serverStorage that I duplicate into objects in order to copy values from the serverStorage globals to like the “parentdirectory.globalValue1.Value” things. That way I don’t have to do that 8 times for 8 different directories from the 1 file. Just saves repeating code. The copied script will work in any directory it’s put in to and set up that directory.
I have scripts that are like that above, but they are in the control script and they will set up all the values in the P1Upgrades directory with the information saved on the server.
So I like have 3 different ways to do each thing, and they are in like 3 different places.
—MY GAME WORKFLOW EXAMPLE
Like I have a player join, my controller (a big workplace.brick on the map) then sets up the player settings in the “controller.player1directory” for example, ready to play.
When the player does something like an upgrade, it pulls the default values from the default global variables in the serverstorage.globals folder and then pulls other information from the controller player variables, and uses that to set stuff in the sign. Say the cost of their next upgrade.
Other places have multiple sign posts that bring up Guis for the player. So click the sign and a player screengui comes up. So the signs, because there are many, all duplicate the script from the server storage.
Now the NPCs have to pull info from the Workspace.Cave.Globals to get information about where they are. They have to pull info from the Control playerglobals based on who is operating them. And they have to get default globals from the serverstorage. They also get given information from the spawner object. They store much of their information in variable objects inside their model. They use all that information to function.
In some instances, I have the player click a sign. The sign passes the player id to the object it spawns, the object passes the player ID to the object it interacts with, and the interacting object passes that player id to the object it spawns, and the spawned object, when clicked, checks the player ID against who clicked it. Something like that.
—END WORKFLOW EXAMPLE
It’s a bit late now for me and I just have to work out, “which of the numerous places where I have stuff, and the numerous ways I do stuff” in order to work on that part.
- What solutions have you tried so far?
I asked on here before about how people set up their game. Where do they put their globals. How do they transfer the information around, but the replay wasn’t clear enough and now I’m getting lost.
I still have no idea what the core structure should be to how to organize the game information to make it easy to navigate and use.
I don’t even know if I’m on the right track or if I do have a complete mess.
1, does that sound like a complete mess or if it fairly normal?
2, How do you organise your stuff so it’s not a complete mess?
As in:
Where do you store your globals? Do you story all your scripts in the same place and duplicate? Or half duplicate? Or not duplicate at all? Do you have like 500 globals in 1 script instead of setting them out into categories and folders? How does the flow of your game work?
All that sort of stuff. Feel free to use something like my WORKFLOW EXAMPLE to explain how your game structure flows.