Anita Borg’s Legacy on Ada Lovelace Day

Today is Ada Lovelace Day, an international day of blogging to draw attention to women excelling in technology. Ada Lovelace was notable for the legacy she left and the inspiration she provided. New generations of women have, in turn, inspired others to enter fields of science and technology, each having an effect that increases over time. Of these, computer scientist Anita Borg stands out as an amazing person who worked tirelessly to provide inspiration and opportunities for other women in computers and technology.

Among her many accomplishments, Dr. Borg founded the Grace Hopper Celebration of Women in Computing, an annual conference that embodies the ideals of Ada Lovelace Day, as well as those of its founder. Be sure to check out the work they do, not to mention the outstanding women recognized by the Anita Borg Institute, the organization that bears her name because of the work she did.

Comments off

Populares Et Optimates, A Game Of Rome Part 2

Watching card manipulation by Dan and Dave Buck including those on their site like the demo video of the Akira flourish got me thinking quite a bit about card shuffling. After seeing some of the false shuffles and other manipulations and having read about games where the shuffling algorithm was only pseudo-random, I wanted to make sure that the card shuffling for my game was at least adequate enough to make the game work.

If you’re not familiar with Dave and Dan, check out this video advertisement for their set of DVDs over at Theory 11:

Wikipedia has a good article discussing shuffling cards and computer algorithms for shuffling.

An example shuffle algorithm in Javascript would be this implementation of Durstenfeld’s algorithm, a modern version of Fisher-Yates that looks like this:

function array_shuffle (aArray)
{
    var i, j, mTemp;
    for (i = aArray.length; i;) {
        // mTemp, j initialized here for shorter code.
        j = parseInt (Math.random () * i);
        mTemp = aArray [--i];
        aArray [i] = aArray [j];
        aArray [j] = mTemp;
    }
}

For the random number generation, I prefer this, but I haven’t exercised it in order to see if it makes a difference, though seeing parseInt in the above makes me wonder about its presence.

j = 1 + Math.floor(Math.random() * i);

As for the cards in the game, they are represented in the Javascript as objects and can be either people or actions. People cards are members of one or the other faction or a third group of loosely-aligned Romans who may be swayed to one side or the other. They have attributes including the side they belong to, whether their side may be changed, their name and current rank. Action cards represent the cards that are used during play. Actions include ranks and positions that may be assigned to People and events like riots, assassinations, and plagues. Action cards often have negative or side-effects, sometimes costing the player who uses it as much as his opponent. Other cards require votes from the Senate such as Exile or the appointment of Generals.

There are a variety of collections that I’ll refer to as decks. There are two decks of people, one for each player. Event decks include one hand for each player, the drawing deck and the discard deck. Additionally, there may be individual cards in play that belong to no particular deck.

I considered a number of names for the game including Optimates et Populares, but that doesn’t roll off the tongue. The working title that I came up with is Marius and Sulla after the two men who fought together in the Social War and then became bitter enemies. The game centers around the time where partisans identified themselves less with the espoused philosophies each represented and more with the personalities themselves. The short version of the game covers the six years following the Social War (88 BC – 82 BC).

Comments off

SPQR Or Pontifex Maximus, A Game Of Rome Part 1

I’ve decided to create a web-based game set in early Rome. It’s intended to be about the leaders of the time with an emphasis on politics rather than military strategy. I want the latter to happen “off-screen” as it were, but with the option for legions to show up at the gates of Rome when needed to influence political events.

The biggest difficulty was selecting a time period that provided the right amount of variety, particularly political in-fighting and manuevering without too much military action (such as the wars with Carthage). In that regard, the early and late periods of the Republic offered some interesting options, as did the time of the First Triumvirate and the period following the death of Caligula, to name but a few points in the turbulent history of the Romans.

I’m particularly fond of the political manueverings described in Imperium by Robert Harris and in the BBC production of I, CLaudius (for which I must confess that I haven’t read the book by Robert Graves). There’s an immediacy to the politics combined with a certain degree of brutality that keeps one from longing overmuch for the good old days. So the more I thought about it, the less Imperial Rome appealed to me and the more I wanted to go back a little further in time. At the same time, Lavinia by Ursula Leguin brings the events of Virgil’s Aeneid to life brilliantly with the interplay between the tribes of the area and the followers of Aeneas.

