Programable Logic Controller Needed

Edward Tuholske shared this feedback 56 days ago
Not Enough Votes

There needs to be a Programable Logic Controller (PLC) in the game.

It can be a block and part of the cockpit where you have a list of logic gates to use.

It would be a list of multiple and, or, if then, etc. logic events that can be set in order with pauses (timer block)

so that you know exactly how the logic flows. As it is now in SE1 you have multiple event controllers and timers that can all trigger at the same time or out of your intended order if things don't go exactly as planned. For example I want to print a drone and connect the connecter then wait until the HY tank is at 100% prior to enabling the AI.

The list would also be all on the same screen so that you know exactly how it is set up, whereas now you have to look up multiple blocks and go back and forth between them.

This will make up for the need of multiple event controllers and timers.

You could even have a "PCI" card that you need to build and add to your PLC or Cockpit to enable this feature or enable multiple logic sets.

Replies (4)

photo
1

Factorio 2.0 added a very nice way of handling logic. Would be awesome to have a similar system in SE2

photo
1

Does this mean learning Verilog, as well as C#?

photo
1

They could take an approach like YOLOL from Starbase, have "script-chips" where you can write your code, and then plug that into whatever you want.


For whatever you want to connect/control (input/output) you can either directly reference it via the blocks ID (each block on a grid has a unique ID, can just count up from 0 i guess), or indirectly gather them by scanning the grid for block types, block with a name, etc.


It should be a more limited dumbed down version of c# as a easy entrypoint for people with limited to no knowledge.

This could get more people to experiment with these systems and eventually get some to move on to the more complex programmable block and then maybe even modding, and if all 3 are c# (or very similar) then it would be even easier to switch.


Lets go through a basic example.

MyGrid has a AIDefensive Block, 2 (exterior) Hangar Doors and a few guns.

I now want to close the 2 exterior Hangar Doors and enable all the guns if the defensive block detects enemies

Any other Hangar Doors should remain as they are.


Then I:

1. Grab the AIDefensiveBlocks ID, search it by name, or just pick the 1. I find on the grid if it doesn't matter.

2. Grab the group that contains the 2 hangar doors, or them both by thier ID or Name

3. Grab all guns on the grid


4. Set it up as a Event or a Loop


AIDefensive detector;
BlockGroup externalDoors;
List<TurretBase> turrets;

void Setup() {
  detector = grid.Blocks.First<AIDefensive>();
  if (detector == null)
    throwError("No Detector Found"); //This could make a LED Lamp on the Block light up red, to signal an error and then show the error in the terminal of the block

  externalDoors = grid.Groups.First(group => group.ID = 1452); //The ID of the group I want
  if (externalDoors == null)
    throwError("No HangarDoors Group found");

  turrets = grid.Blocks.Where(block => block is TurretBase).ToList();

  //part of Option2
  detector.OnTarget(StatusChanged);
}

// option 1
void Update() {
  if (detector.Target != null) {
    foreach (TurretBase turret in turrets) {
      turret.Enabled = true;
    }

    foreach (FunctionalBlock door in externalDoors) {
      ((DoorBase)door).Open = false;
    }
  }
}

void StatusChanged(Entity Target) {
  if (Target != null) {
    foreach (TurretBase turret in turrets) {
      turret.Enabled = true;
    }
    foreach (FunctionalBlock door in externalDoors) {
      ((DoorBase)door).Open = false;
    }
  }
}
Well, ok this code turned out to be a bit more c# like that it should, but I hope you get what I mean.


something inbetween c# and simple "logical text sentences" could be cool because it could act like a bridge,

photo
2

my request is not to have to program it. I would like to see a visual logic event:

If (X) then (Y)

If (X) and (Z) then (A), (B), and (C)

I do like the idea of a PCI card for each timer or event controller that can be installed in the cockpit or control station.

It would also be great to be able to save the card as a blueprint for other ships.

photo
photo
1

I would LOVE to see a PLC block in SE. a 4in 4 out logic setup currently takes up WAY too much room and you shouldn't need that much space for basic logic automation.

photo
1

While we're dreaming - You could have a "rack" block, that you could plug compute "blades" into it. Then you could patch those blades together to create your desired automations. Those blades could be timers, event blocks, ai blocks, programmable blocks, and logic gateways, signal/broadcast and sensor.


You could physically cable/patch those inputs and outputs to generate desired behaviour


Haha, that would almost make it a mini game on it's own. Don't really expect that, but it would be a visually cool.

But I understand that's quite a deviation of the current graphics.


Now that the funny gas has worn off. A more realistic ask would be to have all the computing blocks come in a small form factor, maybe even 25cm size so you can build your own "racks" of computing components

Leave a Comment
 
Attach a file