Crystal Game: Substitution “Cipher” Challenge

One of the remote site challenges game players will be required to complete is the answering of an easy riddle, presented as audio. However, they’ll be required to answer in a “cipher”. For example, the answer to the riddle “What do you seek?” would be “magic”. There will be a sort of keyboard present to allow the players to input their answer but the keys themselves will be cipher keys. Below is a prototype of the “A” key in “cipher”-glyph form, sitting atop a small flashlight:

“A” cipher-glyph button, illuminated from below

There will be a sort of Rosetta Stone near the central portal site that will enable players to figure out which “cipher” glyph corresponds to which English letter. There won’t be any explicit instructions saying that the Rosetta Stone contains the “key” needed to type on the keyboard. Figuring that out is part of the challenge. (Possibly, as 2nd clue, the keys could arranged in a QWERTY layout. Not sure if that is needed.)

As an aside, the reason I’ve enclosed the word cipher in quotes everywhere I used it is that, from a game-creation point of view the act of applying the “cipher” to an English message boils down to typing the message in English and then applying the font named “Lovecraft’s Diary” to the message text. Its not meant to be a hard cipher. This is targeted at kids and this is one of several challenges we expect them to complete in about an hour.

The creation of the prototype presented some interesting challenges, however. I normally create my 3D geometry files in FreeCAD. FreeCAD is able to take the Lovecraft’s Diary TrueType Font file, type text using that font, and then extrude those letters into 3D shapes that can printed. However, I needed something just a bit more from FreeCAD and discovered I absolutely could not get that extra bit just using FreeCAD.

The prototype pictured above consists of the “A” glyph printed in clear PLA and a black PLA cylinder with the “A” glyph removed. However, when fitting two complementary 3D shapes like this together, one needs to create a little bit of void space between the parts to provide a tolerance to variations in the actual dimension of the 3D printed parts. All sort of things go into those variations: belt tension, printing speed, plastic shrinkage, and the list goes on. However, I find that designing in about 0.2mm of extra void space between fitted parts generally results in parts that fit together well.

My first notion of how to create that void space was to scale up a copy of the glyph being used to create the glyph-void in the black cylinder. FreeCAD could do that easily enough, but when I went to center the scaled-up glpyh over the regular size glyph, I quickly discovered the conceptual problem with my notion. It was impossible to arrange the two glyphs so that the larger glyph’s outline was outside the smaller glyph’s outline in every place. Scaling was not the operation I needed. In fact outlining, with an offset, was what was needed. FreeCAD has multiple outlining tools scattered across different workbenches, but none of them could handle this font. I researched and tried for a good length of time before giving up in despair. Finally, it dawned on me that what I wanted to do was fundamentally a 2D operation that another 2D specialty tool might do better.

Inkscape showing the glyph and an offset outline of the glyph

Inkscape to the rescue! I plopped my letter “A” into Inkscape, changed the font to Lovecraft’s Diary, and rocked the size up to 64pt. With a little research and trial and error, I discovered that the procedure is to convert the SVG text element to a path by using the Path | Object to Path menu option. This actually resulted in a group that contained the path, so the second operation was to ungroup that group. With the path selected, I removed the fill and changed the stroke to be 0.001mm. This got me a hairline outline of the glyph like the inner outline in the photo above. Next I selected Path | Path Effects… from the pull down menus. This opened the Path Effects side bar. At the bottom of the side bar I found a “+” button that allowed me to select the “Offset” effect from a gird of effects. Once selected, that Offset effect showed up in the sidebar of Path Effects and there I was able to adjust the amount of the offset to that 0.2mm I mentioned earlier. The offset outline of the glyph appeared!

Next, I saved the SVG file and switched back over to FreeCAD. I hit File | Import.., selected the SVG file, and then, in the pop-up dialog I selected SVG as geometry. This got me both the original and the offset path, as shapes in FreeCAD. I extruded both and used the larger one as the void and the smaller one as the positive shape. They fit together great and I now have a reasonable workflow to create the rest of the letters. I’m pretty excited with the result!

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *