31 January 2015

C sizeof structure member

Something I don’t think I’ve run into with C before.

It can be so hard to come up with a sensible example. So just ignore whether you think I should be doing this. Assume that something similar made sense in context.

typedef struct Foo {
    char uuid[37];
    int value;
} Foo;

char main_foo_uuid[sizeof(Foo.uuid)] = "";
//Compile error!

Doing sizeof(Foo) is fine, but sizeof(Foo.uuid) is not.

One solution is do declare a dummy instance of Foo.

Foo dummy;
char main_foo_uuid[sizeof(dummy.uuid)] = "";

But there’s a trick to avoid declaring the dummy: Cast NULL to a pointer to Foo, and use that as your dummy.

char main_foo_uuid[sizeof(((Foo*)NULL)->uuid)] = "";

Which makes you wonder why the language couldn’t just support sizeof(Foo.uuid).

30 January 2015

Proto rule zero

Rule zero over the years

That is a good article.

Though I think “rule zero”—in some sense—actually predates D&D.

On the Pied Piper forums; Mike Mornard, Rob Kuntz, and Gary Gygax talked about Chainmail games where rulings were made on-the-fly to deal with things players wanted to do that were not covered by the rules. Such as setting fire to the woods enemy units were holed up in. Mike in particular made the point that “what is not forbidden is allowed” was the way the Lake Geneva wargamers played before D&D.

Unfortunately, those PPP forums seem to no longer be online. (And the PPP forums may have had multiple incarnations.)

29 January 2015

Runequest Archive Products Being Retired

Runequest archive products being retired at OBS

This is extremely myopic. One of the great benefits of e-books is that books don’t have to go out-of-print and (potentially at least) become hard-to-find.

What is the message they’re sending to customers who would like to buy these books? If someone wants to give them money for these products instead of (or in addition to) the more recent books, that customer doesn’t care why they’ve been “retired”. They just hear, “No, we don’t want your money.” At best.

28 January 2015

User friendly

A Brief History of User Interface

That is a great video, and nothing here is meant as criticism of it. After all, it is meant to be brief.

It always bothers me a bit, though, when the fact that there was user friendly software before the windows/mouse GUI gets glossed over. The GUI was undeniably a big paradigm shift. (Being graphical by default, discouraging modes, being more event-driven, being more consistent, &c.) But there were plenty of people who wanted to—and did—make computers more accessible before it.

27 January 2015

Other people’s code

Programmers dread reading code written by another programmer. Why is it so hard to read other people’s code? I don’t know, but here are some thoughts.

In C, it is because of the limited ability to express abstractions. Code of any complexity tends towards using function pointers and macros and other techniques that obscure things.

In some languages, like Perl, it is because everyone uses a different subset of the language. In the extreme case, this can also mean completely different styles of programming in the same language.

With some languages, like Scheme, it is because the ability to build powerful abstractions means that code of any complexity essentially becomes another language embedded in the original. To understand the code, you have to learn this new, project-specific language.

26 January 2015

Winter NAMM 2015

Products that looked interesting to me while watching the Winter NAMM 2015 coverage...

Digitech Trio: The Trio puts the old Band in a Box software into a pedal along with chord detection. So, instead of programming the chords and rhythm by hand, you just play the chords and rhythm, then the BiaB bassist and drummer join in.

Note that the BiaB software is fairly sophisticated. It will play fills. It will play busier parts at slower tempos and sparer parts at faster tempos. It could also do keyboard parts, so maybe we’ll get a Quartet pedal in the future if the Trio sells well.

So far, I only saw one demo where they talked about what the optional external footswitches do, and the choices seemed questionable. I hope that will be configurable.

It seems like there would be some potential for a pedal like this that was also a looper. Or maybe they could make it support the same sync feature as the Digitech loopers.

The Eric Johnson Tone Capsule: I’d already been impressed by what I’d been hearing about the new Blues Cube amp. It turns out that they have a socket on it that you can plug a “tone capsule” into. This one is designed to tweak the amp to make it deliver something closer to EJ’s tones.

The fact that it glows and looks like a tube is awesome.

So far, it doesn’t look like there’s anyway to get the BC’s original tones without unplugging the tone capsule. It would be nice if you could have the original tones and the tweaked tones all on tap.

