Garry's Mod
Оцінок: 191
Performance & Stability Fixes for Garry's Mod
Автор: KaptainCnucklz
A guide to improve the stability and FPS of Garry's Mod. (v2.4)
6
   
Нагородити
До улюбленого
В улюблених
Прибрати
Step 1: Launch Options
This is where the basics happen. The backbone of the guide.

Launch Options

1. Open up your Steam library.

2. Right click on Garry's Mod, then click "Properties."

3. In the General section (open by default), click on "Launch Options" text field.
Note: Within this text field you can enter commands (if you know the proper format+commands for it). The game will try to run these commands on each startup in the future.

3.b. (Optional) If you have text in the Launch Options already, delete it.

4. Now for the launch parameters. Copy and paste this list exactly into the text field:
-nojoy -nosteamcontroller -softparticlesdefaultoff -nohltv -particles 1 -useforcedmparms -noforcemaccel -noforcemspd +exec autoexec.cfg

"What does what?"
  • -nojoy - Disable joystick support for faster startup, less memory usage, and less risk of input conflicts.
  • -nosteamcontroller - Disable Steam controller for faster startup, less memory usage, and less risk of input conflicts.
  • -softparticlesdefaultoff - Disable scene depth blending for particles and sprites, for more FPS.
  • -nohltv - Disables SourceTV hosting for less resource usage.
  • -particles 1 - Limits beam count to the minimum of 512.
  • -useforcedmparms, -noforcemaccel, & -noforcemspd - Forces off mouse acceleration.
  • +exec autoexec.cfg - Forces your autoexec.cfg to apply on launch. May be useful if your game doesn't apply it already for some reason.

Note: The popular launch parameter "-threads" is not recommended by Valve developers. It's usually placebo, if not detrimental to performance.
Step 2: "Autoexec" Config File
Now we'll create an "autoexec.cfg" file. The game runs this at start-up.

Creating an Autoexec.cfg

1. Go on your Steam Library again.

2. Right click Garry's Mod > Manage > Browse Local Files.

3. Open the garrysmod > cfg folder.

4. Right click > New > New Text File.

5. Rename the "New Text Document.txt" file to "autoexec.cfg" (no quotes).


What to Put Inside Your Autoexec

1. Open the new autoexec file you made in Notepad.

2. Paste the following wall of text into the file exactly:

//Connection - Improves ping+server responsiveness
rate 30000 // If you have slow internet, try 24000 or even 18000. Experiment away!
cl_cmdrate 66
cl_updaterate 66

//Water - Turns off more intensive water effects.
r_cheapwaterstart "1"
r_cheapwaterend "1"
r_waterforceexpensive "0"
r_WaterDrawReflection "0"
r_waterforcereflectentities "0"

//Lighting - Turns off certain lighting effects.
mat_hdr_level "0"
mat_filterlightmaps "0"
mat_specular "0"

//Shadows - Turns off shadows.
mat_shadowstate "0"
r_shadows "1"
r_flashlightdepthtexture "1"
r_shadowrendertotexture "0"

//Texture Details - Makes textures lower quality.
mat_bumpmap "0"
mat_colorcorrection "0"
mat_picmip "2"
r_3dsky "0"

//Filter + Anti-aliasing - Turns off AA and AF.
mat_antialias "0"
mat_filtertextures "0"
mat_forceaniso "1"
mat_trilinear "0"

//Performance (Other)
cl_ragdoll_collide "0"
fps_max "0"
mat_reducefillrate "1"


3. Save the autoexec file.

Certain beta branches of Gmod (like 64-bit) seem to not run autoexecs by default. Don't worry, though. You can always add "+exec autoexec.cfg" to your launch options to force it to apply.
(Optional) Step 2.5: Retaining Graphics
Here's a more basic set of commands, for FPS benefits without looking too bad.

What to Put Inside Your Autoexec: Raw Utility Edition

1. Open up that autoexec file again.

2. Delete everything in it.

3. Paste only these commands exactly as I've typed them:

//Connection
rate 30000 // If you have slow internet, try 24000 or even 18000.
cl_cmdrate 66
cl_updaterate 66

//Performance
mat_forceaniso "1"
r_3dsky "0"
cl_ragdoll_collide "0"
fps_max "0"


4. Save the autoexec file.
(Optional) Step 3: Experimental Options
By using the commands in the Fourth Step, you agree that no one whose contributed to this guide is responsible for any instability, crashes, poor performance, errors, ect. that may occur to you, your computer, your loved ones, or your neighbor's dog down the street. Any commands in Step 3 are considered to be unstable and have inconsistent affects for different computers.
You've been warned.



Memory Commands for Autoexecs
These "mem_" commands used to control how much memory the game can allocate. I noticed some (quite possibly placebo) improvement in stability and performance when increased, but it's anecdotal at best. They're unused by the game in the newest versions. Don't touch these if you don't have at least 4GB of RAM or you might cause more harm than good.

These settings are what I'd suggest for 4GB of RAM. Seemingly gave a few more FPS on a stranger's old laptop.

