Jump to content

Regenerating forest while preserving caves?


Recommended Posts

Hi all.

Is there a way to regenerate the overworld/forest while leaving caves and players intact? I found some advice regarding the opposite (regen caves while preserving forest), but none of it fully worked when applied to forest.

  • Deleting Master/save directory deletes even players from the caves.
  • Running c_regenerateshard() from the forest shard just breaks the cluster entirely, leaving caves shard endlessly restarting.
Link to comment
Share on other sites

9 hours ago, myxal said:

Hi all.

Is there a way to regenerate the overworld/forest while leaving caves and players intact? I found some advice regarding the opposite (regen caves while preserving forest), but none of it fully worked when applied to forest.

  • Deleting Master/save directory deletes even players from the caves.
  • Running c_regenerateshard() from the forest shard just breaks the cluster entirely, leaving caves shard endlessly restarting.

The Players are always saved with the Master shard, so as you already found out yourself, you can't just delete it.

The issue with the c_regenerateshard() from the Master shard is that each shard has a timestamp on it. All slave shards can forward their timestamp to the timestamp of the Master shard, but they can't go backwards.

Definitely make a backup in case you haven't in case something goes wrong.

I can think of two ways getting around that:

1. Just delete the area files, and hope that you can let a new world regenerate while keeping player and timestamp files. Not sure if that's even possible though.

2. Shut down your slave shard, so it'll be unaffected of everything you do, then use the c_regenerateshard() on your master shard and use

TheWorld.net.components.clock:OnUpdate(16*30*x)

in your master shard to forward to the day your old world was on. (Replace the x with the amount of days your old world had, maybe +1 more to be sure.) Keep in mind, this may cause a HUGE lagspike, or even a disconnect for clients, since the server will calculate all days at once, which with bigger daycounts might be a big task. Just give it a bit of time to work itself out. Afterwards your cave shard should be able to connect again.

Before continuing to play I'd recommend to restart the server once, so the world get's saved and servers usually run better after a reboot when doing things like these.

Link to comment
Share on other sites

Thanks @Daniel86268, I'll test your suggestion this evening. One thing - I expect to do this when there's no one on the server (running commands through the server' local console), would that be a problem?

Also, I was thinking that if master shard couldn't be easily regenerated, would it be possible to swap the shards' roles? (ie. make caves the master shard, and forest the slave). The caves do, after all, have a Florid Postern for new players to enter through.

Link to comment
Share on other sites

8 minutes ago, myxal said:

Thanks @Daniel86268, I'll test your suggestion this evening. One thing - I expect to do this when there's no one on the server (running commands through the server' local console), would that be a problem?

Also, I was thinking that if master shard couldn't be easily regenerated, would it be possible to swap the shards' roles? (ie. make caves the master shard, and forest the slave). The caves do, after all, have a Florid Postern for new players to enter through.

Running the commands from the server console should work exactly the same, without the possible issue that you might get disconnected.

I'm not sure if it's possible to swap the server roles... Only thing that comes up to my head is just swapping the server.ini files and copying over the player files. (you could edit them as well, but might as well just swap them.) Never tried if that works, and imo it shouldn't be necessary.

Link to comment
Share on other sites

@Daniel86268 Sadly, the trick with shutting down caves shard and advancing forest shard's world clock doesn't work - the result is still a cluster where caves shard keeps disconnecting, and looking from the lobby, the game sees me as a new player. The weird thing is - by timestamp, do you mean what the server log prints as "cycles" when starting up? Because that went to 0 after regenerating the shard, but did not increase to the number of days after advancing the world clock (and that DID advance, as the server was presenting itself as the correct age in the lobby). So maybe there must be a different way to advance the timestamp/number of cycles?

EDIT: hmm, after restarting the shard with me in it as a new player, the number of cycles did go up to the expected value. I'll do a few more tries tomorrow.

About deleting map files - which are those? The files directly under save/session/<id>/ , numbered sequentially with each save? No go with that either - the game apparently just regenerates the forest shard when it determines the save's been damaged, so the result is the same as straight-up regenerating the master shard.

I went back and regenerated the caves to make sure the c_regenerateshard() works the way I believed it would, and it does. So I'll see if I can figure out how to swap the shard roles and make forest the slave shard.

 

Link to comment
Share on other sites

Couldn't let go of this (it's very late here... or early ;) )

Turns out swapping shard roles is indeed possible. Just swap server.ini files, copy player data to the new master shard, and you're good to go. I also switched listen ports so that each shard (forest and cave) would remain on the same port as it was, but I don't think that was necessary.

Please stand by for forest regeneration...

A fresh start at last!

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...