Understanding draw(total) and draw(scene), improving performance

TL;DR, what do draw(total), draw(scene), and related values exactly represent?

I’ve been working on a group SCP:F with some fellow devs for about a year now, and as a result of the game’s progression, its performance has gone quite downhill. I am not sure if this is a FAQ, so apologizes if this is the equivalent of a newbie dev question.

With the measures we have, such as low detail mode, performance and optimized meshes, removing a lot of unnecessary terrain and unioning, and chunk loading help with performance, however, I seek to improve the overall performance of the game without forcing players to make their game look bad just for the sake of FPS. However, we have gotten to sort of a roadblock where there is not much left that we know of the can be improved. I haven’t been able to find a general solution, so this is why I came here.

I have noticed however, that games can still have millions of triangles, and yet their draw(total) and draw(scene) values are much lower. I would like to know what exactly these values are drawing from, and hopefully with this information, I should be more than capable of sourcing a majority of the lag our game is facing.

I considered that the part count could be the main culprit, and that it doesn’t matter how many triangles there are in total, and the more parts there are, the laggier, but even with a 30k part difference, there seems to be worse than expected performance in total.

image
Our current game, taken at an angle with most of the site in view. The game has slightly more than 80k parts.

poly2
Our older site that we are replacing, with most of the site in view. The game has slightly over 51k parts in total

3 Likes

The thing is, I have made maps before that had even more than 100k parts and the game didn’t lag at all so there might be something very specific in your file that’s causing this. Make sure you don’t have anything unanchored or duplicated too many times.

Also just in case you used any free models, you should check them for any potential scripts in them. There are cases that people put them in there to cause issues to games by for example auto duplicating and adding assets to your game when it starts running.

Last thing is a recommendation, Incase you haven’t used it already. It’s the streamingEnabled option in Workspace (New Beta Feature: LevelOfDetail Property for Models (Enabled Globally)) but please be careful if you use it cause this will require some changes to your scripts.

Blockquote

Both of the screenshots are taken from in-studio, so I doubt it is an issue with unanchored parts. Nothing appears to be duplicated, either

Our game is fully custom made, and the older site probably still has free models scattered throughout it, so I doubt it is an issue with FMs and malicious scripts, because again, both screenies are taken in studio

We’ve tried StreamingEnabled, but that just breaks too much of our scripting and does not give any visible performance boost-in game. Neither of the games have opted into StreamingEnabled either.

Well the only other possible factor would be one of your scripts causing lag but yeah the only solution I got for you is giving StreamingEnabled another go. I have worked on a game in the past with it and the map had well over 120K parts and no lag whatsoever. It could run 30fps even on potato devices so I highly recommend not giving up on it.

Necrobumping here, but I have yet to come up with a definitive solution to this.

This is more or less asking in regards to studio performance more than anything, as in-game, StreamingEnabled usually obscures any poor performance your game may have. However, I find it extremely confusing how my current site I am working on has such as significantly higher “kb cbuf” value compared to other sites that I have worked on, even with a similar triangle count. Assuming that “mat” stands for materials or in general, textures, what does “kb cbuf” stand for, and what are major contributors to this value?
Are there other values in the render menu that I am not taking into consideration? I have noticed that thre are some values that are vastly higher in the current game I am working on (frm blocks, tcm and clusters values) but from what I have looked, there is no reliable information on what these are standing for.

Yes, I know I am rendering the whole site, but this is just for comparison, and it really does get annoying sometimes working with a lower fps trying to do relatively simply changes.

Both of these were taken at the same time, same settings, constraints off.


image

Shadows are only at 0 because your camera stopped moving. Can you send a GIF of it while moving your camera so we can see how many shadows are being calculated?

Also would you mind showing the MicroProfiler?


I compiled a list of things you can do for your game to try and fix lag:

  • Disable CastShadow on all BaseParts that don’t need shadows.

BaseParts with a size lower than 1x1x1 should have them disabled. High tris MeshParts should have them disabled if possible.

Any object that the player won’t spend more than 3 seconds looking at should have CastShadow disabled. This also means if you’re using parts for wall design (like most SCP games), I recommend disabling shadows and collisions. (we’ll get more into that later)

  • If you’re using humanoids for NPCs, I suggest disabling some of their core states that will never be needed.

  • Change CollisionFidelity of all your MeshParts to Box or to Hull. You can use Mesh Optimization Tools by CloneTrooper to view Mesh CollisionFidelity without entering Play Mode.

  • Any part that doesn’t need collision. For example, bushes, guns, wall designs, super small parts, etc, disable CanQuery, CanCollide and CanTouch. Having all three disabled will exclude them from the collision calculating part of the engine, saving your game from potential and unnecessary lag.

Reminder that CanQuery will only show up once you disable CanCollide.

  • It was already suggested, but I heavily suggest it again, utilize StreamingEnabled. Your game is perfect for StreamingEnabled because you don’t need to see super far distances. This means you can configure the settings of StreamingEnabled to make the streaming distance really short.
1 Like