Garry's Mod

Garry's Mod

448 ratings
Seats Network Optimizer
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Vehicle
Addon Tags: Build, Roleplay
File Size
Posted
Updated
1.091 KB
Feb 12, 2016 @ 8:35pm
Sep 7, 2017 @ 9:32pm
5 Change Notes ( view )

Subscribe to download
Seats Network Optimizer

In 8 collections by Alban CHAMPIGNON [GiletJaune]
Board Games by Mohamed Rachid
16 items
The TTT by Mohamed Rachid
39 items
Mohamed Rachid's Vehicles Paradize
191 items
The DarkRP by Mohamed Rachid
44 items
Soccer by Mohamed RACHID
37 items
Université Joseph Poireau (serveur)
70 items
G-1:788429
50 items
Optimization addons
7 items
Description
Optimizer for servers & multiplayer games

This addon is designed to significantly reduce network usage when using numerous seats and prisoner pods.
This addon is totally useless in a local game, but it can decrease the network usage related to prop_vehicle_prisoner_pod on servers.
It works for standalone seats, passenger seats, SCars, Sit anywhere, prisoner pods.

Important
Note: The same trick applies to (not handled in this add-on):
  • env_sprite entities with an animated material
If you are a mapper, please make a lua_run entity triggered by a logic_auto entity, with the following Lua code:
for _,e in ipairs(ents.FindByClass('env_sprite'))do e:AddEFlags(EFL_NO_THINK_FUNCTION)end

How can I know how much traffic is saved?
Type in console: net_graph 3
The red trace is about entities traffic. It can get much lower with this addon.

Note
A problem causing non-seat vehicles to fail has been fixed on Feb 27, 2016.

How does it work?
The problem is that the internal Think of prop_vehicle_prisoner_pod entities produces a useless network usage, which is noticeable when there are many of them.
The Seats Network Optimizer disables the internal Think of each prop_vehicle_prisoner_pod, and re-enables one of them on each server's Think. Also when you use or leave a seat, its internal Think is re-enabled until the animation is finished.
More details in this bug report: High network usage caused by the prop_vehicle_prisoner_pod's Think[github.com]
45 Comments
Gabe Feb 19 @ 11:30am 
@AxelNoir I'm sure yes, since seats in simfphys vehicles use prop_vehicle_prisoner_pod I beleive
Alban CHAMPIGNON [GiletJaune]  [author] Dec 13, 2023 @ 10:36am 
I took a random picture on the Internet, of course. I don't make my own drawings.
Toolgun Dec 13, 2023 @ 9:11am 
Frutiger Aero preview picture
Alban CHAMPIGNON [GiletJaune]  [author] Aug 24, 2022 @ 11:30am 
Hehe you're welcome, bug busted! 👌
КОСТЯ ПАКИСТАН Jul 28, 2022 @ 5:19am 
omfg that shit works as well as expected i had very heavy net channel and tickrate rape on my sandbox server where the average online is 35-50 and there is tons of funny simpfhys shit and ur masteroiece boosted server performance ty man
Alban CHAMPIGNON [GiletJaune]  [author] Jun 5, 2021 @ 3:09am 
They are added to the list with a hook on OnEntityCreated, obviously.
Joker Gaming Jun 4, 2021 @ 4:04pm 
what if seat entities are created then?
Alban CHAMPIGNON [GiletJaune]  [author] Jun 4, 2021 @ 3:46pm 
No you misread the code. ents.FindByClass() runs once only during the 1st execution. What are you talking about? It's how I keep the seat list up-to-date after a Lua refresh.
Joker Gaming May 29, 2021 @ 1:20pm 
(on a server with no seats, N=0, it runs it every frame)
Joker Gaming May 29, 2021 @ 1:19pm 
it appears to run it every N frames where N=num seats which is nonetheless stupid, just implement it properly by storing the entities as they are created. ents.FindByClass is very expensive as it calls ents.GetAll internally

i tried this on my server (which usually has about 40 players in seats) and it didn't seem to lower the network usage anyway so...