blog games about

The Never-Ending Story

The folks over at the Experimental Gameplay Project just recently announced their theme for September: the never-ending game. I was intrigued.

Given all the hubbub and ballyhoo on the Internets and Twitters and Fax Machines regarding “games as art,” I decided to throw together something entirely stupid—as per my constitutional rights—and the result is a real gem of a mess.

Behold! ArtLovr, a game thrown together over a handful of hours and a fistful of beers, with a little bit of HTML5 duct tape and Akihabara wizardry to suit the punters.

Yes, it’s Pong. Yes, there’s a finite score.

Or is there?

Well, yes.

But in real terms? Well, the way the game plays, the PONGBALL5000 takes a certain amount of time to cross the screen, and assuming it scores immediately, there is still a pause to display a message on-screen before the next PONGBALL3000 is released.

Now, for the sake of argument, let’s instead pretend that the PONGBALL is moving at the incredible speed of 320pixels per millisecond (the millisecond being the favorite time unit of game programmers and anaerobic bacteria), and that a point is scored every millisecond (we also assume no interim messages). A given player’s score is composed of 27 digits:
000,000,000,000,000,000,000,000,000
all the way to
999,999,999,999,999,999,999,999,999

Therefore, at the rate of 1 point per millisecond (in an increasingly lopsided game), how long until we hit 1×1027 and overflow one of the players’ scores?

31.7 quadrillion years.

Or, in units more familiar to you and me, 2.3 million times the age of the known universe. So, frankly, for our purposes, I like to think of ArtLovr as pretty much a never-ending game.

And there’s my take on games-as-art. Entirely fascinating from a technical standpoint I’m sure, but varying from tediously infantile at times to pretentiously lofty at others.

And my opinion is final and the best, QED.

A Relocation in the Life

On September 25th of last year, I started a project: I was to take and share one picture a day over the span of a year. It’s still going strong, and I’ll report back when it’s finished in just over a month, but matters require a quick update.

I was hosting “A Year in the Life” on Flickr, because, well, all the cool kids were doing it, and I’m nothing if not suggestible. As it turns out though, a free Flickr account comes with an itty-bitty living space of 200 photos max.

Grail Knight

“Such is the price of immortality…bullsh*t arbitrary limits.”

Turns out 200 isn’t a big enough number to hold 365 days of photos, and so I’m moving my non-for-profit business elsewhere—to Google’s Picasa, to be exact, where free accounts can be comfortable in their sexuality, and have a somewhat more flexible 1GB limit.

The link is here.

I’m currently in the process of migrating the photos, so not everything will be there immediately, but it should be so in the next week or two. So say we all.

PLANETS ARE AWESOME
As an interesting bit of trivia, Mercury and Venus are the only planets in the Solar System on which “A Year in the Life” could be fully hosted on a free Flickr account—their years consist of a total of about 0.5 and 1.92 local days, respectively. Venus is an interesting case: it orbits the Sun in 224 Earth-days, but it completes a full rotation on itself (a sidereal day) in 243 Earth-days—its day is longer than its year! However, whereas all other planets (viewed from above the Sun’s North Pole) rotate on themselves in a counter-clockwise direction, Venus rotates clockwise, or in retrograde. It’s because of this retrograde rotation that—to an observer on Venus—the Venusian year would last a total of 1.92 Venusian days.

The More You Know

Puzzle Shots

My good friend Erin Robinson recently released her biggest game to date, Puzzle Bots. If you haven’t played it yet, now’s your chance. Trust me, it’s a keeper. Go ahead, I can wait.

Puzzle Bots banner

No, seriously, buy it.

Given that I’d also recently started following The Drunken Moogle, it seemed only logical to somehow combine the two. It is therefore with a great deal of pride—and a moderate amount of less-shame—that I give you…

PUZZLE SHOTS

Puzzle Shots

It is now officially on like Donkey Kong as well as the other, lesser Kongs.

I tried to ensure that all the ingredients would be readily available, or at least easy enough to find in stores. So, without further ado, let’s meet the team (from left to right).

HERO

Hero

  • 1 part orange juice
  • 1 part vodka
  • Dash of blue curaçao

Directions: Mix OJ and vodka separately. Pour blue curaçao into bottom of glass, then gently layer OJ mix on top.
Tasting notes: Refreshing and citrus-y. Quite the go-getter.

ULTRABOT

Ultrabot

  • 1 part crème de menthe
  • 1 part Jägermeister

Directions: Slowly layer Jägermeister over the crème de menthe.
Tasting notes: The Jägermeister provides an initial, punishing Eastern bloc-style punch, while the crème de menthe reveals the sweet underbelly.

KELVIN

Kelvin

  • Literally a few drops of crème de menthe
  • Sambuca

Directions: Pour a few drops of crème de menthe into a glass, then top up with sambuca.
Tasting notes: As this is mostly made of sambuca, clearly it is meant to be set aflame.

IBI

Ibi

  • 1 part gin
  • 1 part grape juice
  • 1 blueberry