IK Multimedia iRig PowerBridge: This is a great idea. A single solution to charging an iOS device while having an audio or MIDI interface connected.

The downside is that the Mini-DIN connector they’re using probably means it is only compatible with IK’s on interfaces. You’d really like it to have a Lightning connector like Apple’s HDMI adapter. I’m guessing Apple makes that option impractical for them. The next best choice would be USB. But that might still make it more expensive and more complicated.

You can argue that it is in IK’s interest to make it only work with their own interfaces. I disagree, but...shrug

Z.Vex Pedal Thief: Allows you to swap an effects loop between a mic and a guitar. I’m thinking this will be handy to use with loopers that don’t have multiple inputs.

Big Ear N.Y.C. More More More: Three boosts in one box.

Mooer Wahter: What’s cool about the Wahter is that it is a compact wah pedal with fold-out sections to make it more compact while travelling. I hadn’t seen that before.

Boss ES-8: I have to wonder why Boss didn’t already have a switching system for pedals like this in their line. I also wonder if it really is a “game changer” compared to similar systems that were already available. But it does look very nice.

It is a bit disappointing that it doesn’t appear to have a lot of support for stereo pedals. Loop 7 has a mono send and a stereo return, and loop 8 has stereo sends and stereo returns.

I think these are all the (single size) Boss pedals that have stereo in: DD-7, RV-5, TE-2, RC-1, and the RC-3. Although you probably don’t want both an RC-1 and an RC-3 in the same rig, you might want all of them and all the others. The TE-2 strikes me as a very special purpose pedal, so I think you’d want a DD-7 along with it. Lots of people like to have at least two DDs set to different delay times. With the ES-8, you’d have to put all of these in loop 8 or put them after the ES-8 outputs. Either option means you aren’t getting the biggest benefit of the ES-8.

Looking at pedals with mono in and stereo out: DM-2W, DD-3, BF-3, CE-5, CH-1, MO-2, PS-6, OC-3. You have much fewer options using these with the ES-8. Only one of these can go into loop 7 in stereo mode.

Still, for most guitarists that probably isn’t as big an issue as I’m making out of it. Mono is plenty for most guitarists.

Fender Limited Edition Sandblasted Telecaster: Looks pretty nice. I’m a sucker for Teles and anything blue. But what looks even nicer is...

Fender Special Edition David Lozeau Art Stratocaster, Dragon Art: Blue and a dragon.

Reverend Descent Baritones: Reverend has some cool guitars, and baritones always catch my eye.

Antares ATG-1 Floor Processor: This was originally announced and “coming soon” in...what...2012? I still plan to buy one as soon as they’re available. I stopped holding my breath years ago.

25 January 2015


Thoughts occasioned upon hearing the song “Rude”...

...or “You keep using that word; I don’t think it means what you think it means.”

There is nothing rude about giving an honest opinion when asked for one. It is rude, however, to dismiss someone’s opinion after asking for it just because it wasn’t the opinion you thought they should have.

If you were going to “marry her anyway”, then you shouldn’t have asked.

I’m not going to say that you have to have her father’s blessing to marry her, but since you asked for it, I have to assume that it is important to you. So perhaps you should consider striving to understand his objections and commit yourself to winning his approval. Rather than simply ensuring that he will never respect you.

24 January 2015

Toon house rules

In prepping to run Toon, the cartoon role-playing game, I came up with a few alternate rules.

This one is straight from the Tooniversal Tour Guide: When a character falls down, instead of the player sitting out for three minutes, they lose three turns.

Not really a rule...just a way to keep track of lost turns. When a player or character loses turns, the Animator hands the player one token (like a poker chip) for each turn lost. When the cycle of turns comes back to that player, they hand in one token.

When a character successfully Dodges a Fire Gun, there is a 50% chance of ricochet. (Normally it is either zero or always depending on whether you’re using the “superstar” rule.)

Each session each player may hand out one Plot Point to another player’s character. Players don’t have to hand out this Plot Point, but they don’t get to save it past the end of the session.

The animator makes all Tracking rolls. The Animator makes two rolls. If the 1st roll succeeds, the 2nd roll is ignored. If the 1st roll fails, the 2nd roll is consulted. If the 2nd roll succeeds, the character knows they’ve lost the trail. If the 2nd roll fails, the character thinks they’re still on the trail, but they’re actually on the wrong trail. (This is slightly different than the original superstar rule.)