Out of all the time periods that I think would make for an worthwhile game, the period immediately following the Social War, a crisis point in Roman history, sounded extremely interesting. Sulla’s First Civil War with the struggle between the optimates and populares (and I’m simplifying matters greatly since it wasn’t that black and white) made for some turbulent times with lots of political and military manuevering. Throw in assassinations, exiles, plagues, riots and external threats like Mithridates of Pontus, and you have a good deal of elements to work with.

As they say, plus ça change, plus c’est la même chose. The politics of the Roman Republic and the Roman Empire have much in common with the infighting during the War of the Roses and the gangland warfare of the Roaring Twenties. For that reason, I wanted to capture some of the feel of the Avalon Hill game Kingmaker, minus the board and tediousnous of moving armies around, with the fast-paced play of Family Business, but with a more historical feel and slightly more elaborate mechanics.

Before starting work, I did some research on already existing games that covered both the time period I was interested in with the politics in a card game or simple board game version. I was positive there’d be a plethora of games of all stripes, some very similar to what I had in mind. Surprisingly, the list wasn’t nearly as long as I expected, though I’m sure I missed more than a couple. My short list of games that aren’t strategy games and that otherwise capture some of the elements I was looking for are as follows:

Certainly, some of these games are ones that I’d really like to play, particularly Triumvirate. But before I do that, I’d like to get my game up and running. First up, a paper prototype. Much like website usability testing with paper mockups and wireframes, I plan to make some cards and to try some mechanics so I can see how they play out. I’ll discuss that in my next on this subject.

Comments off

You’re More Skilled Than You Think

When you’re in the trenches slinging code, it’s very easy to become disillusioned about your skills. Without a frame of reference, tasks you think should be easy become mind-bendingly difficult and there’s no light at the end of the tunnel. That’s certainly been my experience developing for the web and also in designing games. In the latter case, it’s even harder because you can easily convince yourself that no one in their right mind will ever enjoy the gameplay you’ve devoted yourself to for months. I read a post today John Nunemaker that he succinctly titled, “I Have No Talent“. He says:

I am sick of hearing people say, “Oh, I love your code, I wish I could do that.” You can. The only reason you can’t is because you don’t practice enough. I used to think that I wasn’t smart enough. I was jealous of those that did crazy code stuff that I couldn’t even comprehend. Then, one day, I ran into something I did not understand and instead of giving up, I pushed through.

His blog post reminds me of a discussion I had with one of the programmers on Forza Motorsport. At one point, I made an off-hand coment about the complexity and difficulty of what he did in working with the Cambridge Research Center. His response was much the same as Mr. Nunemaker’s, albeit a bit more curmudgeonly. In short, where I perceived this baffling artifice of dazzlingly complex code, he saw it as something that anyone could learn to do with enough time and effort. His insight helped me to keep slugging away at writing my first C# application and not becoming discourage at the intricacies of serializing and deserializing XML.

Working with senior developers has given me insight into how to do some pretty amazing things with computers. Seeing the frustrations of junior developers has taught me how aptitude is different from knowledge. In some cases, things never click, but in the vast majority of instances, it’s just a matter of experience and learning. When I taught basic computer classes through the King County Library System (for those in the Puget Sound region, the KCLS computer classes are a great introduction for novices and they’re free), I got see many people who had never used a computer before gradually come to the realization that surfing the web or using Microsft Word wasn’t nearly as difficult as they feared it would be.

So if you want a more objective appraisal of your development skills, try teaching someone else what you know. And if you want to know whether your game is actually any fun, let someone else play it. But that’s a post for another time.

Comments off

Process Buzzwords and Gemba Walks

Looking out the window where I work, my co-workers and I can see the steady progress on the construction of Amazon.com’s new buildings in the South Lake Union neighborhood. Today, safety-vested and hard-hatted troop of people came parading through in the rain, presumably on a tour to see the progress being made. Since we use Lean processes, it seemed analogous to a “gemba walk” that our managers are supposed to conduct regularly.

But why use a term like gemba walk when the Japanese word gemba has a literal meaning of “factory floor” and applies to an industrial process rather than the development of software? Further, for non-Japanese speakers, why use the specific Japanese word when there are plenty of English words that are more immediately understandable to outsiders (those not engaged in applying Lean methodology in the workplace)? It’s not even so much that using this word jars the ear of an English speaker, but that other words to refer to other parts of the process are not used or are, in fact, translated. In a workplace that also embraces kaizen (lit. “improvement”), why are terms like muda (waste) and seiketsu (standardization) not used? When Lean practitioners do recognize waste, they often fail to recognize the differentiation that would be captured by proper use of the Japanese terms (specifically, muda, muri, and mura, the latter two being distinct from more general waste that comes from an inexact translation of muda). To me, as an occasional speaker of Japanese, the reason to use the foreign word is so that the specific nuance of that word isn’t lost or because the translation is too inexact.

