Saturday, July 28, 2012

Museum Assistant Kiosk at the 2012 Indiana State Fair

I am pleased to announce that Museum Assistant: Design an Exhibit will be featured at the 2012 Indiana State Fair. Our project will be on display in a kiosk at the Ball State Backyard area in the Ball State Ag/Hort Building.

Special thanks go out to two Root Beer Float Studio members who volunteered their time to making this happen. Ryan implemented a "kiosk mode" feature into the game, so that after a minute of inactivity, the game returns to the main menu. Ashley designed a beautiful handout, a great piece that visitors can pick up and take home. They'll be printed  four-up on 8-/12x11" paper, and here's a raster version of the design.

Handout Front
Handout Back
My task in all this was to make the game work on the laptop that will power the kiosk. As regular readers will know, the game is free to play online, but our kiosk will be offline, and we want it to feature just the game, not the whole site. My first attempt involved using Javascript to try to implement kiosk mode, but it turns out that all the mouse events were intercepted by the Unity Web Player, so this approach was doomed to failure. We also could not use a standalone Windows executable because the assumption of a fixed 1024x600 resolution is embedded deep in the implementation; when running the game in fullscreen mode (for which 1024x600 is not an option), many of the widgets are misplaced, so the game had to be embedded in a browser.


Knowing that Ryan was adding the kiosk feature directly to the game, I focused on making an interface that would be most useful to the player. At first, I hoped to just be able to run the game in a fullscreen browser window, but all browsers I could find have a "feature" in which moving the mouse to the edge of the screen pops up a prompt to get you out of fullscreen mode.


Fullscreen Chrome browser with the mouse having been pushed to the top edge
The player will only have a mouse and no keyboard, as the laptop is actually enclosed and protected within the kiosk. This makes it imperative to prevent the player from exiting fullscreen mode and poking around, as then someone else would have to manually go in and restore the settings before the next attendee walks by.


After a bit of surfing, I discovered that Chrome has a kiosk flag that does exactly what I need. I created a batch file that starts Chrome with the "--kiosk" flag, followed by the location of the WebPlayer html file, and it works like a charm. I put a shortcut to this batch file into the Startup directory, and now booting the machine takes you right into the game. So, in the case of failure, a volunteer at the Backyard area need only reboot the machine, and we should be fine.

Incidentally, it was easy to customize the WebPlayer HTML file with a bit o' CSS to get the look above. I'll share it here in case it's useful in the future (to me or to you).

<script type="text/css">
body {
 background: #5d337b;
}
#unityPlayer {
 position: absolute;
 top: 50%;
 height: 600px;
 margin-top: -300px;
 left: 50%;
 width: 1024px;
 margin-left: -512px;
 border-style: solid;
 border-width: 4px;
 border-color: #262263;
}

I'm using a little CSS magic to center the fixed-sized unityPlayer div in the screen. This will work fine as long as the kiosk display is at least 1024x600 resolution, and if it's not, we have even bigger problems. The small purple border around the game makes it pop against the background when playing the game.
Chrome in Kiosk Mode
We also want to prevent the user from right-clicking and fiddling with the browser or the Unity Web Player settings, and so we used the KillRightClick trick explained at lifehacker. Linking the script to the startup menu ensures that the kiosk starts in a stable and hopefully tamper-proof state.

A brief note about the value of reflective blogging. When I started this post, I had an inelegant, resolution-dependent hack for vertically centering the game in the browser window, and I had failed to consider complications of context menus (right-clicks). As I was copying my CSS over to FormatMySourceCode, I thought that there must be a better way; a few jumps around the Web led me to the absolute positioning, fixed-size div trick. As I was generating the screenshots for this post, I realized the vulnerability introduced by the right mouse button, and again, a bit of trial and error led me to the current approach.

Finally, I would be remiss if I did not thank Al Rent for inviting Root Beer Float Studio to showcase our game in the Ball State Backyard.

See you at the fair!

Thursday, July 19, 2012

Adventures in Narnia: Hybrid serious gaming from 1984

Poking around my old box of C64 artifacts, I came across Adventures in Narnia: Narnia, a game that—for a little while—I wasn't sure really existed. There's precious little information on the Web about this game, but hopefully this post will change that!


Adventures in Narnia was released in 1984 for Commodore 64 and Apple computers. It's based on The Lion, The Witch, and the Wardrobe, C. S. Lewis' first book in the Chronicles of Narnia. In fact, opening up the fancy plastic case, you can see that the game comes with a copy of the novel.


The floppy disk was not in the box, but we do see the book, a manual, ... and a deck of cards. Adventures in Narnia came with a deck of cards and a pair of dice that were used during game play. This makes it the oldest example of hybrid game design of which I am aware. (The original dice are nowhere to be found; I'm fairly certain we took them for use in other games ages ago. While I don't fully remember them, my memory tells me they were classic white with black pips.)

I have looked for a disk image for this game on and off for years; as I mentioned, I began to wonder if I the memory was the product of my subconscious! Turns out you can find one at gamebase64, if you have a working C64 emulator. I'm using photos from the manual, which include sample screenshots and provide a bit of context.

 The game plays in two acts, and here's a shot that shows the first one, where you try to gather flowers, avoid dwarfs, and keep Edmund from going to the White Queen.



If you bump into a dwarf, you have to roll the pair of dice and try to beat the given number. Succeed, and the game carries on; fail, and you lose a heart and return to the wardrobe.


At certain points in the game, you would be prompted to flip over a card from the deck.


There are nine different cards. As you can see, each one has the name of a character or location from the book, an illustration, and instructions to press a particular key on the keyboard.


Here's a closer look at those cards.


Pressing the corresponding key brings you into a minigame, many of which involve rolling the dice. Some are just plain bad: Zap makes you lose a heart. Here's another manual pic showing a few of the minigame screens.


At this point, you may be wondering: what's to stop a player from simply entering Aslan's code every time, or typing "12" every time a high roll is needed? Nothing. Well, nothing in the game mechanics anyway. It's up to the player to decide if it is worth playing honestly or if it's more important to win. Check out the first page from the rulebook:

There's a lot of interesting stuff going on here. They distinguish their game from all the others by pointing out that in addition to being fun, it teaches positive values. These days, we call this "serious games." What's fascinating to me is that they're not talking about teaching facts and information, as a lot of poor edutainment tries to do; this game claims to be teaching values. Also, like a lot of modern serious games work, there's no evidence that it does actually teach these values, but it makes a lot of positive-sounding claims.

They call this an "interface(tm) game". Note the trademark. Adventures in Narnia predates modern use of interface to refer to the space between man and machine! Certainly there was some research happening on human-computer interaction, but the concept of interface had not entered the mainstream.

Three pages of the manual are dedicated to the adult reader in sections titled "For Parents and Teachers" (complete with discussion questions from each part of the game), "After Reading the Book," and "Enrichment Activities."

This is a fascinating piece of computing, HCI, and serious games history. There was a second game also produced, based on Voyage of the Dawn Treader, but I've never seen it in the wild.