Posted on Books

A terrible novel or two

In the challenging-myself-to-do-ridiculous-things-just-to-see-if-I-can category: in 2020 I wrote a novel in a month. It was so bad. So, so bad.

But that’s okay! The point wasn’t to write a good novel.

For one and a half to three hours a day (however long it took to reach ~1700 words), and right before bedtime, I sat at my computer frantically typing. I hated every moment of it, which is how you know a challenge is truly funny. The best jokes are the ones you play on yourself.

After all that, you’d think I’d have learned my lesson. But, no. Instead I roped a bunch of friends into a shared goal for 2021: writing another bad novel, but with a twist (there wasn’t much of a twist). I would do a bit more planning and try to make it slightly less terrible. Still bad though. That was important.

I finished it on my birthday (the eighteenth of April), which meant I accomplished the first part, if maybe not the second. But in stranger news, I’ve now written two novels in six months. Which is kind of neat!

They are very, very different.

Interestingly, I found I my wordcount didn’t seem to scale linearly with time when compared against last year – a thousand words a night in about an hour. So either I’ve become faster at spewing words, or there’s some cutoff point between the two where I slow down. I’d guess the latter.

Here is an excerpt from the beginning of the first book, unedited and honestly just untouched from when I first clickity-clacked it out all those months ago – maybe you’ll hate it! Weirdly, I don’t. It’s bad but I don’t hate it.

“Come here, boy.” My grandfather called from the doorway, his voice rough.  A silhouette against the dawn’s light.  He was a tall, weathered man, his height barely blunted by age.

It took him two steps to reach the hearth.  Even in shadow its embers were dull against the morning light.  He took up a stick and began to poke at them, coaxing what life he could.  

I could feel the twigs and leaves under the callowskin insulating me from the cold earth. I pushed myself to my feet shivering against the cold, and shuffled over to join him at the hearth as he tossed in another log and the air was flooded with dust and ash.

He knelt before me, his hands on my shoulders and his expression stern.

“Winter’s time is ending, and you know what that means.”

I looked at him blankly, sleep still dragging on my mind.  Not yet fully alert as is the privilege of one who knows he is safe.  My grandfather pursed his lips and shook his head ever so slightly.

“The assessment is in a fortnight.” 

I felt my eyes widen.  Two weeks.  The cabin softened; my grandfather’s face was no more than a blur before me as tears welled in my eyes.

“Easy, boy.” His voice was gruff and I could picture vividly the stern look that must have taken his warbling face.  “None of that, now.”

I suppressed a sniffle and rubbed my eyes with my palms.

“That’s two weeks to ensure you’re ready.”

I nodded to him, barely listening, not sure what to think and my mind thrashing for it.  He mistook the cause of my concern and smiled at me.

“You’ll catch someone’s eye, boy, we’ll see to it.  See to your chores and we’ll do some training.”  He nodded again, this time to himself.  And with that I staggered through the still open door, and out of the cabin.  Just two weeks until my life would change forever.

Thank you for accompanying me on this generic first-person, past-tense, in a fantasy world journey. That is all.

Posted on crafting

Bluetooth footpedal

My mother has a piano and a Microsoft Surface Pro. The former is good for playing songs while the latter is good for many, many things, including, but not limited to, playing songs. Also the display of sheet music for use with a piano. It would be perfect, really, if there was a way to change pages in a hands-free manner. One traditionally uses ones hands, you see, to piano.

I know what you’re thinking – there is! You can buy such things, but also you can make them.

To start with, I ordered an Adafruit Feather m0 Bluefruit LE from BC Robotics. After that it was a simple matter of wiring a few buttons up to it, and writing some code.

Once I had that figured out (or while I figured that out), I had to design a model to house it. And, you know, act as a foot pedal. Luckily, I have an awesome 3d printer so models can come to life in only ten to fifty hours, or so.

     

The buttons fit into those two holes, and as you apply pressure to the pedal in either direction it presses them. It’s powered by USB, which also charges a battery so it can continue to work should it be disconnected. Here it is assembled!

Posted on Programming

Gradient Vodka Soda

