Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Refinery & Assembler Inventory Management

Discussion in 'Community Creations' started by Derek Lewis, Jul 6, 2018.

  1. Derek Lewis Trainee Engineer

    Messages:
    20
    I've written a couple in-game scripts for managing the inventory of ingots and components by controlling refineries and assemblers. I know there are others out there, but I like the simplicity of this approach. It's low effort/cost to get going. For each of them, all you need on top of at least one refinery or assembler is a programmable block, and 1-2 LCDs.

    Refinery manager: https://steamcommunity.com/sharedfiles/filedetails/?id=1432879178
    Assembler manager: https://steamcommunity.com/sharedfiles/filedetails/?id=1426872621

    You tell it how many of each ingot or component you want to keep "in stock", and it takes care of the rest.
    For assemblers, it queues production orders. For refineries, it transfers ore into their input inventory.
    If there are more refineries or assemblers than there are things needing to be refined/assembled, it'll double-up on some. eg. It'll use multiple refineries for refining iron.
    The status is shown on wide LCD screens.

    Configuration instructions are in the top of the code. Just add this script to a programmable block, copy-paste the sample config (in the code comment) into the "Custom Data", specify your assembler, refinery, and LCD block names, and adjust the desired quantities to whatever you want.

    Refinery manager LCD display:
    [​IMG]

    Assembler manager LCD display:
    [​IMG]
     
  2. Ronin1973 Master Engineer

    Messages:
    4,385
    How is it on server play? Have you run any stress tests? How many grids running each script does it take to start denting the server sim speed?

    There are definitely other scripts to do this... but if yours is really low CPU intensity, it would be a great alternative to TIM managed production.
     
  3. Derek Lewis Trainee Engineer

    Messages:
    20
    Unfortunately I don't know any of those yet. I haven't run stress tests. I would like to find out and improve it. I have a few ways in mind I could improve it's performance if necessary.
    Is there an easy way to tell how much execution time scripts take?
     
  4. Ronin1973 Master Engineer

    Messages:
    4,385

    Create a sample space ship and start copying it.

    I would copy the ship with the programmable block off and see when your sim speed starts to dip. Use that as your baseline. Then repeat the process with it on and see how many ships it takes to get the same dip. It's not exactly accurate but if the number is closely comparable then it's a great script for multiplayer.
     
  5. Derek Lewis Trainee Engineer

    Messages:
    20
    That sounds pretty straightforward. I'll try that when I get home next week. I'm away right now and the laptop I have can barely play SE with all the options turned down/off. ;)
     
  6. Ronin1973 Master Engineer

    Messages:
    4,385
    Perfect potato for Xbox testing. :)

    Thanks for your work. If it's multiplayer friendly I'm definitely going to use it on a server.
     
  7. Derek Lewis Trainee Engineer

    Messages:
    20
    hahaha :D No really, it's bad. I have to turn shadows off, which then makes flashlights not work, so I have to install an increased ambient lighting mod... and it barely even breaks 25 FPS anyway. Without any fancy scripts running.

    I'm not sure what's involved in being "multiplayer friendly", so I can't really say whether it is. Are there any resources you could point me at regarding that?