m. c. de marco: To invent new life and new civilizations...

Kingdom Board Builder

May 21, 2013

My husband and I were talking about designing a game like Kingdom Builder that would have (among other things) an even more modular hex board. That got me thinking about how I could prototype such a board.

I looked into the latest mapping software, and while there were some new options out there like hexGIMP and Tiled that might be able to do what I wanted, they weren’t designed to do it easily. (Tiled needed a patch just to do hexes at all.)

So I decided to write my own tool to lay out hex boards. SVG seemed to be the easiest way to hack some clean, interactive graphics out of JavaScript, with adequate code examples available online (if hidden inside svg files). I decided to make Kingdom Builder boards as a proof of concept:

(Pop out the svg.)

After generating a random board, it lets you edit the board by clicking on it. Note that it has strong opinions about adjacency and the need for location tiles. If you don’t like the editing constraints, try this version.

I decorated the terrain using svg filters I found online, mostly from Inkscape. It would have been quicker to edit them in Inkscape, but editing them by hand was more educational. (If you don’t like the filters, try this version.)

I also spent some time trying to understand SVG’s viewBox madness in order to get a life-sized board, but gave up after I realized that life size was more than 8 ½ inches wide. So you’re on your own for resizing; Inkscape may prove useful for that.

The code, should you choose to look at it, was made gnarlier by my late realization that I had reversed the board. I moved the first column to the end to fix it, which threw off the numbering and layout. Some bits were simplified by advice from Amit Patel’s page about programming hex grids before being complicated later. (Location hex placement is particularly hacked.)

Browser restrictions prevent me from saving your output for you, but you can do it manually from a PC by copying the DOM: in Chrome or Safari, right click on any hex, choose Inspect Element, scroll up to the svg element in the code, right click on that, choose Copy as HTML, paste it into a text editor, and save it with the svg extension. This will leave you with an svg of your last map that you can open in a browser and edit. Any subsequent changes can be saved the same way.

If you need help with saving or have feature requests, let me know (preferably via app.net).

A Week in the Bitcoin Mines

April 29, 2013

I decided to try bitcoin mining after hearing a partial explanation that made it sound more mathematically interesting than it turned out to be. (The moment of existential disappointment came when I read that the number of bitcoins cannot exceed 21 million.)

There’s plenty of advice out there for the rank newbie that explains what bitcoins are and how to mine them with just a web browser at sites like BitCoinPlus.com. My experience with web miners (during some downtime away from the real mines) was that they don’t work now. I suspect they may have worked back when Java plugins were less hoary and suspect, and bitcoins littered the intertubes like, well, bits.

There’s not quite as much advice for the mere amateur, but I found some. I downloaded a real bitcoin wallet for my Mac and waited a few days for it to download the full blockchain. (I had to make more disk space in the middle of that and it wasn’t clear how much of the blockchain Bitcoin-Qt had saved.)

Since bitcoins are now too rare to mine on your own, you need to find a work crew and divide up your take. I followed the advice and joined Slush’s pool. Next, I needed a mining program. Unfortunately, my Mac is still on Snow Leopard, and the options were limited. I downloaded RPCminer, a CPU miner, and set it up to work with Slush’s pool, despite the now outdated instructions.

Slush’s pool turned out to have just started extra fees for using the standard mining pool work-assignment protocol instead of Slush’s new protocol, so I also needed to install his proxy to translate between my old client and the new protocol server. I had all the requirements to build the proxy for Mac, but I still got some errors building it. Nevertheless it built and ran so I ignored the errors.

This setup seemed to work, but no bitcoins surfaced from the rocky soil of the intertubes. CPU miners are too slow for mining in general, and especially so on an aging laptop that tends toward heat exhaustion in the summer. I needed a GPU miner (that is, a miner that uses the computer’s graphical chip instead of its regular processors).

In the bitcoin forums, there was a link to an old build of a Java-based GPU miner called DiabloMiner. From the (long and messy) thread it was clear that DiabloMiner worked in Snow Leopard, but the link was broken and the newer builds required newer OSes. I hunted high and low for the missing link, but found nothing but ghostly links to the dear departed download.

So I tried building the latest Diablo code on Snow Leopard. (This required maven.) It built happily enough, but when I tried to run it, it complained that Apple’s version of OpenCL (the driver to run non-graphics software on your unsuspecting graphics card) was too old. I figured the best solution to that problem was time travel, so I checked out a version of the code from May 1, 2011 and built it.

