Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Level-Of-Detail system working server-side instead of local? [SOLVED]

Asked by 7 years ago
Edited 7 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

So i've been working on a level-of-detail system that would incrementally remove some details of the game and add them depending on what your quality level is (LOW, MED, HIGH). The problem I have been having is that, even a localscript in startergui with FE on is making the changes globally (everyone can see the objects disappear, regardless of who toggled it. I'm fairly certain it has to do with how i'm doing everything (the localscript moves the folder "L2" and "L1" according to your quality level in and out of serverstorage. i tried lighting too). I thought this could occur locally but apparently not. Is there any method of unloading objects locally (only visible to that player) so that the game can run smoother for certain people on lower-end PCs?

An example of the code, in one of the localscripts that should move a file is

if game:GetService("Lighting"):FindFirstChild("L2") then
    game:GetService("Lighting").L2.Parent = game:GetService("Workspace")
end
if game:GetService("Lighting"):FindFirstChild("L1") then
    game:GetService("Lighting").L1.Parent = game:GetService("Workspace")
end

print("Now at level 3 quality.")
wait()
script.Disabled = true

That is pretty much the same with Level 2 and Level 1, they just move L2 and L1 corresponding to the quality level.

0
LocalScripts do things locally. Something is not as you say. BlueTaslem 18071 — 7y
1
Don't use the Lighting service for storage; use ServerStorage when possible. If not possible, use Replicated Storage. Link150 1355 — 7y
0
I've tried both Lighting and ServerStorage, but not ReplicatedStorage yet. I'll try that in a second. The_Sink 77 — 7y
0
It seems to be working when it's put in ReplicatedStorage, actually. Well, thanks! The_Sink 77 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

This kind of thing is generally managed by Roblox as to give the best user experience. It would also be best to include your system within the current Roblox quality setting, e.g:-

-- local script in StarterPlayerScripts

local localUserSettings = UserSettings().GameSettings

local function quolityChanged(qualLevel)

    if qualLevel == Enum.SavedQualitySetting.Automatic then
        -- how will you handle this???
    elseif qualLevel == Enum.SavedQualitySetting.QualityLevel10 then
        -- max quolity
        print('maxed')
    end
end

localUserSettings.Changed:Connect(function(prop)
    if prop == 'SavedQualityLevel' then
        quolityChanged(localUserSettings.SavedQualityLevel)
    end
end)

-- first time setup
quolityChanged(localUserSettings.SavedQualityLevel)

It may also help you to check the GetRealPhysicsFPS to change what is being displayed to help improve the FPS.

Other useful links:-

post-effects

Ad

Answer this question