[ Jocelyn Ireson-Paine's Home Page | Free software | Publications | Virtual Economics As If People Mattered ]

The Lives Behind the Numbers On the Screen: Illustrating the Social Consequences of Economic Change By Telling Stories On the Web

 

It's crazy, but it fits the facts. They aren't Russians and they aren't Martians. These people are advertising men! Maybe they hypnotise us and maybe it's something else, but however they do it, what happens is that they let us live a day at a time. They pour advertising into us the whole damned day long. And at the end of the day, they see what happened - and then they wash the day out of our minds and start again the next day with different advertising.
[Frederick Pohl, "The Tunnel Under the World"]

The quote comes from a splendidly paranoiac short story whose main character wakes up one day and begins to realise that there are flaws in the structure of his reality. Not strange lights in the sky; not gravity-impervious supermen; but strangely insistent advertising jingles in the office lifts, unfamiliar staff at the newsagent's pushing unfamiliar brands of cigarette, and raucous yells from advertising sound-trucks blasting the neighbourhood from its beds in the morning. As in the Matrix, the man in Pohl's story discovered himself to be living in a virtual world. But the Matrix constructed its world merely to ensure eternal survival. The purpose of Pohl's virtual world was serious - to save money on market research.

The models used by real advertisers, do not, I suspect, contain townsful of little simulated people. But if there's one place such a model would excel, it's teaching. Imagine a miniature town inside a glass box, with dials on the front that let you turn taxes up and down, decrease or increase public spending. What a splendid toy this would make for economics students. With recent developments in computing, it looks as though such a thing may soon be feasible, and I'll talk about that later in this article. For the rest, I describe experiments in implementing a much smaller simulation with the same objectives: to generate, from the numerical forecasts of our Virtual Economy macroeconomic model, diaries and newspaper stories about the lives behind the numbers. These can be used to inform students about the economic and personal costs of unemployment, inflation and growth, and to show how deep such problems can strike; to advise on corrective policies; to illustrate the dynamics of the economy; to clarify the significance of the numbers; and generally to link the numbers to real life.

As part of this work, we used interactive fiction techniques to impose a narrative structure on the output, trying to give it a sense of initial complication and tension followed by swift resolution. Telling stories is not a normal topic for an economics journal. However, advertisers, games designers and journalists all try to do this, wanting to render their writing gripping and memorable. What works for them ought to work for us in teaching too, so we felt it worth experimenting to see how easily our programs could impose such structure on their output. It would be an empirical question as to whether this does in fact make it more memorable. We used the same techniques to insert economics-related educational material, such as the effects of growth on traffic congestion, at appropriate points in the stories.

Be your own Chancellor with Virtual Economy

It's tough to be the Chancellor of the Exchequer. Voters are clamouring for extra money to be spent on education, health care and policing. At the same time you have to finance a war, and face less revenue because of a slowing economy, falling stock markets and a deeply troubled manufacturing sector. Be Your Own Chancellor and play our game to see whether you can balance the books!
[Be Your Own Chancellor, BBC, 2003]

We start with our Virtual Economy macroeconomic model [VE], whose output the story generator was to work from. You may have read about it in Volume 13 Issue 1 of CHEER [Beharrell, Church, Ireson-Paine, and Stark] or used the cut-down version we do each year for the BBC Budget site. VE, developed under a Nuffield grant, is a Web-based version of the Treasury macroeconomic model. Users can change taxes and other policy variables, and get back a page of graphs and tables showing a ten-year forecast for the change's effects on the macroeconomy. VE also contains a microeconomic model (not used in this work), and a lot of educational Web pages, amongst them material on the lives of the economists, worksheets, and theories of unemployment and inflation. We refer to these later when we discuss linking the generated stories to them.

VE The Game

The year after finishing VE, we were funded to build an applet version, VE II. As with VE, the model ran on the Web server, but the output, instead of being sent back as HTML, was computed by a Java program - an applet - running on the user's Web browser. The idea was to make VE respond faster so that it would be more involving for the student. We realised we could capitalise on this responsiveness by making VE II into a game, and since that was the starting point for the story generator, we shall describe it next.

Imagine a cross between Budget Day and a driving simulator, with the student sitting at a dashboard driving the economy a year at a time whilst steering to avoid crashing into a depression or flying off the road into an inflationary spiral. Graphs trace out the current forecast; exogenous shocks introduce bumps as we ride; sirens sound if the inflation or unemployment needle enters the red danger zones. Perhaps a factory hooter would be more appropriate in the second case. We can't really make the game as immersive as driving, because we can't forecast the economy far enough ahead to make a decently long "road". Nevertheless, we thought it worth taking the "steering" metaphor to its limits, asking how we would instrument such a game to be as involving as possible.

We had the idea of providing not only numerical feedback, but pop-up "voices from the crowd", with captions such as "We want jobs", "sack the Chancellor!". Perhaps we could add headlines recounting these in the third person, for display on a news ticker: "Opposition calls for Chancellor to resign", "Father of four on scrapheap after 44 years of faithful service". And if headlines, why not complete stories? We were having fun. But it also seemed this would give students a sense of the micro poking up through the macro, the lives behind the screen.

We wondered also whether it could make VE more compelling, providing in a small way the sense of power that would come on playing with living dolls. And - perhaps unworthily - it might appeal to students' destructive instincts, provoking them to crash the economy in order to see how badly they could hurt its inhabitants. This is not mere speculation. When teaching artificial intelligence, one of my props was an expert system that simulated depression. My students loved typing in every dreadful event they could think of to make the "patient" as horribly depressed as possible. The Millennium Dome took advantage of these instincts too in its Money Zone with the inflationarily catastrophic "Meltdown On the Streets Of London". At any rate, computer games use such motivational features, and we ought to exploit them in our educational software. (It may be that increased motivation, which is a many-faceted quality anyway, does not always improve learning. In the current state of educational psychology, this can only be decided by empirical evaluation.)

From macro to micro with the Virtual Mail

Though funding didn't permit work on VE The Game, we felt the idea of connecting the macro to the micro via text generation too useful to drop, and continued it with our experiments on computer-generated newspapers and diaries. We'll now describe the first, the Virtual Mail.

The idea was that the user would click a "Press for News" button on the VE output page, and get back a page describing the social consequences of its forecasts. This would appear as a tabloid newspaper, with news about what people are doing, financial advice and commentary, and the other topics listed in the following section. This newspaper format would act as a good carrier for them all, and the tabloid style would give ample scope for amusing and arresting writing, not least in the headlines.

What should the economy tell the students?

As we worked on the project, we discovered there to be several different kinds of information worth giving to the student. We list these next.

Explicit versus implicit information, writing style, and Heinlining

We found there to be two ways to present the information, which we name "explicit" versus "implicit". Most of the above topics correspond to particular kinds of story or story-fragment - explicit blocks of text inserted at particular places in the output. However, we treated the first two rather differently - we might say implicitly. With them, we converted the macroeconomic state variables into descriptive terms such as "boom", "depression", "brisk", "high", and inserted these into slots in the output. This conveys the significance of the variables' values more elegantly than by saying, for example "Our commentator writes that growth is currently 1.8%. This is untypically low".

This is one instance of the writing technique called "Heinlining", which works information unobtrusively into the story's basic structure rather than ramming it in as obtrusive authorial lectures (see the Heinlining entry in the Turkey City Lexicon [Shiner and Sterling]). It is a principle we want to follow throughout. Another instance occurs in the Virtual Diaries, which invoke pedagogical rules to insert economics-related material at natural points in the narrative.

Motivation

As well as informing the student, we wanted the output to encourage or motivate them. It was difficult to analyse exactly what this means, but part of it is surely that if the output is enjoyable to read, the student will pay it more attention, and spend more time with the model. We came up with three categories of motivation: fun, explorability, and breakability.

Fun

Christopher Hart in "Drawing on the funny side of the brain" [Hart] advises on selecting the right language register. Write "toes" rather than "feet" - "toes" is more gross. Write "kids" rather than "children" - "kids" is more slangy. And so on. Another way is to insert the occasional joke in the output. We must note though that we may turn students off if we appear too patronising or frivolous, something that probably becomes more likely as they do more runs and become accustomed to the space of possible outputs.

Explorability

There seem to be several intertwined concepts here. In part, there's the sense of involvement one gets from soap opera, of following a character through a series of events, of recognising the same person in different situations. With the story generator, we have even more variation: the sense of one character persisting through different alternate universes, as created by the different economic environments. Yet another form of variation is the sense of an event persisting when told from different points of view - e.g. a commentator explaining how unemployment causes stress, a patient explaining their anxiety to a doctor, the doctor writing about his overwork to an agony aunt, a TV team doing a documentary on the problem. We suspect all these are related to the enjoyment one gets from running jokes in comedy, recognition of similarity persisting through difference.

I like very much the way this is explained by Jim Gasperini, author of Hidden Agenda [Hidden Agenda], a simulation of Central American politics where students try their hands at governing the simulated country Chimerica. By taking turns as President, they experience the first-hand pressures facing a third-world country. They make decisions, make events happen, make headlines. Gasperini hoped that as they became involved in the game, students would suspend their American viewpoint and learn to empathize with the plight of a developing nation. Discussing the open-endedness of such simulations, he writes:

Even in the best 'interactive fiction', once all the puzzles have been solved the plot is revealed in all its naked linearity. A finished 'closed-ended' work is like a punctured balloon, emptied of all ambiguity. There is little reason for anyone to go through it again. By contrast, an 'open-ended' work becomes more ambiguous, not less, the more it is played. It is through repeated playings, comparing different plots chosen through the same web of potential plots, that the experience becomes most meaningful. This can be most clearly seen in the genre known as 'simulations'...

Each subsequent time the player enters the election campaign comparisons naturally arise between what happens this time and what happened other times. This serves to deepen the player's awareness of the range of structural possibilities.

[Gasperini]

Another facet of explorability is the creation of a rich and involving world where we can move around and explore, picking up objects, admiring the scenary, savouring the narrative. Explorability is important to game designers, as the Oxford games company Rebellion have told us.

As with overusing humour, we must be cautious here. Rebellion say that explorability is valued much less by Americans than by the British. Their American customers wanted to move directly to the game's goal without spending time to explore the environment, and became frustrated if the game prevented them doing so. (Rebellion also note cultural differences with the French and the Japanese: the French liked games that were pretty but didn't actually do very much, and the Japanese liked long shapeless narratives, or at least ones appearing so to British eyes.)

