How does the overview core of Studio Work?

  1. What do you want to achieve?
    I want to work out how the core of Studio works.

  2. What is the issue?
    Spent 8 hours looking for it and reading the development tutorials and such but to no avail.

  3. What solutions have you tried so far? Spent 8 hours looking for solutions on the Developer Hub to no avail.

Hey guys. Just looking for a quick overview of the way studio works. Pretty basic for anyone who knows. Really, it’s “How does the general overview of the entire game operate?”

Q1. How does the code reading flow? What scripts activate in what order? So Serverscripts before Workspace? Or top to bottom (workspace object at the top, next object down, next object, then after workspace, players then lighting etc)?

Q2. So is all the stuff that’s transported into Player, then considered Client side? And anything NOT INSIDE the player is Server side? So I should only have instant visual and audio stuff in Player so it instantly happens for the player, and the only other stuff inside Player should be for “That player only” like personal Guis or personal sounds. Correct?

Q3. What are the best ways to sort content? So I have a bunch of intValue items in a folder which are used like globals. So I can go in and set my cooldown for a particular thing, or base walk speed, or base attack speed, and that way I can control the overall game from 1 folder. A master control station of global variables. Where is the best place to have them?

I know ServerStorage is best place to have stuff to clone out into workspace (things that are constantly appearing and disappearing). I know Workspace is the best place to have the main map and location objects (permanent stuff). I know Guis which the player requires are best off in StarterGui. I just want to know what are the best places to store what and why they are the best places.

So really I am after something like this:

–[[
Hey Steve,

Q1. Work flow is in this order, Each sections flows from top to bottom. However, ServerScriptService is before anything. Then ReplicatedFirst, then the rest play out top down.

Q2. Yes anything IN PLAYER is Client side. All the Starter sections, StarterGui, StarterPack, etc, copy into any player that joins, and become Client side.

Q3. I store all my game control code and variables in an invisible object called “Controller” parented to Workspace. In there I have a Globals folder, and my main game operation script. Why? Because it’s the top and I can get there super fast and call it super easy. ReplicatedFirst is great if you want something instantly copied to all players before anything else happens. Replicated storage is the same but more for thing that are replicated but big and will slowdown the server if they are all replicated first. ServerScriptService is a way to have the server game script be able to access everything with highest priority for faster calculations. Forget LocalizationService. Alternatively, you can have your globals in ServerStorage but that can get messy and it can be hard to find your globals in there if you have a lot of stuff.

Easy :smiley:
]]–

So just really easy simple answers.

If there is a link to something that just sums it all up for me, that would be AWESOME!

Anyway back to seeing if I can help out other people.

Cheers :smiley:

In all honesty, if you want to know this, I suggest doing background research before doing a full on assault about how RBLX Studio works.

– Drinkinix :slightly_smiling_face:

The order which scripts execute shouldn’t be relied upon, but it probably has to do with ChildOrder. If you need a certain script to execute before another, you should probably use modules and have a script which requires them in order.

Putting an object in PlayerGui so it only replicates to one player is a weird way of doing this, RemoteEvents would be a much better at doing this. Anything in PlayerGui, and PlayerScripts should only really be manipulated on the client side, and to manipulate them on the server RemoteEvents should be used.

IntValues to store data probably isn’t the best idea. (unless you need the .Changed event?) If other scripts need to manipulate the data inside of one script, modules would be a good idea. You could store all the data in one module that is need for the script and read from it each time you need it.

return{
    Value = 100,
    Value2 = 150,
    ...
}

Another way could be to handle all the logic inside the module instead instead of another script. (if the data is seperate for each script)

local Data = {
    Value = 100,
    Value2 = 150,
    ...
}
coroutine.wrap(function()
    --what the normal script would do
end)()
return Data
1 Like

I’ve nearly finished my game. I just want to know the stuff I can’t find to see if I can make my game a bit cleaner. To better understand the game at the core.

I’ve done full NPC AI, with animations and custom meshes and custom accessories. The NPCs are doing exactly what they should. That info is easy to find. Tutorials everywhere. But it seems that no one can answer my simple question. Or is it that no one knows?

I don’t know. I thought they were basic for someone who knows.

Mind you I’ve been making games since StarCraft 1 came out. Been Making maps since DukeNukem 3D came out. So it’s not like I have no idea what I’m talking about.

It’s ok if no one knows. I just need someone to tell me “No one knows” if that’s the case. If no one knows at all then I suppose I’ll have to spend a month doing numerous tests to work it out but it would be WAY easier if someone just told me or at least just linked me.

Cool. Yeah I was thinking about that but I tend to get lost in scripts when I want like 3 specific variables to be sitting there accessible by any other script, and easily changed if I need to get in there.

I think for massive lists of variables I will go for the module and require it when needed. But I’m still learning about that stuff, how to tell it what to give me.

I am still unclear about serverside and client side though.

But I see now that having all my variables in a module is a good idea. I’ll play with that.

Interesting that it’s parent Child. Would that still be top down? I assume so. I suppose that’s what “Wait for child” is for. It’s like “Don’t care if you run before me or after. Irrelevant. I’ll just wait and when you have run before getting back to me, then I’ll run.”

Still would be good to know how to make sure all my globals are 100% the first thing to be set up.

What you maybe looking for is a run time trace facility that would show you the path through the execution and potentially the variables values being passed.
I am aware of other programming languages and OS’s that have this but don’t know of one that would help in Roblox, Lua.

Yeah looks like I have to put in a print function in every little spot and have it print up all the names of every single spot in order. I just thought someone else could save me the time and effort.

This activity for you appears to be your need to understand all the underlying services, processes, execution flow and data being used.
I do sympathise with your intention but unless your are gearing yourself up so you may approach Roblox for a job I suggest you just read through the API definitions and leave the actual implementation to those whose job it is to have all the knowledge.
We as game developers should, in my opinion, be concentrating on our own work and helping the Roblox team when an API does not appear to behave as the API documentation describes. This help would include a well documented test case for them to use to recreate the situation you are experiencing.
I wish you luck in your endeavours.

Yes Ideally I totally agree but I gave up on teams a long time ago. I don’t have the clout or money to get someone to do a better job than I can in a shorter period of time.

It’s easier for me to do all the work myself, although I have borrowed 3 things from the toolbox. A skeleton (screw making all those bones myself, it would take a month and it would then look almost identical. Just giving credit there.

The Zombie AI and the Soldier AI. I’m not sure what parts exactly I cannibalized but I used their AI as the Basis for my AI. Credit there.

And the R15 Dance Humanoid body parts because I can’t do UV mapping. But I changed everything else in any way I could. Looks totally different. Credit there.

But I don’t need anyone else. I know how to do all the other stuff. Just need a few questions answered to really get the gist of exactly what does what and how best to do things.

Read all the API stuff but it doesn’t give the core fundamental stuff. It’s like print(“Hello World!”) when I want the big picture stuff. I don’t really care about the trees. They are boring and I can find them anywhere. I want to see the forest.

1 Like

I would use Datastore2 to store IntValues in datastore. I use it in my game and it works very well. :herb:

I’ve been working out ways to clean up my code.

I like values in objects so that I can just clone a script, and get it to pull it’s differences from the values. Then I can edit 1 script and have it work on like 7 slightly different things.

I like them for a home base with which other things can pull all the crucial things they need. It’s simpler for my brain to wrap around. Especially when I am doing everything myself. Can’t really specialize in the really complicated stuff. Even though it can be cleaner sometimes and maybe more performance friendly.

Onward and upward! :smiley: