XXX

fuzzy notepad

Blog

Page 12
Atom feed

[process] Converting a Git repo from tabs to spaces

This post is about the thing in the title.

I used to work for Yelp. For historical reasons — probably “the initial developers preferred it” — their mostly-Python codebase had always been indented with tabs. That’s in stark contrast to the vast majority of the Python ecosystem, which generally uses the standard library’s style guide recommendation of four spaces. The presence of tabs caused occasional minor headaches and grumbles among the Python developers, who now numbered in the dozens and were generally used to spaces.

At the end of 2013, I bestowed Yelp with a Christmas gift: I converted their entire primary codebase from tabs to four spaces. On the off chance anyone else ever wants to do the same, here’s how I did it. Probably. I mean, it’s been two and a half years, but I wrote most of this at the time, so it should be correct.

Please note: I do not care what you think about tabs versus spaces. That’s for a different post! I no longer work for Yelp, anyway — so as compelling as your argument may be, I can no longer undo what I have done.

[articles] Extracting music from the PICO-8

Update 2016-07-27: PICO-8 0.1.8 supports music export — export "foo%d.wav" while the music tab is selected in the editor!

Our PICO-8 game, Under Construction, contains some music that Mel composed.

The PICO-8 can only play music that you compose with the PICO-8, and it doesn’t have a music export. This posed a slight problem.

I solved that problem, and learned some things about audio along the way. None of this will be news to anyone who’s worked with sound before, but if you know as little about it as I do, you might find it as interesting as I did.

[dev] Weekly roundup: Triple Monday

Howdy, stranger.

May’s theme is clearing my pl— sorry, scratch that, May’s theme is completely out the window. I spent two and a half weeks working on virtually nothing but a PICO-8 game with Mel. Oops.

The upshot is that… we made a game, Under Construction! I’ve never released a serious, complete, independent game before. Neat. Here’s hoping I do more of that.

A couple of other things happened.

  • art: I drew a, uh, Leafeon/Braixen hybrid. I also drew an Eevee sprite for the credits in Under Construction.

  • doom: I tinkered a bit when very exhausted with working on UC. I think I only really made a little progress on the pain elemental variant, and rigged ammo to drop smaller ammo if you didn’t need all of it.

  • blog: I wrote about making Under Construction and what it was like to work with the PICO-8. I also wrote most of an extremely ambitious Perlin noise post (with interactive gizmos!), which I just finished earlier today.

I still have some obligations left for this month, like one more post (up to four now! augh!), and then next month I can finally spend clearing my plate.

Except.

Something looms on the horizon.

Is that…

Could it be…

Oh no.

DUMP 3 was announced

[articles] Perlin noise

I used Perlin noise for the fog effect and title screen in Under Construction. I tweeted about my efforts to speed it up, and several people replied either confused about how Perlin noise works or not clear on what it actually is.

I admit I only (somewhat) understand Perlin noise in the first place because I’ve implemented it before, for flax, and that took several days of poring over half a dozen clumsy explanations that were more interested in showing off tech demos than actually explaining what was going on. The few helpful resources I found were often wrong, and left me with no real intuitive grasp of how and why it works.

Here’s the post I wish I could’ve read in the first place.

[updates] Under Construction, our PICO-8 game

Mel and I made a game!

We’d wanted to a small game together for a while. Last month’s post about embedding Lua reminded me of the existence of the PICO-8, a “fantasy console” with 8-bit-ish limitations and built-in editing tools. Both of us have a bad habit of letting ambitions spiral way out of control, so “built-in limitations” sounded pretty good to me. I bought the console ($15, or free with the $20 Voxatron alpha) on a whim and started tinkering with it.

The result: Under Construction!

pico-8 cartridge

You can play in your very own web browser, assuming you have a keyboard. Also, that image is the actual cartridge, which you can save and play directly if you happen to have PICO-8. It’s also in the PICO-8 BBS.

(A couple people using Chrome on OS X have reported a very early crash, which seems to be a bug outside of my control. Safari works, and merely restarting Chrome has fixed it for at least one person.)

I don’t have too much to say about the game itself; hopefully, it speaks for itself. If not, there’s a little more on its Floraverse post.

