Jump to content

leveldataoverride, worldgenoverride, and World Settings Picker (mod), Oh My!


Recommended Posts

Hey folks, wanted to bring up an issue with managing world settings in dedicated servers. Might be a bug in here.

As has been established, leveldataoverride is not for admin use and worldgenoverride is for admin use. Zark created the World Settings Picker mod (henceforth referred to as "the mod") to make it possible to easily change settings on dedicated servers since they lack the "start server" UI where settings are normally changes for client hosted servers. I believe based on my testing that the mod stores its settings in save/shardindex as to persist between server restarts.

In my testing, it appears that when worldgenoverride.lua is present, the settings written by the mod are ignored, and it's not possible to change settings. When leveldataoverride is present without worldgenoverride, the mod works between soft restarts (ie, c_reset), but not hard restarts (ie, stop the dst dedicated process completely).

I was going crazy trying to get the daywalker setting to be "always" in the caves due to these issues. I ended up having to settle for adjusting worldgenoverride and not using the mod due to the hard restart issue. Haven't tested this issue on the forest shard.

Is there a "right way" to set this all up such that the World Settings Picker settings are maintained between hard restarts? Framing this another way (and assuming my understanding is correct), why does save/shardindex get clobbered when doing a hard restart with only leveldataoverride.lua? I think ideally we should be able to remove leveldataoverride.lua for dedicated servers, and worldgenoverride.lua should apply overrides that are explicitly mentioned, and otherwise everything should fall back to whatever is mentioned in save/shardindex and have it not get clobbered. I think this would necessitate a "bug" fix from Klei?

Thanks!

Link to comment
Share on other sites

think everything works if I apply this patch and remove the leveldataoverride.lua file
 

diff --git a/scripts/networking.lua b/scripts/networking.lua
index 1aacbab..f15ee3c 100644
--- a/scripts/networking.lua
+++ b/scripts/networking.lua
@@ -873,7 +873,7 @@ function StartDedicatedServer()
                 end
                 serverdata.use_legacy_session_path = slot_server_data.use_legacy_session_path
             end
-            ShardGameIndex:SetServerShardData(nil, serverdata, onsaved)
+            ShardGameIndex:SetServerShardData(ShardGameIndex:GetGenOptions(), serverdata, onsaved)
         end
     end
 end

 

Link to comment
Share on other sites

Patch has been working great for me so far.

One thing that occurred to me is that maybe dedicated servers shouldn't load leveldataoverride.lua at all after the first launch of the server. It's not a big deal to go manually delete it of course, but it just seems like it can only cause problems in a dedicated server setting since there's no UI for actually tweaking leveldataoverride.lua as there is with client hosted servers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...