Tuesday, May 30, 2017

2014 Secret Santa: Mini puzzles

(Super late, but better super late than super never, right?)

For 2014, I decided to take a different approach. Since we had recently done several escape room games, I thought it would be fun to have some small puzzles to solve. The setup was much more simple than last year's, with a red tool box from the garage and a cheap dial combination padlock from my high school locker making up the bulk of the materials. I came up with a couple of friend-appropriate console gaming and UX themed puzzles, printed them out, and taped them in semi-hidden spots around the tool box to recreate the puzzle-hunting experience. Unfortunately, I didn't get any pictures of the un-solved box, so the text will have to do:

In the card:
Merry Christmas! Since you missed all of the times we did Escape From The Mysterious Room, Escape From The Bank Vault, Escape From The Moon Base, Escape From The Time Travel Lab, and Escape From The Auction House, I thought I would give you a small taste of the action with your secret santa present. Of course, this will be much easier than the real thing, but I want you to actually be able to open your gift.
On the bottom of the tool box:
The combination for the lock is:
XYR ZL  XXR
Sticking out from under the lid:
There are X lines in a hamburger menu icon
On the back of the lock:
P: 2   3   4
X: 0 360 Z

Put it all together for the combination of 30 right, 1 left, 33 right, and the lock opens!

I tried to keep the whole affair much more simple than last year, and it went well. I could have improved on having better presentation, since the tool box was a last minute find. On the plus side, the puzzles were easy enough to be solved quickly, but not trivial enough to require no thought at all, and the giftee had fun, so I'd say it was a success overall.

Thursday, January 23, 2014

Summary and Postmortem: My Ticking, "Exploding", Secret Santa Gift

Introduction 

Motivation

Last December, some of my friends had organized a Secret Santa gift exchange. Inspired by this great handmade game/gift, I wanted to push myself a little and put together a gift-opening experience that was hopefully as memorable as the gift itself. After a week or two of letting my mind wander and brainstorm, an idea suddenly crystallized in my mind during a particularly boring meeting: a box that was a Hollywood-style toy bomb to disarm, complete with wires to cut, an audible ticking timer, and a simulated explosion. A handmade mini arcade cabinet was outside of my level of handiness, but the traditional cardboard box form factor would be perfect. I already had an Arduino Uno and a servo motor, so most of the material costs were already covered. Over the next week, I finalized the design in my mind, keeping track of my thoughts with OneNote.

Engineering Design Specification

The giftee will receive a wrapped box which appears to be totally normal, with no protruding wires or noises. Unwrapping and opening it will reveal the first gift (something thin and flexible, like a t-shirt), resting on top of an inner, unwrapped box. Removing the first gift will reveal that the inner box has three wires protruding from the sides and wrapping around the top, inhibiting the opening of the top flap. Opening the outer box will also have caused the inner box to begin emitting a ticking noise. On top of the inner box will rest a pair of wire cutters. Cutting any two of the three wires will cause nothing to happen, hopefully leading the giftee to believe that the "bomb" has been defused. (Stopping the ticking noise at this point would help reinforce this belief, but likely not practically possible with a mechanical kitchen timer.) Upon cutting the third and final wire, the inner box will emit a loud banging or popping noise. At this point, the inner box may be opened to reveal the second gift, which will be accompanied by a pithy note.

Prototype

Figure 1: The guts of the inner box

