Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Gear-Controlled Levers: A simple way to get mechanical logic to work in DF  (Read 1410 times)

Arkenstone

  • Bay Watcher
  • Perfect Clear Diamond
    • View Profile

I was thinking about the logic gates, how much a drain they are on FPS, and I thought that having a systen based entirely on mechanisms would work better.  I saw that mechanical logic is already good enough for OR and AND gates, and that a NOT gate is all that is needed to get to programming everything else.  My first idea was to have a 3x3 workshop-like transistor, but then I came up with a much more elegent solution:

Let gear assemblies hook up to levers.

That way, not only are NOT gates possible, but so are usable output signals for gates, bridges, et cetera.  It wouldn't require massive amounts of coding, I hope, and if it would be easier then a lever-like gear assembly could be used instead of levers.  For now, it would by necessity have infinite range; but it would be the first step towards more realistic traps as well, as Toady would only have to make it be adjecent to the gearbox it's deactivating in order to make it work.
« Last Edit: October 29, 2010, 05:30:11 pm by Arkenstone »
Logged

Quote from: Retro
Dwarven economics are still in the experimental stages. The humans have told them that they need to throw a lot of money around to get things going, but every time the dwarves try all they just end up with a bunch of coins lying all over the place.

The EPIC Dwarven Drinking Song of Many Names

Feel free to ask me any questions you have about logic/computing; I'm majoring in the topic.

thijser

  • Bay Watcher
  • You to cut down a tree in order to make an axe!
    • View Profile
Re: A SIMPLE WAY TO GET MECHANICAL LOGIC TO WORK IN DF
« Reply #1 on: October 29, 2010, 12:47:47 am »

Very good plan this way we could make many systems actually work.
Logged
I'm not a native English speaker. Feel free to point out grammar/spelling mistakes. This way I can learn better English.

cooky173

  • Bay Watcher
    • View Profile
Re: A SIMPLE WAY TO GET MECHANICAL LOGIC TO WORK IN DF
« Reply #2 on: October 29, 2010, 05:39:18 am »

Do you mean allow levers to control gears, or allow gears to control levers? I think the first one is already possible, although it has been a while since I've played.
Logged

Arkenstone

  • Bay Watcher
  • Perfect Clear Diamond
    • View Profile
Re: A SIMPLE WAY TO GET MECHANICAL LOGIC TO WORK IN DF
« Reply #3 on: October 29, 2010, 05:15:51 pm »

I mean gears to control levers; levers which can control gears thus making NOT gates possible without resorting to FPS-eating water pumps.
Logged

Quote from: Retro
Dwarven economics are still in the experimental stages. The humans have told them that they need to throw a lot of money around to get things going, but every time the dwarves try all they just end up with a bunch of coins lying all over the place.

The EPIC Dwarven Drinking Song of Many Names

Feel free to ask me any questions you have about logic/computing; I'm majoring in the topic.

Foehamster

  • Bay Watcher
  • Zig Frostrushes The Speachless Eater of Saints
    • View Profile
Re: A SIMPLE WAY TO GET MECHANICAL LOGIC TO WORK IN DF
« Reply #4 on: October 29, 2010, 05:17:22 pm »

The addition of a NOT mechanism gives us Turing complete mechanics. Currently we have OR gates, connect two powered gears to a third gear and if either is powered the output is powered(the non-working input is powered too, but that's OK.)

Right now we can hook up a lever or pressure plate to stop a powered gear assembly from transmitting power. And the currently we'd have to use a pump and pressure plate for automation.

Methinks the best method of implementation is to give gears a Q menu option of "Locked by gear" where you select one of the connected gears that when powered will deactivate the gear assembly. The connection would have to be mutual as the driver gear shouldn't power the lock gear, which will then lock the driver gear. Instead the lock gear when powered locks the driver gear, and the driver gear when powered locks the lock gear. Bah dumb, it has to be a directional and the driver simply cannot transfer power to its lock gear. If they locked each other out then the lock gear could never be powered to stop the flow.
« Last Edit: October 29, 2010, 05:24:33 pm by Foehamster »
Logged

Foehamster

  • Bay Watcher
  • Zig Frostrushes The Speachless Eater of Saints
    • View Profile
Re: A SIMPLE WAY TO GET MECHANICAL LOGIC TO WORK IN DF
« Reply #5 on: October 29, 2010, 05:22:15 pm »

Of course we run into problems if we set up a series of race conditions or something that oscillates. I guess using the 10step bridge method for switching is the best choice.
Logged

Arkenstone

  • Bay Watcher
  • Perfect Clear Diamond
    • View Profile

Hm, having oscilators would be "At your own risk".  But a compact water-based Repeater already exists, anyways.

Also, the only two gates we currently have that are gear-based are OR and AND, where and is several gears lined up in a row.  (It might technically be NOR through...)

Lastly, I need to clarify:  Gear-Levers will not transmit power of any kind, they just switch the lever like a dwarf would.
Logged

Quote from: Retro
Dwarven economics are still in the experimental stages. The humans have told them that they need to throw a lot of money around to get things going, but every time the dwarves try all they just end up with a bunch of coins lying all over the place.

The EPIC Dwarven Drinking Song of Many Names

Feel free to ask me any questions you have about logic/computing; I'm majoring in the topic.

Gamli

  • Bay Watcher
  • Will fight to the death over shiny black rock.
    • View Profile
Re: Gear-Controlled Levers: A simple way to get mechanical logic to work in DF
« Reply #7 on: November 29, 2010, 03:45:13 am »

This is just another one of those awesome ideas I could use.
Bravo.
Logged

TolyK

  • Bay Watcher
  • Nowan Ilfideme
    • View Profile
Re: Gear-Controlled Levers: A simple way to get mechanical logic to work in DF
« Reply #8 on: November 29, 2010, 11:42:17 am »

+1 to you if you mean:

G--->L
1      /
0      \

L--->G
1      /
0      \

(NOTE: \ and / are reverse, depending on initial state, so that you can actually connect devices to create either time delays or faraway linked items)
(NOTE: this should incorporate delay)
Logged
My Mafia Stats
just do whatevery tolyK and blame it as a bastard mod
Shakerag: Who are you personally suspicious of?
At this point?  TolyK.

Silverionmox

  • Bay Watcher
    • View Profile
Re: Gear-Controlled Levers: A simple way to get mechanical logic to work in DF
« Reply #9 on: November 29, 2010, 01:47:16 pm »

The gear assemblies might as well act as AND, OR, NOT. With the q menu one could change it (default OR?), a mechanic goes over there to rearrange the gears, et voila, it acts as desired. Then just connect however you like. Every gear assembly would have the appropriate ins and outs.

A similar option could be to change which sides are the inputs and which the output. That way you could build rooms full of gear assemblies to form a computer without needing linkages, that would be great and atmospheric. Goblins being crushed in the gears while calculating the number of -felsite mugs- in the DF world would just be an unfortunate coincidence.
Logged
Dwarf Fortress cured my savescumming.

Gamli

  • Bay Watcher
  • Will fight to the death over shiny black rock.
    • View Profile
Re: Gear-Controlled Levers: A simple way to get mechanical logic to work in DF
« Reply #10 on: November 29, 2010, 06:53:17 pm »

This brings to mind another useful feature: A pressure-plate that triggers based on the weight of items sitting on-top of it.

So Dwarves would be instructed to Move all felsite mugs to pressure plates A through Z and all the pressure plates that had more than Y felsite mugs sitting on-top of them would trigger while plates with less than Y felsite mugs would not trigger.
Logged