<!DOCTYPE html>
<!-- ========================================== kroc camen of camen design ============================================= -->
<title>code · A New Kind of Text Adventure</title>
<link rel="stylesheet" type="text/css" href="/design/design.css" />
<meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=no" />
<link rel="alternate" type="application/rss+xml" href="/code/rss" title="Just code" />
<link rel="canonical" href="/code/text-adventure" />
<!-- =================================================================================================================== -->
<header>
	<h1><a href="/" rel="index">
		Camen Design
	</a></h1>
	<nav><ul>
		<li><a href="/">all</a></li>
		<li><a href="/projects">projects</a></li>
		<li><a href="http://forum.camendesign.com">forum</a></li>
	</ul><ul>
		<li><a href="/quote/">quote</a></li>
		<li><a href="/writing/">writing</a></li>
		<li><a href="/blog/">blog</a></li>
		<li><a href="/photo/">photo</a></li>
		<li><a href="/code/" rel="tag">code</a></li>
		<li><a href="/art/">art</a></li>
		<li><a href="/link/">link</a></li>
		<li><a href="/poem/">poem</a></li>
		<li><a href="/audio/">audio</a></li>
	</ul><ul>
		<li><a href="/web-dev/">web-dev</a></li>
		<li><a href="/annoyances/">annoyances</a></li>
		<li><a href="/eve/">eve</a></li>
		<li><a href="/code-is-art/">code-is-art</a></li>
		<li><a href="/inspiration/">inspiration</a></li>
		<li><a href="/windows/">windows</a></li>
		<li><a href="/gift/">gift</a></li>
		<li><a href="/gaming/">gaming</a></li>
		<li><a href="/mac/">mac</a></li>
		<li><a href="/osnews/">osnews</a></li>
		<li><a href="/c64/">c64</a></li>
		<li><a href="/linux/">linux</a></li>
	</ul>
	<a rel="previous" href="/code/the_next_web">
		older article →
	</a><a rel="next" href="/code/splitscreen">
		← newer article
	</a></nav>
</header>
<!-- =================================================================================================================== -->
<article><header>
	<!-- date published or updated -->
	<time pubdate datetime="2011-05-14T12:15:00+01:00">
		<sup>12:15<abbr>pm</abbr> • 2011</sup>
		<abbr title="May">May</abbr> 14
	</time>
	<!-- categories -->
	<ul>
		<li><a href="/code/text-adventure" rel="bookmark tag">code</a></li>
		<li><a href="/gaming/text-adventure">gaming</a></li>
		<li><a href="/web-dev/text-adventure">web-dev</a></li>
		<li><a href="/code-is-art/text-adventure">code-is-art</a></li>
	</ul>
	<!-- licence -->
	<small>
		<a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_GB">c</a>
		share + remix
	</small>
	<!-- enclosure -->
	<a type="application/zip" href="/code/text-adventure/mystery.zip">
		mystery <em>199.2 KB</em>
	</a>
</header>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<p>
	<small>This is an <a href="/passion_process">abandoned project</a>, now made publicly available and free for
	anybody to use, adapt and share.</small>
</p>
<section>
<h1>A New Kind of Text Adventure</h1>
<p>
	<strong>Text adventures (“interactive fiction”, or “IF” to some) are still based on the original 1970’s
	concept.</strong> Graphical adventure games split off and became their own thing (point-and-click adventures), but
	the text-adventure of 2011 is still pretty much
	<a href="http://en.wikipedia.org/wiki/Colossal_Cave_Adventure" rel="external">Adventure</a> (the first
	text-adventure), but on new hardware. This is okay, but we’re still stuck in that ’70s implementation mindset
	that was shaped specifically around the restrictions and programming style of the computers in that time.
</p><p>
	I am working on a novel, presented using a new, elegant, web-based format that ditches the 1970’s look-and-feel
	and limitations.
</p><p>
	There exists two main problems with current Adventure-like interactive fiction that make it unsuitable for the book
	I want to write. Firstly, not enough text, and secondly, out-of-place navigation.
</p><p>
	Most text adventures accept that they are room based and that you move around a lot and so keep the descriptions
	brief. This places more focus on issuing commands than being absorbed in the story. I wish to write a story first, a
	game second. My book will read just like a book, but the player will initiate each new paragraph. How long and how
	detailed a chapter is will be up to the player, but the end result will still be a readable chapter; not a string of
	commands.
</p><p>
	The cardinal navigation used in Adventure-likes is inelegant and frankly horrible for the purposes of my story. I
	don’t tell people in my dining room to “go east” to get to the sitting room. You go from one location to
	another via relative and known portals such as doors, ladders, paths, gates <abbr title="et cetera">&amp;c</abbr>.
	This is how books tell the story.