To my mind, using the term gemba smacks of putting a new coat of paint on the idea of management by walking around, albeit with a formally defined set of goals and methods. However, I think the formality of the process, typified by the use of ill-defined buzz words, becomes a waste all its own. The danger is that the process becomes a meaningless exercise: “It’s a ‘drive-by’ gemba. No matter how sincere, it is shallow.”

On a related note, the term kaizen rolls off the tongue easier than Kontinuierlicher Verbesserungspozess (such as that employed by Volkswagen), the latter being more in the nature of focussed improvement on a specific process and being more punctuated than the Japanese process.

Addendum: Regarding the use of Japanese terms, Mike Wroblewski has some excellent points and links to arguments both pro and con. In case it’s not clear, I agree with him and don’t think that the Japanese terms should be abolished, but rather that practitioners shouldn’t let the term obscure the intent. By all means use the appropriate terminology to effect the changes the organization wishes to see. If the changes aren’t occurring, then perhaps the managers performing their gemba walk has gotten bogged down in the terminology or process and need to spend more time listening to what is actually being said.

Comments off

Javascript Sorting

Not too long ago, I was asked, as a theoretical question, how I might take a string of random alphabetical characters and sort them in order using Javascript. Thus, given NFARAKDMSLSJDQKJKCXLK, find a simple way to turn it into AACDDFJJKKKKLLMNQRSSX. It’s a pretty basic question for anyone who uses Javascript and I immediately thought of splitting and joining the string as an array (a quick and easy way to tokenize the string). However, for some reason, I completely forgot about the Array.sort() function that’s pretty much a universal across languages.

Instead, the first thing that came to mind was the last time I had to sort a collection and started thinking of Java sorting. In the work I’ve done, such sorting usually requires the use of comparators because the default sort order is often not the one that’s desired. As a case in point, we have a set of JSP pages for rendering content including archive and list pages that display in posting date or sequence order derived from the content. For example, here’s some code to sort by a custom “sequence” attribute using the Vignette Content Management API (this particular snippet is the work of the inimitable Yong Chen):

Comparator aComparator = new Comparator(){
	public int compare(Object obj1, Object obj2) {
		int result=0;
		try {
			Integer s1 = (Integer) ((ContentInstance) obj1).getRelations(CT_RELATION_HEALTH_PLAN)[0].getAttribute("sequence").getValue();
			Integer s2 = (Integer) ((ContentInstance) obj2).getRelations(CT_RELATION_HEALTH_PLAN)[0].getAttribute("sequence").getValue();
			result=s1.compareTo(s2);
		} catch (com.vignette.as.client.exception.ApplicationException e) {
		}
		return result;
	}
};

For debugging, I might break it out a little differently to avoid the multiple casts in a single line. I think the Vignette API is fairly robust, but I would still split the ContentInstance cast apart from the Java native Integer cast in this case. But that might just be me.

In any event, while Javascript can also use comparators without much loss of speed, for a task like the one delineated initially, a simple sort will do the job and the whole can even be condensed to a single line function like this:

function order(unsortedString) {
	return unsortedString.split("").sort().join("");
}

Depending on the browser, the sort function will be some variation on a quick sort or a merge sort. It depends on whether the browser architects chose a stable algorithm or opted for some other version based on various considerations. Mozilla used to use a quicksort prior to Firefox 3.5, but they opted for a merge sort instead in more recent versions. In the course of reading about sort implementations, I came across notes on timsort, Python’s default sort implementation, that I found particularly intriguing.

As an aside the return value for a comparator that works in Firefox may fail with Webkit (Chrome and Safari) since you need to return -1 instead of zero (and a boolean false will also fail). You can read more about Webkit’s Array.sort() handling.

With Java, it looks like this:

String unsorted = "xzya";
char[] content = unsorted.toCharArray();
java.util.Arrays.sort(content);
String sorted = new String(content);

With Perl, you can do something like:

