Reducing Lag on rails that move things periodically.

    Joined
    Jul 6, 2013
    Messages
    451
    Reaction score
    108
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 5
    Okay there are now quite a few posts pointing out that you can use a speed controller linked to one off actuator block and also linked to all the single block docking rails to turn off movement checks and reduce lag. This works cause the rail even if just one block is still checks to see if the docked entity can move and checks for collisions. By setting the rail to 0 speed it reduces the calculations the server/computer needs to do.

    Extending this idea to rails that have to move. You could put an actuator at the end of the rails which through a NOT block would turn off the actuator linked to the speed controller. So at the end of the movement the rail speed is set to zero. Then setup the rail movement logic to turn on the actuator linked to the speed controller when you do want to move it. This way that railed entity will only generate a bit of lag while actually moving.

    Obviously this won't work on a rail entity that is constantly moving.
     
    Joined
    Jul 6, 2013
    Messages
    451
    Reaction score
    108
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 5
    Figured out the logic. This only works for a rail system with a single switch that goes toggles like forward and backward. Its independent from the logic shifting the rails so this should be available as an add-on. You can switch directions in the middle and it will still work.

    Requires an additional 4 Actuators, 3 Buttons, 1 NOT, 1 DELAY, 1 AND, 2 Flip flop. Plus your original actuator to switch the rail system and the speed controller with actuator that's already linked to the rails.

    The previous logic I posted here does work but seems to run into issues sometimes where the logic doesn't switch probably due to simultaneous conflicting inputs. This revised version is more complex but doesn't seem to run into the timing issue. Just don't spam the control actuator to fast when the rail is moving from the end of the rail to the second block from the end (Not sure what will happen).

    Add a actuator to the each end of the rail system ACT1 and ACT2
    Add an actuator one block in from each end of the rail system ACT3 and ACT 4
    Link Rail Toggle switch to NOT
    Link Rail toggle to BUTTON1
    Link NOT to BUTTON1
    Link BUTTON1 to Flip Flop1
    Link ACT1 to ACT2 and link them in reverse as well
    Link ACT1 or ACT2 to BUTTON2
    Link BUTTON2 to Flip Flop1
    Link BUTTON2 to DELAY
    Link DELAY to BUTTON3
    Link BUTTON3 to AND
    Link AND to Flip Flop2
    Link ACT3 to ACT4 and link them in reverse as well
    Link ACT3 or ACT4 to Flip Flop2
    Link Flip Flop2 to AND
    Link Flip Flop1 to OR
    Link Flip Flop2 to OR
    Link OR to speed controller actuator
    Link Flip Flop to Speed Controller Actuator
    Make sure the speed controller actuator starts in the ON Position.

    Now your speed controller will be set to off when the rail isn't in use and you can change directions or stop the rail midway and the speed controller will stay on until it gets to either ACT1 or ACT2
     
    Last edited: