Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [CALL for ENGRAVINGS] Locksmithing challenge  (Read 6532 times)

taptap

  • Bay Watcher
    • View Profile
[CALL for ENGRAVINGS] Locksmithing challenge
« on: July 07, 2015, 06:02:48 am »

Dwarves have for a while mastered the art of building dwarven combination locks. In memory of Iton Fikodesis, engineer of Subtlehammers, who drowned in a tragic accident recently, the dwarves of Subtlehammers send a call for engravings to all dwarves in hillocks and mountainhomes to go the next step in dwarven locksmithing.

The treason-safe combination lock (i.e. one with a changeable passphrase/sequence).

The winning design will be the easiest to implement, working design, that the current chief engineer in Subtlehammers can still understand.
« Last Edit: July 07, 2015, 11:04:10 am by taptap »
Logged

Larix

  • Bay Watcher
    • View Profile
Re: [CALL for ENGRAVINGS] Locksmithing challenge
« Reply #1 on: July 07, 2015, 03:27:31 pm »

The easiest to implement basic concept would be the simple "binary combination" mechanism i presented in the last post of that thread: the success/failure rides on whether a pump/roller is powered. And it can only be powered if all assemblies in a chain of gear assemblies are engaged. With gear toggling rules, you can enable any combination you want, and you can switch to other "PIN"s by toggling a number of the assemblies, e.g. by another lever.

Obviously, you need to build some more machinery to actually turn this into a lock: an additional "test" device that must be switched on to actually test whether the correct combination was entered.

The basic concept allows for 2^(number of switchable gears) combinations.

A lock that requires e.g. pulling a number of levers in the correct order is harder to build but can give more combinations - i think it's at least the factorial of the number of levers, which offers more combinations when using four or more levers; a model that'd allow "changing the lock" would be _pretty_ tricky.
Logged

taptap

  • Bay Watcher
    • View Profile
Re: [CALL for ENGRAVINGS] Locksmithing challenge
« Reply #2 on: July 08, 2015, 09:10:59 am »

I found ravendarksky's setup for fixed sequence very clever. Generally speaking it is a set of lever-operated edge detectors working a set of S/R-latches with a link to one SET and all "lower ranked" RESETs, thus enforcing the sequence (at the cost of plenty of mechanisms). The evalution is through a line of gears* working a combined AND/NAND gate. The edge detectors and latches can be easily done in fluid logic, as well, with a smaller footprint than the minecart-based original. (only door plate door for edge detectors and latches)

This line of gears, with pre-toggling as needed, is already the basic binary combination lock, you are right, this is almost too easy. Afaik, some irl digital combination locks work that way that you just can type in numbers until you hit the combination/sequence without any separate "EVALUATE NOW" functionality. Of course you do need that, when you want to have consequences from fails / NAND results. But this is easy - it can be a suitable color-coded "EVALUATE NOW" lever working a combined AND/NAND gate like in ravendarksky's design. When a traitor leaves the fort / a kid knowing the combination is kidnapped you can just change the pre-toggle pattern. Similar binary combinations could be built in other disciplines, but this is a pointless waste of space / resources when pre-toggled gears are so easy. A 5x5 array of levers allows a sufficient number of combinations already.

So, the principle problem is already solved. (24 masterwork obsidian mechanisms are on the way, Larix.) Can we do "changing sequence locks", as well? (I have an idea, but need time experimenting.)

Ravendarksky

  • Bay Watcher
    • View Profile
    • DFMon.exe - Get rid of DF SPAM
Re: [CALL for ENGRAVINGS] Locksmithing challenge
« Reply #3 on: July 09, 2015, 11:24:15 am »

*deleted*.

I think I can do this! I just need to refresh myself on my old design and check if its setting the machines to off or toggling their status when levers are pulled.

OK so I've not managed to come up with a design yet, but I've managed to get one which has multiple combinations to solve where the solvable combinations number is always equal to the number of leavers in the trap (4 levers, 16 permutations, 4 solutions, 5 levers, 32 permutations 5 solutions, etc)
« Last Edit: July 10, 2015, 03:24:07 am by Ravendarksky »
Logged

