2013-08-19

Twine: Multiple files in one story using StoryIncludes

List your .tws or .twee files in a special passage titled "StoryIncludes" and recent v1.3.5 betas will import the passages from those files when your story's .html file is built.

Newest Twine alphas/betas are here.

2013-08-11

Design Demons: The Demons at War

I received the following message from a reader:

I am the creative type. It is easy for me to focus on stuff but I find it hard to make myself disciplined. I am strict about the arts I produce though, I hate flaws and I am very detailed. But I tend to give up and tense up easily if I meet an obstacle. I start blaming myself and getting so stressed I get no work done. Is it still possible for me to pursue design? I am not a very productive person but I have concentration and passion for art. I just don't have the discipline and hard work to stick through it.

I think that the commenter can do well in design for this overriding reason: They are reflecting upon themselves and their projects. However, for now, they are probably over criticising.

The Design Demons are a good way to examine this situation. The Critic and Creative demons are fighting while the Pragmatic demon is ignored. This leads to feeling depressed and frustrated with projects.

In detail: The Creative demon has an amazing idea which the designer works on for a while but the Critic keeps saying that the work is not good enough yet. The project runs into rather normal problems and that further infuriates the Critic: “this isn’t good enough! Why can’t you do this?” The Creative demon becomes frustrated at the lack of exciting progress and so begins to interrupt with new ideas. Both the Creative and Critic are so noisy that neither pays attention to the Pragmatist demon. Eventually the project is abandoned out of frustration and the excitement of the new.

Here is a technique to strengthen the Pragmatist demon while taming the Creative and Critic demons.

  1. Maintain a list of potential projects. Record new ideas but do not act on them immediately.
  2. Set a deadline ahead of time: e.g. Today I have 3 hours to finish a project.
  3. Choose a goal OUTPUT from the list of potential projects.
  4. Execute.
  5. Post OUTPUT online.
  6. Repeat as necessary.

The focus of this exercise is on quantity of outputs with quality constrained by time. The deadline must be set before the project is decided and the deadline should be close. What tangible output can be completed before the deadline? The deadline limits the size of the idea but the designer can attempt a part of a larger idea provided that part is posted online by the deadline. The Pragmatic demon will learn to estimate project size better with practice.

The Creative demon may interrupt with new ideas so take two minutes to record the idea. Maybe the idea will be chosen later and maybe it will not. If the Creative demon stays too noisy then consider having a "No New Projects" week, or month. New projects can be recorded anytime but only projects listed at the start of the time period can be attempted. The Creative demon must learn when to be quiet.

The deadline will encourage the Pragmatic demon to challenge Critic demon: “We only have 30 minutes left, just how important is fixing this flaw?” The Pragmatist can work with the other demons to solve project problems: the Creative loves coming up with novel solutions while the Critic can iterate solutions quickly.

This article advises how the strong critical and creative designer can become a bit more pragmatic. More broadly, this article gives an example of how dysfunctional relationships between the Design demons are a useful model for examining designer psychology.

2013-04-02

Design as Simple Complexity

In 1963 Buckminster Fuller introduced the Design Science movement. The movement was largely abandoned within a decade because science (as we know it) does not explain design well. Horst Rittel's explanation of "wicked problems" and the methods approaches of Bruce Archer are more useful explanations with better outcomes.

Our current scientific method (called hypothetico-deductivism) makes predictions and then tests those predictions. If a prediction is not disproved enough times then eventually it becomes theory. The problem is all those experiments take time and control over the variables.

The more time taken to research increases the likelihood of feedback where effects loop back and cause changes to the thing being studied. In an area like design, feedback loops can be extremely quick; an Internet Meme can rise and fall in a matter of days. Science cannot always move fast enough and even if it does the conclusions reached might no longer be applicable as the feedback loops increase. Once research is published then it too feeds back into the system - stimulating differentiating rebellions and copy-cat self-fulfilling prophecies.

Science can explain things like Universal Aesthetics because the feedback loops are less problematic. But there are only a few such areas of design with this property. Science can be like trying to explain boxing by examining the posts and ropes because they are not as complex as understanding events inside the ring.

