Tutorial 190: Cicada

Joe Clay | Aug 23, 2019

I was working on some other ideas for this week's After Effects tutorial, and I wasn't really getting anywhere. So I took some time to do other things and just take a break. Wednesday morning, I was rowing and while I row, I watch videos on YouTube. Great Big Story just published an excellent documentary series on Cicada 3301, so I was watching the last two episodes and I thought their graphic treatment was interesting.

I've been a fan of Cicada 3301 and puzzles like that in general. When I was a lot younger, I discovered notpron and spent a while going through it. I never finished it because I didn't have the time, though I should probably go back to it. But ciphers, steganography, etc. have always been really intriguing to me.

So, combining that with my love of Albert Omoss' work on the FITC Tokyo 2015 titles I quickly thought of a way to build a stupidly simple L-system-ish expression to make generative lines. We randomly choose directions and lengths, and draw points at 90 degree angles. So we end up with interesting paths, almost like a 2D version of the old pipes screensaver!

Taking those paths and combining them with shape modifiers we can make all sorts of things—lines, boxes, paths for movement, etc. You could even take these and use other modifiers like twist to get really odd looks and movement. This technique renders pretty quickly too. Our example is a little slow, but it has camera blurs, grading, and more so keep that in mind!

Have fun experimenting with this. I'm sure there's a lot more that can be done with this if you take the time to explore! Tweet us @workbench_tv if you make anything with this! And grab the Cicada drawing from aniszewskas here if you want to use it.

Expression Code

Make sure to add all of the slider controls necessary and rename them. We need Random Seed, Steps, Max Length, Stroke, Offset, and Completion sliders. The expression below should be applied to a path in a shape layer. Stroke, Offset, and Completion sliders are basically just pickwhipped to Stroke Width, an Offset modifier, and the End property of a Trim Paths modifier.

s = thisComp.layer("Controller").effect("Random Seed")("Slider");
n = thisComp.layer("Controller").effect("Steps")("Slider");
l = thisComp.layer("Controller").effect("Max Length")("Slider");

seedRandom(s, true);
var pts = [];
var x = y = 0;

for(i = 0; i < n; i++) {
    var d = Math.floor(random(l));
    var r = Math.floor(random(4));
    switch(r) {
        case 0:
            x += d;
        case 1:
            y += d;
        case 2:
            x -= d;
        case 3:
            y -= d;

createPath(pts, [], [], false);

Grab the Project Files

Get the project file through our Gumroad Store. This project file contains everything shown in the tutorial. It also includes other elements used in the thumbnail. The After Effects project was built in AE CC 2019 but a version was saved that will open in v14 (2017). It shouldn't have any issues with either expression engine, but JavaScript would be the faster engine to use if you're in a current version of AE. You might get a notice that you need a plugin or a font, but they aren't required to use this effect. They're mainly used for the thumbnail.

If you're buying project files, consider becoming a Patron. At the $5/mo. tier, you get access to project files as they come out and some tutorials also come with additional BTS content showing more of the builds.

Get the project on Gumroad

Become a Patron

If you'd like to help support Workbench, check out our Patreon page. Thank you for even considering clicking this link to support what we're doing. We appreciate it. Patrons get all sorts of benefits, from R&D files, setups, and elements to early product releases.

Check out our Patreon Today