Can I change how parts/models render in the game to improve performance?

I want to start a new project which may involve over 100 npcs to be loaded at a given time however this is a problem as during a stress test on one of my previous games the amount of memory on the client rose very high as npcs spawned continuously which caused lots of lag.
but when a new game starts client memory is low and performance is optimal leading me to believe that having too many things loaded on the client can ruin the game. with that said I was wondering if there was a way to actively load and unload content on the client. I tried using streaming enabled but there are still too many things for the client to handle, it didnt help much at all. for example the game aegis reborn, trees shrubs and rocks don’t load unless the player is near them, could I perhaps do something like this?

1 Like

I do not have an answer to your specific problem but:
If you are experiencing lag because of a large number of humanoids, I have seen some posts (example) saying that it can be somewhat reduced by disabling certain humanoid states like climbing or swimming upon their instantiation: i.e.

h:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)

Hopefully that helps
Sorry that I can’t answer your main question

I think you’ll want to look at general performance, since that’s what your thread is leaning towards. You have broken thoughts laid out in the thread: you wish to create a game that supports upwards 100 NPCs and you also want to change the map to fit rendering. That won’t do.

You need to look at everything involved in your game in order to be able to combat performance lows. I can see where the thought of part rendering comes into play to attempt to improve humanoid handling but that’s not enough. Humanoids by nature are expensive and also require heavy optimisation on your end.

If you’re interested in performance as it relates to rendering, you’ll want to look at your options for what you can do to help rendering further than what the engine already does. For example, ensure that the greater majority of your parts have Automatic RenderFidelity to allow the engine to decide how to render parts. Make use of streaming or area/chunk loading techniques to get by. Rely less on the server: treat NPCs as a single part on the server and render their parts on the client. So on, so forth.

1 Like

so basically I should look into general improvements such as automatic rendering and of course streaming parts. are there any other things I can do? for example I heard anchoring the humanoidrootpart in an npc when not in use helps with performance. does full transparency also make a difference?

Improvements are possible on all ends. Building, coding, memory (use of pretty much everything), textures, so on so forth.

Translucent parts are more costly to render than fully transparent or solid parts. A transparency of 1 takes parts out of the rendering pipeline if I recall correctly, or at least from the greater majority of processes. The difference may not be that noticeable but it’s worth keeping that in mind.


ok, thanks for the information.

about the transparency, it not works :neutral_face:

Keep in mind that these are just simple tips on how to improve render time performance. Fully transparent parts don’t need to be visually rendered and fully opaque parts are less expensive to render than translucent parts. They aren’t catch-all solutions to performance problems in your game.

I made sure to clarify that it’s possible to combine a number of different practices in order to try to bring down how much the engine has to render and, while a bit unclear, I intended to imply that these may make very minute or unnoticeable performance differences but are still considered improvements.