I do have some things to say about making it. Also I am really, really tired, so apologies if this is even more meandering than usual.

[dev] Weekly roundup: clearing my plate

May’s theme is clearing my plate. I have a lot of small-to-medium-sized stuff I’ve been intending to do for a while, and the sheer number of things is getting a little overwhelming. A lengthy todo list starts to get stressful; it feels like constant looming noise in my head. I want to spend this month getting as much of it as possible out of the way.

  • gamedev: I have vastly improved EeveeQuest™, my dink-around non-game for the PICO-8. From where it started last Saturday, it’s grown momentum, friction, gravity, collision, sound effects, background music (basically my first try at music!), scrolling, a HUD, and some evolution stones. The PICO-8 is super adorable, by the way.

    Also, Mel decided we’re making a game, so I’ve been adapting it to fit a map they’ve been designing.

  • blog: I rewrote the list of work I’ve done to be less, uh, unreadable garbage. I also set up subdomains c.ee.vee for hosting hostable work, and t.ee.vee for maybe eventually hosting cat photos and the like. I think these are pretty clever.

    I also wrote about what it’s been like trying to learn to draw.

  • pokémon: I’m still working on a Pokémon Showdown client for Patreon reasons; I got a bit sidetracked trying to make urwid and asyncio play well together, but I’m well on my way to having a usable API.

  • art: Lotta doodling. Appropriately, I think I’ve gotten a lot better in the last month or so.

  • doom: I made most of a horrible, horrible pain elemental variant that everyone will hate.

  • irl: I got Anise microchipped, so finally my cat is a cyborg. He is better, faster, stronger, and far more mischievous than any pure cat. His cybernetic enhancements have already enabled him to drive me up the fucking wall far more efficiently today than ever before.

  • Runed Awakening: In a stroke of inspiration, I figured out a way to connect a puzzle with no reward to a puzzle with no solution. I’m really happy with the shape the game is taking, even if there’s still infinity work left to do.

This week, I would like to finish the PICO-8 game with Mel, write another two posts, finish some of the art I’ve left hanging, finish this Showdown work, and make at least three significant improvements to Runed Awakening. Christ, I’d better get started.

[process] Learning to draw, learning to learn

On January 1, 2015, I started learning to draw.

I’d made a couple brief attempts before, but nothing very serious. I’d eyeballed some official Pokémon artwork on two occasions, and that was pretty much it. I’d been dating an artist for seven years and had been surrounded by artist friends for nearly half my life, but I’d never taken a real crack at it myself.

On some level, I didn’t believe I could. It seemed so far outside the range of things I was already any good at. I’m into programming and math and computers and puzzles; aesthetics are way on the opposite end of a spectrum that only exists inside my head. Is it possible to bridge that huge, imaginary gap? Is it even allowed? (Spoilers: totally.)

In the ensuing sixteen months, a lot of people have — repeatedly — expressed surprise at how fast I’ve improved. I’ve then — repeatedly — expressed surprise at this surprise, because I don’t feel like I’m doing anything particularly special. I don’t have any yardstick for measuring artistic improvement speed; the artists I’ve known have always been drawing for years by the time I first met them. Plenty of people start drawing in childhood; not so many start at 27.

On the other hand, I do have 15 years’ experience of being alright at a thing. I suspect, in that time, I’ve picked up a different kind of skill that’s undervalued, invaluable, and conspicuously lacking from any curriculum: how to learn!

I don’t claim to be great at art, or even necessarily great at learning, but here are some things I’ve noticed myself doing. I hope that writing this down will, at the very least, help me turn it into a more deliberate and efficient process — rather than the bumbling accident it’s been so far.

[dev] Weekly roundup: mad dash