Gradient vodka soda is vodka soda with a novel twist – each bottle has a different amount of alcohol, allowing you to easily taper off your consumption through the night – which they call modern moderation. Check them out if you’re in the market for that sort of thing (and are of legal drinking age).

I programmed their teaser website, which had a bunch of interesting technical requirements. In this post I will go over a few of the more interesting tests I wrote. Most will work best if you have hardware acceleration enabled.

Rotating cans

The website revolves around a 3d can (see what I did there?). To accomplish this, I used, as I do given whatever excuses I can find, the programming language Haxe. And this time in particular, Heaps.

I got a 3d cylinder rotating, and applied a material to it. (It’s not really a cylinder, I made a model to account for the inset near the top.)

I ended up rendering each can to 2D, and positioning it that way. It made it easier to line everything up and prevented skewing from the camera’s perspective. This allowed the overlays to fit consistently. (The metal of the can, and the shadows on it are overlays.) The actual 3D can is just an ambiently lit label applied to the model.

But I couldn’t find an easy way to switch the labels on it; so I ended up writing a shader to do that. And so it went for so many more things –

But what if it was a shader?

I wrote a bunch of these to accomplish neat graphical effects. Heaps actually makes it pretty easy. Though, in most cases, I ended up moving away from the shader solutions to better support visitors without hardware acceleration enabled.

Ever moving blobs

The client wanted some subtle blobs floating around in the background, so I thought to myself, high on my recent shader successes, why not do it as a shader too?

I made a quick proof-of-concept, and it looked kind of neat, almost like a lava lamp. The blobs ended up getting cut in favour of a background video, which then also got cut.

Different sized dots

I tried dots a few different ways to see what which worked best. First I tested moving a small canvas with the mouse, and that worked fairly well. Unfortunately, requirements shifted so I tested drawing dots over a large canvas.

Performance wasn’t great, so I ended up using a small canvas to draw the dot at the appropriate size (the sizes change as you scroll), and used that as a pattern to fill in the larger, screen-sized, canvas.

That seemed to work fairly well, except that iOS apparently doesn’t send mouse events while scrolling, which interacts poorly when you’re making a scroll-based website.

Scroll-based flash animations

As you get to the bottom of the page, there is a box that the cans slide into. It was meant to close, spin around, and settle onto the ground, as you scrolled down. Unfortunately, we didn’t get the rotating box assets in time, so Sheldon amended the animation concept.

I figured it would be a pain to do in code, and animations are exactly the sort of thing Adobe Animate (formerly Flash) was made for. All I had to do was hack their JS to animation to progress through the timeline on vertical scroll rather than time. I wrote a quick proof of concept (and ran into a bunch of issues with more complicated, nested animations), but overall it worked really well.

So well that it got me wondering if that’s already a thing people do. If not, it seems perfect for this sort of website. Adobe should consider adding as an option to their JS output. Or maybe I should just release a library for it.

As an added bonus, using Adobe Animate let Sheldon prepare the animation himself, which meant less work for me!

There were so many problems

Most to do with different devices and browsers, and the different values between them. It took forever to track down and deal with these, but in most cases we managed to get the numbers to line up.

But one thing that kept cropping up was the matter of hardware acceleration.

I kept it turned off for my tests, but apparently some Macbooks have it enabled by default, but disable it when unplugged. This caused a number of surprises when people tested it, many to do with a feature I had implemented for just this purpose.

Framerate scaledown

All of these things going on could be quite a load on a slower system, at times making it painful to use. No matter what, I wanted the website to be useable – responsive design, but along the dimension of framerate rather than browser width.

To help with this, I implemented a system of framerate scaledown. Basically, the browser would check your framerate, and if it was too low too many times, it progressively disabled features.

I was pretty happy with this system. In a lot of cases it would just turn off interactions (remove the background video, make the dots non-responsive to mouse position, etc.). It worked really well, but in conjunction with the above it lead to some confusion. Sometimes the dots resizing under your mouse would work, and sometimes they wouldn’t (they wouldn’t work if they’d been disabled).

If you want to checkout the website, you can find it at drinkgradient.com

Posted on Art

Percy Animé

March 2020 will forever be remember by the world for at least one thing: the introduction of Percy Animé – inquisitive rogue; catman; avid journaler. Alignment: neutral, to avoid scientific bias.