Breakability

We hinted at this - the urge to break things - at the end of the section on VE The Game. Students will enjoy pushing taxes and other policy variables to their extremes in an attempt to break the economy and see people suffer.

Implementation

We continue with an account of our implementation. Before going into details, we want to cover two topics of general relevance: how our ideal implementation would work (and how we believe it will in a few years' time), and our programming language Prolog.

Panic on the streets of Novistrana

For Christmas that year, Julian gave Sassy a miniature Tyrolean village. The craftsmanship was remarkable. There was a tiny cathedral whose stained-glass windows made fruit salad of sunlight. There was a plaza and ein Biergarten. The Biergarten got quite noisy on Saturday nights. There was a bakery that smelled always of hot bread and strudel. There was a town hall and a police station, with cutaway sections that revealed standard amounts of red tape and corruption. There were little Tyroleans in leather britches, intricately stitched, and beneath the britches, genitalia of equally fine workmanship. There were ski shops and many other interesting things, including an orphanage. The orphanage was designed to catch fire and burn down every Christmas Eve. Orphans would dash into the snow with their nightgowns blazing. Terrible. Around the second week of January, a fire inspector would come and poke through the ruins, muttering, "If they had only listened to me, those children would be alive today".
[Tom Robbins, "Even Cowgirls Get The Blues"]

In my introduction, I suggested we shall, fairly soon, be able to simulate a small town in enough detail to make a wonderful teaching aid. For the past few years, computer games company Elixir [Elixir] has been working on Republic, a game set in the fictional post-Soviet-breakup country of Novistrana [Novistrana]. To play Republic, you must remove the President from power, be it by military coup, forced resignation, or a people's revolution. You do this by moving from café to meeting hall to bar, trying to persuade spies, gangsters and politicians to do your bidding. And as you do so, the (extremely detailed) graphics show you the inhabitants of Novistrana going about their daily business: collecting bread from the bakers, sipping coffee in the café, or saying hello as you pass by them in the street. Elixir claim Republic contains one million of these simulated characters. Whether or not the game actually can simulate that many, it does appear to contain a very large number of simulated agents.

How do these agents work? Elixir aren't giving much away, but in an interview [Mayer] concerning the AI techniques used, they say they're based on subsumption architectures implemented as augmented transition networks, a technique well-known to games designers and computer scientists. At any rate, Elixir's claim begins to sound plausible. The game, if driven by an appropriate economic model, would make the ideal "glass box" simulation, and we should watch for developments. It's worth noting that such techniues are easily implemented in Prolog, our next topic.

Programming in Logic

Everything can be expressed in predicate calculus, even irony.
[Anon.]

We now move on to our programming language, Prolog. We don't have space to make you an expert here, but we do need to indicate how we used it in our implementation. It's also worth noting that it lets you tackle problems that would be impossibly complex in other languages. So why Prolog? We conceived the story generator in terms of entities such as rules, grammars and records of events; we needed a language whose primitive data structures we could easily map these onto. By analogy, Fortran sees the world as rectangular arrays of numbers, so if you are writing vector or matrix programs in it, the coding will flow smoothly. Only a maniac, however, would write an expert system or a natural language parser in Fortran. And just as Fortran provides arrays as a primitive notion, so Prolog provides grammars, rules, and the ability to store and manipulate facts about events. We'll give two examples, both related to the story generator.

Prolog is different from Fortran, and from C, Java and most other languages. With these, a program is a sequence of instructions - read data, assign to a variable, print variable - which must be followed to solve the problem. This is "imperative" or "procedural" programming. But in Prolog, one writes logical statements - statements in a subset of first-order predicate calculus - that describe the solution to a problem. This is "declarative" programming. If writing an imperative program to build a house, one would code instructions telling the computer to pick up a brick, lay it on another brick, put a window next to it, and so on. The declarative logic program, though, would specify what it means for something to be a house - it has walls, which are parallel to one another and perpendicular to the ground, and composed of bricks in one of several patterns, and may contain a window, and other things. Special methods are needed to compile Prolog into something a computer can execute, which is why it appeared on the scene later than Fortran. These methods are now well understood, and there are some very efficient Prologs around. We used SWI-Prolog [SWI], which works well on Unix and Windows.

As our first example, suppose we have a list of economic events, such as "tax has increased", "exports have decreased", and "workers' incentives have decreased". And suppose we have a list saying which events directly cause which other events: for example, "tax has increased" causes "workers' incentives have decreased". Our goal is to write a program that will tell us, given any two events, whether one causes, either directly or indirectly, the other. (This is the transitive closure of the "direct causation" relation.) The logic of this is straightforward:

A causes B if A directly causes B.
A causes B if A directly causes some third event Z, and Z causes B.
Note that the second rule is recursive, defining causation in terms of itself.

Translating this into Prolog is equally straightforward:

causes( A, B ) :- directly_causes( A, B ).
causes( A, B ) :- directly_causes( A, Z ), causes( Z, B ).
Here, the symbol :- means "if", and the comma in the condition of the second rule means "and".

To run this, we need some data. Let's enter some facts about the economy:

directly_causes( tax_increases, workers_incentives_decrease ).
directly_causes( workers_incentives_decrease, production_decreases ).
directly_causes( production_decreases, exports_decrease ).
Then if we were to load these into Prolog and ask it
?- causes( tax_increases, exports_decrease ).
it would tell us the answer yes. With a bit more effort, we could make the program give the "route" - the chain of events - between any two points. Not being a complete implementation of logic, Prolog isn't always this straightforward, but the tricks and idioms needed are easily mastered and greatly increase one's problem-solving ability.

What we have here is a brutally simple qualitative economic simulation. We derived it by reverse-engineering the song "There's a Hole in My Budget" [Michael Flanders and Donald Swann], in which there occurs a "dialogue between the Prime Minister and Chancellor, who wander round the room in a slow inflationary spiral". The Virtual Mail simulation works in the same way.

For the second example, please look at a little program that generates plots for science fiction stories [Ireson-Paine (plot generator)], enhanced from "The Science Fiction Horror Movie Pocket Computer" [Wilson]. Like the previous example, it is concerned with connections within sequences of events, but its goal is to generate such sequences given a specification of which events can directly cause one another, rather than to examine sequences and check for causal connections within them. The Virtual Diaries history generator works in a similar way.

Implementing the Virtual Mail

"And all the papers have reports from three or four agencies?"
"Yes."
"But if we all send the same thing it seems a waste."
"There would be a row if we did."
"But isn't it very confusing if we all send different news?"
"It gives them a choice. They all have different policies so of course they have to have different news."

[Evelyn Waugh, "Scoop"]

The Virtual Mail was relatively straightforward to implement, consisting of a qualitative social simulation that generated logical propositions about events, all represented as Prolog facts. There was also a database that associated these propositions with fragments of English text. By running the simulation and then finding all the fragments needed to cover the propositions it generated, we had our stories. The program then generated its final output by slotting them into a tabloid-style HTML template.

The system starts by converting VE's predictions into logical propositions: e.g. "unemployment is high at 4,000,000". These trigger inference rules describing plausible consequences of the propositions. For example, high unemployment is likely to trigger the owner of a local factory to warn about closure and eventually to close. The proposed and actual closures may trigger stress amongst workers, in its turn triggering visits to a doctor and complaints about costs to the health service. The newly unemployed will visit the local pub less, possibly triggering knock-on business problems for the landlord. And so on. As these rules are executed, the simulation accumulates propositions describing all these consequences. The consequences are selected probabilistically, with probability dependent on the macroeconomic variables, so will differ from run to run.

We designed the Virtual Mail's narrative structure to depict in compressed form these generated chains of economic cause and effect. For example, the issue resulting from the events described above will probably contain stories about the closure of the factory, and then about its effects on the pub. So the dynamics of the Virtual Mail reflects that of the economy. We decided that each issue would therefore have to report more than one day of simulated time, However, the actual time between simulated events is less than it would be in real life, days rather than weeks or months. This is similar to soap opera [Curry], where events unfold more quickly than in reality. Another soap-opera convention we followed was to restrict ourselves to a cast of a half-dozen people or so - in the real world, one would have more people and less eventful lives.

Some of the inference rules were linked to objects representing people such as the paper's economic advisor and the doctor, and groups such as the CBI and the unions. This made it easy to generate the kinds of information described earlier. For example, if the advisor was triggered, he might emit a story about corrective policies; if the CBI or unions were triggered, they might emit headlines about the level of growth and their dissatisfaction with it. The qualifiers mentioned under the section on the significance of the macroeconomic variables were inserted here, generated from the variables' values using fuzzy control [Kosko]. We did this by associating words (or phrases) such as "marginal" with the interval they could reasonably describe; a value was translated to a word by looking up the interval in which it was most central. The correspondence between words and values was calibrated from newspapers and from a book on the economic history of the twelve EU countries which happened to contain a very large number of sentences that mentioned a numerical value for these variables in the same breath as an appropriate word. As a first attempt at knowledge engineering, we also created a spreadsheet in which we hoped to get members of the VE team and others to associate regions of the three dimensional growth-unemployment-inflation space with specific qualifiers and typical events [Ireson-Paine (knowledge engineering]. More recently, we have devised a questionnaire [Ireson-Paine (knowledge engineering 2]. Unfortunately, without funding for the project, we could not persuade anybody to spend time filling these in.

We provided the CBI, unions and other actors with functions that "perceive" the macroeconomic state into a degree of goodness or badness. Perception depends on ideology: the CBI is mainly concerned with the business confidence index, the unions worry about unemployment, and the Opposition sees the worst of everything. On the basis of these perceptions, the objects may trigger events: the doctor writes to an agony aunt, the unions, CBI and Opposition condemn the Chancellor. One thing this structure allows for is the point-of-view variation mentioned in the section on explorability. Thus we may come to know of the costs to the health service either via the doctor writing a letter to his favourite agony aunt, or directly because the advisor writes about it in his commentary.

The Virtual Mail begins with a summary giving immediate feedback on the state of the economy: a story with a Sun-style headline such as "A DOLEFUL BUDGET", "IN THE DOLEDRUMS", "PROPHETS OF DOOM FORECAST ECONOMIC GLOOM", or "IT'S THROW YOURSELF OUT OF THE WINDOW TIME FOLKS!", followed by a few lines indicating what the columnist thinks of the Chancellor. Some of the headlines we made up; others we collected and adapted from assiduous study of the tabloids (all research has its pains, no matter how great the gains) and books such as Hold Ye Front Page [Perry and Roberts] and Have I Got News For You [Deayton, Hislop, Merton, Swash and Thompson]. To make the generator select an appropriate headline, we used another database which indexed headlines by the propositions they could be used to describe.

The paper also contains a few fillers and jokes chosen at random. Some of these are parameterised by a context - carried through the rules - that contains randomly-generated environmental properties such as a weather forecast. Thus the fat cats of the local council may go on a "fact finding" trip, to Hawai if the weather is cold and rainy, or to the Alps if there's a heatwave. We also experimented with cartoons as fiillers, putting them at the end of the paper to provide a sense of closure. For example, there is an Andy Capp cartoon [Smythe] in which Andy walks past a brewery, looks up and sighs: "So much beer, so little time". We can (manually!) write different captions for different forecasts - e.g. for hyperinflation, "Never mind the Campaign for Real Ale. What about a Campaign for Real Money?" - and then use fuzzy logic to select the one best matching a particular forecast. ("The Cartoonist's Workbook" [Hall] has a useful section on how to think up jokes.)

Getting the layout of the Virtual Mail right was the easiest part. There is a program called Nonsense [Baughn et. al.] that generates parodies of Slashdot and other well-known Websites from templates describing their format and random-choice rules for their content. We translated this into Prolog, then modified a Nonsense template that describes small-town American newspaper, making it a British red-top, complete with white-on-red logo in the masthead.

Some examples can be seen at http://www.j-paine.org/Mail.html. This is a prototype: it only works with high unemployment, the text fragments were written in a hurry and are not very varied, we haven't tuned their style to make it coherent across stories, and we haven't tuned the economic-related factors.

Telling it like it is, with passion

Yet for me the real irony is that modern Britain seems to be a place in which more people feel passionately angry about society's inequality, and more likely to support anyone who opposes it, than at any time I can remember. ... We can respond to the injustices of the world by supporting them, ignoring them or opposing them. The second reason for writing this book is, in its own small way, to attempt to redress the balance towards the idea that comedians can be, and are, part of the Opposition.
[Mark Steel, "It's Not a Runner Bean"]

After the Virtual Mail, we changed focus. This was for two reasons: to go deeply into the personal costs of economic problems, and to make the output more memorable.

There has recently appeared a clutch of popular books concerned with the 1980s and 1990s: the unwanted social changes induced by Thatcherism and the hoped-for social changes not induced by New Labour. On the fictional side, we have Tim Lott's "Rumours of a Hurricane" [Lott]; on the documentary, Polly Toynbee's "Hard Work: Life in Low-pay Britain" [Toynbee], reviewed by Peter Kilfoyle [Kilfoyle]; on the autobiographical, John O'Farrell's "Things Can Only Get Better: Eighteen Miserable Years in the Life of a Labour Supporter, 1979-1997" [O'Farrell] and Mark Steel's "Reasons to be Cheerful" [Steel (2001)]. These - particularly the passion evident in quotes like this one from "Reasons to be Cheerful" - were what inspired the Virtual Diaries.

Then there was the problem of money. On the dole you literally run out of money. I have had frustrating conversations about this, in which someone would shrug their shoulders and agree it was a nuisance when you had no money. 'But I don't mean "not much money", or "no money until I get to the bank",' I'd grimace, 'I mean NO MONEY". One of the most frustrating pieces of advice in that situation was information about shops that sell cheap shoes or a kitchenware sale. Because if you've got NO MONEY it makes no difference whether something costs ten quid or twenty quid. You either nick it or go without. You might as well tell someone that Swan Hunter are offering a half-price battleship for only eighty million quid.

In the same vein, Steel describes the draining away of self-respect:

In one sense being unemployed is the hardest job of all, in that it's relentless. It wouldn't be so bad if the hours were the same as other jobs, so you spent the day in a numb trance or walking to Camberwell to get cheap onions, but at five o'clock reverted to a normal human being with forty quid in the bank and a reason to wash. What a joy it would be to wake up on a Friday thinking 'one more day and then a whole weekend of having enough money for a pint before being back in the sleeping bag'. And at least you'd feel you mattered if a supervisor came round once an hour yelling at you to get back to sleep. Instead, unemployment impregnates you with an infectious sense of worthlessness that spreads through your whole body to leave a numb vacant slouch, because you can spend all day in a sleeping bag and no-one's going to complain, or even notice.

We felt it essential to incorporate such emotional responses into our output. To make this easier, we concentrated on the details of one person's life, switching from the Virtual Mail to Virtual Diaries. How we implemented these is the subject of the next few sections.

Implementing the Virtual Diaries

We conceptualised these as a set of sets of alternate universes. There is one set of universes for each combination of economic variables forecast by VE; within this set, there are many alternative histories, since our programs are probabilistic and do not generate the same output every time. How can we implement this?

We started by reverse-engineering "Reasons to be Cheerful" and assorted other works, including economics textbooks, to form a structure from which appropriate histories could be generated. This entailed identifying common factors in the histories and factoring them out as far as possible. (Technically speaking, this is akin to converting a set of strings into a grammar that generates them all.)

As we were doing this, we chopped the histories up into atomic chunks of text, each describing an event or episode that the diary generator regards as indivisible. We then associated each chunk with a unique logical proposition; the diary generator manipulated those rather than the texts, using a database similar to those in the Virtual Mail to map propositions to text on output.

We needed to decide our ontology, or how the world is to be divided up into processes, events, objects and other primitives. We adapted this from Lang's declarative model for simple narratives [Lang], using sheaf semantics (a beautifully elegant way of formalising the notion of object and system) [Goguen]) to guide our representation. The result is similar in spirit to our science fiction plot generator, but with transition probabilities that depend on the macroeconomic variables.

There isn't much intelligence in these simulated agents. We can draw a spectrum of implementation methods, becoming more intelligent and offering more data compression as we go on. On the left, we'd have an impossibly unwieldy list of all possible histories; then the grammar we actually used; then the augmented transition networks used by Republic, and techniques such as hierarchical task networks; and finally, such things as general purpose planners, programs that search for a chain of actions that achieve a specified goal. For our work, if we want to make the agents more intelligent, we would probably use augmented transition networks or hierarchical task networks. There is a short games-related article on the former [Brownlee], and a clear account of how one designs the closely related fuzzy state machines in "Fuzzy State Machine Modeling of Autonomous Agents For Games" [Gough, Suliman, and Mehdi]. An article on hierarchical task networks appears at "Generating Dynamic Storylines Through Characters' Interactions" [Charles, Mead, and Cavazza].

Even with very intelligent agents, we would still have difficulty generating English descriptions of their actions. It is easy to convert atomic events into a declarative phrase such as "John opened the door". But to combine many phrases into text that reads well, the program must know when to replace nouns by pronouns, to insert sentence connectors, and so on. Otherwise we end up with text only a Dalek could enjoy: "John opened the door. John put the key in the lock in the door. John turned the key". Such programs are beginning to become available: see "Narrative Prose Generation" [Callaway and Lester] but do not yet have the coverage needed for our work. I hope that by the time Republic-level techniques are available for our models, natural language technology will also have advanced so that we can hook up such a program to the model and let it run, generating narratives completely automatically.

Life is a narrative

The Greek concept of tragedy was an extreme form of narrative imperative: the nature of the impending disaster had to be evident to the audience and to virtually all of the players; but it also had to be evident that it was going to happen anyway, despite that. You were Doomed, as you should be - but we'll watch anyway, to see how interestingly you'll be Doomed.
[Terry Pratchett, Ian Stewart and Jack Cohen, "The Science of Discworld II: The Globe"]

So far, the Virtual Diarist generates sequences of events from someone's life, chosen to illustrate various points of economics. I now want to ask whether we could structure these to be more effective in teaching.

Novelists and scriptwriters know the difference between a good story and a bad. More to the point, so do advertisers. Advertising is a kind of teaching, and advertising companies don't just film an actor opening a jar of coffee or getting into a car; they spend millions of pounds on constructing commercials that will grab the viewer's brain by its evolved-in wiring and burn their message into his soul in letters of fire. According to "Writing for Story" [Franklin], so do modern journalists, since Truman Capote popularised the idea in the 1960s that they should structure their articles as stories, making them exciting, gripping, and saleable. If advertisers and journalists can benefit, shouldn't teachers?

So what separates a good story from a bad? What computational criterion distinguishes text that burns its message into one's soul in letters of fire from text that merely flicks it with a limp lettuce leaf? This is what we consider next.

Blueprints for stories: Interactive Fiction

It's the dullest of truisms, and seems to have originated with that unutterable bore Aristotle, but it's accurate all the same: a good story requires a beginning, a middle and an end.
[John Simpson, "News From No Man's Land"]

There is actually a thriving branch of computer science devoted to such questions. This is interactive fiction, which probably began in the 1970s with artificial intelligence research aimed at building story-writing programs able to handle natural language and the rules of commonsense physics and social interaction. Examples of such programs over the years, from a grammar for James Bond stories onwards, are shown at GNL, Narración y Poesía [Gervás].

This work has cross-fertilised with game designers attempts to create worlds, and then to create worlds that immerse you in a gripping and satisfying narrative. This started with the text adventures of the 1970s (see Graham Nelson's "A short history of interactive fiction" [Nelson]), and has carried over to today's graphics games. The ideal is for the game to feel like a film, with an auctorially-omnipotent scriptwriter continuously monitoring events and adjusting events and plotlines so that the whole thing is always a good story. The bibliography references a number of useful on-line papers on this and related topics.

If we are to apply these ideas to the Virtual Diaries, we must understand what constitutes a good narrative. Aristotle's Poetics [Aristotle] appears to have begun the analysis, splitting stories into a beginning, middle and end. The 19th century novelist and dramatist Gustav Freytag went further, seeing plots as an initial complication followed by a slow increase of tension and a swift resolution. This can be drawn as a "Freytag triangle", plotting the density of plot up the Y axis against time along the X axis. The ideal story would show a line rising slowly to the summit of tension then falling rapidly away. Other important properties are that most narratives have a protagonist (the character who is the main focus of interest), and possibly an antagonist or a foil (one or more figures who highlight the protagonist by their contrast with him or her).

We could add many other refinements, but we'll stick with these: one main character, a foil or two, an initial complication, a gradual increase in tension, and a final resolution. That's our structure - how do we achieve it?

How to keep the wolf at the door

We are now armed with a basic knowledge of story structure and have decided how our agents are to be controlled. In this final section on implementation, we'll show how the one can be imposed on the other, giving a simulation that is not only intelligently realistic, but also narratively satisfying. Recall that the purpose is to make the simulation output more story-like and hence more memorable.

Because it is the subject of a well-written introductory paper on this topic, "The Automatic Creation of Acts of God for Dramatic Effect" [Rhodes and Maes], we shall illustrate with reference to the story of the Three Little Pigs [Heiner]: those characters who lived in houses in the forest and found themselves constantly under threat by a Big Bad Wolf who liked pigs only in the strictly gastronomic sense.

It would not be difficult to simulate the pigs' world in Prolog, representing it as logical propositions. We'd begin with a description of the forest: location of the pigs' houses, caves for the wolf to shelter in, rabbit warrens and herds of deer for its food. The wolf would be equipped with some top-level survival goals - eat, shelter, drink - and less urgent goals which it can work on when not preoccupied with brute survival. We must also give it some way to convert these goals into actions. For example, the goal of obtaining food might get converted into "locate deer; run to deer; disembowel deer; eat". We talked about how to do this at the end of the section on implementing the Virtual Diaries.

Now we let the simulation run. But what has happened? Perhaps the wolf gobbles down the first two pigs, decides he's full up, and wanders off to kip in a cave. Or a female wolf lopes by and he decides to abandon the gastronomic satisfaction to be gained from the pigs in favour of satisfaction of a different kind. In both cases, the agents have behaved intelligently according to their programming, but there's no sense of continuing tension: the story collapses.

To get round this, Rhodes and Maes propose introducing a "stage manager" who continuously watches the simulation unfold, and who - if the simulation doesn't provide it itself - introduces a complication at the start by moving a threat into place. Similarly for resolution at the end. This is what we did. In our Prolog implementation, the "stage manager" was not a separate process, but a set of constraints on the histories being generated, probabilistically propising specific narrative-enhancing events if certain predicates were true of the history so far generated.

A nice side-effect was that we could cause economics-related educational asides to be inserted. For example, we have some text fragments in which the protagonist notices and comments on the level of traffic - noisy and polluting if growth is high, relaxingly sparse if it is low. By equipping these with preconditions on where they can go in the narrative (basically, when the protagonist is cycling or walking along a road, for example because he is travelling to a new job or a DSS office), we ensured they got inserted at a suitable location. Writers have a maxim "Show, not Tell" (see entry "Show, not Tell" in Turkey City Lexicon [Shiner and Sterling]). We would like to think we are following this here. The protagonist's emotional responses were handled in the same way.

We finish with two warnings. First, like most interactive fiction research today, our work is what Nick Montfort calls a linguistic "shell game" [Montfort]. The computer isn't generating text from scratch, but automatically assembles parameterised fragments of pre-written text. We are beginning to see programs that can do so - we cited Callaway's STORYBOOK [Callaway], but they are not yet ready for general use. Fortunately, authors of interactive fiction are used to living with this and have developed authorial techniques for working around it. See for example Chopped Fresh, not Canned [Stern], where the poster advocates reducing the grain size of the text fragments. Useful general hints on writing interactive fiction can be found at "Game Design and Aesthetics" [van Egmond].

The second caution is that by imposing these narrative structures, we are making our histories less realistic. As Phil Goetz writes:

Stories rely on conflict. Conflict is implicit in a simulation of a battle, a dogfight or an economic system (survival vs collapse). When the conflict is resolved, the simulation is over. But a novel is constructed by suststaining a major conflict, continually introducing new complications that prevent the protagonist from resolving the situation. The gradual escalation of conflict we find dramatic is unnatural, a failure on the parts of both protagonist and antagonist. It needs artifice to maintain it. Furthermore, the consequences of the resolution must be commensurate to the magnitude of the conflict. In real life, the war may be lost for want of a nail, but in IF, the protagonist had better have to work harder than to provide someone with a nail
[Goetz]
Does this matter? Probably not, as long as we tell our students. In any case, we must never fool them by pretending that the output from these programs is anything other than a - necessarily inaccurate - simulation. It is useful for understanding, but it has its limits.

Conclusions and future work

We are the storytelling ape, and we are incredibly good at it.

As soon as we are old enough to want to understand what is happening around us, we begin to live in a world of stories. We think in narrative. We do it so automatically that we don't think we do it. And we have told ourselves stories vast enough to live in.

[Terry Pratchett, Ian Stewart, and Jack Cohen, "The Science of Discworld II: The Globe"]

The work descsribed here had two objectives. The first was to generate accounts of the social circumstances accomapnying the forecasts from our Virtual Economy macroeconomic model, thereby showing students how the micro and the macro are connected. In doing this, we decided on a classification of the topics that should appear in the output. Using our knowledge of computer games, we also identified motivational factors.

The second objective was to impose a narrative structure on the output, making it - we conjecture - more memorable. Our implementation drew on techniques from interactive fiction, using them also to insert economics-related educational material into the output.

Our programs are incomplete prototypes, covering only a subset of the space of macroeconomic states and of possible events within these. The writing style hasn't been "tuned" to be coherent within stories, and we haven't tested the output on students. We must also rewrite the code from scratch, as it is messy, hacked, and even though in Prolog, procedural enough to make a Prolog guru weep.

As noted in the previous section, the implementation is something of a "shell game": it works by automatically assembling parameterised fragments of pre-written text, in this case under the direction of a blatantly simple social simulation and a set of rules for maintaining narrative structure. However, it seems from developments in computer games, AI, natural language processing, and interactive fiction, that we shall, fairly soon, be able to build simulations that model the everyday life of a large and diverse population in enough detail to make a wonderful teaching aid. This is something we should watch out for.

That is the long term. In the short term, I would like to finish the story generator in time to link it to the BBC Budget Day 2004 version of VE. This would be a valuable public service, and the huge number of visitors the site attracts would be an excellent chance for feedback and suggestions for improvements.

Virtual Economy is not the only program that could benefit from this work. I would like to design a story-generator "shell" (in the sense used when talking of expert systems shells) with which simulation authors could define their own actors and events and animate their own models. The small schematic models in the Virtual Learning Arcade [VLA], such as those for elasticity of demand and the interrelationship between markets would be ideal candidates.

This work was not funded in any way. I would like to find funding to continue it, and would appreciate hearing from anyone interested in collaboration.

Acknowledgements

Thanks to Peter Creak for interesting discussion and for writing some of the story fragments.

References

The URLs were checked on June 26th 2003.

Aristotle; translated by S. H. Butcher. Poetics, http://classics.mit.edu/Aristotle/poetics.html.

Jorn Barger. IF, AI, and the confabulating-arranger model of interactive fiction, http://www.robotwisdom.com/ai/ifdesign.html.

Barton Moss Secure Education Unit. Hyperinflation, http://www.pfeg.org/PDF/Hyperinflation%2017.pdf.

James Baughn; patches by Fred Hirsch and Peter Suschlik. The Nonsense random text generator, http://nonsense.sourceforge.net/. The Nonsense newspaper generator can be tried at http://nonsense.sourceforge.net/demo/newspaper/.

Andy Beharrell, Keith Church, Jocelyn Ireson-Paine, and Graham Stark. The Virtual Economy, http://www.economics.ltsn.ac.uk/cheer/ch13_1/ch13_1p32.htm#Stark, Computers in Higher Education Review Volume 13 Issue 1 pp 32-34, 1999.

Jason Brownlee. A Finite State Machine Framework, http://ai-depot.com/FiniteStateMachines/FSM-Framework.html.

Charles B. Callaway and James C. Lester. Narrative Prose Generation, http://tcc.itc.it/people/callaway/papers/npg-ijcai01.ps.

Fred Charles, Steven J. Mead, and Marc Cavazza. Generating Dynamic Storylines Through Characters' Interactions, http://wheelie.tees.ac.uk/users/f.charles/publications/journals/2002/ijigs2002.pdf.

Chris Crawford. Chris Crawford's "Erasmatron" story engine, http://www.robotwisdom.com/ai/crawford.html.

Chris Curry. Writing for Soaps, A&C Black, 2002.

Angus Deayton, Ian Hislop, Paul Merton, Colin Swash and Harry Thompson. Have I Got News For You, BBC Books 1994.

Elixir Studios, http://www.elixirstudios.co.uk/.

Clark Elliott Why boys like motorcycles: using emotion theory to find structure in humorous stories, http://www.ai.mit.edu/people/jvelas/ebaa99/elliott-ebaa99.html.

Jon Fernquest. World of Programming Examples Weblog: An Open Source To-Do List, http://www.geocities.com/bayinnaung/progexampweblog.html.

Michael Flanders and Donald Swann. The Songs of Michael Flanders and Donald Swann, Elm Tree Books and St. George's Press, 1977.

Jim Franklin. Writing for Story, Plume 1994.

Jim Gasperini. An art form for the interactive age, http://www.mud.co.uk/richard/ifan194.htm, Art Com, Volume 10 Number 10, December 1990.

Jim Gasperini. Hidden Agenda, http://www.mcli.dist.maricopa.edu/proj/sw/games/hidden-agenda.html.

Pablo Gervás. GNL, Narración y Poesía, http://calisto.sip.ucm.es/people/pablo/teaching/gln/sesion4.pdf.

Phil Goetz. Interactive Fiction and Computers

Joseph Goguen. Sheaf Semantics for Concurrent Interacting Objects, http://www.cs.ucsd.edu/users/goguen/ps/sheaf.ps.gz, Mathematical Structures in Computer Science, Volume 2 pp 159-191, 1992.

N.E. Gough, H. Suliman, and Q.H. Mehdi. Fuzzy State Machine Modeling of Autonomous Agents For Games, http://pers-www.wlv.ac.uk/~in6543/fzsm.pdf

David Graves (1988). Bringing Characters to Life, ftp://ftp.gmd.de/if-archive/programming/general-discussion/Graves.2, The Journal of Computer Game Design, Volume 2 Number 2 pp 10-11, 1998.

David Graves (1991). Plot Automation, http://www.tela.bc.ca/tads/authoring/articles/graves3.html, The Journal of Computer Game Design, Volume 5 Number 1 pp 10-12, 1991.

Robin Hall. The Cartoonist's Workbook, A&C Black, 1995.

Christopher Hart. Drawing On The Funny Side Of The Brain, Watson-Guptill, 1998.

Heidi Anne Heiner (compiler). The Annotated Three Little Pigs, http://www.surlalunefairytales.com/threepigs/index.html.

Jocelyn Ireson-Paine (plot generator). Web-based science fiction plot generator, http://www.j-paine.org/cgi-bin/spin.php.

Jocelyn Ireson-Paine (knowledge engineering). Knowledge-engineering spreadsheet for Virtual Mail, http://www.j-paine.org/KE.xls.

Peter Kilfoyle. Still the poor relations, http://books.guardian.co.uk/reviews/politicsphilosophyandsociety/0,6121,882172,00.html, The Observer, Sunday January 26, 2003.

Bart Kosko. Fuzzy Thinking, Flamingo, 1994.

R. Raymond Lang. A Declarative Model for Simple Narratives, http://www-2.cs.cmu.edu/afs/cs/user/michaelm/www/nidocs/Lang.pdf.

Tim Lott. Rumours of a Hurricane, Viking, 2002.

Peter Maunder, Danny Myers, Nancy Wall, and Roger LeRay Miller. Economics Explained, Collins 1995.

Jonathan Mayer, Interview on AI in Republic, http://www.strategyplanet.com/republic/ai.shtml.

Nick Montfort. Interfacing with Computer Narratives: Literary Possibilities for Interactive Fiction, Part IV, http://nickm.com/writing/bathesis/srth9.html.

Graham Nelson. A short history of interactive fiction, http://www.inform-fiction.org/manual/html/s46.html.

The Republic of Novistrana embraces Internet!, http://www.novistrana.com/.

John O'Farrell. Things Can Only Get Better: Eighteen Miserable Years in the Life of a Labour Supporter, 1979-1997, Black Swan, 1999.

The Oz Project, http://www-2.cs.cmu.edu/afs/cs.cmu.edu/project/oz/web/oz.html.

John Perry and Neil Roberts. Hold Ye Front Page! 2,000 years of history in THE SUN, HarperCollins, 1999.

Frederick Pohl. The Tunnel Under the World, Alternating Currents, Penguin, 1966.

Terry Pratchett, Ian Stewart, and Jack Cohen. The Science of Discworld II: The Globe, Ebury, 2003.

Bradley Rhodes and Pattie Maes. The Stage as a Character: Automatic Creation of Acts of God for Dramatic Effect, http://xenia.media.mit.edu/~rhodes/Papers/aaai95.html. Presented at the AAAI '95 Spring Symposium on Interactive Story Systems: Plot and Character, 1995.

Lewis Shiner and Bruce Sterling. Turkey City Lexicon: A Primer for SF Workshops, http://www.sfwa.org/writing/turkeycity.html.

Reg Smythe. Laugh at life with Andy Capp: Andy Capp No. 46, Mirror Books, 1982.

John Simpson. News From No Man's Land, Pans, 2002.

Mark Steel. It's Not a Runner Bean, The Do-Not Press, 1996.

Mark Steel. Reasons to be Cheerful, Simon and Schuster UK, 2001.

Andrew Stern. , http://steel.lcc.gatech.edu/grandtextauto/archives/000013.html

SWI-Prolog, http://www.swi-prolog.org/.

Mariët Theune, Sander Faas, Anton Nijholt and Dirk Heylen Parlevink. The Virtual Storyteller: story creation by intelligent agents, http://wwwhome.cs.utwente.nl/~anijholt/artikelen/cve_2002.

Polly Toynbee. Hard Work: Life in Low-pay Britain, Bloomsbury, 2003.

Stephen van Egmond. Game Design and Aesthetics, http://bang.dhs.org/if/library/category.html?cid=7#24.

Virtual Economy Online Model, http://www.bized.ac.uk/virtual/economy/.

Virtual Learning Arcade Online Models, http://www.bized.ac.uk/virtual/vla/.

Evelyn Waugh. Scoop, Penguin, 2000.

Gahan Wilson. The Science Fiction Horror Movie Pocket Computer, The Year's Best Science Fiction No. 5, Harry Harrison and Brian Aldiss, Sphere, 1972.

5 July 2003

[ Jocelyn Ireson-Paine's Home Page | Free software | Publications | Virtual Economics As If People Mattered ]