Science typically assumes that a problem can be broken into small parts which can be solved individually (reductionism) and the conclusions reassembled. This works if the relationships between the parts is simple and well understood - the variables can therefore be easily controlled. But relationships between design elements is complex so that controlling variables too greatly results in studies with narrow conclusions.

What are narrow conclusions? Research seeks the simplest theory that explains the most. Narrow conclusions are where a study is so focused, the variables controlled so tightly, that conclusions are not easily generalizable. A very narrow study might examine just one design (e.g. one app or a website). The outcomes of narrow studies are probably useless to somebody who isn't facing a near identical problem.

Since hypothetico-deductivist science has problems explaining design due to feedback loops and narrow conclusions then what might be a good approach? Surely there has to be something more rigorous than connoisseurship, visual intelligence or intuition? It turns out that there might be; Complex Adaptive Systems Theory is improving techniques towards a Science of Complexity. This area fits quite well with what Rittel and Archer were articulating.

Complex systems have agents that signal each other via relationships. Feedback loops are just natural parts of the system. There is also the property of emergence - where very simple interactions create the appearance of complex behaviour by the whole system. A complex system is more than just the sum of its parts.

Designers know about the dangers of mindless deconstruction and that design is synergestic. The whole is greater than the parts. Here’s a word play; make deconstruction = reductivism and synergy is emergence. Complexity science seems to be a good fit.

Computer based tools for working with complexity are improving beyond what Rittel and Archer had available. Design could now be treated as an applied domain within complexity science. Complexity is not a silver bullet (or golden hammer) but it could produce insights with a rigor that our intuition-based methods alone cannot provide. What might we do with such understanding? How about better design education and better design software.

2013-04-01

"The Quiet American" - History as a Love Story

Spoiler alert. Read the book (1956) and/or watch the films (1958, 2002) first.

All I remember about my first viewing (some years ago) is being quite confused about why Pyle and Fowler acted strangely in both their relationship with each other and their dealings with Phuong. This confusion ruined my enjoyment of this well crafted film. I watched the movie again today and have a new appreciation for its genius.

Since my first viewing I have walked many of the Saigon streets in the film so the whole movie felt much more familiar. I have also learned a little more Vietnamese history from the 1950s. I have not read Graham Greene's book or seen the 1958 movie. I accept that a 2002 interpretation by an Australia director (Phillip Noyce) made a couple of decades after the Vietnam War will have a different spin. Here is my opinion.

The relationships between the characters are parallels to the global forces they represent. Pyle is the USA, Fowler represents old Europe, Phuong the hope of new Vietnam and her sister the practical cynicism of old Vietnam. Old Man Europe and new Vietnam are happy lovers but old man Europe cannot fully commit to new Vietnam because of prior commitments outside his control. USA offers a marriage to new Vietnam and old Vietnam approves. The sister works directly for the Americans once the marriage between new Vietnam and the USA is arranged.

Phuong's character is never fully developed and this represents the hopeful possibilities of new Vietnam. Her name means Pheonix which is a western symbol for rebirth. She is largely controlled by her sister and we learn that she was the daughter of a professor. Phuong’s background is not one of naiveté. Van Mieu; the Temple of Literature in Hanoi (an old University) is nearly one thousand years old. Phuong’s emotions are either enigmatically blank or joyful - except when she was lied to about a marriage with Old Man Europe. It was no accident she proudly took the letter to her older sister who then told her the truth - this was old and new Vietnam realising it needed new allies.

The scene where Pile proposed to Phuong while Fowler looks on seems crazy. What man would let or encourage another man to propose to his lover? The whole relationship between Fowler and Pyle tolerating each other's affections for Phuong is nuts. How could a man be so forgiving of another for taking his mistress from him? Fowler's agreement that she would have a better life is nothing more than a platitude. This scene (and many others) make no sense until you realise this is America and old man Europe courting the new and hopeful Vietnam.

Bill is the powerless colonial ex-pat. His manners are poor even by his own country's standards but he tolerated in Vietnam provided he spends money. Bill is wrapped up in his own concerns and is oblivious to the world around him. Always drunk. His home country is sick but there is nothing the ex-pat can do. Vietnam is where he feels important.

At the film’s end the new and hopeful Vietnam happily embraces old man Europe and they forge a new future together. I'm told that in the book Fowler finally gets permission to marry Phuong. This is not made obvious in the 2002 movie - which probably reflects the passage of history.

