Left 4 Dead 2

Left 4 Dead 2

34 ratings
(MSC) Map Optimizer
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts, Miscellaneous
File Size
Posted
Updated
14.661 KB
Sep 17, 2020 @ 12:45pm
Oct 15, 2020 @ 2:19pm
7 Change Notes ( view )

Subscribe to download
(MSC) Map Optimizer

In 1 collection by [FoRcE]army_guy3
(MSC) Scripts
33 items
Description
MSC_ID: MSC_Map_Optimizer
Supports MSC_AUTOLOAD.

This is the 11th test script that runs on the Master Script Controller while hosting your own server.

Note: I have disabled the auto optimize render function. If an area is too laggy then use the /arealag command to attempt to improve your fps. You can bind these commands so you can press a button instead of typing it each time.
Example:
bind kp_minus "say /areareset"
bind kp_plus "say /arealag"

Typing these two commands in console will bind them to your keypad (+) and keypad (-) buttons.

This script was designed to optimize Render/fog/physics/props/Custom_Weapon_Controller for custom campaigns that have lag issues.

Render:
The script checks render distances against fog distances to determine how much area can be optimized. This can look odd in certain circumstances but this script was mainly designed to make them playable.. Not pretty.

Fog:
The script can control fog values if it's still too laggy to play.

Physics:
The script has an experimental system to prevent severe lag caused by many physics props settling at once when the round starts. It will automatically detect awake objects and ignore ones that are sleeping. Nighty night prop <3

Props:
The script has a proplag command that stops network heavy entities known to cause network issues on some custom maps. typing "net_graph 5" in console will enable your net graph to show stats. A tall red wall is bad and may lead to clients getting heavy choke. In this case you can try this command to see if it helps.

Custom Weapon Controller:
Some custom maps have a script known as the Custom Weapon Controller. The background script logic controller for it can be altered with my optimized version of the code. It will automatically optimize the Custom Weapon Controller if it detects it.


Current functions:

proplag - (Stops network heavy entities that cause consistent choke lag)

propclean - (Detects unneeded entities and removes them to free up entity slots. Useful if the map keeps crashing with edict errors.)

arealag - (Detects the current area of the activator and further optimizes it. This can make the area look very odd in some cases but it's mainly used so people with lower end systems can actually play these maps. Each time the command is typed it will optimize the area more.)

areareset - (Detects the current area of the activator and resets the fog settings to before it was optimized.)

optimize - (Detects all areas and optimizes areas with basic optimization. This is the code that used to run automatically. Note that basic optimization requires certain area parameters to work in that area. For advanced optimization use the arealag command.)


Note: This script requires the Master Script Controller.

You can subscribe to it here:
https://steamcommunity.com/sharedfiles/filedetails/?id=2203978515

This script now supports MSC auto run. It no longer requires MSC_ADDSCRIPT.


These scripts take a lot of time and effort to produce. If you like them and/or want to see more, you can show your appreciation by throwing some money my way at:
https://www.patreon.com/ag3_killstreak
18 Comments
[FoRcE]army_guy3  [author] Jan 15, 2022 @ 5:59pm 
Glad to hear it works again. :)

The A3 Variant has almost all the functionality of the normal MSC so it should work with all MSC subscripts.

I believe the freeze is caused by a problem in the game engine code that times out while generating the script structure on lower end processors. I moved the code into the one place I know doesn't time out.. The ScriptMode_Init() function.

I'll work on getting this fix into the main MSC.

Thanks for the help in debugging, Scarlet :)
Lat Jan 15, 2022 @ 5:25pm 
wow it's miracle!! i tested itself and with your spawn weapons,map optimization scripts those worked perfectly now. Tks you so much for your help! I'm appreciated it!
[FoRcE]army_guy3  [author] Jan 15, 2022 @ 11:34am 
Ok I updated the A3 variant. Can you tell me if that still freezes?
Lat Jan 15, 2022 @ 2:47am 
Yes, i tried itself with no other mods.
[FoRcE]army_guy3  [author] Jan 15, 2022 @ 2:43am 
Ok I'll look more into it. Thanks for the info.

And just to be sure, You tried running A3 by itself with no other addons?
Lat Jan 15, 2022 @ 2:11am 
I must tab out of window to end task l4d2 by task manager, it's said my game is not responding.
Lat Jan 15, 2022 @ 2:09am 
Tks u for responding. I'm using window 10 and i tried to test all official maps with both old MSC and the new MSC A3 too and they are still same the problem. Actually my game is not crashing, it likes freezing my game at loading screen.
[FoRcE]army_guy3  [author] Jan 15, 2022 @ 1:41am 
Also you can try the MSC A3 variant version to see if that works properly. Remember to disable the main MSC before using it.

https://steamcommunity.com/sharedfiles/filedetails/?id=2719910910
[FoRcE]army_guy3  [author] Jan 15, 2022 @ 1:14am 
Hey Scarlet,
Glad to hear you enjoy my mods. I am actively attempting to find and fix crashing and freezing issues. The problem is mainly that I can't recreate the crashing on my end so debugging the cause is very difficult.

If you could answer the following questions, It would really help me out.

What operating system are you using?

What campaign did you try?

Does it still crash if the MSC is the only addon enabled? Meaning even the map optimizer is disabled.

Does it always crash in the same place while loading or does it vary?
Lat Jan 14, 2022 @ 11:51pm 
I love this mod but since the last stand has been updated, I can't use this mod with Master script controler anymore. My game keeps crashing from loading screen even i unticked other addons. I wonder there is anyway to fix that problem? Tks u.