Programable Network v1.1.4a
Adds additional options to control machines by custom specified conditions in Controllers. Contains also programable displays and lights
| Source code | https://github.com/DeznekCZ/COIM/tree/main-programable-network-0.8 |
| Websites |
Programable Network — Mod Overview

What it adds
A logic-and-signals layer for Captain of Industry. The mod introduces a Controller building that hosts a grid of Modules wired together with typed cables. Modules read game state, perform arithmetic / boolean / control logic, and write back commands or signals. Several display and signal-bus entities round out the toolkit.
Top-level entities (registered from C#)
- Controller — placeable building with a grid layout. Hosts a programmable network of modules. Inspector supports Add / Move / Edit modes.
- Antenna (AM / FM) — wireless signal bus. Channels carry single values (AM) or arrays of borrowed signals (FM) between distant controllers.
- Display Entity — colourised lights, 7-segment and 16-segment digit displays driven by module outputs.
- Speaker — audio cue triggered by signal.
Module groups
Modules ship in groups, each registered by a RegisterData call in ModDefinition and assembled via the ModuleBuilderStart(...) fluent API in Data/Mod/Modules/Modules.cs (~2900 LOC). Categories visible to the player:
- Constants — integer, hex, product, crop, machine, vehicle…
- Buttons — manual triggers / latches.
- Arithmetic — sum, subtract, multiply, divide, modulo, etc. (extensible pin counts replace older fixed-arity variants — see Deprecation table).
- Stats — read live stats from buildings, machines, mines, farms, storages.
- Forks — fan-out / route signals.
- Booleans — and / or / xor / not (extensible).
- Decisions — conditional pickers (e.g. flip-flop, latch, memory).
- Connections — read / write to game entities (recipes, priorities, thermal storage, transports, etc.).
- Comparation — int compare (>, =, <, ≥, ≤).
- Display — 7-seg / 16-seg, ints, sliders, LEDs, toggles, images.
- Radio AM / FM — antenna read/write modules.
- Variables — named state slots shared across the controller.
- Plc (its own ModuleGroup) — runs user-authored Python code per tick via
PlcPy*. - Special:
Game_Pause(debug-only).
How user-authored content plugs in
The mod ships a Python "Custom" layer that loads at runtime — players can drop .py files into the mod's Modules/Custom/ folder to register new modules, templates, or controller blueprints without compiling C#.
Custom Python files (current ship)
Located under src/ProgramableNetwork.Modules/Custom/:
| File | Purpose |
|---|---|
clock.py |
Cyclic time source (configurable period & rollover). |
connection_isactive.py |
Reads the active state of a connected entity. |
connection_thermalstorage.py |
Reads thermal-storage charge level. |
controller_template.py |
"Basic hour clock" — a sample full Controller blueprint with wired-up modules. |
delay.py |
Delays a signal by N ticks. |
equal_selector.py |
Selects an output channel by equality match. |
flipflop.py |
Set/reset latch with extension pins. |
latch.py |
One-bit memory latch. |
max.py |
Max-of-inputs (extensible). |
memory_selector.py |
Indexed memory cell. |
notification.py |
Triggers a controller-level notification. |
randomizer.py |
Random integer source. |
shift.py |
Cyclic shifter — rotates channel inputs onto matching outputs. |
template.py |
Reference of a category-favorites + simple constants/displays template. |
timer.py |
One-shot / repeating timer. |
Python "Core" API (read-only — published lib)
Under src/ProgramableNetwork.Modules/Core/. Do not edit — it's the public surface other mod devs target.
| File | What it exposes |
|---|---|
module.py |
Module base class, default controllers, in/out helpers. |
template.py |
Template, Controller blueprint base. |
categories.py |
DefaultCategories (Connection, Arithmetic, Display, Control, Boolean, …). |
display.py |
Display registration helpers. |
fields.py |
Int32Field, EntityField, etc. |
io.py |
Input / Output proto helpers. |
errors.py |
Exception types surfaced to the parser. |
mafi.py |
Wrapper for Mafi types (e.g. Fix32). |
translate.py |
tr(...) for localized strings. |
ids.py |
(generated) IDs for all C#-registered modules. |
Custom .py files may import only from Core.* and Mafi.* — the runtime parser does not support stdlib or third-party modules.
Python PLC
The Python API also allows to write custom logic directly in the controller. Enough is to add the nodule and write a proper code.


This mod has no dependencies.
No other mods depend on this mod yet.
Bits and switch
Jul 14, 2026 v1.1.4What is new
- Modules for merging and splitting signals to simple booleans or partial number
- Switching of similar module
Bits & Bytes
Very long time there was problem to transfer big amount of bit signals around the factory. Now it will not easier bit each signal can be bundled and transferred as one.




The encode and decode modules can combine any type of input and operate with any length is signal, so you can set to single signal for example 8 small number of length 4 bits (0-7)
Swap
From now similar modules can be swapped for example:

New controller design - added BUS system
Jun 08, 2026 v1.1.3New design of the controller panel. I feel this one is much more visible against the version before.

The new BUS system allows directly connect close placed controllers, that reduce use of input and output modules for controllers.
Also, what is possible, is option to add additional variables to the PLC-Py or read from it

Allows to select close controller and read variable from any bus or module Connection: Output
Allows to read additional variable from PLC-Py, this variable must be set inside PLC
Allows to set value and then read from PLC or by bus in other controller
v1.1.4 | 2026-07-02:
v1.1.4 | 2026-07-02:
- added min() and max() built-ins to PLC-PY and to Python modules (from Core.mafi import min, max) — accept either several values (min(a, b, c)) or a single iterable (max(self.Array)); works with any comparable type but every item must be the same type (numbers int/float/Fix32 may mix), and a mismatch gives a plain-language error in both the compile check and at runtime
- changed arithmetic (+, -, *, /, //, %) in PLC-PY/Python scripts to mix int/float/Fix32 automatically (e.g. min(a, b) * a Fix32 pin no longer errors) and to report type mismatches in plain language ("can not add int and str") instead of the old "Types has no divide yet or never" message
- fixed chicken farm module
- added Bits: encode (pins → word) module — packs its input pins into a single raw 32-bit word; each pin owns a configurable (offset, length, format) bit-field edited in the new Bit layout inspector (little-endian), so a 2-pin encoder with lengths 16/16 is a combiner; per-pin format picks how the signal is read — hex (raw value, e.g. Constant (hex)) or int (integer part); pins (max 16) are added/removed from the module edge or the Bit layout editor's +/- pin buttons, and each input has an LED that lights while its signal is non-zero
- added Bits: decode (word → pins) module — splits a raw 32-bit word into its output pins by the same per-pin (offset, length, format) Bit layout; format emits each field as hex (raw value) or int (integer part); a 2-output decoder with lengths 16/16 is a decombiner/splitter; a src_int toggle reads the input's integer part instead of its raw value so a plain integer's bits can be decoded; each output has an LED that lights while its signal is non-zero
- added Hex → Integer and Integer → Hex modules — bridge between the hex/raw 32-bit Bits/Constant (hex) world (values in Fix32's raw backing) and normal arithmetic signals (integer part)
- changed Shift module: ported from Python to C# with the same pins and extensions; old Runtime_Shift_2/4/7 saves migrate automatically
- added config.json "controller_reach_distance" (default 20 tiles) — sets how far a module's entity field may reach when picking an entity to connect to
- added module prototype swap — modules in a swap group show a small "⇄" button in the bottom-left of their name; clicking it opens a searchable picker of compatible operations and replaces the prototype in place, keeping cables and field values. A candidate that would lose data is shown disabled with the reason (e.g. swapping a multi-input AND/OR into XOR, which has no extension pins). Swap groups: arithmetic combiners (Sum/Sub/Multiply/Divide/Modulo), integer comparators (A=B/A>B/A<B/A≥B/A≤B), boolean (AND/OR/XOR), Hex↔Integer bridges, integer/hex constants, single-pin displays (product/entity/LED), 7-seg/16-seg number encoders, 7-seg/16-seg display drivers, Import/Export logistics-mode set and get, the storage-flow/storage-logistics/get percentage modules, and the notification modules (Info/Warning/Error). Swap groups accept Python-written modules too — a Python module declares `swap_groups = [ SwapGroups.Notifications ]` to join a built-in group, or authors define their own named group with a `class MyGroup(SwapGroup)` (see the new Modules/README.md for the full custom-module/group/template guide)
- changed Sub/Multiply/Divide/Modulo modules: now extensible with up to six extra input pins like Sum (a-b-c…, a*b*c…, a/b/c…, a%b%c…); for Multiply/Divide/Modulo an added-but-unconnected pin is skipped so it can't zero the product or divide by zero
- changed Button (on/off) module: the on/off display is now an SVG rotary toggle knob (black ring) — red and rotated 45° left when off, green and rotated 45° right when on, pointer swings up to the neutral mid position (keeping the current color) while held, and gray while the controller is paused — replacing the old "( | )" symbol. Modules can request it via the new "[button]" display type (AddDisplay(..., button: true))
- changed Button (pass value) module: the display is now an SVG pass-through gate knob with a flow arrow — arrow down while passing (green when the input is non-zero, red when the input is off), arrow right with the light off (gray) when blocked, and arrow to the bottom-right (keeping the current light) while held. Modules can request it via the new "[pass]" display type (AddDisplay(..., pass: true))
v1.1.3 | 2026-06-05:
v1.1.3 | 2026-06-05: - added bus system for variables/signals - added Connection: Animal Farm (A-FARM) module — controls chicken farms, cattle ranches and any animal farm: writes the slaughter slider step (0-10, <0 off) and breeding pause, each applied only while its pin is wired or its override toggle is on so it won't fight the manual UI; outputs the operating state, current slaughter step and the starving / missing-water flags, with optional output extensions for animals-born / carcass per month. Logistics, pause, priority, power/worker status and the animal / food / water / produce counts stay on the existing generic Connection modules (Storage with its watched product, Import, Export, …) - changed Max module: a single extensible module (2 base inputs A/B, extend up to 8) replaces the fixed-size variants and the old "Maximum: A or B" module; optional output extensions expose the input index of the minimum (indexmin) and maximum (indexmax), and each input now has an LED below it lighting green for the current maximum, red for the minimum, and gray otherwise — old Max saves migrate automatically - changed Connection: Storage (STOCK) module now also reads Research Labs — outputs the global current research's node id (display falls back to the research's own icon, or the first thing it unlocks if no explicit icon is set) along with steps done / total cost / completion percent - added Statistic: Health (HLTH) module — reads PopsHealthManager.HealthStats from a Hospital or Captain's Office; main output is the current health percent, extension outputs add this-vs-last-month diff, last month's percent, and remaining months on the active disease - added Relay (RLY) module — gated pass-through that mirrors each input to its same-position output when the enable input is non-zero (defaults to enabled when unconnected); base pair is A, and input/output extensions grow in lock-step so the Nth input always pairs with the Nth output - added per-module highlight color: a paint button in the module edit dialog opens a color picker that recolors the entity tint and connection line shown when the module (or the whole controller) is hovered; default matches the previous CornflowerBlue so existing controllers look unchanged - added "Pick reachable signal" button to the FM receiver module's frequency picker — opens a list of currently in-range broadcasts labeled with channel frequency, ID3 name, and signal strength; clicking jumps the receiver straight to that channel - fixed AM antena entity-level copy (Ctrl+C / V): the per-channel mine/ship routing now travels with the antena instead of the clone coming up with an empty redirected list - fixed Connection: Office - Edict module's max-level: previously counted every tier in the edict chain (including ones blocked by un-researched unlocks), so the target would clamp to a level the player could never reach; now stops at the first locked tier so the displayed x|n and the target clamp match what's actually enabling-capable
v1.1.2c | 2026-05-23:
v1.1.2c | 2026-05-23: - added translation for Brazilian Portuguese by @Raffaelmjr
v1.1.2b | 2026-05-17:
v1.1.2b | 2026-05-17: - hotfix after change of variable was not possible to remove unused variables
v1.1.2 | 2026-05-16:
v1.1.2 | 2026-05-16: - added calculation optimization for copying of connected signals - updated actions to be done with commands for potential multiplayer - added read for computation on Mainframe and DataCenter - added module for set racks - added button to deselect all categories - cargo docks can now read with transport module, connected ship - added Connection: Office - Edict module to drive edict level on the Captain's Office - prototype picker grid switched to transparent icon-only buttons; vehicle options now show vehicle + fuel icons side-by-side - fixed that the recipe selector did not update recipes when more than one or no one set - the recipe selector also unset the building
v1.1.1 | 2026-06-12:
v1.1.1 | 2026-06-12: - added option convert hex values, that is usable for colors and product - added Compare: A vs B module (A<>B) — combined less/greater compare with binary / positive / sumup output modes; mode variants surface in the module picker as preset templates - extended Connection: Office - Unity - now have extendable pins to show more info - added hint checkbox, that will hide tooltip for controls - added option to select template directly from NewModule picker - added option to precofigure some fields directly from NewModule picker - added direct edit for modules, that are not part of controller yet - moved panel for openning variable window
v1.1.0 | 2026-05-01:
v1.1.0 | 2026-05-01: - added python PLC module for custom pin to pin reaction - changed cable display - updated modules to be extendable
v1.0.0 | 2025-07-10:
v1.0.0 | 2025-07-10: - added the connection modules - added simple LED lights - added 7-segment and 16-segment displays - added sound emitter