Sign in to follow this  
Ipsquiggle

Understanding Shards and Migration Portals

Recommended Posts

myxal    527
23 hours ago, k2trix said:

Do someone here knows how can i make it asyncronous ?

I was also interested in this - I tried to configure a 2-shard world with regular-cycle caves and eternal winter forest.

  • The fact that there's no season options in the caves section of the world configuration already suggests that independent season manager for each shard is not supported.
  • Even manually adding the season options into the override file and regenerating the worlds didn't work.

I'd suggest taking a look at how seasonmanager works - perhaps you can modify the world entity for each shard, assuming it's there?

 

  • Thanks 1

Share this post


Link to post
Share on other sites
qpa85    0
On 17/11/2015 at 9:16 PM, Ipsquiggle said:

Effectively what you have to do is, for each migration portal in your world (and you can add or remove them just like any prefab, with c_spawn() and :Remove()), you need to disable the automatic linking, and then point each portal at the world it should migrate to.

Hi, i know that is maybe long time ago but, i found this treat when i search for "Multiple Worlds". And i want to ask you people...

When i want to SPAWN a new portal/link like "cave_entrance" or "cave_exit" with the c_spawn command, the "portal" spanws closed (like with wood blocking the entrance) and i really don't know if i'm linking it or if the mod is working. May someone that set this up and working provide me some tutorial or example on how to do this.
 

Thanks !!

Edited by qpa85

Share this post


Link to post
Share on other sites
qpa85    0
On 22/11/2015 at 12:39 PM, DarkXero said:

You are not supposed to touch the code of worldmigrator.lua.

You are supposed to run code on the console.

 

1) Join a server

(We are in master now, shard_id is 1)

2) c_spawn("cave_entrance")

(Cave entrance will be id 11, automatically, since there were 10 cave entrances by default on generation)

3) Stand near the entrance, as c_find picks the closest thing

4) c_find("cave_entrance").components.worldmigrator:SetDestinationWorld(shard_id)

(This shard id will be the second slave)

5) Use the entrance

6) You will migrate to slave 2, from portal 11 from master

7) Since only 10 cave exits are here, you will go somewhere else, find a place to make a new exit

8) c_spawn("cave_exit")

(This cave exit will be id 11, automatically, since there were 10 cave exits by default on generation)

9) c_find("cave_exit").components.worldmigrator:SetRecievedPortal(shard_id, 11)

