Sponsored By

Developing the First Sentence-Making Video Game

What happens when you move the word game genre to the level of the sentence? This post includes the key considerations necessary to create Sleep Furiously as well as lessons learned.

Jen Helms, Blogger

November 10, 2015

6 Min Read

“Based on my reading, the human brain is mostly a voracious consumer of patterns, a soft pudgy gray Pac-Man of concepts. Games are just exceptionally tasty patterns to eat up.”

- Raph Koster

 

At Playmation Studios we agree with Raph Koster, games are fun precisely because we discover patterns when we play. Language, as it turns out, is incredibly rich with formal patterns. Despite the richness and complexity of language, most word games are based on spelling, and even when they escape that, they still don’t move beyond individual words (for example Scribblenauts). It makes sense that language games have largely been about orthography; there is a longer and more established tradition about how things are spelled. Also, because orthography isn’t an innate human activity, establishing clear social rules about it seems to work better than having rules about syntax.
 

Seeing the opportunities with language, we focus on new aspects of language to design gameplay around. Noam Chomsky first posited that a sentence can be grammatical but nonsensical and coined the sentence “Colorless green ideas sleep furiously.” Taking Chomsky’s view, we imagined a game in which players connect words to form sentences similar to the joy of making fridge magnet sentences. Here is a look at what we came up with.

 



Now let me explain how we got there and what, in retrospect, we might have done differently. There are three camps in regards to syntax:

  1. Old-school grammarians: 1) A sentence is either grammatical or ungrammatical; 2) There are a certain set of rules that are just better than other rules and should be conformed to.

  2. Chomskyan: Keeps the first premise, sentences are either grammatical or not, but makes no prior assumptions about what formal rules people’s grammars will or should conform to.

  3. Some contemporary linguists, ie Pullum: Backtrack on the first assumption in particular saying that instead of a grammaticality being a binary, sentences can be more or less grammatical.

We made a lot of design choices to make it seem like the old-school grammarians were right (despite the fact that we believe Pullum to be correct). The perspective of the old-school grammarians implies a set of definite grammar rules that all English speakers share, leading to more consistent play. Further, we realized we had to constrain the lexicon, most crucially by eliminating a lot of function words and instead focusing on content words. By eliminating the function words we greatly decreased the number of grammar rules we had to model and also got rid of a lot of the borderline rules. For example, because we don’t have the infinitive marker “to” we don’t have to worry about whether or not the player thinks it is ok to split an infinitive.

If a word could be both a noun and a verb, we wanted to be sure to choose words in which the usage of both was common. For example, ”tree” can be both a noun and a verb though its use as a verb is really uncommon. I would imagine that “The house dogs tree eats shark” wouldn’t seem very grammatical to you. In contrast, it would be easier for you to mentally parse “The house dogs hate eats shark”. These were issues understood early on but a prototype quickly reinforced their importance as well as ensured we could get the parser working. So how did we do that?

Early Sleep Furiously prototype

There are two types of grammar formalisms: constituency grammars and dependency grammars. Constituency grammars are the primary way for American linguists to model grammar. This is what we used to create the parser. A possible advantage of a constituency grammar is it’s easy to interpret the type of structures being presented to you. With a constituency grammar, however, there are all these possible and unknown number of nodes that lead to some messy decisions as to when and what memory to allocate. It turns out a dependency grammar is much cleaner to program and it is just as computationally powerful as a constituency grammar.

After releasing Sleep Furiously, early feedback was not too surprising. Users complained about the limited vocabulary and because the database of words was hand-curated, the database had been quite small. We have since released multiple updates to increase the size of the database substantially. Secondly, and also not surprisingly, the game doesn’t always fit people’s intuitions about what is grammatical. We tried to force clear rules but the reality is that grammar doesn’t really work that way. Through feedback and iteration we have been able to update the parser to more closely match what the average player would believe is grammatical. Luckily, the fun players have creating silly and absurd sentences seems to outweigh the fact that the game will still occasionally deviate from a player's intuitions.

We also believe that we should have altered how points are allocated. Points in the game increase quadratically with the length of the sentence. This overly incentivizes points driven players to make the longest sentence possible when in fact it is shorter sentences that often feel the most fun. Having points increase linearly would probably have been better. To offset this, without too dramatically changing the point structure for players, we added bonus points for alliteration.

We also realize Sleep Furiously would benefit from gameplay that encourages more long-term strategic thinking. The game is more of a turn-by-turn exploration of language and the player’s goal is to work to beat their prior past score or rank in the leaderboards. We have thought a lot about how we could add more strategic gameplay with a sentence-making game. What we have come up with is an asynchronous two-player game that will be released for iPhone soon. Follow us @playmationgames to stay in the loop.

Read more about:

Featured Blogs

About the Author

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like