Game optimization


As you can see in the first screenshot, the optimization of the game in Studio. And on the second when I click on Play. And here I have a question, is this a good optimization for an RPG mode with three locations? If it lags a bit, if it’s a bad optimization, then how to make it good?

Absolutely not. You should make sure the bars don’t consistently “reach the top” in the microprofiler.

You can take away how many unnecessary things the program is doing each cycle. Examples:
Don’t need to see miles in the distance. A type of “fogging” to limit view (in some cases).
Not every object needs to have CanCollide, CanQuery, CanTouch.
A Massless object isn’t part of the tasks of the Havok system (gravity).
Not everything needs a shadow, decals, special color or a special texture.
Some things are better suited to be on the sever vs local or vice versa.
Many objects can be locked in place and anchored.

Good program housekeeping helps too vs objects and scripts scattered and buried in many different places.

Things like this don’t require as much internal testing, resetting, outputting. exc …
Added together they give you back cycles aka: optimization.

Also can try setting StreamingEnabled (may or may not help)

Scripts running in the background can hurt optimization when they over test or over output.
I also like to use task.wait(#) vs wait(#) to help keep everything in sync.

local rs = game:GetService("RunService")

while true do wait()
       --
end

while true do rs.Stepped:Wait()
	--
end

while true do task.wait(3)
       --
end

The first wait will eat cycles like mad. Pick what wait is best for that task.

1 Like

You should know by your FPS how well your game is running. If it is also running poorly (generally anything below 60 FPS, but it depends), then you can hover your mouse over the larger “labels” of the Microprofiler (the little bars) to figure out what is causing it.

I recommend you check out the following two articles:

1 Like

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