mem_max_heapsize "1024"
mem_max_heapsize_dedicated "128"
mem_min_heapsize "96"


For those with 6 (or more) GB of RAM. Seemingly reduced crashes and stutter on my old 8 GB PC.

mem_max_heapsize "2048"
mem_max_heapsize_dedicated "256"
mem_min_heapsize "256"



Again these apparently are unused in new versions, so it's all likely a placebo.
Here's details of what they used to do:
  • mem_max_heapsize - Maximum amount of memory to dedicate to engine hunk and datacache (in mb). Used by clients (players). Default of 256.
  • mem_max_heapsize_dedicated - Maximum amount of memory to dedicate to engine hunk and datacache, for dedicated server (in mb). Only used by the server host. Default of 64.
  • mem_min_heapsize - Minimum amount of memory to dedicate to engine hunk and datacache (in mb). Used by both clients and the host, most likely. Default of 48.


Experimental Multi-threading Settings for Autoexecs
These are some commands you can add to your autoexec for further multi-threading. By default, some things will already be multi-threaded, but adding these lines to your autoexec will enable some more experimental multi-threading settings. You can expect mild performance gains in exchange for a risk to the game's stability.

gmod_mcore_test "1"
mat_queue_mode "2"
cl_threaded_bone_setup "1"
cl_threaded_client_leaf_system "1"
r_threaded_client_shadow_manager "1"
r_threaded_particles "1"
r_threaded_renderables "1"
r_queued_ropes "1"
studio_queue_mode "1"



Further Stutter Reduction with Launch Options
These launch options are for Windows only. On some PCs they give a mild reduction in stuttering, while on other PCs they make Gmod unable to play sound properly.

-primarysound -snoforceformat

  • primarysound - Tells to the game to always use a direct hardware sound buffer (only works with 2 speakers or headphones). Reduces stuttering.
  • snoforceformat - Tells the game to not set the hardware sound buffer format. Reduces stuttering, and solves some minor issues with primarysound.
Factory Reset for if SHTF
Factory Resetting Gmod Settings and Commands
Provided for if anyone was a little too eager and ignored my warnings about this section.

1. Navigate to Steam > Userdata > [Your account ID] > 4000 > remote > cfg

2. Open your "config.cfg" file, and delete everything inside.
Note: Dont delete the file outright, or Steam Cloud would only download it again. It's recommend you disable Steam Cloud, if you dont mind your other cfg files or saves being lost.

3. To be sure about settings reset, you can paste this command line in launch options:
"-autoconfig -default +host_writeconfig config.cfg full +mat_savechanges +quit"

4. Start the game, let it load. It should automatically close the game when finish. All settings should now be reset.

5. Delete the commands in the launch options.
Final Thoughts and Acknowledgements
Brief Credits
Huge thanks to mxusoleum and Kipper the Doge!
They've helped correct me on a lot of misinformation in the guide, and contributed useful commands that I was able to add. Without them this guide wouldn't be nearly as informative as it is now. :)

Feedback for how this guide has helped you is welcome.


Changelog
  • v2.4 - Added extra multi-threading, and moved resetting the game to it's own section.
  • v2.3.1 - Phrasing tweaks to both the experimental and launch options sections.
  • v2.3 - Renamed the sections for clarity. Added details about "mem_" tweaks.
  • v2.2 - General restructuring of the guide. Clarifications in my previous notes.
  • v2.1 - Further revisions based on information given by Kipper the Doge.
  • v2.0 - Overhauled entries based on information give by mxusoleum.
  • v1.0 - Initial writing of guide.

Коментарів: 40
Fitzwad 28 трав. о 5:19 
i have a slow pc that can KINDA run high prop populated areas in servers, method helped a few and i got 10 or 15 more frames but i aint complaining. Thanks! :charliemurder:
SilentOWolfo TTV 19 квіт. о 14:37 
ima bonk my ram min to 4gb and max 10gb lmfao got 64 gb in spare
ClarifyAI 2 листоп. 2024 о 21:23 
this guide fixed my problem of the models having weird flickering problems. thanks
KaptainCnucklz  [автор] 28 черв. 2024 о 12:47 
I mean like under 5mbps. Most people on cable internet should be fine with what I listed, and only really DSL is that slow these days.
Potions 27 черв. 2024 о 20:37 
What do u mean by slow internet speeds. Like under 100Mbps
♥♥♥♥♥ БАНАН 4 трав. 2024 о 6:07 
ok
KaptainCnucklz  [автор] 4 трав. 2024 о 5:29 
@averageteaenjoyer Setting the fps_max to 0 will only disable the limit, not limit the FPS to 0, don't worry.
♥♥♥♥♥ БАНАН 3 трав. 2024 о 22:14 
fps_max "0" (arent it supposed to freeze game?)
Noe 4 квіт. 2024 о 23:34 
Yeah that's what I meant. Thx for clarifying.
KaptainCnucklz  [автор] 24 берез. 2024 о 11:32 
@Noe You mean quotations? The values work with or without quotations around them. For example: fps_max "0" and fps_max 0 would both work fine.