Here's a short outline on the components and how they worked together:
  1. Green: Arduino Uno powered by 9V battery. This monitors two wire loops (orange and blue) and controls the servo (red). The Arduino helpfully allows digital input pins to be configured to use internal pull-up resistors, so the loops are simply from ground to an input pin.
  2. Orange: A 0.10" header is hot glued to the upper corner of the box, near the lid. A jumper is installed on the header and attached to the lid of the outer box so that when the outer box is opened, the jumper is removed and the loop is opened.
  3. Yellow: A standard mechanical kitchen timer, held in place by perforated steel tape screwed to the wooden base. (It's tricky to find a timer that actually ticks these days.) During set up, the timer is set so that the handle is horizontal and can be held in place so that the ticking stops.
  4. Red: A standard servo is mounted onto some wooden blocks with a wooden arm on top with a needle hot glued to the end. Initially, the arm is set over the timer handle. When the jumper (orange) is removed by the outer lid, the servo moves a bit so the timer is free to tick. When the outer wires (blue) are all cut, the servo moves a bit more and pops the balloon (purple) with the needle.
  5. Blue: Three colored wires soldered in parallel and running out the sides of the box. In order to be able to seal up the box, a separate wire runs out each side and they are soldered together unobtrusively near one side of the box.
  6. Purple: A standard party balloon from my local supermarket.
The code on the Arduino implemented a very simple state machine to move the servo to two preset positions: allowing the timer to tick, and popping the balloon.
Figure 2: Arduino state machine

 

Postmortem


What Went Wrong

  1. I found right before the box was sealed that, through the course of testing, moving the servo so much had drained my first 9V battery. I hastily added code after each servo move to disable the servo control, since it wouldn't have to actively hold its position, but in doing so, I introduced a bug where the servo was being constantly disabled while idle. This might have also shortened the battery lifespan, but I couldn't tell for sure.
  2. Using scotch tape to hold down the components inside was not good enough. While it was being wrapped, the box ended up being turned on its side, causing the Arduino to come lose, which pulled several pins out. 
  3. I didn't design the box to be accessible once it was closed, so the easiest way to fix the Arduino ended up being to cut one of the wires and slice open a flap in the lid. 

What Went Well

  1. Working with the Arduino was a breeze - total time spent writing software was about 10 minutes. I also learned about the internal pull-up resistor feature. 
  2. I was able to put the project together for extremely low cost. All of the wood was recycled from scrap, the perforated steel tape was a spare part, and I borrowed the kitchen timer. The only things I had to buy were the battery and the balloons.
  3. The reception was pretty positive overall, despite the flaws.

Now, I just need to make next year's gift even better. I already have some ideas, but they might require external power...

Thursday, August 15, 2013

Augmented Virtual Reality

One of the moments in recent gaming history that made the biggest impression on me was Heavy Rain's ARI, the Added Realty Interface.



When I read this Penny Arcade Report article about how the developers of City Quest implemented Oculus Rift support for their 2D game by creating a virtual basement for you to play it in, I was immediately impressed. Lots of developers are coming up with clever ways to use the Rift to create completely new and unique experiences, but I haven't seen much in the way of using the Rift to augment traditional gaming experiences. The Ibex Virtual Reality Desktop project is one such project, but it In City Quest's Rift edition, you can look around and see the computer the game is running on, decorations from 80s nerd culture, the doorway leading out of the room, and even hands (though lacking virtual arms) using the mouse and keyboard:



While the dev's reddit thread announcing this feature calls it the "silliest way they could think of" to implement support for the Rift, I believe that the concept of using the Rift to create virtual spaces where we can interact with augmented reality-style interfaces has a lot of potential.

With only a Rift, you're limited to a traditional form of input like keyboard/mouse or game controller. Of course, while wearing the Rift, when you look down, you see what's in the game, not what's on your desk. You're totally blind to where the real world keyboard is, or where the real world keys are on it. If you want to move your hand from the mouse to the keyboard or press a hard to access key like F10, you have to grope around and rely on your proprioceptive memory. However, if there were a way to project your real keyboard, mouse, and hands into the virtual space, those clumsy moments would be no worse than glancing down in real life.

3Gear Systems and Lead Motion are two of several companies that are already working on machine vision-based products that could be used to provide this solution. A camera looking down at your hands could conceivably be used to track not only the position of your hands, but the devices they interface with. I believe keyboard layouts are standardized enough - main large block of letters and numbers, function keys clustered in fours, etc - to be able to use the positions of the printed letters and some intelligence to automatically (or assisted with some guided manual calibration) produce a virtual representation of any given keyboard. Mice would be harder to represent accurately, since there are so many variations of mouse contours, button sizes, and side buttons that would be hard to precisely identify with an overhead camera. However, I believe the main difficulty with using a mouse with the Rift would be simply locating it with your hand, and so a simple representation (or perhaps one chosen from a selection of popular models) should suffice.

Once you're set up in your augmented reality Rift office, how could you take advantage of working in virtual reality? I have more ideas about that which this blog post is too narrow to contain.

Tuesday, August 6, 2013

Augmented VR brainstorming

"It’s easy to mess with someone who is in virtual reality, although doing so is borderline cruel. Anything that increases the dissonance between what the person inside is seeing and hearing from the game and the stimulus from the “real” world will be distracting, and in many cases disturbing.

If your brain thinks it’s in an underwater ship, why can you hear people faintly talking? You look behind yourself, but you see only the back of your vessel, although that’s where you hear the voices. Being touched is nearly intolerable for some people after they’ve settled into a virtual world; it is incredibly difficult to feel someone’s hands on your body when you look around and see no one around you."
Why not take advantage of the dissonance? These sound like amazingly immersive tools for a psychological horror game. It sounds a little impractical, but with something like second screen or tablet device relaying instructions to a partner (using a timer or a third person view to ensure the effects are synchronized with the game),  you could combine in-game effects with physical sensations at key dramatic moments. 

Imagine seeing an elderly groundskeeper get snatched away by something lurking in the darkness around the edge of your lodge, then later searching his deserted room, and suddenly feeling a gentle tap on the back of your shoulder - you turn around and he's standing there, as if having appeared from thin air, smiling and talking to you like nothing strange has happened since the start of the game. Your character could be walking and suddenly hear a visceral squelching sound while you feel a tugging on your real feet, only to look down and see that the carpet has been replaced by a writing mass of grabbing fleshy fingers. Or perhaps while running away from an otherworldly horror in-game, your partner could be lightly brushing or grabbing at the back of your shirt and pants...or even neck.

The partner would probably need to be careful and remain a safe distance away from the gamer while carrying these out.

Wednesday, October 3, 2012

Earlier today, I was wondering about the topology of sandwiches.

A simple open-face sandwich is essentially a two-dimensional sandwich - you have only the surface area of the single piece of bread to work with (most open-face sandwiches will pile toppings on toppings, but let's overlook this for now). If an open-face sandwich is the two-dimensional sandwich, it's not a stretch to consider the traditional sandwich to be a three-dimensional sandwich, since you use the volume between the two pieces of bread for your sandwich constituency.

What would happen if we were to extend the sandwich to a fourth dimension? It's been a while since I've read Flatland, so I can barely wrap my head around the concept. Would you have a sandwich that would change depending on what part of it is in our 3D space? A sandwich that you eat before you finish making it? A sandwich with another sandwich inside itself?