</p><p>
	I started first by looking at <a href="http://inform7.com" rel="external">Inform</a> (and had considered
	<a href="http://www.textadventures.co.uk/quest/" rel="external">Quest</a> too), but even these most modern tools
	are still using the same Adventure mindset and after spending hours trying to learn Inform’s syntax I realised the
	whole shebang was completely over-engineered. I could spend forever learning one language to get the editor to
	understand my intentions, for it to compile into another language
	(<a href="http://en.wikipedia.org/wiki/Z-machine" rel="external">z-machine</a>), that would be interpreted by
	another language (<a href="http://parchment.toolness.com/" rel="external">Parchment</a>) and still leave me with a
	70’s game design that I couldn’t fundamentally change.
</p><p>
	I decided to write in what I know best: HTML. HTML would give me the formatting I wanted, universal access for
	players (no software to install) and the raw writing language that wouldn’t have to be written in one dialect in
	order to be converted into another one.
</p><p>
	I also decided not to write a system for writing text-adventures. <em>PHP is already a programming language for
	implementing a text-adventure</em>. Most people don’t seem to realise this concept, and instead write a PHP
	program to generically read and interpret data that’s been written using <strong>another</strong> tool they
	usually had to write as well. If I did this, I would be spending an eternity developing a system and never actually
	getting around to writing the <strong>content</strong>! The game’s logic is therefore actual PHP commands. Ifs are
	<code>if</code>s, with no virtual-machine between the two. This lets me write any logic I want, in a simple
	scripting language and inline the story text in the same HTML as will be rendered by the browser. Blissfully elegant
	and content-focused.
</p>


<h2>What Kind of Story Is It?</h2>
<p>
	The story is a new and original <a href="http://en.wikipedia.org/wiki/Sherlock_Holmes" rel="external">Sherlock
	Holmes</a> mystery, inspired by the Conan Doyle works. Exact details have not yet been pinned down. It is important
	to understand that this is a novel first, and a game second. Whilst the goal of most (if not all) text-adventures is
	simply to issue the right commands in order to win, the goal of this game will be to experience the story, the same
	as reading any book. The level of detail revealed will be up to the player’s curiosity and ingineuity.
</p>
<img src="/code/text-adventure/mystery.png" alt="Front cover of the text-adventure book “The Mystery of the Missing Detective”" width="560" height="770" />
<p>
	This fundamental and refreshing difference is best demonstrated rather than explained.<br />
	That said, before you see this, bear in mind that this is a very, very raw prototype.
</p>
<ol>
	<li>
		<p>
			The “engine” that powers this is about 150 lines of PHP / HTML, everything else is story text
			and logic
		</p>
	</li><li>
		<p>
			Many reactions are not programmed yet, and there’s no response for incorrect actions (“I
			can’t let you do that Dave”)
		</p>
	</li><li>
		<p>I haven’t added an inventory yet, which will be necessary to complete the demo room fully</p>
	</li><li>
		<p>
			As a prototype it lacks the depth. The rooms and objects provided are examples, and don’t fully
			explore the prosaic exploration possible. For example, I would imagine that the player would read
			a few pages of introductory story in Chapter 1 before they even get to the command prompt
		</p>
	</li>
</ol>
<p>
	Regardless, enjoy!
</p>
<ul>
	<li>
		<p>
			<strong><a href="http://mystery.camendesign.com" rel="external">Play The “Mystery of the
			Missing Detective”</a></strong>
		</p>
	</li><li>
		<p>
			<strong><a href="/code/text-adventure/mystery.zip" type="application/zip">Download the source
			code.</a></strong>
		</p>
	</li>
</ul>
</section>
<p>
	<small>This is an <a href="/passion_process">abandoned project</a>, now made publicly available and free for
	anybody to use, adapt and share.</small>
</p>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
</article>
<footer>
	<nav><a href="http://forum.camendesign.com">‹ Discuss this in the Forum ›</a></nav>
		
	<a href="mailto:kroc@camendesign.com">kroc@camendesign.com</a>
	<nav>view-source:
		<a href="/code/text-adventure.rem">Rem</a> •
		<a href="/code/text-adventure.html">HTML</a> •
		<a href="/design/">CSS</a> •
		<a href="/.system/">PHP</a> •
		<a href="/.htaccess">.htaccess</a>
	</nav>
	<form method="get" action="https://duckduckgo.com">
		<input type="hidden" name="sites" value="camendesign.com" />
		<input type="search" name="q" placeholder="search…" />
		<input type="submit" value="Go" />
	</form>
</footer>
<!-- =================================================================================================== code is art === -->