fCPU


Factorio Customizable Processing Unit. Allow to write any logic on low level machine code. The fCPU acts like a programmable microcontroller with a vector coprocessor that supports many useful instructions.

Content
18 days ago
0.18 - 2.0
10.2K
Logistic network Circuit network

i Programmable trains

4 years ago
(updated 4 years ago)

Here's an idea for an interesting extension to this mod:

  • Have a recipe that combines a CPU with a train to create a programmable train
  • This creates a locomotive that has an interface very similar to a CPU, but with a few differences:
    • There is an extra array of train stops you can manually set, but programs cannot alter - i.e. it is ROM.
    • CPU input red and green wires come from the stop the train is stopped at, if that stop has that enabled (through the normal Factorio UI).
    • CPU output wires are sent to the circuit network connected to the stop the train is stopped at.
    • There are instructions for interacting with the train, such as:
      • Query the train's ID
      • Query composition of the train - i.e. wagon types and locations
      • Query contents of wagons and locomotives by index, this includes fuel in locomotives
      • Tell the train to navigate to a stop by its index in the stop array
      • Wait until the train reaches a stop and/or a rail signal
      • Check if the train is at a stop, and if so, get the index of that stop in the stop array if present (returns -1 otherwise)
    • There are also some other possible instructions that are not as essential:
      • Manual control mode:
        • Forward/backward control of the train
        • Set whether the train should take the left or right branch if it reaches a fork in the rails.
      • Set whether the train should ignore red signals.
      • Set maximum allowed speed.
      • Communication with other CPU locomotives in the train through indexed channels
      • Detection of signals, stops and other trains ahead/behind the train and at what distance.
      • Detect obstacles on the track (e.g. players, vehicles, biters)
      • Emergency stop
      • Coupling/decoupling of the train
3 years ago

If this was to be implemented, I'd vote to also create the equipment grid version, so that with mods like vehicle grid, every train can be programmed

New response