#Tungsten - Serverside-only Optimization Mod

86 messages · Page 1 of 1 (latest)

upper ridge
#

Server-side only performance optimization mod for Vintage Story. The base game is already very much optimized, this is my attempt to speed up what's possible.
 
This can also benefit players in a singleplayer world, although much more limited.

⚠️ Testing Phase: This mod is currently in testing phase. Real performance gains may vary de...

grim iris
#

W mod I need to test that. might be very useful for some servers I know of

old hemlock
#

🔥

old hemlock
#

Same crash happened even after the fix, but with the same context. Loaded into the world, played fine, had to restart cuz of that stupid network issue ( #gameplay-help message ), crash upon trying to load back into the world

27.11.2025 16:24:11 [Fatal] Caught unhandled exception in thread 'chunkdbthread'. Shutting down server.
27.11.2025 16:24:11 [Error] Exception: Cannot access a disposed object.
Object name: 'System.Threading.ThreadLocal`1[[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]'.
   at System.Threading.ThreadLocal`1.GetValueSlow()
   at Tungsten.ChunkUnloadingOptimizer.GetReusableList1[T]()
   at Vintagestory.Server.ServerSystemUnloadChunks.SaveDirtyUnloadedChunks_Patch0(ServerSystemUnloadChunks this, FastMemoryStream ms)
   at Vintagestory.Server.ServerSystemUnloadChunks.OnSeparateThreadTick() in VintagestoryLib\Server\Systems\World\LoadThread\UnloadChunks.cs:line 215
   at Vintagestory.Server.ServerThread.Update() in VintagestoryLib\Server\ServerThread.cs:line 125
   at Vintagestory.Server.ServerThread.Process() in VintagestoryLib\Server\ServerThread.cs:line 55
27.11.2025 16:24:11 [Notification] Server stop requested, begin shutdown sequence. Stop reason: Exception during Process
27.11.2025 16:24:11 [Event] Something went awry...please check the program logs... (Exception during Process)
#

Btw, just so I can have peace of mind, should I worry about major issues from this mod or is what it does safe? I don't want to have to deal with world corruption or any of that

upper ridge
#

I'll look into this

upper ridge
old hemlock
#

If it happens again I'm slapping you with a moderately damp trout
-# (thanks o7 )

old hemlock
#

Seems to have worked! Thanks :>

old hemlock
#

There seems to be some weird loading "jitters" when loading into the world, is that related to this mod (or OptiTime)? It's hard to describe, like there's a half second where my camera teleports and chunks appear where I swear that wasn't the case before.

It should be noted I don't know if this is just 1.21.5 things, as mentioned elsewhere my co-op and I just updated from 1.19.8 a week ago and the loading times seem longer. Performance seems a little worse. I was getting somewhere around 30 less FPS (guessing, didn't pay attention to the numbers), and then OptiTime actually improved my framerate in our main base. I don't know if it was our chicken pen or what.

upper ridge
#

best way to be sure is disabling both of them for some time and test the FPS and speed of things.

#

tungsten will probably benefit servers with 5+ players.

faint stump
#

@upper ridge
Greetings. I wanted to suggest implementing this optimization (either fully or partially) into your mod. The developers tried to integrate it into the 1.22 code, but some of their hash sums didn't match, possibly due to existing changes in their dev branch of the repositories. I discovered why this might be the case - the resulting json might contain child elements in a slightly different order, but this doesn't affect their registration in the game. If they can't implement it before the 1.22 release, I suggest you use my work in the mod. It's quite useful if you have a large number of mods installed.

https://github.com/anegostudios/vsessentialsmod/pull/42

GitHub

The object type loading system was refactored, resulting in the following key improvements:

Efficient parallel execution: Instead of launching multiple threads with manual task distribution, Paral...

upper ridge
#

Thanks! i'll take a look. for sure the 1.21 game will be have it in a fair use..

upper ridge
faint stump
#

I added a link to your mod on my channel.

upper ridge
#

I added many safe fallbacks, though, if it proves not very stable, it should fallback to vanilla (logging it)

upper ridge
tepid coyote
#

hey @upper ridge salty made a mod for me.. It's a backpack that can emit light. This servermainlinqoptimization is preventing the rucksack light sytem packet to reach the server. How much optimization am i losing if i turn it off just for my backpack?

#

or can salty do something to not get filtered out by your mod?

upper ridge
tepid coyote
upper ridge
#

lemme check

upper ridge
tepid coyote
old skiff
#

Are there any guides on this and OptiTime?

#

@upper ridge

Sorry for the ping. But I think a good guide for both mods is due.

#

Plus it would help users a bit.

upper ridge
old skiff
#

How to properly use the configs and such

#

Because some settings aren't that straight forward

#

For instance, in Tungsten's config, there is this line, as an example, that does not explain much:

"ObjectPoolMaxSize": 32,

#

I also had a slight suggestion of my own, but only because of things I've noticed. Some optimizations for both mods to handle when the game is deciding to guzzle up a lot of RAM. This could make it more useful in modded setups.

upper ridge
# old skiff For instance, in Tungsten's config, there is this line, as an example, that does...

For that specific example, ObjectPoolMaxSize is basically the cap for how many reusable objects Tungsten keeps cached in a pool (lists of entity despawns / entity IDs, lists of block positions for updates, chunk-send ID lists, item stack lists for drops, cooking, containers, and crafting). If the pool already has that many objects in it, extra ones just don’t get kept.

So in practice:
higher value = less reallocating/GC, but more memory kept around
lower value = less memory held, but more reallocating under load

But I think a guide is overdue, yes. I'll make one and will inform people when it's ready 🙂

old skiff
#

But yeah, I want to figure out ways of reducing memory load, because despite having a powerful PC, this game acts like Google Chrome sometimes.

upper ridge
old skiff
#

Any news on the guide?

upper ridge
old skiff
#

Also, I've noted that both Optitime and Tungsten like to cause random crashes out of the blue. I know I have an absurd amount of mods, but I've seen such issues in much, much smaller mod counts.

Other users have also noted such issues.

#

I'll send the latest, since it does blame both Tungsten and Optitime. But weird errors like these have been noted by me a lot.

old skiff
#

Also, does Salty's Cinematic Camera have any issues with your mod? Attempted to boot up the save this crash came from only to get an identical crash, but blaming that mod.

upper ridge
# old skiff Also, does Salty's Cinematic Camera have any issues with your mod? Attempted to ...

None of these crashes are caused by Tungsten or OptiTime.

The texture atlas crashes (BitmapExternal.GetPixelsTransformed) are a vanilla client-side bug — probably a content mod with a bad texture. Neither Tungsten nor OptiTime touch texture loading.
The Cinematic Camera + Immersive Mining crash is those two mods conflicting with each other. Immersive Mining reads animation state that Cinematic Camera nulls out. Tungsten and OptiTime just show up in the stack trace because they patch the game tick loop, but they're not the cause — the crash would happen without them.
The handbook crashes are from other Harmony mods patching GetHeldItemInfo. Neither Tungsten nor OptiTime patch that method.

visual oasis
#

i keep having lag spike problems and i got this from my server-main

#

5.5.2026 14:25:47 [Notification] 1 players online - A tick took 20456.09 ms
20456.09ms, call : all
20452.72ms, 1 call : tickentities
20451.67ms, 111 calls, avg 184249.28 us/call: behaviors
20450.71ms, 21 calls, avg 973843.17 us/call: ai-tasks
20446.22ms, 38 calls, avg 538058.41 us/call: task-startexecute-fleeentity
3.76ms, 15 calls, avg 250.59 us/call: task-startexecute-meleeattack
0.48ms, 10 calls, avg 48.00 us/call: task-continueexec-idle
0.44ms, 1 call : entityPlayer-ticking
0.41ms, 27 calls, avg 15.31 us/call: entity-animation-ticking
1.08ms, 1 call : timers-updated
0.74ms, 1 call : gmlbVintagestory.GameContent.BlockEntityFruitPress
0.48ms, 1 call : testspawn game:shiver-nightmare
0.41ms, 1 call : physicsmanager-servertick
0.37ms, 1 call : entityphysics-mainthread (110 entities, single-threaded) (1 physics ticks to do)

#

does anyone here know what the problem is ?

upper ridge
visual oasis
upper ridge
visual oasis
#

i don't really know any other mod that does the same thing

upper ridge
# visual oasis i use it for tracking issues like the one here

Not a Tungsten issue — these are vanilla AI pathfinding and entity interaction spikes. Your log shows multiple causes:

  1. Too many entities clustered together (~110-130 in your loaded area). The repulseagents behavior took 16 seconds with 110 entities.
  2. Draconis mod is spawning shiver-nightmare entities which trigger mass flee events — 38 entities all pathfinding simultaneously = 20 second freeze.
visual oasis
#

why is it doing that

#

anyways thanks a lot also quick question should I remove tungsten mod

upper ridge
#

removing tungsten should have not do any impact on that.

visual oasis
#

by the way how did you know it was the draconis mod ? is it writin somewhere

visual oasis
#

If you don't mind helping me out

upper ridge
visual oasis
#

@upper ridge hi man i am having another problem a i was hoping you could help with

#

i keep getting this log spam and my frame rate tanked

#

6.5.2026 00:58:59 [Warning] Chunk (or some other mesh source at origin: X=511744,Y=96,Z=512800) exceeds default geometric complexity maximum of 500000 vertices and 750000 indices. You must be loading some very complex objects (#v = 1046764, #i = 1570146). Adjusted Pool size accordingly.

#

it was in the client-main file

faint stump
visual oasis
#

The thing is the lag spikes I have been experiencing started with that log so I thought it was related

faint stump
visual oasis
visual oasis
upper ridge
tired quail
#

Does this mod, when installed on a server, help players to log into the multiplayer server more quickly? As of this writing, it takes each of our players about 2 minutes to log in and then be placed in the world.

upper ridge
tired quail
#

What about Synergy mod? Would that help login time? BTW, do you know what causes long load in times on servers?

upper ridge
tired quail
#

Thank you for your guidance. The long load in times are my single biggest complaint with modded gameplay. I hope the devs find a remedy.

ionic wren
ionic wren
#

well it definitely ain't from tungsten. happened again when i got the time to try without