Kieaer / Essentials

Mindustry plugin - Essentials
61 stars 23 forks source link

Game syncing issues #82

Closed martinfiers closed 3 years ago

martinfiers commented 3 years ago

Describe the bug

Hello, I tried to set up a server. I used essential plugin v11.5, together with the latest build of Mindustry. I found that there's a lot of synchronization issues and problems (not being able to build stuff, my plane jumping around). Has anyone encountered these problems before? When I run a normal server without plugins and using an older java VM, (version 12 - which is easier to obtain on most Linux systems btw), things are OK. Has anyone encountered this before?

Is there a walkthrough - step-by-step on how to set up a server using the essential plugin? Which JVM do you recommend using? (openjdk doesn't have a version > 12 on my ubuntu). Linux/Windows, ...

Expected behavior

No sync'ing issues.

Screenshots

I can add more details if that is useful to debug the problem.

Server (please complete the following information):

Additional context Add any other context about the problem here.

Kieaer commented 3 years ago

Ah... yes. Essentials has structural defects. Porting the ones from version 5.0 to 6.0 caused many performance issues.

Among the functions of plugins, synchronization errors occur when working in a separate thread, so many functions are designed to work only on the main thread. Because in Mindustry 4.x ~ 5.x versions, it was difficult to expect synchronization between threads because all operations were operated as single thread.

However, in Mindustry 6.0, a new AsyncThread was created to solve this problem. Therefore, the game performance has been greatly improved, but the plugin is structurally designed for Mindustry 4.x ~ 5.x, so it has a very big impact on performance.

As of now, the workaround is to recreate the plugin from scratch.

KR-Plugin repository link This plugin is intended to be applied to my server, but there's also a solution to the structural defects of the Essentials plugin.

It's still in its infancy! It may take more than 1 month.

martinfiers commented 3 years ago

Hello,

Thank you very much for your clear explanation! I'm happy to test out once you have something working.

Kieaer commented 3 years ago

I tried to improve performance using a mutli-thread, but it caused many internal errors. This problem is that Mindustry's game logic works as a single thread. All the buildings, effect, bullet, units calculate worked only one thread.

So the solution is just to use cpu with high single-core performance. I tested it on Ryzen 3800x and 4350G, and there were a lot of lags based on 400x400 map size for 10 users without plugins.

Kieaer commented 3 years ago

I found a way to make only some features work as single threaded.

Kieaer commented 3 years ago

Use Essentials 11.8