GithubHelp home page GithubHelp logo

edge_transports's Introduction

Edge Transports

Clusterio plugin implementing item and fluid transfer between servers by letting them pass "over the edge" from one server to another.

Installation

In the folder of each of your clusterio installs, run the following:

npm install @clusterio/plugin-edge_transports
npx clusteriocontroller plugin add @clusterio/plugin-edge_transports

Instance Configuration

The edge debug view can be toggled with /c edge_transports.toggle_debug()

edge_transports.internal

Holds the definitions for the edges on this instance and where they go to. This is an internal data structure with no type checking or safeguards, modify with caution.

Example configuration:

Instance 1 (id 1684700589)

{
    "edges": [
        {
            "id": 1,
            "origin": [10, -10],
            "surface": 1,
            "direction": 2,
            "length": 20,
            "target_instance": 843892199,
            "target_edge": 1
        }
    ]
}

Instance 2 (id 843892199)

{
    "edges": [
        {
            "id": 1,
            "origin": [-10, 10],
            "surface": 1,
            "direction": 6,
            "length": 20,
            "target_instance": 1684700589,
            "target_edge": 1
        }
    ]
}

Instance 1 Instance 2

Edges are defined as originating from an origin point in the game world and going out in direction for length number of tiles, where the right side is considered part of the world and the left side is over the edge. The valid direction values are north=6, east=0, south=2, and west=4. The other side of the edge is defined by target_instance and target_edge.

Defaults to {"edges":[]}.

edge_transports.ticks_per_edge

The number of in-game ticks to spend processing each edge in the world. A lower values means less latency for items and fluid crossing the edge but more work to do each tick. A value in the order of 60 / number of edges on the instance is a decent compromise between latency and work done.

Defaults to 15.

edge_transports.transfer_message_rate

Maximum rate in messages per second to send data of items and fluids transported over edges to other instances at. Transfers of items and fluids sent from the game exceeding this rate will be delayed and bunched together, increasing latency and decreasing operational overhead. Note that this limit applies per edge.

Defaults to 50.

edge_transports.transfer_command_rate

Maximum rate in commands per second to send data of items and fluids transported into this instance. Transfers exceeding this rate will be delayed and bunched together, increasing latency and decreasing operational overhead. Note that this limit applies per edge.

Defaults to one command every 34ms or a little under 30.

Troubleshooting

Edges show as inactive in the debug view

The first time instances are starting with a new edge configuration there may be some state inconsistency causing edges to not activate. Try restarting the controller server. Check the instance logs - if the edge doesn't have a valid partner an error should be shown, ex Got update for unknown edge ...

Seeing edge_transports: setActiveEdges [3,2] in the host logs means its working.

edge_transports's People

Contributors

danielv123 avatar hornwitser avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

edge_transports's Issues

Creating edges occasionally requires a server restart to activate

Steps to reproduce:

  • Start 2 instances
  • Create edge configuration to link them
  • Observe that the edge does not create a link
  • Restart the controller/the server/the host and the link will start working.

I am having this issue with my gridworld plugin where links are automatically created while exploring the world. The latest variation of the issue is that setting up a new link when leaving one instance deactivates other links on the instance you are leaving until it or the controller is restarted.

I am not really sure where to start debugging this, except looking into what happens when applyActiveEdges is called and what it sends to the instance to cause issues.

onStop handler failing

Sometimes stopping the server fails with the following message:

image

using clusterio/clusterio/pull/425

This is caused by something here:

edge_transports/instance.js

Lines 254 to 262 in f0245d3

async onStop() {
await this.info.messages.ensureEdgesDeactivated.send(this.instance, { instance_id: this.instance.id });
await this.sendRcon('/sc edge_transports.set_active_edges("[]")')
for (let edge of this.edges.values()) {
edge.messageTransfer.cancel();
edge.commandTransfer.cancel();
}
}

Migrate to clusterio v17

The plugin does not currently work with the latest version of clusterio after the message and configuration refactor. Update the plugin to use the new message format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.