Element-0 / ElementZero

Run windows version of BDS in linux with Mod support
GNU General Public License v3.0
272 stars 51 forks source link

Suggestion: Provide server performance settings for lower end host devices #35

Closed ambiennt closed 4 years ago

ambiennt commented 4 years ago

I think It would be a really cool addition to add some settings to reduce lag and keep server TPS more constant. This would for sure make hosting using the server mod more versatile and improve quality of the host. Also, apologies if I misused this tab as I am not reporting an issue, but I dont know where else I would add this.

IvanTurgenev commented 4 years ago

disable encryption

ambiennt commented 4 years ago

disable encryption

do you mean to enable the noencryption mod? I dont see how enabling a mod would increase performance.

IvanTurgenev commented 4 years ago

disable encryption

do you mean to enable the noencryption mod? I dont see how enabling a mod would increase performance.

yes

ambiennt commented 4 years ago

disable encryption

do you mean to enable the noencryption mod? I dont see how enabling a mod would increase performance.

yes

how exactly would enabling that mod increase server performance?

IvanTurgenev commented 4 years ago

encryption is cpu expensive

ambiennt commented 4 years ago

encryption is cpu expensive

thank you very much, I will enable that. Is there anything else I can do besides lowering the render and tick distance to improve performance?

IvanTurgenev commented 4 years ago

server movement

ambiennt commented 4 years ago

server movement

what setting are you referring to exactly? Do you mean the configurations in the server.properties file? I see this: server-authoritative-movement=true -Enables server authoritative movement. If true, the server will replay local user input on -the server and send down corrections when the client's position doesn't match the server's. -Corrections will only happen if correct-player-movement is set to true.

player-movement-score-threshold=20 -The number of incongruent time intervals needed before abnormal behavior is reported. -Disabled by server-authoritative-movement.

player-movement-distance-threshold=0.3 -The difference between server and client positions that needs to be exceeded before abnormal behavior is detected. -Disabled by server-authoritative-movement.

player-movement-duration-threshold-in-ms=500 -The duration of time the server and client positions can be out of sync (as defined by player-movement-distance-threshold) -before the abnormal movement score is incremented. This value is defined in milliseconds. -Disabled by server-authoritative-movement.

correct-player-movement=false -If true, the client position will get corrected to the server position if the movement score exceeds the threshold.

How can I alter these settings to give the best performance? and at what cost would the alterations be to connection and player movement?

ambiennt commented 4 years ago

It turns out that the comment that was here, didn't actually help with performance

which comment are you referring to?

ambiennt commented 4 years ago

The one I deleted, with network compaction, it won't affect performance changing it

theoretically wouldnt it? if I set the compression threshold to 0 that would mean all bytes (0 bytes of bigger) of data sent would be compressed.

IvanTurgenev commented 4 years ago

disable corrective movement

ambiennt commented 4 years ago

disable corrective movement

alright, done. Can I now expect players to be lagging a lot now? lol, im not sure what the noticeable effects of disabling this would be.

IvanTurgenev commented 4 years ago

No hackers might fly

ambiennt commented 4 years ago

Hackers might speed cheat too, without it, most movement cheats would become usable

So it acts as a rudimentary anti-cheat? It wont make normal, non-hackers laggy or anything?

ambiennt commented 4 years ago

I’m not too sure, I haven’t tested it with hackers... but judging by the name, it should work and also: could you please post the specs of the machine you’re using on the server?

intel i7 8750h 2.21ghz 32gb ram 2667mhz. As you could probably guess my cpu bottlenecks.

IvanTurgenev commented 4 years ago

Expect hackers flying small trade-off

codehz commented 4 years ago

TIP: you can chage server-wakeup-frequency in server.properties to lower than 200 to get lower cpu usage... a little

ambiennt commented 4 years ago

TIP: you can chage server-wakeup-frequency in server.properties to lower than 200 to get lower cpu usage... a little

I do not see that setting in that file. Where would it be?

ambiennt commented 4 years ago

No offence but, LOW SPEC? I’m running my server on an intel m3 with 8gigs of ram on one of my older laptops, and my server is running fine, I don’t quite understand how you are running into performance issues? How many players join your server anyway? That may be the cause of your performance issues

maybe 15-20, but there are commands running.

HongyiMC commented 4 years ago

@nrss Or put more money into a i9 10900k server

ambiennt commented 4 years ago

@nrss Or put more money into a i9 10900k server

Say sike please

codehz commented 4 years ago

@nrss it is hidden settings, just append as new line (Ps: you can use 1 as value to test if it is working (it will be very lagging

ambiennt commented 4 years ago

@nrss it is hidden settings, just append as new line (Ps: you can use 1 as value to test if it is working (it will be very lagging

why would 1 be laggy? you said a low number would be better for performance. Also, what are the downsides of this setting being low?

codehz commented 4 years ago

@nrss This requires manually finding a balance between the two options.The default settings will be smoother at first, but will quickly become unplayable when the number of players and entities increases.This option is somewhat similar to setting the shortest interval for processing events, so it will freeze when it is reduced to a certain level.The default setting is 200, which means that it wakes up 200 times a second to process events. This is usually sufficient, but it may not be suitable for your current device.

ambiennt commented 4 years ago

@nrss This requires manually finding a balance between the two options.The default settings will be smoother at first, but will quickly become unplayable when the number of players and entities increases.This option is somewhat similar to setting the shortest interval for processing events, so it will freeze when it is reduced to a certain level.The default setting is 200, which means that it wakes up 200 times a second to process events. This is usually sufficient, but it may not be suitable for your current device.

ah, thank you for the detailed explanation. In my case, I might as well leave it at the default then. Also, where can I find a documentation for hidden properties settings?

codehz commented 4 years ago

@nrss Unfortunately, there no documentation for hidden option. I got this by reverse engineering. BTW, there are some another hidden option language=en_US (can change the command output in console.) op-permission-level=1 (if change to 4, you can use /stop /whitlist command in game

ambiennt commented 4 years ago

language=en_US (can change the command output in console.)

yes, as bluebot said, that is cool and worth noting. One last (semi-on topic) question though. Is there a hidden setting to enable the world type to flat? I do not see it as a pre-existing feature in the properties file.

codehz commented 4 years ago

@nrss no, but you can easily import client generated world... I may add an custom flat generator mod in future, and it can customize the flat world option

codehz commented 4 years ago

@nrss I found it, it called level-type options: LEGACY, FLAT (updated: only works with upper case but still lack flat option in config

codehz commented 4 years ago

@Bluebotlaboratories image From ProperitiesSettings::ProperitiesSettings

ambiennt commented 4 years ago

@nrss I found it, it called level-type options: LEGACY, FLAT (updated: only works with upper case but still lack flat option in config

ah, so I need to make it all caps. I tried doing this the other day with lower case but it didnt work. thanks!

ambiennt commented 4 years ago

Also, another sort of related question but I didnt feel that it was worth opening a new thread for. Are there existing mods for this software to change the despawn timer of items? I figured this mod could be simple to create, but havent seen any existing ones out there. Also, if anyone reading this knows something about a mod similar to this that may already exist, please let me know.