• Lag optimization for many players?
    21 replies, posted
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)
[QUOTE=Thiefdroid;52517952]Hm, I made all players invisible and fps went up by a solid 15. (31 Bots)[/QUOTE] 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
[QUOTE=Thiefdroid;52517974]Im gonna push the limit and try it out anyways. Next step will be not drawing any entity whatsoever. :3[/QUOTE] I have proof Source already doesn't draw entities you can't see. Just make a custom SENT and draw anything in its [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ENTITY/Draw]ENT:Draw[/url] 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.
[QUOTE=MPan1;52520747]I have proof Source already doesn't draw entities you can't see. Just make a custom SENT and draw anything in its [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ENTITY/Draw]ENT:Draw[/url] 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.[/QUOTE] 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. :)
[QUOTE=Thiefdroid;52521388]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. :)[/QUOTE] It's done to make sure all networking is completed before the entity is marked as dormant.
[QUOTE=Thiefdroid;52521388]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. :)[/QUOTE] 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.
[QUOTE=Thiefdroid;52522877]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.[/QUOTE] 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.
[QUOTE=ArcticWinter;52525237]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.[/QUOTE] 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.
[QUOTE=Thiefdroid;52522877]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.[/QUOTE] 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. :)
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.
[QUOTE=code_gs;52525372]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.[/QUOTE] 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.
[QUOTE=ArcticWinter;52526904]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.[/QUOTE] 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.
[QUOTE=Mrkrabz;52527224]never had any issues The majority of issues[/QUOTE] :thinking: 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.
[QUOTE=NeatNit;52528700]:thinking: 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.[/QUOTE] Whoops. Yeah, sorry I meant after the hook and ULX were replaced/cached we never saw any issues. I run a server with 128 players daily and we run at 16 tick, at that point tho it's pretty impossible to go higher. A normal DarkRP server with 32-64 players should easily get away with 33 tick if it's optimized correctly, hell I've seen one with 40 players and 66 tick running just fine. It really does depend on the hardware you are using tho.
Decreasing the tickrate means the client interpolates more and expects less, you shouldn't have the tickrate higher than your server can actually process ticks. But decreasing tickrate doesn't "fix" anything, it's not increasing performance it's just accepting that it can't perform well enough to do x frames per second. You can always notice the difference especially when doing anything that has to wait for the server, gunshots & moving props are the two easiest things to notice with low tickrate servers. Low tickrate on the server doesn't give the client high FPS.
Sorry, you need to Log In to post a reply to this thread.