(This shard_id is 1 if it's master)

 @DarkXero When i create a "cave_entrance" (#2) the sinkhole that spawns is sealed, so i'm unable to go in. And is possible to see in the console that the "new portal" is Inactive.

Share this post


Link to post
Share on other sites
k2trix    7

Using the "shard configuration mod" makes the world linking way easier :)
you should have a look to this topic -->

Spaming new entraces isn't necessary, 10 for each world is far enought if you want to make a maze :D, just link them to each other:
-unidirectional portals leads to florid posterns (portal[0]) no way back,
-bidirectional portals leads to each other (portal[1-10] to portal[1-10],
-with this mod you can use the command c_migrateto(shard_id,portal_id) teleporting you anywhere you need.
ex : c_migrateto(2,0) [only admin cmd] teleports yourself to the florid postern of shard 2... enjoy !

Edited by k2trix

Share this post


Link to post
Share on other sites

In case it's useful, this is the shard mod config I used to use in my dedicated server, for 3 forest worlds and 1 caves, all interconnected:


   ["workshop-595764362"] = {  -- Shard Configuration Mod
      enabled = true,
      configuration_options = {
        ["SyncFromMaster"] = true,
        ["Connections"] = { -- only point higher, not lower;must be the same in every shard; 2ways list only one side!
           ["1"] = { "2", "2", "2", "2", "3", "3", "3", "4", "4", "4" },
           ["2"] = { "3", "3", "3", "3", "4", "4", "4", "4" },
           ["3"] = { "4", "4", "4" },
           --["4"] = { },
        },
        -- ["OneWayConnections"] = {
        --   ["1"] = { "2", "2" },
        -- },
      },

Unfortunately, too many of the other mods I use couldn't handle the multiple forests, and even fewer could handle multiple forests with different configs (I wanted 3 unique worlds, not 3 identical worlds).

Share this post


Link to post
Share on other sites
L. Ringmaster    165
On 3/3/2019 at 11:03 AM, Lucidi0us said:

If it helps, here is a my config for 6 worlds with different seasons on 4 of them

 

@Lucidi0us That is awesome! 

Using this mod is it possible to have certain shards synchronized?
For example: two pairs of independently synchronized overworld and caves?

Share this post


Link to post
Share on other sites

I would just like to be sure I understand this information correctly before I delve too deep into it. How would regenerating the worlds affect the pointers for the portals. Would you have to set the pointers each time the worlds are all regenerated with the new sinkhole's or are the sinkholes just number x - x connected based on what you apply and then when the worlds regenerated while the sinkholes may be moved around those same values still hold true?

Share this post


Link to post
Share on other sites
Lomion    25
On 02.03.2020 at 12:53 PM, emyily said:

the commands to link portal arent working for me

c_find("cave_exit").components.worldmigrator:SetRecievedPortal("shard_id", portal_id) works.

First it wasn't working for me too, until, for some reason, i added "quotes" around shard_id.

Edited by Lomion

Share this post


Link to post
Share on other sites
Berniperni    0

Hello, we're trying to make a server with 4 shards - the master server is an overworld, the 2nd shard is a cave, and the 3rd and 4th shards are both overworlds connected with one portal to the second shard. I'm able to connect the servers properly, and I can link all the portals of shards 1 and 2 together. However, when I try to spawn in an extra cave_exit in the second shard I cannot get it to connect to a portal of the 3rd (or 4th) shard. In the official Klei forum I read that after spawning the cave_exit I was supposed to use c_find("cave_exit").components.worldmigrator:SetDestinationWorld(3) and this is where the trouble begins. If I do that the cave_exit gets overgrown and unusable. If I migrate to the 3rd or 4th shard I cannot connect it to the newly spawned 11th cave portal either, wich I tried with the following command: c_find("cave_entrance").components.worldmigrator:SetRecievedPortal(2, 11) (It also doesn't matter if I use (3) or ("3") - both of which people claimed would work). I tried those commands in many many variations and different orders and nothing would really work, the best I could achieve would be that I would end up in the correct world but at the florid postern, not at the cave_exit/ _entrance that I wanted to end up at. I hope this despriction is detailed enough and not too confusing! I'd be incredibly happy about any and all tips you can give me, so thank you in advance! Kind regards

Share this post


Link to post
Share on other sites
myxal    527
20 hours ago, Berniperni said:

I was supposed to use c_find("cave_exit").components.worldmigrator:SetDestinationWorld(3)

World IDs are strings, and if you're going to pair portals with inequal IDs then you also need to specify true for the permanent parameter: ..SetDestinationWorld("3",true). Also, your other command...

20 hours ago, Berniperni said:

c_find("cave_entrance").components.worldmigrator:SetRecievedPortal(2, 11)

..should be ..SetReceivedPortal("2",11)

Also, you can verify how the portal is set with print(c_find("cave_entrance"):GetDebugString())

Better yet, run this in each shard to verify if what you think is configured is actually configured:

for k, v in pairs(Ents) do if v.components.worldmigrator ~=nil  then print(v.components.worldmigrator:GetDebugString()) end end

 

  • Like 1

Share this post


Link to post
Share on other sites
Berniperni    0
On 5/14/2020 at 4:34 PM, myxal said:

World IDs are strings, and if you're going to pair portals with inequal IDs then you also need to specify true for the permanent parameter: ..SetDestinationWorld("3",true). Also, your other command...

..should be ..SetReceivedPortal("2",11)

Also, you can verify how the portal is set with print(c_find("cave_entrance"):GetDebugString())

Better yet, run this in each shard to verify if what you think is configured is actually configured:


for k, v in pairs(Ents) do if v.components.worldmigrator ~=nil  then print(v.components.worldmigrator:GetDebugString()) end end

 

Alright, so I had tried it with both "" and true in the commands before, but it hadn't worked anyways. However, I think I now know what the problem was/is. Thanks to you. Because the last command solved everything for me. Thank you so much. Being able to check how the portals are configured without having to go with trial/error and having to migrate all the time and hope to make sense of what I could see was... I can't express my gratitude enough, I think! Out of curiousity (and because it might help in the future); I think I'm only able to pair portals with the same ID. If I set the DestinationWorld then that automatically happens. And for some reason I can't use c_find("cave_exit").components.worldmigrator:SetRecievedPortal("shard_id", portalId), because then I get this: [string "c_find("cave_exit").components.worldmigrato..."]:1: attempt to call method 'SetRecievedPortal' (a nil value) (And I did make sure to use ("shardID", true) this time.) So the solution was to make an 11th and 12th portal on the 3rd and 4th shard respectively, which would pair without problem with the portals of the 2nd shard. But even if I can't get an answer to this question, I've managed to connect my worlds properly and everything works and I don't have to use a mod that gives me weird spam in my server, so. Again, thank you!!

Edited by Berniperni

Share this post


Link to post
Share on other sites
myxal    527
7 hours ago, Berniperni said:

I can't use c_find("cave_exit").components.worldmigrator:SetRecievedPortal("shard_id", portalId),

Received, not Recieved ;)

Share this post


Link to post
Share on other sites

Hi there. Sorry for the stupid question, but is it work for local servers? Everytime I launch my local server, "server_port:" option in server.ini switch to default (10999) and nothing works...

Share this post


Link to post
Share on other sites
Alanoid    0

when I connect the shards like this, ["1"] = { "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "3" }
2 = caves, 3 = second overworld, the 11th portal in the first overworld goes to the first portal in the second overworld. What I actually want is the 11th portal in the first to connect to the 11th portal in the second. Can anyone help?

Share this post


Link to post
Share on other sites
minsk1    0

Hi,

I'm new to this, but i've been following the directions,

but all my sinkholes are blocked (blanks ontop of them)

I've been reading this topic and everybody talks about this: worldmigrator.lua 

but i cannot find this at my computer, and I see the portal linking command includes worldmigrator in it, 

so where do i get this ? 

So I have used the Nuke1:s mod but every hole is blocked and I tried to use the command to 
link them but it does nothing. I dont understand :( 

When i start the host, there are reading this:
skipping portal [1] different permanent world
skipping portal [2] different permanent world

 

etc.. 

Edited by minsk1

Share this post


Link to post
Share on other sites
myxal    527
On 12/28/2020 at 10:04 PM, minsk1 said:

I've been reading this topic and everybody talks about this: worldmigrator.lua 

but i cannot find this at my computer,

Where are you looking? Since a few years ago, all scripts in the game are compressed. It's in <game folder>/data/databundles/scripts.zip/scripts/components/worldmigrator.lua

On 12/28/2020 at 10:04 PM, minsk1 said:

skipping portal [1] different permanent world

I'm not 100% sure, but I think this means the portal is set to link to a world (=shard) that doesn't exist on the cluster. Check if the migrator's destination world matches the destination shard's world ID seen in server.ini. And remember to use a string, not integer.

Share this post


Link to post
Share on other sites
Phizzle    19

I see...

"[00:05:25]: Registering secondary shard in US lobby"

"[00:00:34]: Registering master server in US lobby"

in my consoles but I do not see my dedicated server in the Browse list. (I triple checked my filters and tried looking for a LAN connection.) 

I need help, please

Share this post


Link to post
Share on other sites
JazzyGames    1396

Working on a video guide for this. Wanted to drop a couple of important notes here for would-be multi-shard world admins:

1) Keep only the portals that have matching ID's in the shards to which they are linking. For example, if I'm linking a third world then I'll only keep portals with ID's 5-10, and my second world will keep portals with ID 1-5. This might not be entirely necessary but makes troubleshooting infinitely simpler. (EDIT: some of the dev comments strongly suggest that this is necessary as portals will look for their matching ID when linking).
2) This has been mentioned but you MUST manually run the linking command on each portal in order to completely turn off automatic linking.
3) You need to modify your .bat file to start up additional shards.

Edited by JazzyGames

Share this post


Link to post
Share on other sites
myxal    527
11 hours ago, JazzyGames said:

Before doing any manual linking, open every cave entrance in every shard.

What is the reason for this? Do the settings get lost when cave_entrance is replaced with cave_entrance_open? (Haven't dealt with this in a long time - IMHO if I'm already dealing with each migrator individually, accommodating the commands for different prefabs on a case-by-case basis is not a huge deal)

 

12 hours ago, JazzyGames said:

Working on a video guide for this.

:steamhappy:

Share this post


Link to post
Share on other sites
JazzyGames    1396
5 hours ago, myxal said:

What is the reason for this? Do the settings get lost when cave_entrance is replaced with cave_entrance_open?

I suppose the main reason for this was to simplify the managing of cave entrances on each shard, and cracking them all made it easier to check the total number of portals in a forest world without having to run console commands on two different prefabs. Plus I was also having linking issues with unopened portals that I am now unable to duplicate, so perhaps it was an unrelated problem. I'll probably edit that suggestion out.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this