print (join “”, sort split //,$_)

In bash, this will do the same job:

echo “teststring” | grep -o . | sort -n |tr -d ‘\n’; echo

All in all, not only did I refresh my memory about good ways to sort strings and arrays in Javascript, I also learned some new things about sort algorithms and implementations of those algorithms.

Comments off

Computer Science Education Week (December 6-12)

Computer Science Education Week As a current computer science major, I’m glad to see the ACM in a joint effort to help organize Computer Science Education Week (CSEdWeek), which started December 7th. The week was chosen specifically in honor of Rear Admiral Dr. Grace Murray Hopper, also known as “Amazing Grace”, or “a little old lady who talks to computers,” who was born on December 9, 1906. She was a computer science pioneer and her work, spanning computer languages, compiler verification, software development concepts, and much more, has served to inspire a generation of computer scientists.

Comments off

Idioms and Economy of Language

I was talking with a co-worker about my limited facility with Japanese and my interest in improving my facility with that language. During the course of our conversation, she mentioned a fascinating aspect of Japanese for expressing certain idioms or proverbs. That’s were I learned about yoji-jukugo (四字熟語), which are idiomatic expressions made up of four kanji characters. These idioms are written only in kanji only and have no kana between them.

One such example would be the Japanese equivalent of the idiom, “two birds with one stone.” This is rendered as isseki nichou (一石二鳥) (literally, “one stone, two birds”). There are many more yoji-jukugo, many of which have similar versions in English (and many other languages besides).

The Chinese equivalent from which yoji-jukugo originate are called chengyu (成语). The same idiom above has a similar chengyu that translates as, “two birds, one arrow” (yī jiàn shuāng diāo, written 一箭双雕). Another one I like is sān rén chéng hǔ (三人成虎) (literally, “three men make a tiger“), which refers to how a repeated rumor may be erroneously accepted as truth.

There are lots of examples of these idioms including a chengyu of the day. You learn something new every day.

Comments off

Language Impressions

Today I read an interesting perspective on Dutch language, particularly the rather unique ‘ij’ sound in that language. But more than that, it’s a poetic take on the way language seems to feel. (via Snarkmarket)

“There’s something slightly disturbing about the visual scan of the language (I don’t even know what the term is for that: you know when you see a page, or a sign, written in a language and you have an immediate impression of the content of the text? This works also in your native language: look at a page from, like, Dickens, and you can sort of get the Shudder of the Text, or whatever, anyway, what I mean is that some languages, like French, always seem to bear a melismatic philosophy behind the page; German, an authority, Amharic, a crooked delight…) … with Dutch what I get is a sort of childlike pornography: hoog, sneeuwt, poesje, standplaats. But I’m obsessed with it: there’s nothing better than having an old school diagraph still kicking around like an appendix.”

I like the word melismatic in this context, as though the words on the page were the notes and the meaning of the page was the word or melisma. It’s a new one on me even though I subscribe to A.Word.A.Day and occasionally test my vocabulary at FreeRice.

Comments off

What’s the Definition of a Game?

A month ago, I updated my LinkedIn profile to say I was, “…playing and making some games.” I’ve had a few game ideas kicking around and the games I’ve been playing lately have gotten me a bit more motivated to work on my own ideas. My thought was that this small declaration would keep me moving forward and I would actually make some headway on at least one project. As others have noted, ideas are cheap, but seeing a project through to completion is considerably more difficult.

What I hadn’t anticipated was a co-worker asking me what kind of games I was working on. Since my day job is in web development for an HMO, my co-worker was unaware of my background in game design and my continuing interest in doing that kind of work. However, the reason I’m not employed full-time doing game design has more to do with the nature of industry, particularly the crazy hours and my daughter being of an age where she started to think daddy lived in the phone. At the time, people were beginning to take a hard look at some of practices and work environment that went with game development, the most visible being the story of EA Spouse. Just as a case in point, the agency I contracted through gave me vacation time that accrued at a rate of 2 weeks per year based on hours worked. In my first contract, between overtime and the occasional all-nighter, I accrued four weeks of vacation.

So, though I’m not working in the game industry as my day job, I’m still very much interested in games. But my co-worker’s question raised an interesting point: What is the definition of game? Her assumption was that, as a computer guy, I would be turning my energies toward some form of computer game. But even that’s a pretty broad range, given the proliferation of casual games, many of them web-based, alternative reality games, that incorporate many forms of technology including web pages and other technology, and console games, developed on computers despite the hardware being rather specialized.

However, I also play pen-and-paper roleplaying games (Dungeons and Dragons and Ars Magica, among myriad others), I am guilty of having played live-action roleplaying, and I play boardgames, given the opportunity. In fact, about the only thing I don’t play is fantasy football and its real-world team sports analogues.

So, while I’m not planning on creating something like BASEketball any time soon, I’m casting my net considerably wider than trying to develop the next version of Duke Nukem Forever (figuring whatever game I work on still probably has a better chance of seeing the light of day).

Comments off