qszekely Posted January 30, 2017 Share Posted January 30, 2017 Yet another post about lag. There should be a Lag Megathread, what do you think about it? I might update the post with the answer's comments if this is useful. DST suffers a lot from lag, here I post many things I've learned regarding this issue, hoping to get some attention from the devs to address the issue. In my case, I can have 1-2 seconds of input lag, more often than not. I'll mainly write about a dedicated server, with some non-dedicated comments. There are two important factors to take into account regarding the server, bandwidth and machine power. Firstly, the server has to be powerful enough to serve a lot of information, specially if you use caves, since that's two servers. Secondly, the internet bandwidth of the server is crucial. Specific comments to solutions/causes I've read: * Port forwarding DST uses UDP ports 10996-11000 by default. Forward those ports from the firewall/router _and_ the OS's firewall. Additionally, you can activate uPNP on the router so this forwarding is done automagically. * Movement prediction If movement prediction is on (default) the client guesses what's going on without awaiting confirmation from the server. Under lag conditions, this means you get hit when you where out of reach of the mob. If you switch it off, then you'll experience input lag, which means your character will take a moment to react to your movement and commands. Deactivating movement prediction helps see how much lag you have. It also "helps" fighting mobs since you understand when you'll get hit and when not, and you can even account for the input lag (if it were constant, which it isnt). * VPN Connecting to the server through a VPN helped, although sometimes it doesn't make a difference. I was playing through a 4G router and that solved a dramatic lag issue(1-2 sec input lag). I've re-tried without it recently, and ran ok, while I had big lag again through VPN. * Tick rate (credit to @CarlZalph) If your server can handle it the higher the tick rate both in CPU and network demands, then clients will experience lower latency of actions. Neglecting a lot of small factors, and 15 is default, for 1-5 frames of delay: 15: {66.6ms, 133.3ms, 200ms, 266.6ms, 333.3ms} 30: {33.3ms, 66.6ms, 100ms, 133.3ms, 166.6ms} 60: {16.6ms, 33.3ms, 50ms, 66.6ms, 83.3ms} (1000/tickrate)*N, where N is the number of frames of delay encountered. N varies depending on server choke and network delay, both adding together, and from what I can see it will always be at least 1. Meaning all networked inputs are calculated on the server and sent back the results the following clock tick. Network delay is going to be your latency to the server doubled since DST uses a Client->Server->Client protocol of communication- the client waits for the server to tell the client what happened before proceeding. * Map and minimap mod Some people point to the minimap mod as a cause of lag or to the host's explored area. This is true for non-dedicated servers. I've read clients lagged when the host opens the map, thus if you have the minimap mod, clients would lag all the time. Apparently the map is very demanding. * More lag the more we've explored Another source of lag is caused by the amount of stuff dropped all across the world, since, I guess, it's more information to process and serve by the server. There's a mod called "no more lag" which cleans the dropped stuff. It could be a good idea to activate it every once and then, but it may remove the things you dropped on the ground. * Disconnecting and re-connecting helps * Rebooting helps (sometimes) * Turn on triple-buffering on the NVidia settings for DST This a weird advice I read somewhere. It helped once, but may just have been coincidence, I couldn't reproduce. My server config & specs ==================== BW 150Mbps/15Mbps. 32gb RAM, Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz. For DST, I've opened the ports 10996:11018, allowed ping on iptables. For steam I've opened ports 4380, 8766 and 27000:27030. Since my server uses a firewall, I also had to set a security policy rule to let the port forwarding thru. Mods: --#Global Position --#Health Info --#Display food values --#digable reeds --#extra equip slots --#no more respawn penalty --#large chest --#craftable gears --#combined status --#custom settings --#pause Tick rate at 30. About the clients ============= We usually play 4 of us, two in germany and two in switzerland. 1 plays on linux, the rest on windows, all laptops. Mine: i7 with 16gb RAM & Nvidia Quadro K3100M. 1 of the german clients hardly ever experiences lag (althought the server is in switzerland). In my case, lag depends a lot on the day. Final comments ============ I'm here for the devs! I'll gladly provide any log, specs or whatever to help profile this. I've read there's a profiler in DST, is there a way to turn it on? I sometimes have a lot of lag, while some others don't. These are all the suggestions I've read so far. Let me know in the comments for things that are wrong or whatever I could throw in there. Also if you want more detailed explanations on something. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/ Share on other sites More sharing options...
PanAzej Posted January 30, 2017 Share Posted January 30, 2017 Meh. Either the host can't handle 4 players at once, has too many resource-heavy mods enabled, has a lot of things built in one place or has unstable internet connection. The only thing I can recommend is to learn to play with Movement Prediction disabled. This game is pretty much unplayable to a regular person (aka person who just wants to casually play with Movement Prediction) with a ping over 30, I'm talking from my experience. Up to 30 ping you could play with Movement Prediction enabled without experiencing complete disconnection between things that you're seeing and the things that are actually happening. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862388 Share on other sites More sharing options...
Maslak Posted January 30, 2017 Share Posted January 30, 2017 4 minutes ago, PanAzej said: This game is pretty much unplayable to a regular person (aka person who just wants to casually play with Movement Prediction) with a ping over 30, I'm talking from my experience. Up to 30 ping you could play with Movement Prediction enabled without experiencing complete disconnection between things that you're seeing and the things that are actually happening. This. I just can't play DST properly, I mean I can't fight stuff. My internet connection isn't the best, for sure, but I can play other online games fine most of the time. Sometimes I disable prediction so I can land even 3 hits on treeguard when I try to kite, but that's pretty all about it. I can also farm Dfly scales, but it's not hard at all. But hey, all of this made me wear logsuit almost all the time, I dumped backpack and I feel great about it. Now I can switch clothing depending on weather without need to drop backpack! I also don't have to use battle helmets, since the damage reduction is the same. Log suit takes less hits, but is even cheaper to make. Improving DST gameplay by fixing those problems would be a nice thing to do after New Reign is done. But I'm aware that it's probably really hard or impossible. Dang. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862391 Share on other sites More sharing options...
StarvedKasad Posted January 30, 2017 Share Posted January 30, 2017 The more I read about lag the more I believe the game should never be written in lua . It doesn't handle multi processing well,it requires an shard to play caves adding even more input delay,the movement prediction adds even even more delay and the more you explore and increase your world the more the game lags. The input delay is just a bonus. Yes it requires a good rig to play the game,but the game suffers on single player as well. The next updates should be focused around performance improvements.Maybe hire some more programmers for this job. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862393 Share on other sites More sharing options...
Spyro1 Posted January 30, 2017 Share Posted January 30, 2017 I am on ps4 my gf and I have a day 700+ world. We have explored 95% of the overworld and around 70% of the caves/ ruins. Currenly the server runs fine when it is just us two playing, when a third person joins it starts to lag a little every now and then (the kind of lag is mostly characters being unresponsive and floating off in one direction for a few seconds or something like that think its referred to as rubber banding) anyways when theres 4 people we start experiencing moderate lag and when there is more than 4 people it is severe lag that makes it almost unplayable. I am the host using a ps4 pro so if it is hardware limitations then theres not much more i can do other than buying a beefy pc. Is there anything i can do or am i just doomed to be limited to only being able to play 2 players. We try actively clean up our world by constantly picking up and loose items like rot or spider glands etc to try free up any clutter but it hasnt seemed to help much Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862394 Share on other sites More sharing options...
BluesyBuesy Posted January 30, 2017 Share Posted January 30, 2017 What puzzles me about lag on dedicated servers is that I get a non-trivial amount of lag even when I am playing on an offline world that's hosted on the same machine that I'm playing on. Why is that?! Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862396 Share on other sites More sharing options...
Spyro1 Posted January 30, 2017 Share Posted January 30, 2017 I would love for some dev input on this thread. I dont mean to sound whiny or anything but the lag issues are a really big issue in dst. It would be great if we can try come to discuss possible sollutions on both the dev side of things as well as possible player side/temporary solutions Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862399 Share on other sites More sharing options...
qszekely Posted January 30, 2017 Author Share Posted January 30, 2017 9 minutes ago, Spyro1 said: I would love for some dev input on this thread. I dont mean to sound whiny or anytbing but the lag issues are a really big issue in dst. It would be great if we can try come to discuss possible sollutions on both the dev side of things as well as possible player controlled temporary sollutions This. 26 minutes ago, BluesyBuesy said: What puzzles me about lag on dedicated servers is that I get a non-trivial amount of lag even when I am playing on an offline world that's hosted on the same machine that I'm playing on. Why is that?! I've never had this, playing on the same LAN as the server had 6 ping and no lag, until I added the Caves, then I got tremendous lag. My guess is that the routing table was wrong, but didn't dig into the issue since I'd be playing from outside the LAN anyway. To get things straight, you're running a dedicated server on your computer _and_ then launching the client? Why not just host a game as per the in-game menu? Or that's what you meant? (that's what I meant by non-dedicated server). Do you still have lag when running a non-dedicated server? If you want, open a new thread and tag me on it, so we don't pollute this thread with a particular case. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862400 Share on other sites More sharing options...
BluesyBuesy Posted January 30, 2017 Share Posted January 30, 2017 12 minutes ago, qszekely said: This. I've never had this, playing on the same LAN as the server had 6 ping and no lag, until I added the Caves, then I got tremendous lag. My guess is that the routing table was wrong, but didn't dig into the issue since I'd be playing from outside the LAN anyway. To get things straight, you're running a dedicated server on your computer _and_ then launching the client? Why not just host a game as per the in-game menu? Or that's what you meant? (that's what I meant by non-dedicated server). Do you still have lag when running a non-dedicated server? If you want, open a new thread and tag me on it, so we don't pollute this thread with a particular case. Well, my understanding is that enabling caves launches what is in actuality a dedicated server behind the scenes, so that's why I used that term. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862402 Share on other sites More sharing options...
qszekely Posted January 30, 2017 Author Share Posted January 30, 2017 @BluesyBuesy Ok, now I understand. Yes, the caves are ran in another server indeed, although I myself wouldn't call your setting as a dedicated server (headless, running elsewhere, with a firewall screwing up things). Have you checked if you have lag without the caves? Just to rule out other causes. Have you checked the LAN only option? Unless it is a common problem, I imagine your problem belongs to another thread who will treat your case in particular. If that's a common issue, though, it totally belongs here. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862406 Share on other sites More sharing options...
Zeruul Posted January 31, 2017 Share Posted January 31, 2017 Anyone knows if how switching between tick rate will affect lags (15,30,60 tick, with default 30 IIRC)? Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862524 Share on other sites More sharing options...
CarlZalph Posted January 31, 2017 Share Posted January 31, 2017 1 hour ago, Zeruul said: Anyone knows if how switching between tick rate will affect lags (15,30,60 tick, with default 30 IIRC)? Neglecting a lot of small factors, and 15 is default, for 1-5 frames of delay: 15: {66.6ms, 133.3ms, 200ms, 266.6ms, 333.3ms} 30: {33.3ms, 66.6ms, 100ms, 133.3ms, 166.6ms} 60: {16.6ms, 33.3ms, 50ms, 66.6ms, 83.3ms} (1000/tickrate)*N, where N is the number of frames of delay encountered. N varies depending on server choke and network delay, both adding together, and from what I can see it will always be at least 1. Meaning all networked inputs are calculated on the server and sent back the results the following clock tick. Network delay is going to be your latency to the server doubled since DST uses a Client->Server->Client protocol of communication- the client waits for the server to tell the client what happened before proceeding. So if your server can handle it the higher the tick rate both in CPU and network demands, then clients will experience lower latency of actions. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862532 Share on other sites More sharing options...
qszekely Posted January 31, 2017 Author Share Posted January 31, 2017 Oh right, I forgot to add what i've read about the tick rate, CarlZaph's comment is much more clearer than what I'd read with your permission @CarlZalph I'm adding it to the main post, let me know if you want it removed for some reason. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862547 Share on other sites More sharing options...
SendRamenNoodz Posted January 31, 2017 Share Posted January 31, 2017 Is it only possible to change tick rates in a dedicated server ? Have been looking for a settings.ini but can only find client.ini in the documents folder. I'd love to change tick rates in worlds I host cause i'm sick of getting hit a mile away ._. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862599 Share on other sites More sharing options...
qszekely Posted February 1, 2017 Author Share Posted February 1, 2017 @Drozo I guess you mean if you can change them when hosting a game. If you meant change the tick rate of the server you connect to, you can't. About the former, I haven't tried but I'm pretty confident you can. In windows you can find the cluster.ini under Documents/Klei/DoNotStarveTogether/Cluster_1, under linux is the same path but under ~/.klei. Add the tick rate option under the [NETWORK] section. Also, I guess you can set it as a launch option with -tick 30. You can add launch options through steam, google it if you don't know how, it's the same for all games. This excellent guide intended for dedicated servers has more details on the information you need than what I just wrote. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-862739 Share on other sites More sharing options...
SendRamenNoodz Posted February 2, 2017 Share Posted February 2, 2017 Ohh Of course obviously I can't change tick rate on the server i'm connecting too. Yea, I wanna host a world (non dedicated) and are you sure it's in the cluster.ini and not client.ini ? Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-863072 Share on other sites More sharing options...
qszekely Posted February 3, 2017 Author Share Posted February 3, 2017 @Drozo The non-dedicated hosting follows the same structure as the dedicated ones, with a Cluster_1, Cluster_2 directory for each world. My educated guess is that this setting goes in cluster.ini as it does in the dedicated version of it. But maybe on the client.ini sets it for all servers and can then be overridden using the cluster.ini. I can't remember if the debug render tells you the tick rate of the server... Maybe give it a try. Set the tick rate, launch the game and while in-game, press backspace and see if it does say it there. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-863369 Share on other sites More sharing options...
FistfulOfZen Posted February 7, 2017 Share Posted February 7, 2017 Struggling with lag issues right now. Trying everything. Given the sheer number of "pieces" in a game world, even fully explored, at the start of a game, I am not certain how much this actually impacts the overall game, but when I host a game for my friend and myself, we're at day 150+ and the lag is making the game absolutely unplayable and sucking all the fun out of it. I can say without question that it's not my computer that's the problem, because resource usage isn't going over 60%, even with voice software, browsers and numerous other background programs running. It is definitely something in DST itself that is broken, and it's broken badly. Would a mod that removes rot periodically and culls spider nests, Beefalo, etc. to a fixed max number help? I keep finding mods that do way more than I am comfortable them doing in order to reduce lag. I don't want animals carrying off dropped items, but I do want to keep the number of things within a reasonable but useful amount (example: don't need 100 beefalo, but don't want them limited to 10 either). This seems like it could be something Klei could implement fairly easily, no? -Fist- PS - The game is lagging in the title screen, even when freshly loaded. The character animations are noticeably jerky. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-864496 Share on other sites More sharing options...
minespatch Posted February 7, 2017 Share Posted February 7, 2017 I would love to play mygame on my laptop, until then, I'm pretty cosy with my vanilla single player experience and maybe I can play shipwrecked once I finally get the hang of all four seasons. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-864674 Share on other sites More sharing options...
qszekely Posted February 7, 2017 Author Share Posted February 7, 2017 @FistfulOfZen You sure you're not running on power saving mode? What are your computer specs? The game should not be laggy on the welcome screen at all. There's no server or anything running at that moment. I haven't tried the clutter removing mods other than for a few minutes, I deactivated it as soon as I realised stuff I had left on the ground had disappeared. @minespatch good for you, not in any way related to this topic. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-864681 Share on other sites More sharing options...
minespatch Posted February 7, 2017 Share Posted February 7, 2017 2 minutes ago, qszekely said: good for you, not in any way related to this topic. I'm having a lag problem on my laptop, so sorry I didn't exactly explain my case. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-864683 Share on other sites More sharing options...
FistfulOfZen Posted February 8, 2017 Share Posted February 8, 2017 @qszekely, yes. I play exclusively on a desktop. I play a tremendous number of games, and have never experienced anything close to this kind of trouble. And DST can hardly be described as graphically intensive. As far as the title screen, I have absolutely no idea what's going on with it. I also messed with the resolution, and now DST refuses to fill my entire monitor while on full 1920x1080 resolution. Running Windows 10, AMD Phenom II x4 955 3.20 Ghz processor with 8 GB of RAM. Graphically, using an NVidia GeForce GTX 760. Been running this rig for a while and can play far more graphically intensive games without problem. All drivers are up to date. I'm running a number of mods, but the game ran fine with them... until it didn't. I've tried removing and readding the mods and verified the cache on Steam. I'm guessing that there's a problem with Steam and DST, but I also see that people have similar difficulties with DST outside of Steam. I'm at a loss. And given that we're in 2017, and the game came out last year, I'm guessing Klei is at a loss, too. It's more than a little frustrating spending more time researching these graphical problems than playing these last two days. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-864756 Share on other sites More sharing options...
KassCrout Posted February 8, 2017 Share Posted February 8, 2017 Don’t mix up lag and fps drop. I've got like 500+ hours in DST: I've played solo in my local server with my good desktop PC and my old laptop too. I've hosted a server to play with my friends with my desktop PC. Now I host a public DST game on a Linux dedicated server I rent. If you're playing solo in your own server: that's not lag, that's fps drop. In my Linux server i used to host an Ark server (3D FPS, open world, building features, "flying vehicles": to give you an idea of the config requirement to host this game) with 12 players without problems. And now I can't host a DST server with more than 6 players without "lag" (dedicated server icon becoming red, in-game freezes and delays), in fact it's not lag from bad internet connection or too much bandwidth used - nah, it's just that the only Core used to run the game is overloaded, the Core load excess 100% so it takes more time to the server to calculate and send back the info to users which is resulting these "lags". I know a lot of people except new skins, new features, bosses, etc. in future DST updates but as a host, when I read the changelogs I can't see any code optimisations, performance/networking improvements sadly... When I'm monitoring my server there is some errors in the log, these errors are already reported (years ago) in Klei bug tracker, but it seems they won't be fixed any time soon... Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-864826 Share on other sites More sharing options...
qszekely Posted February 8, 2017 Author Share Posted February 8, 2017 @KassCroot Good post Did you activate some debug mode? I don't see any errors (other than some issues with one mod's assets) on the dedicated server. If you did, could you tell me how? me too would like to research more what could be done to help. DST is not multithread? dang... I'll monitor de cpu load to see wether is bw lag or cpu lag, in my case it's the former. We're only 3 playing and I get 70 ping. Ark is so much more demanding! I'm starting to think maybe lua is unable to deal with this, meh. I've checked and adding multithreading could be possible as well, maybe a mod could? Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-864828 Share on other sites More sharing options...
Maslak Posted February 8, 2017 Share Posted February 8, 2017 24 minutes ago, KassCroot said: If you're playing solo in your own server: that's not lag, that's fps drop. Actually you can have lags while playing DST solo, but it's important to know the difference beetwen lag and fps drops, thanks for pointing that out. And pretty valuable post in general, like qszekely said. Link to comment https://forums.kleientertainment.com/forums/topic/73709-lag-megathread-candidate/#findComment-864829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.