With that lens, The Quiet American starts making sense to me. It is a way of metaphorically communicating a complex history through the familiar mode of a love story.

YMMV.

2013-03-21

Arduino LCD: Run on DFRobot LCD Shields.

Simon Baker (TinkerTronics) sent me the following code to get the Arduino game conversions running using the DFRobot LCD Keypad Shield. Just replace the relevant code at the top of the file and uncomment the #define DFROBOT_LCD line.

You'll notice that the ADC reading are slightly different. Enjoy!

/*--------------------------------------------------------------------------------------
 Defines
 --------------------------------------------------------------------------------------*/

// uncomment the next line to enable settings for the DFRobot LCD Shield -by Simon Baker
// #define DFROBOT_LCD 

// Pins in use
#define BUTTON_ADC_PIN           A0  // A0 is the button ADC input
#define LCD_BACKLIGHT_PIN         3  // D3 controls LCD backlight

#ifdef DFROBOT_LCD
  // ADC readings expected for the 5 buttons on the ADC input
  #define RIGHT_10BIT_ADC           0  // right
  #define UP_10BIT_ADC            99  // up
  #define DOWN_10BIT_ADC          256  // down
  #define LEFT_10BIT_ADC          410  // left
  #define SELECT_10BIT_ADC        640  // right
#else
  // ADC readings expected for the 5 buttons on the ADC input
  #define RIGHT_10BIT_ADC           0  // right
  #define UP_10BIT_ADC            145  // up
  #define DOWN_10BIT_ADC          329  // down
  #define LEFT_10BIT_ADC          505  // left
  #define SELECT_10BIT_ADC        741  // right
#endif

#define BUTTONHYSTERESIS         10  // hysteresis for valid button sensing window

2013-02-23

Strategery "The Finger" for Border Games

Here is another strategy video for my favourite iOS game Strategery. This video if for breaking through static borders in the mid to late game. Use this technique in preference to just creeping the border forward to end the game quickly or when you must come from behind to win. I used the finger to win a game where I only had about one third of the regions to the other opponents two-thirds. A disadvantage to that extent is a near certain loss if you stick with a "border creep" strategy. So, give your enemies the finger!

The finger can also useful in non-border reinforcement games - though the specifics of the opportunity are less likely to occur. Those specifics are; strong border (both) with a weak hinterland reachable by a break through.

See my other article: Strategery review, hints, tips, guide for more general info about the game and tips on how to play other modes.

Strategery Starting Moves (Border, Attrition mode)

My favourite (by installed time and playtime) iOS game has to be Strategery. I have already written a general review and tips guide. This time I did a video that covers getting started in the Attrition casualties, Border reinforcement mode.

This mode makes for the fastest games and are therefore perfect for casual play. By the 4 or 5 turn you know whether or not you are winning the game. In this mode ten spots almost don't matter like they do in Winner Takes all / Random mode. Choke points are where you can have a single region that borders multiple enemy regions. The basic tip is to establish a strong border around a hinterland and then to creep that border forward. Try to increase the hinterland without increasing the border.

See my other article: Strategery review, hints, tips, guide for more general info about the game and tips on how to play other modes.

2013-02-03

Strategery review, hints, tips, guide