Success at last! My miners mined away happily for an hour or two, producing an infinitesimal fraction of a bitcoin before tragedy struck in the form of a DoS attack on Slush’s servers. But now that I had a rig set up I could switch to another pool, like the fickle ‘49er I’d become.

Unfortunately, in my haste I picked a pool, Bitminter, that didn’t pay out until you’d earned at least 0.001 bitcoins. Even with my husband’s Mac mini shanghaied into mining for me, it took about a week (and a couple of unexplained work stoppages from both miners) to reach 0.001. On the bright side, Bitminter also does simultaneous Namecoin mining—something Slush still promises on his account setup page but which (the bitcoin forums report) hasn’t been supported there for some time.

But (of course there was going to be a but), while namecoins can be mined with no additional effort by my lazy miners, they don’t accrue at the same rate as the bitcoins. So cashing out of bitcoins at 0.001 meant leaving about 0.00075 namecoins lingering at Bitminter until the next DoS sends my miners back there. According to the Bitcoin Exchange, my bit of namecoin is currently worth a homeopathic fraction of a bitcoin, so I’ll probably leave them lying in the intertube I found them in for quite some time.

Bitcoin mining is about as profitable as fiction writing in that it costs you more in electricity than you will ever earn. The best way to score virtual riches may instead be to get in on the ground floor of another virtual currency like namecoins. I tried out a promising upstart called Litecoin which is supposed to level the playing field between amateurs and professional miners to some extent.

My efforts were once again hampered by my old OS—I wasn’t able to find a GPU miner for it and had to settle for one CPU miner on the Mac mini. This rig is not ideal, but it’s also not the handicap it would be with bitcoins. I’ve already mined 0.065 litecoins (worth about a quarter on the virtual market) with one CPU in the same week or so of time it takes to mine 0.001 bitcoins (worth one thin dime). Now all I need to do is mine and wait for the coming litecoin bubble to inflate.

Crossposting with Drafts

April 15, 2013

I’ve been wanting crossposting software for a while now. People I’d spotted successfully crossposting either did it manually in a browser or worked for Google (solving the Google+ problem through nepotism?), and Hootsuite only handled a couple of my networks. Streamified did more but still not all (and is temporarily without an iOS client).

Drafts does more too, but also lets me do it all—even save the markdown to Dropbox for later inclusion in my Jekyll blog—all from my iPad. This is my first blog post using Drafts, but I’ll also edit it later for some other streams.

So, isn’t crossposting evil? The short answer is it’s evil when businesses do it for their financial (as opposed to social) purposes, or when trolls do it to rile up one newsgroup with a discussion more appropriate to the source group (or to no place at all). It’s also evil when the crossposter is himself largely responsible for the fragmentation of the community (say, an excessive proliferation of mailing lists on the same topic) that he then needs to crosspost across in order to have a discussion.

It’s not so evil when the crossposter is innocent of the fragmentation of his community—say, some of them won’t use Facebook and others don’t use mailing lists (or any of them are lawyers). In the case where businesses are intentionally using your content to keep people in their own advertisement-filled silo (Facebook, Google, Twitter, etc.), crossposting is the pro-social option. Bonus points if you also point your siloed readers to an especially pro-social forum (App.net, Tent, etc.).

Polaroids

April 11, 2013

I’ve downloaded my Instagram photos using Instaport and laid them out as Polaroids. The polaroid styling is based on Polaroids with CSS3 on Zurb and a similar post by Paulund. I tweaked them a little and added the handwriting font, a Google web font called Patrick Hand SC.

If you want to make your own, you can see and steal my CSS at the bottom of my main style file. Google has instructions for adding individual web fonts, or you can copy the link to the font from the source of the Polaroids page, near the top. Some grungier details follow; feel free to stop reading now.

I ended up putting the link list together manually because Jekyll still doesn’t include basic image gallery or file listing functionality and the plugins I tried didn’t work out—partly because I was unwilling to wipe out my macports directory to satisfy homebrew’s polite and clear but excessive requirements. I made the thumbnails with ImageMagick, which I happened to have lying around the Mac.

The export from Instagram didn’t capture my titles, so I added them manually and titled the untitled photos.

Social Archiving II

April 9, 2013

Last time I linked to my local twitter archive but failed to explain how to download your own—so there you go. It’s much more useful than your Springpad archive; on the other hand, Springpad now has better embedding. You can see my embedded notebooks and recipes in the spruced up social section of the site.

I also got rsync working for jekyll thanks to this wise advice from Nathan Grigg, so I’m declaring the new site officially up. However, my hosting service is not so up, so I’m waiting until it stabilizes a bit to take down the github copy of the site.