April’s theme was finish Runed Awakening, which I definitely did not do, but I am way further along than I was a month ago. Maybe by the end of May? I don’t want to set a hard deadline when I have no real way to estimate how much work is left, but I don’t want to lose this momentum, either. I’ll keep y’all posted. Hopefully by the end of this week I’ll have made a significant dent in some combination of Runed Awakening and May blogging.

  • Runed Awakening: Implemented padlocks, woohoo. Did some more high-level planning; getting pretty close to a cohesive whole here, at least in theory. Drew a couple more pixel items. Then, uh, kinda didn’t touch it again for most of the week because I had Patreon obligations to take care of, oops.

  • blog: I wrote about dozenal and using Lua for game development, which somehow turned into a dissection of how to embed Lua and Python.

  • art: I spent a couple days drawing after not really doing so much of it for the last few weeks, resulting in some cat complaints, some cat revenge, and my finishing this ancient art trade. At which point two more people asked to trade, sob.

    Also touched up my avatar for May.

  • doom: So there’s a texture pack (Community Chest 4) that was really popular among DUMP 2 mappers, but it’s some 13MB. A good chunk of it is just translations or color substitutions of vanilla textures, which is something ZDoom can already express with a human-readable text format, so I started writing a script to detect and convert as many of these as possible. It turned out to be harder than I was expecting and I kinda bailed halfway through. This is very fascinating, I’m sure.

    I did also poke at anachrony a bit; still trying to settle on a set of weapons/items/monsters so I can actually go build some maps when I have the urge.

  • tech: A friend lost some data from a web-based shop thing and I magicked it back into existence because I’m actually a witch IRL.

  • gamedev: Having admitted I’d never tried PICO-8 in the Lua post, I bought it on a whim and tinkered with it a bit last night, producing this fine non-game. (I worked on it some more today, so it’s better now, but it’s not last week any more so this doesn’t count.)

[articles] Embedding Lua vs Python

Nova Dasterin asks, with money:

How about usage of Lua for game development? Love2d etc. Also http://lexaloffle.com/pico-8.php which I recently heard about.

clarification: thoughts on Lua as a ‘good choice’, also Lua vs Python for that subject (gamedev)

There are a couple ways I can interpret this, so I’ll go with: all of them.

(edit: you may be interested in a subsequent post about the game I actually made for the PICO-8!)

[articles] The case for base twelve

Decimal sucks.

Ten is such an awkward number. Its only divisors are two and five. Two is nice, but five? Who cares about five? What about three and four?

I have a simple solution to all of these non-problems and more, which is: we should switch to base twelve.

[dev] Weekly roundup: pixel perfect

April’s theme is finish Runed Awakening.

Mel is out of town, so I’m being constantly harassed by cats.

  • irl: I cleaned the hell out of my room.

  • Runed Awakening: I finally figured out the concept for a decent chunk of the world, and built about half of it. I finally, finally, feel like the world and plot are starting to come together. I doubt I’ll have it feature-complete in only another week, but I’m miles ahead of where I was at the beginning of the month. The game is maybe 40% built, but closer to 80% planned, and that’s been the really hard part.

    I’d previously done two illustrations of items as sort of a proof of concept for embedding images in interactive fiction. A major blocker was coming up with a palette that could work for any item and keep the overall style cohesive. I couldn’t find an appropriate palette and I’m not confident enough with color to design one myself, so the whole idea was put on hold there.

    Last week, a ludum dare game led me to the DB32 palette, one of the few palettes I’ve ever seen that has as many (!) as 32 colors and is intended for general use. I grabbed Aseprite at Twitter’s suggestion (which turns out to default to DB32), and I did some pixel art, kind of on a whim! Twitter pretty well destroyed them, so I posted them in a couple batches on Tumblr: batch 1, batch 2, and a little talking eevee portrait.

    I don’t know if the game will end up with an illustration for every object and room — that would be a lot of pixels and these take me a while — but it would be pretty neat to illustrate the major landmarks and most interesting items.

  • spline/flora: I wrote a quick and dirty chronological archive for Flora. I then did a bunch of witchcraft to replace 250-odd old comic pages with the touched-up versions that appear in the printed book.

  • blog: I wrote about elegance. I also started on another post, which is not yet finished. It’s also terrible, sorry.

[articles] Elegance

Programmers sometimes like to compliment code as elegant, yet I can’t recall ever seeing a satisfying explanation of what “elegant code” is. Perhaps it’s telling that I see “elegant” used much less often by more experienced programmers, who opt for more concrete commentary.

