Repository navigation
Changes to improve performance - #376
Yamachinima wants to merge 1 commit into
Conversation
|
I think the only thing I will change later is to convert the |
|
lmao ai slop request |
|
Changes don't make any sense, source's datatable networking is delta-driven and setting the same value is safe because it will check internally |
|
Yeah I didn't even wanna make this pr but I was asked too, the changes barely do anything at 1-5 cars but actually make a difference when at higher "unrealistic counts" last pr I will ever make dw. I'll just keep future issues to myself from now on and focus on my own stuff |
|
Not speaking for a styled, but in common: |
|
Yeah... im just blindly benchmarking. Sure the networking already avoids sending a value over the internet if it hasn't changed but it still saves work, setting a value even to the same thing makes the game run some code. This only adds up with my 30-50 vehicle stress test. It's a micro optimization |
|
But anyways I hear you, just ignore this pr. It's ai slop |
Some changes to Glide to lower server and client cost so more vehicles can be driven at once.
Changes:
Network variables are only set when the value actually changes: wheels, steering, brake, engine RPM/throttle and water state. Wheel slip values are rounded so tiny changes don’t get sent.
there is now less garbage in wheel physics, forces are built from numbers instead of new Vectors every tick.
Car tuning values are cached on the server and cleared when they’re edited.
New client convar glide_max_projected_headlights (default 8, 0 = no limit): only the nearest cars get projected headlights. Sprites still draw for every car.
Wheel sounds are only updated when volume or pitch actually changes. Far-away wheels update less often.
Tire and exhaust particles scale with how big they look on screen. Distant cars spawn fewer or none.
Cached sit animation lookups, reused light and sprite tables, sleeping vehicles skip water checks, and no bodygroup work for cars without light bodygroups.