Lag optimization for many players?

How does one do this? I have been on servers with 100 players and getting the fps i get when playing with 31 bots.
(Running the same map and base gamemode in the bot tests)

Are there ways of disabling the drawing of players if they are behind the local player or something like that?
Or do I set the players color to invisible locally if they are behind me? Would that give higher framerates?

Pretty sure Source already does that sort of thing automatically. It might be your ping

Source already does this when it calculates the PVS.

Hm, I made all players invisible and fps went up by a solid 15. (31 Bots)

Yes, but now you will run into networking issues with players since they’re not drawing and any kind of map occlusion that makes parts transparent. The internal PVS calculation is as accurate as something you could pull off in Lua.

Im gonna push the limit and try it out anyways. Next step will be not drawing any entity whatsoever. :3

I have proof Source already doesn’t draw entities you can’t see. Just make a custom SENT and draw anything in its

ENT:Draw function. Just make sure it sticks out from the entity. You’ll notice that if you turn away from the entity, any parts you drew sticking out of it will not be drawn.

Sure, but it doesn’t stop drawing it as soon as it’s out of the players view, it has to be a little more than just out of the view and im making it so that it stops drawing it as soon as it gets out of the players view based on the model and players resolution+fov. :slight_smile:

It’s done to make sure all networking is completed before the entity is marked as dormant.

It doesn’t because it uses renderbounds to verify if entity it’s outside of screen, any calculation you make in Lua will be way slower than engine calculations, don’t waste your time, that kind of optimation it’s already made by the engine and has been coded by profesionals

Just make sure that your game mode code doesn’t suck so you don’t have to try optimize the game itself

Well I figured out how to fix the lag, I set the server tickrate to 33 instead of 66 and now i got about double fps.

I mean, you laugh now, but think about it - does your server really need to be running at 66 ticks/sec? CS:GO this is not, and people are going to have crap ping anyway. Why not save on computing resources and halve the tickrate? Most modern AAA FPSes have low tickrate and they do just fine. Frankly, if you’re going to be running 16+ players you might as well crank down the tick rate.

It may not make a huge difference for other FPSes, but GMod and many other Source games are very physics and movement reliant. While 33 will work fine for RP or less-interactive gamemodes, it gets unbearable under 20. For BHop and Surf, a minimum of 66 is needed.

Aylmao, now you have HALF fps, not double, you are forcing the game to run at 33 fps than 66, that’s why it uses less resources, but that might bring precision issues

I dont have half fps, the server does, and it’s barely noticeable. :slight_smile:

I really hope you’re trolling, I can’t really take you seriously at all…

I think I’d be able to tell if I was running at 33 fps when I’m used to 144 if that’s what you are talking about. It’s 33 updates per second on the server and not 33 frames per second for the player.

Well, sure. But I thought this was in the context of RP; I can’t imagine trying to get more than 16 or at a stretch 32 players to fit into a bhop or surf game.

We used to run at 66 tick with 64 players on Surf, never had any issues. The majority of issues came from the PlayerCanHearPlayersVoice hook and ULX.


But more seriously, I don’t see why the dumb ratings. Don’t plenty of servers run at 33 or even smaller tick rates? And regardless of the answer to that, if it keeps his game/server running smoothly and he doesn’t notice any negative effect, then it’s a good solution.