Coincidentally it’s also when I joined a D&D campaign.

But who is Percy Animé?

As a kitten Percy was “adopted” by a hag. And though he eventually escaped, he is still haunted by his time with her.

To learn more about him, we need only inspect these few pages from his journal that I found, torn and stained, in a dusty alley somewhere in the dank side of Waterdeep:

Percy clicked the last ring into place and the whole thing came apart in his hands. Huh. Simpler than I expected, he thought. The rough stone at his back dug its way into his awareness as he absently reassembled the puzzle. He pushed himself off the wall and was midway through tossing it into the depths of the alley when the most intriguing thing caught his eye. 

A group of ne’er-do-wells entering a tavern, artfully painted with the filth of hard travel. There were five of them, mixed in amongst the rabble.  All strangers from the looks of it, apart from two. Those two looked similar enough to be brothers, though it’s difficult to tell with half-dragons. 

What were they doing in Water Deep, he wondered. What were they up to? 

Percy smiled, ever so slightly. An astute observer might have just glimpsed his needle-sharp teeth. 

What was a self-respecting tabaxi to do, but investigate further?

Slipping into the tavern, he edged along the wall as he took in its layout. The group of ne’er-do-wells stood facing one of their number, a human female, whose back was to the bar.  Integrating into the group was as simple as weaving his way through the common-folk, caught up in their own lives. Planting himself just close enough, and just far enough away, for it to be ambiguous as to if he were with them or not.  He focused on the female human as she began to speak.

“Introductions are in order.” She paused. “I am Zelinas Havellyn, member of the Knights of the Shield.  We specialize in legal services. And debt collection.” 

She raised her voice noticeably, presumably so as to carry to the rest of the tavern’s occupants. “So if you’re looking for legal services, look no further than the Knights of the Shield.”

“Now, if you would please tell me a little about yourselves.” She nodded to one of the towering half-dragons.

“My name is Sasuto, practitioner of the blade.  It is all I have in this life.” He had two, in fact.  Along with horns, and red scales which glinted despite the tavern’s glooms.  

The matching half-dragon, but for a third sword and deep, black scales, sighed.  He finished the drink in his hand and spoke next.

“I am Roronoa, master of the blade.  Sasuto is my brother.” He grumbled.

Brothers. He’d never doubted it.

“Hi! My name is Chadley and I’m an acolyte of Semuan.” Wide-eyed and with a cheerful grin, he looked to be half-elven. Or perhaps a dainty human.

The last of them – a firbolg – rumbled, “I am Gygg. Druid of the spores.” 

“Anyone else?” Zelinas asked, looking directly at Percy.

“Umm..” I should have seen this coming. Surely they’d see through his deception and mark him as the imposter he was. Surely. And then he’d have to injure one of them and flee.  Perhaps Chadley, he looked feeble. 

Percy’s mind briefly caught up in plans and contingencies, none of them ideal. There was nothing for it. He had to double down and hope they hadn’t noticed the interminable pause.

“Yes, it is I! Percy Animé. Famed catman of diverse interests and great skill.” He nodded to each of his presumed companions in turn.

Zelinas nodded back, and Percy let out a nearly audible sigh of relief.  He hadn’t truly expected that to work.

— Percy Animé’s private journal

I’m sure there must be more, hidden away somewhere. He’s reported to be a cagey cat. Perhaps it’s buried, or knowing Percy, he probably zagged, storing somewhere no one would expect. What’s the opposite of buried? No. There’s no way it could be in a cloud. Are there spells for that?

Just how handsome is he?

In short, very. There are no known pictures of Percy Animé, so I took it upon myself to render a portrait of him in exacting detail, through the art of digital painting.

Percy Animé

It looks a little washed out, printed on canvas. But now his portrait hangs behind me, in an elaborate wooden frame of custom make.

I went over it with modpodge to give it the texture of brush strokes.

What has become of him?

Unfortunately there have been few sightings of Percy Animé since his time in Borovia; we only know that he left it alive, and well, if somewhat changed by his experiences there. Strangely however, there was a sighting of someone going by a similar name (Persy Von Catsing). This “Persy” looks suspiciously like Percy, but younger. He is a bard, or so I’m told.