Directions: Mix the gin and grape juice in a glass. Add the blueberry.
Tasting notes: Ever the shy one, Ibi tends to curl up into a ball on land.

BOMCHELLE

Bomchelle

  • Rosé wine
  • Dash of tabasco sauce

Directions: Pour a shot full of rosé wine. Then add generous dashes of tabasco.
Tasting notes: Starts off sweet enough, but carries a surprisingly potent sting.


And there you have it! Remember people, always drink responsibly. And if that’s not an option, blame the new guy.

Cube Jumpr!

Apple has famously flashed Adobe the ol’ digitus impudicus by abandoning Flash in all of its most recent i{*} products.

What this means from a business standpoint, I’ll leave to more intelligent and informed pundits 1 (modulo a digression later on, methinks)—but what it does of interest to me is throw Apple’s not-inconsiderable weight behind HTML5 for browser-based gaming. Accordingly, Darius Kazemi and Darren Torpey recently uploaded a series of tutorials for Akihabara, a JavaScript API for HTML5 games. While it’s still in its infancy and perhaps not fully-featured (I wouldn’t mind seeing mouse/touchpad input down the line, for instance), Akihabara’s one of the first such APIs out of the gate, and will hopefully encourage devs to experiment some more in HTML5.

Now, I’ll be the first to admit that I’ve never worked at all with Flash. That’s not to say that I never will (next on my list is to tame the wild FlashPunk), but the Akihabara tutorials popped up right around the time I was looking for something new to learn. To top it off, I’ve never worked much with JavaScript either (notwithstanding some recent tinkering in Unity), while I’ve been getting more and more interested in browser-based cross-platform gaming in general. All I needed was a modest project of my own to code.

Cue KJumpingcube, one of my favorite free, built-in Linux games. It has the mindlessness and simplicity of Minesweeper with a competitive twist, and massive end-game reversals are always fun to watch. Given that it’s horribly straightforward, it seemed a good choice to implement with Akihabara.

After about a week of intermittent coding, the game in its most basic form is available here, dubbed Cube Jumpr! in honour of its main inspiration as well as the vowel-challenged Web2.0 sites that I’ve grown to despise. Fun!

Cube Jumpr! makes use of the arrow keys and the ‘z’ key. Since Akihabara maps the external ‘z’ key to the internal ‘A’, you’ll notice a lot of “Press A to do something or other” prompts that actually require a ‘z’ press. That’s a feature I may be addressing in future releases. Or not. Also to be (potentially) addressed are some improved sprites, as well as possibly adding the aforementioned support for the mouse cursor and/or touchpads.

The rules are thus:

  • Players take turns clicking on individual tiles—either blanks or ones they already own—to increment the value contained within.
  • When a tile’s value becomes larger than the number of immediately adjacent tiles, these adjacent tiles are incremented and “claimed” by the current player, while the original tile is reset to a value of 1.
  • The first player to claim all tiles on the board is the winner.

As I say, the game is extraordinarily simple—my own implementation even more so—but it’s moderately enjoyable, and made for a good first project in Akihabara.

HTML5 gaming is no doubt going to have an uphill battle against the entrenched ecosystem of Flash developers, publishers, and players. To make things even more difficult, being written in JavaScript means (for the moment) that the games are publicly readable, and thus open-source and impossible to market commercially 2. But I’m still looking forward to seeing what the community will come up with, as APIs like Akihabara become more fully-featured and powerful.


1 The Internet: Truly, the natural, logical development of civilised Socratic debate.

2 “But Linux is open source and some people do market it commercially!” Yes, well, you know what I mean.

Spare Parts — Walking a procedural path

As one may be aware, my graduate studies at McGill were focused on procedural content generation (PCG) for videogames—the end result was a rather primitive-looking pipeline for generating terrain, road networks, and buildings. While I enjoyed the work, it was something of a let-down for me because the bar had already been set extraordinarily high, most notably by ETH Zürich graduates Parish and Müller in their “Procedural Modeling of Cities.” Follow that link, read their paper, explore the site, and be bloody impressed.

P&M’s fantastic-looking algorithm is based on a heavily-modified implementation of L-systems, named for Hungarian Aristid Lindenmeyer, who developed them to model branching systems seen in plant development; later it was applied to blood vessel networks, fractal imagery, and a few other applications. P&M made their version context-aware and applied a two-step process of 1) proposing “global goals” (e.g., roads follow a circular or other global pattern) and 2) adapting proposed roads to local constraints (e.g., roads don’t go into the water, and can intersect with previously-built roads). 1

Being the consummate slacker that I am, I took one look at the algorithm in P&M’s paper and dismissed it as too complicated to implement for the purposes of my thesis—I had other, more different fish to fry, after all. And so I turned my back on L-systems, which felt like something of an intellectual cop-out.

A year later though, we come to Spare Parts, as previously advertised.