Surely elegance is a quality to strive for, but how are we to strive for something we can’t define? “I know it when we see it” isn’t good enough.

I think about this from time to time. Here’s what I’ve come up with.

[dev] Weekly roundup: zoning out

April’s theme is finish Runed Awakening.

It took a few days to clear my plate and get up to speed, and I’m a little worried at how much time blog obligations seem to be eating this month, but I made some good progress.

  • twitter: I installed Windows 95 in a VM and documented the experience. I also wrote a good Twitter bot that tweets every word, distorted by some Unicode shenanigans.

  • blog: I wrote about emoji, at considerable length.

  • Runed Awakening: Ehh. I ran dry on major ideas and spent several days mostly struggling to drum up some more (or avoiding the question altogether, which is how the Twitter bot came to be). I did end up making a little progress, but not what I would call a week’s worth.

I’m halfway through the month and don’t have a whole lot to show for it, unfortunately. Learning how to have ideas is… difficult. With Doom architecture, I at least found a trick for getting my foot in the door: find an empty space and just draw something in it. I don’t know how to translate that to a text-based puzzle game where everything has to make a bit more narrative sense, which is a little frustrating.

I’ve had some more inspiration today, so that’s good, but I’m going to run dry again pretty quickly if I can’t find a reproducible way to generate new ideas. I have a hard time just sitting and thinking in the first place, which is a huge handicap. I’ve had the best luck when doing something tedious and purely physical, so my mind can wander, but I’ve never been able to duplicate the effect deliberately.

[dev] Weekly roundup: an awakening

April’s theme is finish Runed Awakening.

It took a few days to clear my plate and get up to speed, and I’m a little worried at how much time blog obligations seem to be eating this month, but I made some good progress.

  • blog: I scrapped a bunch of manual thumbnails from git and finally switched to Pelican’s thumbnailer plugin. I also wrote about my first computer(s).

  • art: I painted an Eevee, and it came out okay. I also did a quick painting inspired by Runed Awakening work.

  • Runed Awakening: Aha! Much like making a Doom level, the hardest part is just having ideas, and then having more ideas to fill in the details of the bigger ideas. I’ve got enough big ideas; it’s the little ones that are proving tricky. I did manage to fix a ton of bugs, finally add several alternative solutions for getting past the ███████, implement the ████████ ██ ████, add a new ████████ and an item that can ████████, and jot down some notes on future direction. It’s not quite a week’s worth of work, but it’s a solid few days’ worth, and I feel like it’s a big step forward. I hope I can keep it going!

[articles] Apple did not invent emoji

I love emoji. I love Unicode in general. I love seeing plain text become more expressive and more universal.

But, Internet, I’ve noticed a worrying trend. Both popular media and a lot of tech circles tend to assume that “emoji” de facto means Apple’s particular font.

I have some objections.

[personal] My first computer

This month — March, okay, today is March 36th — Vladimir Costescu is sponsoring an exciting post about:

How about this: write about your very first computer (e.g. when you were a kid or whatever) and some notable things you did with it / enjoyed about it. If you’ve ever built your own computer from parts, feel free to talk about that too.

[dev] Weekly roundup: sleep deprivation

March’s theme is video games or whatever.

I performed my monthly ritual of completely ruining my sleep schedule and being a zombie for a day and a half, so I’ve spent the last few days trying to fix it. Oh, well, good to take a few days off every now and then.

  • art: Did a whole lot of doodling the nights I was nocturnal.

  • pokémon: I started tinkering with a Pokémon Showdown CLI client for Sketch’s day of my time last month. I got sort of a proof of concept, and I guess this month I’ll try to turn it into a Python async API.

  • blog: I wrote about the Doom map I made, producing the second-wordiest post I’ve ever written. I also slightly improved how Pelican handles thumbnails, and nuked a ton of old manually-created ones from git in favor of a plugin that generates them automatically.

The short time limit of DUMP somehow got me to pour myself into a new thing and produce pretty decent (and ambitious) results, so April’s theme is going to be: finish Runed Awakening. I want it playable by the end of the month, at which point I’ll share it on Patreon for some beta-testing.