The oldest game on my iPad that still gets regular playtime is Strategery (http://strategerygame.com). First I'll review the game then give a few hints, tips, guide advice. There is a Lite version but the app is only a couple of dollars. That equates to micro-cents per hour of play time.

Strategery is a Risk-alike with a couple of rule changes that make all the difference. This is skilled game design; realising when the product is good, removing dross and adding polish rather than unnecessary bling. Risk has its own version of Rule 34 - if you can think of a theme then there is a Risk clone for it. The App store is clogged with "Risk-like" games that are essentially the same game with a few extra maps and varying amounts of annoying fluff. Strip away that shallow theme and that's just annoying time wasting stuff that gets old fast. No thanks.

Risk is an excellent game to play with humans because of the psychological aspects and diplomacy, but Risk can be improved for the casual gamer. Strategery can be played both psychologically with humans and as a casual game. The polished interface, the random maps, dynamic flow and speed make for a better casual experience. Strategery has a simple interface that just makes sense. There are subtle animations: these are tastefully done to enhance your situation awareness. I like the moment of tension when your dice roll is mediocre and you see the first opposing dice settling on sixes. Even this is done at exactly the right speed - fast.

Yes, maps are randomly generated and regions generally have more adjacent regions than Risk. There are choke points but you must deduce these for every new map. A standard region supports a maximum of seven army dots and mega-regions max out at ten dots. Resupply is at the end of turn (not the start) and the amount is based upon the largest contiguous clump of regions controlled. Each dot represents a six sided dice that is rolled to battle. All attacking armies less one are moved into a conquered regions so no time is wasted in awkward troop transfers.

Strategery's limited dots per region reduces the "build up and overrun" effect of Risk's choke points and thus encourages a more dynamic flow. The resupply rule rewards maintaining territorial integrity and incremental expansion over lightning raids. Having said that, late game, you will goad an attack that exposes a weakness for you to exploit.

There are two game modifiers that change the play style; The casualty modes "Winner Takes All" and "Attrition" and the resupply placement types "Manual", "Border" and "Random". That's six variations that play differently. There are other modifiers but they have less of an impact on the game. Smaller maps mean there is no late game stages so I typically only play Epic. You can also choose if the map starts with all regions claimed or not.

The casualty modes select whether or not the winner of a battle takes casualties. Winner Takes All makes for a brutally fast early game but the late game is a grind. Attrition makes for a slower early game but a much faster late game. The resupply placements are manual placement which is slow and I think actually focuses you away from grand strategy into small conflicts. The border strategy resupplies regions that border an enemy region and this mode is good for faster games but does leave you prone to overruns. Random resupply replacements do the most to emphasize territorial integrity and incremental expansion.

The general strategy in the early game is to limit your border regions by taking choke points and building a contiguous territory. This limits attack vectors and gives time to build strength. Try to conquer new regions while minimising the number of new borders. Enemy will generally attack the weakest regions so think twice before taking a low-dot region that borders a high-dot enemy; you might be better to let the seven-dot attack first then clear up the weakened survivor.

The mid-early game is about containing opponents. While you continue to expand, prioritise expansion towards your most threatening opponent while encouraging the other players to attack each other. Do not come between your enemies while they are killing each other. Keep your choke points and limit your borders but do make an opportunistic grab for a mega-region if that does not risk your territorial integrity. You should be building towards a dominant number of territories.

The mid-game is about finishing off weaker opponents and establishing territorial superiority. Continue to harass the largest opponent while finishing off weaker players if you can. Sometimes you can attack a well-entrenched (a few territories with high dot counts) player by waiting for an opponent to attack them first then striking in for a winning blow. A "buffer state" player will attack towards their easiest to win battles so ensure that is another opponent and not you.

The late game is all about resupply. By this time you have territorial superiority so you are getting more resupply per turn. Take advantage of this by increasing the number of regions with enemy borders. If you can make a run to a map edge and split the enemy territory then you strike a huge blow to their resupply. The simple math is that if you inflict more casualties than the enemy can replace then you will win. If your dot count is increasing while the opponent's dot count is decreasing then you are winning.

Late in attrition games you will be attacking with every possible region (even a two-dot into a ten-dot) because you know that your two-dot region will be fully resupplied and you will inflict casualties that will not be replaced. Late in Winner Takes All games you will generally be attacking seven-dot versus seven-dot so conquer regions where you increase your number of seven-dot attack vectors onto further single enemy regions. In the late-late Winner Takes All games you will conquer regions where the enemy has more attack vectors onto your regions - because they will not be able to resupply fully.

My favourite game is Winner Takes All casualties with Random resupply but this can make for long games. In this game type you want a strong hinterland. These are regions that experience long-periods of peace so they eventually fill up and that focuses your resupply forward. When your border is overrun then you can "blow" one of your hinterland regions to retake lost territory. As you push into the opponent's hinterland expect them to "blow" their seven dots and overrun you in counter-attack. This is fine provided they are unable to fully resupply the hinterland. This ebb and flow is what makes Winner Take All / Random resupply an exciting game.

For shorter games try attrition with border resupply. That's enough writing - I'm off to play.

2013-01-27

How to Insert Images into Twine Without Linking


UPDATE: Twine 1.4 makes this process much easier. Go to the "Story" menu and select "Import Image". The techniques in this article are still valid too.


Twine has enjoyed some recent popularity and it is great to see the diverse and wonderful things people do. Inserting images into Twine is something that has become popular but having to transport the image as a file separate to the Twine output .html introduces some additional complications. I like the single output file nature of Twine.

Look at this Twine demo:
http://eturnerx.com/files/twinehowto/ImageDataURI.html (source .tws)
There is an image stored in the .html file itself using a Data URI (RFC 2397). That image is not a separate linked file. You can check it yourself, I'll wait.

Data URIs contains the data for the image in an encoded string that is embedded into the html <img> element. This works fine in most recent browsers (IE 8+) but is only suitable for smallish files. For IE8 the limit is not much bigger than 20 kilobytes but other browsers (including IE9) work just fine with much larger file sizes.

It is surprising how much image can fit within 20 kilobytes just by playing with filetype, compression settings and reducing pixel dimensions. Most flat line drawings in a few colours will generally compress well as PNG or GIF. Scanned line drawings should have the contrast boosted and/or posterized to flatten the colours in the image. Photographs or scanned images generally work better as JPEGs.

Once you have a small image file then it will need converting to a Data URL. I like to use:
http://websemantics.co.uk/online_tools/image_to_data_uri_convertor/
They also have links to online tools that can further compress your image.

Here is the code that goes into your Twine passage:

<html><img width="11" height="14" src="data:image/gif;base64,R0lGOD
lhCwAOAMQfAP////7+/vj4+Hh4eHd3d/v7+/Dw8HV1dfLy8ubm5vX19e3t7fr
6+nl5edra2nZ2dnx8fMHBwYODg/b29np6eujo6JGRkeHh4eTk5LCwsN3d3dfX
13Jycp2dnevr6////yH5BAEAAB8ALAAAAAALAA4AAAVq4NFw1DNAX/o9imAsB
tKpxKRd1+YEWUoIiUoiEWEAApIDMLGoRCyWiKThenkwDgeGMiggDLEXQkDoTh
CKNLpQDgjeAsY7MHgECgx8YR8oHwNHfwADBACGh4EDA4iGAYAEBAcQIg0Dk
gcEIQA7" alt="File Icon"></html>

(data URI example from: http://dataurl.net/#about)

The <html>...</html> tells Twine to treat the code inside as raw HTML. The <img ...> is the HTML code for placing an image. The width="11" and height="14" code give the width and height of the image - you should change these to suit your image. The alt="..." code improves the accessibility of your file by giving a text alternative to your image. Most likely the code will work without a width, height or alt specified but it is considered good practise to include them if you can. The real magic happens inside src="...". That src is an abbreviation for "source" and normally that would link to an external file. Here we give it the data URI instead.

TIP: These data URIs can produce large walls of text that are annoying for you as an author to scroll past. What I suggest is to put all the image code into a different passage then use the <<display>> macro to.... ummm... yeah... display the image. This makes the image reusable anywhere in your story and keeps your text passages nice and tidy. Consider this abbreviated example... (:: Double colon is the passage title)

::Start
<<display "Image:Document Icon">>
This is my text and there is an image above.

::Image:Document Icon
<html><img ...></html>

Your Twine story can use both data URI images and normal "linked" images. And data URIs work just fine in CSS too; great for setting background patterns. (The thing in square brackets [] is a tag applied underneath the passage title).

::Stylesheet1 [stylesheet]
body {
  background-image:url(data:image/gif;base64,R0lGOD... etc );
}

You have the tool, go make something cool.

2013-01-08

The Semantic Web is an Innumerable Corpus

I recently had the opportunity to present my PhD to people who are knowledgeable in related fields (particularly CYC) and have noticed that their questions usually come from me not properly explaining one property of the Semantic Web which I have called the "Innumerable Corpus".

The Innumerable Corpus is defined as: Innumerable triplets describing innumerable subjects expressed using innumerable ontologies. The word innumerable means a "practical infinity", that is, something that is not infinite but is uncountable. This means that there is no one source or one ontology that should be considered as authoritative. There is no guarantee that information of the same type (e.g. people) from the same source will use exactly the same ontologies. A general purpose semweb browser will adapt to RDF data from any source.

The inherent instability in triplets for a subject means that thinking is terms of looser "predicate patterns" is perhaps more useful than expecting conformance to ontologies.

Many Semweb projects scope the Innumerable Corpus property out. There are projects that use RDF as a data transmission language for data that is from controlled sources and in well defined ontologies. In that context a pragmatic approach is to hand produce the displays dependent on rdf:type. By ignoring the Innumerable Corpus property it is also possible to limit a project to a small subset of semweb data, place it locally for speed of access and perform computationally expensive processing over that data. Inferences can be pre-computing inferences before a user needs them.

All research projects have to scope things out for practical reasons but personally I find the Innumerable Corpus the property that most interests me about the semweb. The political argument is an important one; who controls how our knowledge is defined? Sure, authoritative information sources expressed in well known ontologies are important to our shared understanding but what about murky knowledge on the fringes? What about knowledge that is in dispute? What about knowledge that does not easily fit the orthodox ontologies? The decentralized possibilities of the semantic web really struck at the cyberpunk principles I've grown up with.

But there is also a technical reason too. Semweb browsers will eventually elaborate upon a subject by aggregating and inferring over RDF data from multiple sources. The greater the expansion then the greater probability that subjects of the same types will have less consistent predicate sets, particularly as owl:sameAs links are followed and rdf:type definitions expand. Data expansion The number of triplets per subject could be very high due to data expansion. Without filtering, grouping and ordering the displays of all those triplets will cause information overload.

The Innumerable Corpus means that each subject requires a custom produced display of data. This could be derived from how other similar (by rdf:type) subjects are displayed. These custom displays must be produced runtime.

Producing an authoritative display for an rdf:type is inherently fragile because it is difficult to account for missing predicates and additional predicates that do not conform to that display. Even the concept of an authoritative display assumes a single centrally ordained way of showing things. My preferred approach is to use personalization to let users negotiate with the semweb browser as to how they would prefer to see the data.

Plurality, instability and inconsistency are not special cases; The Innumerable Corpus is about accepting plurality, instability and inconsistency as normal and good.

2013-01-07

Twine GameStory Recommendations I

Here are some Twine stories that demonstrate what skilled authors can do with Twine. These examples are selected to show some of the many story types or narrative structures that can be created with Twine. These are reviews that might contain minimal spoilers.

CYBERQUEEN by Porpentine
Transhuman. Surgical horror. Some good time-based visual text effects. The writing is very atmospheric and keeps shifting reality. When reality stablises I'm not sure you're happy with the result.
Minimum playtime: 15 mins

Stygia by Kitty Horrorshow
It's a grittier Monsters Inc for adults... hang on, it's a horror themed afterlife. Well written with a setting and backstory suited for a movie. Limited replayability but you won't mind.
Minimum playtime: 10mins

Cold Dead Fish by Chris Klimas
Chris is the creator of Twine. This story is rather linear with only a few choices that really matter. Much of Twine's capability is used to "chunk" the story into unfolding bites that allow for contemplation and re-reading time as the reader explores the parenthetical links. These asides are interesting to the setting, but would have choked the narrative if the story was strictly serial. The subject of the story is a gentleman and an enigmatic lady.
Minimum playtime: 15mins

Fake Nerd Girl Detector by Zoe Quinn
Twine used instead of a flow-chart. This technique allows more space to make an argument and allows the author to keep the ending a surprise.
Minimum playtime: 5mins - some replayability in exploring the various endings

Choose Your Own Anna Anthropy Interview by Cara Ellison
This one is a hypertext arrangement of an interview with Anna Anthropy. If you're familiar with Anna's work you can skip most of the "asides". If you're interested in Anna's take on something in particular then you can read that. The format enables more indepth and richly annotated interviews than an equivalent serial article could.
Minimum playtime: 5mins - though you could easily spend more time if the subject matter interests you

Time Quest by Dungeon Smash
This choose your own adventure is sophomoronically funny. You get to trip around time and even postulate on the nature of time itself. Twine is very easily suited to make these kinds of stories.
Minimum playtime: 10mins

That's it for this round-up. Until next time (undetermined), maybe you can check out my Twine conversions of some old text games.