In a nutshell, Spare Parts will be “a procedurally-generated grave-robbing prototype.” Thus far, I’ve stuck to simple methods to generate the graveyard borders and the terrain contained within: three intersected rectangles define the extent of the level, which is then filled in with a variety of tiles distributed according to a single-iteration Perlin noise function. If it sounds overly simplified, well, it is. But I have to say, I think the results aren’t bad, if you’ll forgive my (lack of) artistic skills:

noroads1

noroads2

noroads3

Note the small white gateway, which marks where the player starts each map.

If nothing else, I like to think they look like plausible levels, if not necessarily photorealistic. Either way though, it’s still missing the finishing intermediate touch which inspired this whole darn post: randomly-generated roads. Because graveyards just aren’t the same without an interminable winding path2. I decided that this was probably as good a time as any to return to L-systems, and perhaps redeem myself for having abandoned them so hastily.

Looking online for an appropriate starting point in Lua (scripting, you’ll recall, being one of my motivators for this prototype), and still fully expecting it to be a long and complicated process, I happened to come across this forum post. Read it at your leisure, but I’ll go ahead and spoil the punchline: L-systems are bollocks. Well, not in every situation, but certainly in the case of road network generation.

P&M’s L-system algorithm, like any L-system, relies on “production rules,” which, on parsing a string of symbols, essentially just says “when you see substring X, turn it into Y,” with probabilities and/or conditions sometimes associated with a given rule. The magic of L-systems then comes from defining “branch” symbols, and balancing a certain regularity of pattern with some element of chance; plants, for example, are often mathematically precise, and yet still subject to environmental vagaries3. But looking at P&M’s rule set shows that about half of their rules ignore the “global goals/local constraints” pattern and are used instead for simple housekeeping: prepare a symbol (road) for deletion, delete roads in the next turn, propagate time-delay information, and so on. This, argues the author of that forum post, is useless and complicated work, and I’m inclined to agree. The author then proceeds to systematically deconstruct the L-system algorithm given by P&M, approaching the underlying, functional core of the procedure; that is, to maintain a list of “proposed” roads, and then evaluate them in some order, see if they are acceptable (with or without some minor modifications), and then store each accepted road while “proposing” a handful more branching from it. The post gives the following (slightly modified) pseudo-code:

initialize priority queue Q with a single entry: r(0, r0, q0)
initialize segment list S to empty

until Q is empty
  pop smallest r(ti, ri, qi) from Q (i.e., smallest ‘t’)
  accepted = localConstraints(&r)
  if (accepted) {
    add segment(ri) to S
    foreach r(tj, rj, qj) produced by globalGoals(ri, qi)
      add r(ti + 1 + tj, rj, qj) to Q
  }

Here, r(ti, ri, qi) represents any proposed road: ti is the time-step delay before this road is evaluated, ri is the actual representation of the road (e.g., a vector), and qi contains meta-information relevant to to our globalGoals function (e.g., for circular roads it might describe the polar angle, or it might declare the segment to be a highway as opposed to a country road, &c). The localConstraints() function evaluates a given road (passed by reference, so that the road can be modified—snapped to local intersections, for instance), and then determines if the road is acceptable or not. If it is, the road segment is added to segment list S, and the globalGoals() function uses that road to suggest new branching roads, which are then added back to priority queue Q with an incremented delay.

This is beautiful. It is the absolute height of simplicity. No housekeeping, no complicated symbols, just a priority queue and a simple loop. Developers can just focus on tailoring their globalGoals() and localConstraints() functions to the application at hand, and not worry about implementing a convoluted evaluation framework.

Needless to say, I immediately emailed the author of this forum post and offered him a beer; second, I got to work implementing his algorithm (the framework, at least) in my PCG library, and the global/local functions in Lua. For the purposes of Spare Parts, my needs are simple: roads can only be horizontal or vertical, and there are no necessary global patterns to speak of (if you’ve ever walked around certain parts of Père Lachaise Cemetery, you’ll know what I’m talking about). I impose the following constraints on the paths: that they form proper intersections; that, if two paths are parallel, they must be separated by a given minimum distance; and finally, that a certain minimum fraction of the terrain tiles must be “near enough” to a path.

These are extraordinarily simple rules. But will they produce anything remotely interesting? Have a gander:

roads1

roads2

roads3

Rocks and trees added as decorative obstacles. Eye-bleeding yellow used for contrast.

And of course, you can apply the same algorithm to the same tracts of land and still get different results…

roads4

roads5

roads6

It’s all still fairly primitive, but I was primarily concerned with making “roughly believable” paths through these graveyards, and I’m happy with the results, even if they’re not necessarily quite sophisticated, and lifelike. They should at least be fun to play.


1 If I’m not mistaken, the rad dudes at Introversion are using a similar system for Subversion.

2 This is something of a pun, of course, since the makers of The Graveyard also made The Path.

3 As a side-note: Przemyslaw Prusinkiewicz3a, who worked with Lindenmeyer, runs the Algorithmic Botany project at the University of Calgary, where you’ll find an impressive collection of virtual plants generated by L-systems.

3a Rudzicz. Prusinkiewicz. They’re cops. Polish cops.