If this seems strange and confusing, I was right there with you, but then I began to think. What if Percy isn’t tethered by time and space in the usual manner? What if he isn’t weighted down by them as we are?

I started doing some research and I found an ancient document, of reputable source, that may explain it (which I’ve reproduced it here).

It describes, at a high level, a background which takes another as its parameter. What if there are multiple versions of Percy Animé, free of the constraints of time and space. What if there are many Percy’s, but only one will prove suitable to be the Percy Animé.

What if he is the Schrödinger Cat.

Posted on Travel

Whew 2020 was a busy year!

And I didn’t post a single time during it. But it wasn’t because nothing happened—things happened! So many things that I didn’t feel comfortable setting aside the time to stop and blog.

I got back from a month in Europe, which was really cool and, it turns out, convenient. Europe is neat, and I lucked out in a lot of ways. Traveling is fun, but the actual process of traveling itself is kind of grueling, especially when you’re tall. I haven’t really left my apartment in almost a year now, and I’ve found that I don’t really mind it. But maybe that’s just because I’ve been too busy to really notice.

As loyal readers (hey, that’s me!) will surely know, I do computer programming, and in 2020 I was successfully lured into accepting a job – I’m an employee for the first time in twelve years – and it’s been interesting and strange. To think that this is what it’s like for people, getting paid on a set and immobile schedule.

My Snapmaker 2.0 arrived, and it is awesome. I’ve used it to 3D print some things, and done some CNCing. I haven’t tested the laser cutter yet.

As you also know, I am prone to challenging myself to do ridiculous things just to see if I can, and in most cases, stubbornly following through. To that end, I wrote a terrible novel in a month. It wasn’t enjoyable, forcing myself to spew out ~1700 words a day, but it turns out doing things poorly is isn’t as difficult as you might think.

I started listening to Spout Lore, a podcast. Which makes me an official podcaster. Or a podcastee. Or a podcatcher. I don’t know how it works; whichever one listens to podcasts. I also wrote a Spout Lore fanfic, and made a new website for them. Check it out if you like cool podcasts.

I programmed the website for a neat Vodka Soda company, which had some interesting technical challenges that I’d like to break down at some point. It was designed by Sheldon Rennie, who is a cool designer that you should use if you need cool designs.

I joined a D&D game that lasted like nine months. It just ended. For the first few, after each session, I wrote out what happened from my character’s perspective. I stopped doing that somewhere around 45,000 words, but I would like to tell you a bit more about him if only so I can use it as easy reference. A new campaign is starting soon.

There’s a bunch of work stuff that I can’t really talk about, but I also got a pull request accepted into Apache Superset. Now you can do RLS (row level security) with it!

Yeah I’ve been to Edinburgh so what
Posted on Programming

Don’t Starve Together – crafting tool, revisited

I haven’t played Klei’s Don’t Starve Together in quite a while, but there was an update recently which got me thinking about my DST crafting tool. With all the new additions, my data’s bound to be out of date. And even if I update it, that doesn’t really solve the problem, only delay it until the next update.

With my Conan Exiles data tool, I pulled the data directly from the game files – which I could access thanks to their modding support efforts.

Don’t Starve Together supports modding. I’ve even made mods for it. Could I do something similar there? Could I retrieve the data directly from the game files?

If I could, that’d sure help solve the issue.

Turns out I could.

Don’t Starve Together stores its data in Lua, XML, and Tex files, packaged into zip archives. So it’s not overly difficult to read the data from those files. It’s slightly more difficult to extract it in a usable format – many of the definitions reference (and arithmetically modify) other definitions.

But now I have a script for that.

So next time there’s an update, I should just be able to run that script to refresh my data. Here’s hoping.

Also, here’s a link to my don’t starve together helper tool.

It should be pretty intuitive, but click on the ? Icon for further usage instructions in any of the sections. There’s some neat stuff in there. I integrated Logipar into it.

The first two tabs (What can I make, and What do I need) should be fairly helpful. I used them a lot in their previous incarnation. The third (Recipes) less so.

I’m not clear on how the Recipes section should work, yet. Or what it should be. So I just threw something quick up, in the hope that it would help toward figuring out where it should go.