-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
great mod but less laggy perhaps? #1
Comments
I didn't notice much lag during testing, perhaps a mod interaction triggered it. Could you provide more details? Like the mod list you're using, etc. |
its not like its super laggy its like +1ms |
1ms doesn't seem that bad. The code's pretty simple so it might be hard to further optimize, just a postfix might not do the trick. I'll look into it. |
I'm having the same problem. Mod enabled, 17fps/30ups. Mod disabled, 60/60. With the mod enabled, i can also fix the fps/ups problem by not having any guns able to shoot, either by not giving them sails or not giving them a reachable target orbit. As soon as one gun with sails can target an orbit, though, I get the fps/ups hit. I also use Railguns Retargeting, but disabling it while leaving SmartEjectors enabled does not solve the problem. Disabling SmartEjectors with Railguns Retargeting enabled, the game runs fine. Not sure what other mods would affect it, but here's my mod list right from r2modman (some are dependencies): |
Im failing to recreate the issue. Could you send your PC's specs and your save file (put it on a Google Drive and send me a link). While you're at it, send all the config files too so I can replicate the exact conditions. |
I'm seeing something similar. I get 30 frames-ish without this, and 10 with it. I'm using a few thousand ejectors in various systems to fill their spheres. I looked at the code, and I'm not sure how often "EjectorComponent"'s So on every Especially if some of the properties are heavy to access.. F.ex. this code access both the layers by id, which could represent some computation to produce this list.. and then for each of those it accesses If I may suggest, an alternative approach would be to calculate the two states (filled & limit reached) for each system once every, say, 20 seconds. And then using those values to determine if a specific ejector should be locked or not. It probably does not matter if the "update rate" is 20 seconds, meaning it could be 20 seconds before ejectors stop or start firing again. Even if the update rate was 1 second, it'd probably be a huge improvement, as you're saving the computation needed for hundreds or thousands of ejectors. If the game has an internal tick counter, you could also cache the values of filled & limit reached, for each tick, such that the value is always up to date, but only computed once per tick. |
Thanks for the detailed info, I'll look into it. |
Just wanted to chime in that I confirmed this mod is slowing down my game immensely. I disabled all mods except the CompressSave/DistributeSpaceWarpers mods, in order to load the game, and then this mod, SmartEjectors. Additionally, BepInEx and NebulaMultiplayerModApi are loaded as dependencies. Without SE, I got approx. I created a share with my save file here: There is also a file, |
I just realized you could make this even faster. If you at first run calculate the number of solar sails places left for some Dyson sphere, you could then keep subtracting from that until you hit 0. Interlocked.Decrement() can subtract a number, atomically, without concurrency issues. In order to track how many sails can be absorbed at once, you could use a semaphore-like setup. Set it up with a number of allowed sails at once, and then subtract one every time you launch a sail. When sails then arrive, maybe that’s a function you could hook - then add one back to the semaphore. The semaphore should be recalculated once in a while, such as when Dyson sphere planning changes. Mike. |
Calculations now run once per game tick per sphere. Given the same save file: |
OH GAUD DANIEL IT TOOK YOU A WHOLE YEAR TO FIX THIS ISSUE be like me and only update mods once every 3 years or so ;) |
I have this very issue. My ups went from 36 to ~75 and Dyson Sphere calculation from 7.5ms to 0.5ms when I disabled this mod. Link to save: One Drive PC specs: |
Reopened with #7. I'll look into it. |
any way to make the mod less laggy like its not lagging that much but yea
The text was updated successfully, but these errors were encountered: