r/Worldbox • u/MartinShwuaner • 2d ago
Misc Worldbox and it's Optimization problem
Many in this community believe that worldbox has a huge performance problem. And I can see why. Back in the 0.22 days it was normal to run tens of thousands of units in massive worlds and it ran fine. Now it's not even close to that.
We all have our different ideas about why this is happening. SOMEBODY in particular thinks it has to do with quantum sprites which is idiotic, because the game is still laggy as hell zoomed out
Some believe it is way deeper then that. According to a modder, tayfim it has to do with mono and unity itself. Most of us believe that it simply is due to the game being so bloated.
Just think about it, thousands of units, each with their own complex AI, alot of checks, and many functions running for all of them. A simple optimization mod can't fix these issues.
I had been working on a project to try to tackle it. Updating the game to use coreclr in beta unity did improve it substantially but it wasn't nearly enough. A few code optimizations here and there (basically from existing mods) weren't enough either. The truth is that worldbox's optimization problem doesn't have to do with it's code, but what it's trying to do. Like I said it's very bloated.
So what we can do to fix this? I attempted to create a ActorLOD system. Basically non visible actors will skip frames in their checks, and in compensation their step (p_elapsed) is multiplied by the number of frames skipped. The issue is the game isn't designed to handle that. Alot of performance critical code simply can't be skipped. You can imagine the disappointment on my face after I wasted my time on that.
In order to optimize this game we have to fundamentally change how it works. we can analyze the whole codebase to see what and how to modify it to be simpler. Users will always be able to configure the level of behaviour changes
Tayfim does have a point too, which is why I am working on migrating actors and buildings to Burst using DOTS like memory structures. This is a job for claude (I'm not refactoring the entire codebase).
We often attacked the devs, insulted them even due to the lag. But after looking at it myself I understand it now. Perhaps we were too harsh on you
5
u/Affectionate_Job_568 2d ago
I wish you the best of luck in this pursuit. As I myself planned to do this until I realized how strenuous of an undertaking it would be. A major concern/roadblock you will likely reach however is testing/tuning.
6
u/Opposite_Mirror1744 Cold One 2d ago
I mean I can run up to 35k units okay in a fully developed world. Usually I start running into issues at that size during wars as the game tries to direct lots of armies around.
I have had some issues with fire staffs causing lag if there are a lot of them. Maybe part of that specific lag is projectile-related and/or fire effect-related.
Also, maybe you should assume more that people don’t know what your talking about cause you seem to just bring up random people like everyone knows who they are.
¯_(ツ)_/¯