So this is an idea that I had to add additional functionality to the logic system, making it more practical in use. Because even if you could design arithmetic circuits using purely boolean logic, it would take a LOT of blocks and a LOT of work, and may not exactly be practical for logic-based controls on ships and stations. The idea is for a set of blocks that work similar to logic blocks, only instead of passing a Boolean value (1 or 0), they pass a variable containing a numeric value.
These are some of the ideas I had for the different blocks and how each system would work. I've boiled it down to the bare basics because I believe you shouldn't just be able to program a single block to do whatever you want. However, using these blocks would enable players to make arithmetic programs that can do more than just basic logic blocks while still requiring a base level of ingenuity and creativity to make a functional logic system.
Meter Block: This block would basically measure things related to the blocks slaved to it and output the numeric value of what it is measuring. For example, slaving Shield Capacitors to the Meter Block would output your current shield value, while Shield Rechargers would display your current recharge rate. We could also connect them to weapon systems to measure parameters in regards to those systems. Since there are multiple things they can measure with weapon systems, there would be a drop-down menu similar to production menus in factories, except this would list the possible things it could measure based on what is slaved to it. When the parameter is set and the block is activated (either manually or through Boolean logic blocks), it will take the value it is supposed to measure and send that as a numeric logic signal to other numeric logic blocks connected to it.
Memory Block: Similar to the Meter Block only instead of actively measuring, this block "holds" a numeric value, either set manually or passed from another numeric logic block. When activated with a Boolean "on" signal, it passes the value it is holding to the numeric logic blocks slaved to it. There can be variants on how this works, say one memory block that holds a value indefinitely, or one that erases its value when it is deactivated.
Operator Block: These would be blocks that would perform a specific arithmetic operation based on numbers passed to them. There would be one for each major operation: addition, subtraction, multiplication, and division, the block would take inputs from connected numeric blocks and send the result as output. For subtraction and division blocks, it will have drop down menus to determine which value is being subtracted/divided by the other. For simplicity's sake I think each individual operator block should be limited to two inputs; you can always send the output from one operator block to another allowing you to easily construct equations.
Conditional Block: The Meter and Memory Blocks can output a numeric value in response to being sent a Boolean signal. This block would do the opposite: it would compare numeric values received from inputs and output a boolean "true" or "false" value, making it the logic block representation of an if-then statement. You can use the drop-down menu to select both the order of the inputs and the comparison you are using (greater than, less than, or equal to.)
Finally, I think you should be able to assign names to numeric blocks like you can with factories and storage areas. The idea is that the block's "name" is essentially a variable name representing that block's output value. This is helpful for setting up conditional and operator statements as you know which input is which. I also think that if a named numeric logic block is connected to a display module, you should be able to set the display module to show that output using a syntax like [numericBlockName]. Display modules can already do this with your ship's shield and power variables so adding that functionality shouldn't be hard.
I've heard suggestions that the devs should implement blocks that hold basic LUA scripts for use with logic systems. That's all well and good but I think this system would be simpler and would tie into our existing boolean logic system quite nicely.
These are some of the ideas I had for the different blocks and how each system would work. I've boiled it down to the bare basics because I believe you shouldn't just be able to program a single block to do whatever you want. However, using these blocks would enable players to make arithmetic programs that can do more than just basic logic blocks while still requiring a base level of ingenuity and creativity to make a functional logic system.
Meter Block: This block would basically measure things related to the blocks slaved to it and output the numeric value of what it is measuring. For example, slaving Shield Capacitors to the Meter Block would output your current shield value, while Shield Rechargers would display your current recharge rate. We could also connect them to weapon systems to measure parameters in regards to those systems. Since there are multiple things they can measure with weapon systems, there would be a drop-down menu similar to production menus in factories, except this would list the possible things it could measure based on what is slaved to it. When the parameter is set and the block is activated (either manually or through Boolean logic blocks), it will take the value it is supposed to measure and send that as a numeric logic signal to other numeric logic blocks connected to it.
Memory Block: Similar to the Meter Block only instead of actively measuring, this block "holds" a numeric value, either set manually or passed from another numeric logic block. When activated with a Boolean "on" signal, it passes the value it is holding to the numeric logic blocks slaved to it. There can be variants on how this works, say one memory block that holds a value indefinitely, or one that erases its value when it is deactivated.
Operator Block: These would be blocks that would perform a specific arithmetic operation based on numbers passed to them. There would be one for each major operation: addition, subtraction, multiplication, and division, the block would take inputs from connected numeric blocks and send the result as output. For subtraction and division blocks, it will have drop down menus to determine which value is being subtracted/divided by the other. For simplicity's sake I think each individual operator block should be limited to two inputs; you can always send the output from one operator block to another allowing you to easily construct equations.
Conditional Block: The Meter and Memory Blocks can output a numeric value in response to being sent a Boolean signal. This block would do the opposite: it would compare numeric values received from inputs and output a boolean "true" or "false" value, making it the logic block representation of an if-then statement. You can use the drop-down menu to select both the order of the inputs and the comparison you are using (greater than, less than, or equal to.)
Finally, I think you should be able to assign names to numeric blocks like you can with factories and storage areas. The idea is that the block's "name" is essentially a variable name representing that block's output value. This is helpful for setting up conditional and operator statements as you know which input is which. I also think that if a named numeric logic block is connected to a display module, you should be able to set the display module to show that output using a syntax like [numericBlockName]. Display modules can already do this with your ship's shield and power variables so adding that functionality shouldn't be hard.
I've heard suggestions that the devs should implement blocks that hold basic LUA scripts for use with logic systems. That's all well and good but I think this system would be simpler and would tie into our existing boolean logic system quite nicely.