Introduction
Starmade's logic system is really neat by itself, but when trying to marry a complex array of blocks into a ship of smallish size without compromising its performance, it starts to stink. The capabilities are there. There's lots of options, but it's clunky. Sadface.
There are two problems.
- Size of blocks: Restricts complex logic and display block functions to large or strictly non-combat ships. I appreciate the attempt to go for "everything is made of blocks" but it just doesn't work. Implementing a bar of lights to show shield capacity takes many blocks to do. Other cool stuff usually does as well.
- C+V connections: Enough to make a real-life computer engineer pull his hair out. You can't see what gates connect to what if you make a device even remotely compact. Even with it spread out you often can't. Even if you can, it's awkward.
We need a single block that lets us set up a certain number of inputs and outputs with logical functions between them. We shall call this a "
processor" for now. These should connect to one another and to input and output devices. They could even exist alongside the current logic system, although there would be little use for the logic gate blocks at this point.
Inside a processor
When activated with R, a processor opens a GUI interface. Along the top are 16 inputs. Along the side are 16 outputs. The center is a grid of points 16 points by 16 points, with the inputs and outputs forming an extra row at the top and an extra column at the side. (Yes, I drew it with blocks. Deal with it. The inputs and outputs should be numbered.)
View attachment 44298
Along one side, or the bottom, or wherever, there is a row of controls. From here you can click and drag logic gates onto the grid. Each gate can be rotated so that it outputs in any direction. The other sides may be inputs. Some, like AND, OR can have up to three inputs. You can click the spaces between dots to make "wires." When wires connect, they get a little arrow on them to show direction (which I don't have a way to draw).
View attachment 44300
This shows two inputs running into an AND gate, that signal and another input running into an OR gate, and all of it running through a NOT gate to one of the outputs.
Inside the processor, you can place sensors (which now have their value set by a GUI... grrr.), rail speed controllers, etc. However, things that interact with the outside world (like buttons, lights, rails) must be connected physically to the processor from the outside.
On the outside
The processor block can connect to or be connected to other blocks. To do so, I can't think of anything besides the old C+V controls. When the processor is selected, all the inputs and outputs are highlighted (cyan and green, respectively). To connect either an input or output, "V" it.
When you "V" something, a small GUI comes up with numbers 1-16, which you can cycle through with the scroll wheel. This chooses which input or output to connect the item to. Cycle to the number you want and left-click for an input or right-click for an output. (Some items like lights or area triggers can only be one or the other.) When the processor is selected with C, all inputs and outputs show the numbered "port" they connect to next to their color-coded highlight on the HUD.
You can connect multiple items to one port. For inputs, this makes the input act like an OR signal of all the things connected. For outputs, it sends the same output signal to all connected devices. The next time you open the connection GUI for this processor, the same number will be highlighted to make connecting several items easier.
Moar stuff
- Keep the old logic blocks so as not to break people's old stuff. Besides, if I just want to OR together a few switches to hold one door open, I'd rather just plop down an OR signal rather than deal with a processor.
- Putting rail orientations or display block text inside a processor would be utterly amazing, but could be added later I guess...
- Optionally, allow naming ports instead of numbering them. In this case the name would appear in the scrollable connection GUI, highlighted with cyan for input or green for output.
- We will need a blueprint-like system for saving and sharing processor guts (including any named ports). This could make complex logic more accessible to the community.
- How about a new block with several buttons on it? Or a touch-screen display module? Something besides meter-wide buttons and switches?
- Processors within processors? They'd be limited by the number of inputs and outputs on a single block, but it'd still be amazingly epic. You could theoretically build a computer in one block.
- Anti-lag measures: make logic run on a low-priority thread in the server. If done properly, lag bombs will be completely ineffective at disrupting anything but other logic. Also add admin warnings about entities that cause logic lag.