Garry's Mod

Garry's Mod

692 ratings
Automatic Culling - Dynamic auto-cull
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Fun, Roleplay
File Size
Posted
Updated
2.517 KB
28 May @ 5:58pm
28 May @ 6:44pm
2 Change Notes ( view )

Subscribe to download
Automatic Culling - Dynamic auto-cull

Description
What is this?
This script is a dynamic aggressive culling applicator for Draconic's aggressive culling system I released a few weeks back. I had a fair few people ask me to make a script that makes it "automatically apply to everything". So tl;dr, here's that request, -ish.

Not so tl;dr: If I were to apply it to everything you would end up losing more performance than you would gain. So I wrote this script which has a size & material count filtering system for spawned entities, as well as a blacklist for entities it should not bother with, to make sure this only applies to entities that will actually improve your performance by enabling aggressive culling on them. This also includes convars if you wish to try enforcing it on more things just to see yourself that trying to do so will only result in a net loss. Draconic's aggressive culling disables when the entity is within close proximity so you won't have to worry about stuff like weapons and gameplay objects becoming invisible near you, as well as whenever you are zoomed in.

So where will this actually save my FPS?
  • Entities obscured by the world from player view, but not traditionally culled (either due to a large visleaf or a poorly optimized map).
  • Entities an extreme distance away will not render at all.
  • Weapons with a ton of materials held by NPCs.
  • Custom entities with a lot of polygons and/or materials.
  • If used on a server with "custom base maps" or other perma-prop-like solutions, likely to help save a decent few frames from scripted entities with lots of materials being picked up by this script.

Convars
  • sv_autocull_enabled 0/1 -- Enable/disable this script from flagging newly-spawned entities for aggressive culling.
  • sv_autocull_dolargeculling 0/1 (Default 1) -- Enable/disable "large" entities from being aggressively culled (See image).
  • sv_autocull_domassiveculling 0/1 (Default 0) -- Enable/disable "massive" entities from being aggressively culled (See image).
  • sv_autocull_minimummaterials 3 (Default 3, max 32) -- Minimum number of materials an entity must have in order to be considered for automatic aggressive culling. Using this on a ton of entities with only one material will result in a loss of performance rather than a save.

If you are looking for a way to manually apply aggressive culling to specific entities there is a toolgun tool I made for exactly this purpose.

IMPORTANT NOTE
Do NOT mix multiple culling-method addons. All you accomplish by doing this is creating extra processing overhead which will make your game run worse than if you didn't have any at all.

Support me on Ko-fi[ko-fi.com]
If you need immediate help with any of my addons, or just want to know what I'm working on or etc, then consider joining my Discord[discord.gg] server.
141 Comments
def. 13 Jul @ 8:45am 
Does this cull NPC's?
Colio 11 Jul @ 12:58pm 
Ohhh, I'm really sorry for wasting your time... I kind of forgot I needed that enabled.
Vuthakral  [author] 6 Jul @ 7:07pm 
You didn't install the required addon
Colio 6 Jul @ 6:39pm 
Hey, what's up with this error?

[Automatic Culling - Dynamic auto-cull] lua/autorun/automatic_aggressive_drc_culling.lua:3: attempt to index global 'DRC' (a nil value)
1. unknown - lua/autorun/automatic_aggressive_drc_culling.lua:3

Is it something to worry about? Is it something else conflicting?
Vuthakral  [author] 30 Jun @ 7:34am 
If those props are small enough, have 3 or more materials, and the map isn't already culling them then yes
Bob. 30 Jun @ 4:34am 
so if there are a ton of props on a map, this will help keep the lag down?
Microphone 26 Jun @ 6:16pm 
Catch them, kill them.
91шина 26 Jun @ 12:21am 
having pattern recognition is apparently russophobic now? take a load of this guy
Creedani 24 Jun @ 11:42pm 
@Vuthakral я имел ввиду, что можно сделать альтернативный аддон, как в случае с wOS, а не разбирать код базы на 10 аддонов, я просто не так выразился видимо, в целом, мне больше и нечего добавить.
lovaid 24 Jun @ 6:04pm 
this saved my computer