There will probably be more as we play it more.

23 January 2015

Thought upon second watching of Malificent

So, the fae gave Aurora the gift of always being happy and graceful. If they’d just done that for Stefan...

22 January 2015

Voting on our next RPG

(This is only incidentally about RPGs and mostly about voting methods.)

I took the opportunity of choosing the next RPG my group would play to try out an instant-runoff election. Which has also led me to learning more in-depth about voting methods.

The first thing to say is that this election is a bit weird because there are more candidates than voters. The second thing to say is that any election method used with three or more candidates has to make compromises. There is no perfect solution.

The actual voting was conducted via OpaVote. Each voter had to rank the 11 choices from most favorite to least favorite.

Instant-runoff voting (IRV) was probably a poor choice for this particular application, but it worked for picking the first-place winner. One of the criticisms of IRV is that it can fail to elect the Condorcet winner when there is a Condorcet winner. A Condorcet winner is a candidate who would beat all other candidates in one-on-one contests. In this case, there was a Condorcet winner, and the IRV method choose it.

I then tried to rank the other candidates by removing the winner and running the election again. This seemed to work OK for the first-, second-, and third-place. Then I started to run into one of the limitations of IRV.

Say you have three candidates: A, B, and C. Four of the voters choose A as their first choice, B as their second choice, and C as their third choice: A>B>C. Three of the voters vote: B>C>A. The last three vote: C>B>A.

A wins the first IRV round. One of the first-round losers needs to be eliminated for the second round (the runoff). The losers, however, are tied. If you eliminate B, then C wins. If you eliminate C, then B wins. If you eliminate both B and C, A wins. But B is the Condorcet winner who would beat both A and C in one-on-one races. The OpaVote IRV method chooses to break these sorts of ties randomly, which seems insane to me.

In practice, the larger the number of voters, the less likely you are to run into this. With a small number of voters, however, it becomes more likely.

The problem with just choosing the Condorcet winner is that there isn’t always a Condorcet winner. There are various methods that use Condorcet and then use some sort of “completion rule” if there is no Condorcet winner. Two of the best seem to be ranked pairs (Tideman) and beatpath (Schultz). Both of these also have the ability to rank all the candidates rather than just declaring the first-place winner. Due to my small number of voters, though, even these had to declare a five-way tie for third place.

So, I came up with my own way to break the tie. (Although, no doubt, this is an already known method. Perhaps Condorcet-IRV?) I ranked them by largest number of votes in the most preferred rank. e.g. Two voters picked D&D3e as their first choice, but no voters had chosen any of the others in the tie as their first choice. So, I gave third-place to 3e. (Which was where it placed in my IRV-based ranking attempt too.)

So, the final ranking I came up with is...

  1. Toon
  2. Shadowrun
  3. D&D3e
  4. Forbidden
  5. Dragon Age
  6. Star Frontiers
  7. Dragon Warriors
  8. Dungeon Crawl Classics
  9. Lejendary Adventures
  10. Lords of Creation
  11. SLASH!

I should also mention the Borda method. I’ve been aware of it, but I’ve never been particularly fond of it. Although I think it might have potential if the scores were calculated differently. It favors “broadly acceptable” winners rather than majority winners. Though there is an argument that that might be appropriate for this case. Here are the Borda results... (There were a couple of ties.)

  1. Shadowrun
  2. Toon
  3. D&D3e and Star Frontiers
  4. Dragon Age
  5. Dungeon Crawl Classics and Forbidden
  6. Dragon Warriors
  7. Lejendary Adventures
  8. SLASH!
  9. Lords of Creation

I’m now much less of a fan of IRV than I was. I think I agree with those who say a Condorcet winner, when there is one, ought to be the overall winner despite the drawbacks of the Condorcet methods. I am undecided on which of the completion rules I prefer.

The ironic thing that kept hitting me while reading about voting methods is that you could have a vote to choose a voting method.

Besides OpaVote, Eric Gorr’s Condorcet calculator was helpful in trying different counting methods.

08 January 2015

What is great about C++?

There is plenty that is not great about C++, but I do enjoy the language. So I wonder why. This may be a reason.

A myth from Stroustrup’s article on C++ myths: “For efficiency, you must write low-level code”

