r/CreateMod
•
u/TuxeBroReally
•
12d ago
•
1
PSA: Coasters Simulated will LAG your Server if there are tons of Sublevels loaded
I am a staff member of a public Aero server (I won't tell it, rule 2) and there was a time when the server was lagging hard if there are big or tons of loaded sublevels. Which is fishy and not normal, considering Sable can handle those scenarios very well.
So I did a simple singleplayer test using Spark mod, by loading 225 small sublevels to find out the cause. And then I found out that Coasters Simulated is the main culprit to this and no other mod, not even Sable itself.
I took a look on what part of the mod's code are doing the lag, then I saw that Coasters Simulated was scanning ALL of the blocks of EVERY loaded sublevels at every tick, trying to find specific blocks from Coasters.
For the nerds and the Dev(s) who want to know which part does it lag, this is what I found from my Spark profile and my decompiled JAR investigation (using JADX, nice program for decomp JARs). Classes are specifically in dev.silvergold.simulatedcoasters.track.cart and dev.silvergold.simulatedcoasters.rivet packages
CoasterCartPlotScan.scanBearingCells()andCoasterCartPlotScan.forEachBearingWorldCell()- shown in Pic 5 and 6, scans a butt ton of blocks in a Sublevel, that tries to find specific "bearing" blocks (so far it's finding rivets and coaster carts). Fix it by only scanning sublevels when necessary, or either a direct faster pinpointing blocks with that specific type?RivetDisassemblyEnforcer::onPrePhysicsTickandCoasterCartTrackSnap::onPrePhysicsTick- runs at every physics step (Sable's ticking) and checks for every loaded Sublevel. Fix it by never runningscanBearingCellsat every physics steps at all?
My final thoughts on this was the fact the mod was primarily made out of AI code might be the reason why. Since in my eyes, AI code can typically make "correct" but unoptimized code. But sparingly, AI might help with optimization like take a look at the game Big Walk for fixing a lighting performance. (oh no, nooance in redit???)
I am not saying that Coasters mod is immediately bad (because i love me some rivets), but I am pointing out a flaw that hopefully it gets fixed by now. And developers must consider their liabilities when using AI for code.
(the version tested was v0.1.5, it might be updated or fixed at any day now)
EDIT: it has been fixed in v0.1.6!






96
u/Shoddy_Bumblebee_398 12d ago
This is good to know. Can definitely see this info sparing me some headaches if true. I'm using the Let It Walk mod, and considering each leg is sometimes multiple sublevels, it could explain some things.
65
u/mario12323 11d ago edited 11d ago
Hi! This is the developer to comment on this. Yes, Coasters is still very unoptimized, and yes, I want to do everything I can to bring the quality of the project up to speed. The intent of the early access was to get a ton of player feedback before optimizing. I've been working on a full rewrite for awhile now but it wasn't my intention for it to be included in so many serious modpacks/servers while its still in early access. As a short term solution I'm looking into on-boarding people for patches while I work on larger rewrites. Ask me anything!
(Edit: patch 0.1.6 is now published!)
45
u/TriggerMeTimbers2 12d ago
That…explains a lot. A friend of mine who’s obsessed with rollercoasters just started a custom modpack and server and I’ve been wondering why it’s lagging to hell and back
25
u/DarkIcedWolf 11d ago
We need more people like you man, with all the unoptimized AI shit- some people don’t have time to check it for themselves or know how so I appreciate you homie.
45
u/Looxond 12d ago
every tick? jesus christ
38
u/Bladereaper 12d ago
You have probably saved me a ton of debugging headache, I'm working on a server/pack and I just added Coasters due to the rivets after seeing a vid about diagonal placement, but until they update it I might have to remove that feature (or just make my own mod to patch it out)
7
u/WheatleyBr 12d ago
So does everyone else also use the mod just for the rivets?
6
u/certainlystormy 12d ago
how simple it would be to create a list of references to locations of the rivet blocks lmfao
6
u/CaptainNakou 11d ago
Very interesting : I've been running around on our server trying to figure out what is breaking FPS in some places and turns out Coasters Simulated render methods seems to be called even if there is no coaster stuff used on the map in some places (noticed via multiples /sparkc profilers).
We were thinking about removing the mod all together (since nobody was using it yet) well your post has convinced me to make an executive decision about it.
Turns out a "vibecoded in a few days and then forgotten forever" mod wasn't the best thing to add to our modpack u_u'.
4
u/LLoadin 12d ago
Dang it
4
u/thebe_stone 11d ago edited 11d ago
Someone in the discord posted an unofficial patch that helps a bit, that's what I'm currently using.
Edit: like 20 minutes after I said this an official patch was posted in the discord
9
u/diplex89 12d ago
Coasters simulated is terribly optimiser whether it be a server or solo, it's a shane because the bolts are super useful
3
u/Garry-Love 12d ago
Well done. Good investigation and potential fixes
3
u/NoImNotADogLicker 12d ago
I had a similar thing with a mod called "create: connected blaze burners". Gave me multiple headaches on my single-player world
1
u/matteo_fay 11d ago
Ever since sable 2.4 sable has been lagging my server to death
1
u/SoraLee7 11d ago
Wow, ive been getting hit with alot of lag from sublevels and thats probably why. Thanks sm for this
1
u/Ok_Journalist3899 11d ago
What do you use for debugging?
1
u/BendIllustrious4854 6d ago
Mod Name 2?
0
u/PTMR2 11d ago
I (well, my friend) noticed that it also increases ping, for some reason. Also, happy cake day!
-1
u/meutzitzu 12d ago
Who could have seen this coming?
-14
u/Dadamalda 12d ago
Idk how you got 2mspt. That's too little lag even for an empty world.
-15
u/Meiseside 12d ago edited 11d ago
So you made a report and the promise to correct it?
Edit: They have made an update to 1.6 it is now fixed.
-9
u/Kakjung124 12d ago
i hope Create :Steam n Rails use Sable Engine
-14
u/LucAAAgamer 12d ago
Mod name (oh dang ty)
-31
u/wizard_brandon 12d ago
yeah no shit?