Ravendarksky

  • Bay Watcher
    • View Profile
    • DFMon.exe - Get rid of DF SPAM
Re: [CALL for ENGRAVINGS] Locksmithing challenge
« Reply #4 on: July 13, 2015, 04:34:33 am »

So I was attempting to design a logic circuit where each starting state had one and only one solve state for X inputs. This way my original design could be used with a programmable start state (Needs to be programmable so you can reset it!).

However I've failed -_-. The best circuit I've had time to come up with has two solutions for each starting state. Also sadly they are always the same two solutions so this is useless!

Now it is DEFINITELY possible to build this, I just can't remember my Higher Tech studies notes from 12 years ago well enough to do so.

ANYWAY I decided to "cheat" and come up with a less elegant solution.
~~~~~~~~~~~~~~~~~~~~~
Programmable lock:

Advantages:
- It works and is pretty easy to build
- Relatively easy to add in more levers later.

Disadvantages:
- As the number of levers used increases the lock gets more and more complex and takes up more and more space.

In my previous lock each switch (using a four lever example here for simplicities sake) moves a minecart over a pressure plate which either toggles
#ABCD
One1000
Twox100
Threexx10
Fourxxx1

For ease of discussion we will call each of these a "Pin". You must activate Pin 1 then 2 then 3 then 4. In other words the order is fixed.

To make this order programmable all I had to do was make each Pin have four routes and control these routes to make sure that each pin takes a different route from the other three.

So now I have:

Pin 1:
Route 1 : 1,0,0,0
Route 2: x,1,0,0
Route 3: x,x,1,0
Route 4: x,x,x,1

Pin 2:
Route 1 : x,1,0,0
Route 2: 1,0,0,0
Route 3: x,x,1,0
Route 4: x,x,x,1

Pin 3:
Route 1 : 1,0,0,0
Route 2: x,x,1,0
Route 3: x,1,0,0
Route 4: x,x,x,1

Pin 4:
Route 1 : 1,0,0,0
Route 2: x,1,0,0
Route 3: x,x,x,1
Route 4: x,x,1,0

So now you can see the solutions:
Route 1: 1,2,3,4
Route 2: 2,1,3,4
Route 3; 1,3,2,4
Route 4: 1,2,4,3

You can add more route combinations to make more solutions possible. For a four "pin" lock you could have 16 different solutions but you'd spend quite some time getting the routing set-up to make sure you never had two "pins" taking the same route.

So why is this cheating?
Well to my mind it feels like I've just designed a way of efficiently turning one lock into four locks, as you have to add routing for each extra programmable solution you want.

The true solution is to be able to take any combination of start order and have only one unique output for a series of logic. Then you can make it programmable by simply changing what the start input is.

I've written some c# code for testing solutions if anyone wants to see what they can come up with. This is a lazy approach though, the best way to do it is with paper, pen and an understanding of logic circuits. (From memory you draw a line for each input then add a series of logic gates until you get each desired output and then simplify your design by grouping things together into NAND gates)
Spoiler (click to show/hide)
Logged

taptap

  • Bay Watcher
    • View Profile
Re: [CALL for ENGRAVINGS] Locksmithing challenge
« Reply #5 on: November 23, 2015, 10:58:32 am »

I was experimenting with minecart collisions (with one minecart static) a little. I noticed there are elastic and inelastic collisions depending on the weight of the minecarts, this offers a new solution for locks!

A "minecart collision" lock (using sequence of lever pulls) links levers to different weight minecarts (i.e. hatches said minecarts stand on), that get released into a "memory" line. When all levers have been pulled and the evaluation line is filled with one of each type of minecart another minecart can be collided into it. Only when minecarts are sorted by weight will the last minecart go at maximum velocity and reach furthest in an evaluation track (i.e. a suitable set pressure plate unlocking the treasure vault), otherwise velocity will be smaller and the pressure plate will not be reached.

PRO
The pass-sequence is changeable (by rearranging the minecart setup).
The amount of mechanisms required is very small by comparison (2n+2 for n! combinations),

CON
It needs calibrating.
It is limited in the maximum amount of levers it can operate.
It does not really allow for second attempts (or requires labour or far more machinery to do so).