You can say that often people over-emphasize efficiency. You can certainly point to places where C++ has failed at this or where the implementations have not yet lived up to the promise. But C++ does demonstrate that you do not always have to trade efficiency for abstraction.

07 January 2015

Magic in RPGs: Effects > mechanics

Five problems with magic in D&D

I’ve written about some of the things in this article before, but this is the bit I want to talk about today:

If your first answer was “a person who casts one spell, then has to sleep before re-memorizing it out of a book no matter how many times he's previously cast it”, then you're almost certainly someone that plays Dungeons & Dragons, and for one reason or another never bothered to question why magic works the way it does.

When I think about wizards, what pops into my head? Someone who is reluctant to use magic.

This is possibly the most common theme in stories about magic. Characters who use magic are either evil, reluctant to use magic, or both. Or the whole point of the story was that they should not have used magic when they did.

Too often magic in RPGs is criticized based on its mechanics rather than its effects. I don’t care that the mechanics of magic in Decipher’s Lord of the Rings RPG didn’t match the mechanics of magic in Middle-earth as described by Tolkien in his letters. What matters to me is that they made the effects of the magic system fit what is described in the books.

Now, I’m up for arguments about mechanics that might do a better job of getting the results you want. But first we’ll need to agree that magic in an role-playing game likely serves a very different role than it does in stories.

06 January 2015


Jon Peterson’s article on the making of a D&D module at TSR: Quagmire!

I’m not so sure that the process itself was so bad as the execution.

05 January 2015


FastMail is proposing/developing a replacement for IMAP.

(IMAP is one of the protocols that many e-mail clients use to talk to e-mail servers. For instance, it is how my iPhone gets my e-mail for all my e-mail accounts.)

My first reaction was negative.

First, I’m not convinced that many of the innovations in e-mail are all that useful. Secondly, today’s climate seems so opposed to these kinds of standards, the seem stacked against it.

But IMAP has bigger problems than end-user features. IMAP has technical issues that keep it from being good at the things it does support. They’ve convinced me that JMAP makes sense.

The bigger issue here is that we seem to be moving further and further from interoperable standards. Companies claim that the standards keep them from innovating. But on the whole, I’m not seeing a lot of benefits to end users in trade for this lack of interoperability. Instead, lock-in seems to encourage companies to care less about what is good for their users.

I’m hoping JMAP will be able to buck that trend.

04 January 2015

Invalid and ubiquitous; D&D’s key innovation

Jon Peterson’s year-in-review linked to this article about mana that he had contributed to.

How could the concept of mana as a generic spiritual force become invalidated and ubiquitous at the same time?

That kind of thing strikes me as utterly normal.

The first modern role playing game, D&D’s key innovation was to combine the rule systems of tabletop wargaming with the setting of fantasy fiction and the interpersonal improvisation and role-playing that had been percolating in gaming and fan communities for years.

That may be the best, most concise explanation of what D&D did that I’ve ever read. It is clear (especially if you read Jon’s book) that all the elements were in play before D&D. D&D brought them together. Which ought to be unsurprising, because that’s how these kind of things usually happen.

03 January 2015

Available capacity

Over at iMore, they’d published a piece titled: “Apple sued for false advertising by plaintiffs that don't understand iPhone digital storage” It seems they’ve since removed or edited it. But I’m responding to it anyway.

Just because it is industry practice to advertise total capacity instead of available capacity doesn’t make it right. It makes zero sense to advertise any capacity other than what’s available for the user’s use. A number that is always some arbitrary size bigger than what is usable doesn’t tell the customer anything anything.

The fact that available capacity varies is no excuse. They just have to advertise a conservative value that they know will always be available for the user’s use. (Available at the time of sale. If a system update would take up all the headroom, the user can be warned about that before updating.) If things change more than expected so that new devices come with less available space than that conservative value, they need to update their specs and advertising accordingly.

Will that be expensive? I’m sure it will be, but cost is not an excuse for not being honest with your customers.

It isn’t just Apple that needs to change. It’s the industry.

02 January 2015

Jon Peterson

It is hard to understate the influence that D&D has had on computerized games. Today, gamification is bringing that influence to all kinds of software beyond games. It is surprising that more historians aren’t doing a better job of telling the story of D&D.

But Jon Peterson and those who have been working with him are doing some great work. His book, as good as it is, is quite a long read. But check out some of the shorter things he wrote during the last year in his 2014 year in review.