v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:Larix/MPL/5

From Dwarf Fortress Wiki
Jump to navigation Jump to search

5. Assessment of Minecart Pathing Logic. Strengths, weaknesses and peculiarities.[edit]

Benefits:

  • Minecart Pathing Logic can perform the basic logic operations, it can be used to store, write and read data, it allows building individually adressable memory banks, repeaters, counters and adders. It is a "complete" DF computing discipline. It needs no fluids, the ramp-based designs need no power, either, and the circuits have an aesthetic appeal - i find that they remind of electronic circuit plans. MPL circuits take signals as input and directly generate signals as output, needing no additional conversion steps. The circuits can be compartmentalised and walled off - they can keep functioning without maintenance and without the need for power or water supply lines.
  • Minecarts move at significant speeds, easily much higher than what a goblin can achieve and are "motivated" by simple acceleration and immediately present paths, not complicated "escape routes" that need to be opened and blocked regularly. Minecarts' movement is completely deterministic: as long as the entrance conditions into a circuit are the same, the output will be the same, regardless of minecart weight or material. ("Build order" can cause one-step differences for some reactions, but that's the case for all logic and should be largely irrelevant with the typical reaction delays of ten or more steps. I'm also assuming the use of "pure" MPL which doesn't include collisions as logical operations.)
  • A single minecart can "hold" more than one bit of information, all it requires is sufficient movement speed, so that it can re-visit each signal plate before it times out. In the case of powerless MPL, two or at most three bits of information on a single cart should be possible, although the latter would be difficult to "write" to. In powered applications, a single cart can hold one byte (eight bits) of information, probably even a few bits more.


Disadvantages:

  • On the downside, Minecart Pathing Logic is slow and "short-sighted": unlike mechanical logic, which transmits power through a gate or circuit instantly, or creature logic, where the "computing unit" will calculate its full path to a goal whenever it makes a pathing choice, minecarts take between six and twenty-five steps to react to the open/closed state of a hatch-switched ramp and only react to the conditions of the tile they currently occupy and the tile they try to enter. When faced with a four-input OR gate, power will instantly flow or not flow through a mechanical gate, a goblin will perform a pathing calculation and directly follow the path corresponding to the true/falseness of the logic condition. A minecart will have to check each input transmitter individually and sequentially, spending almost a hundred steps to determine that none of the four inputs are on.
  • Minecarts, especially when propelled by ramps, are inherently dangerous to any creature they might encounter. An unlucky hit to the face even by the lightest cart will instantly slay a dwarf. And dwarfs don't take the presence of a busy minecart track into account, they will try to collect stones from a pit and sometimes even path through a circuit on a hauling job. Minecart computing areas require special care to keep the dwarves out of harm's way.
  • Minecarts on closed circuits, kept in perpetual motion by ramps, generally do not stop by themselves. If any kind of maintenance or reconstruction is desired, the carts must be stopped first, preferably by track stops or similar "full-stop" buildings installed ahead of time. If you neglected to build such safeguards into your circuits, getting a cart to stop gets a lot harder. Throwing extra carts into the circuit only rarely puts a stop to misbehaving carts, the perpetual motion will usually be capable of keeping both carts going. The deconstruction-teleport bug can and will grab minecarts and can teleport them to the tile of the dwarf performing the deconstruction job; a moving minecart may move off the teleport target square, but the deconstruction worker will generally not be harmed.
  • In MPL, a cart can only hold a plate down by constantly moving across it. In most cases, carts will always be in motion, checking and re-checking the status of their inputs or keeping their connected output in the correct state. This can result in rather large numbers of minecarts moving around constantly, and this will put a strain on FPS. In active operation - when circuits get switched - the state changes of buildings will lower FPS much more. The latter is specifically only a disadvantage compared to mechanical logic, fluid and goblin logic should have the same "switching" issues.
  • Adressing multiple switches by unified commands requires much more in material and work than what mechanical logic can get away with: if you want to switch a dozen gear assemblies, you can run them all through a single power supply and build one connection to turn power at the root on or off. If you want to switch a dozen hatches by the same signal, you have to link every hatch individually, spending twenty-four mechanisms and the possibly very long time required for twelve linkage jobs.
  • Minecart Pathing Logic is very speed-sensitive. The acceleration gained in straight ramps can easily put carts past the derail threshold, which lets them ignore corners and further ramp openings. Even before derail speed is reached, the high exit speeds can slam carts into ceilings or let them jump over corners. Corner ramps in pits can cause diagonal movement, resulting in a wide variety of possible misfunctions. All presented circuits have been tested and proven functional in long-term operation, but they are the results of a long trial-and-error process. If you endeavour to design your own MPL circuits from scratch, be prepared for inexplicable failures and misbehaviour. Regulating speed and trajectories is a third of MPL, and another third is figuring out the actual reasons of errors and possible remedies.


Other Peculiarities:

  • MPL can conceivably also be performed by high-speed carts, propelled either by long downward ramps or impulse ramps. Due to their high speeds, dwarfs must be safely kept out of such circuits, most circuits must be surrounded completely by walls (because carts will derail and go flying off the course otherwise) and only doors and maybe raising bridges can really be used for switching. Carts can go at speeds of more than a full tile per game step, which lets them "teleport" past pressure plates they do not occupy at the end of a turn, failing to activate them. Even at such high speeds, they will still observe pathing obstacles like walls and closed doors instead of "teleporting" through them.
I have done very little work in that direction, but computing devices based on derail-switches have been built and have performed satisfactorily.
  • MPL as a full logic discipline only really makes sense if it's based on perpetual-motion carts - using the ramp acceleration bugs to provide speed without consuming power. As such, it is built on the abuse of a blatant bug in the game, making it a morally questionable discipline. Furthermore, if Toady gets around to fix ramps so that they behave in a more realistic manner, this kind of computing will be a thing of the past.
  • Powered minecarts can be used for signal generation, addition/incrementation, timing and data storage, but manipulating their paths is not really useful for constructing logic gates. It's generally simpler to use a mechanical logic gate and only use the minecart to generate the output signal.
  • Designing working logical devices often requires out-of-the-box thinking: a "full" memory cell should be read- and writeable, but in DF it may be better to build very simple memory cells and build the read-/write-logic in a completely separate device. My adder design doesn't consist of actual binary adders, it's a weird kind of incrementer with directly adressable bits.