Virtual Economy was developed by the author and colleagues for distance-teaching economics to sixth-form and beginning higher-education students. It runs over the Web (at the time of writing, at http://www.bized.ac.uk/virtual/economy/) and allow students to act as Chancellor, changing tax rates and other parameters, and getting back numeric forecasts for growth, inflation, unemployment and other macroeconomic variables. One problem is that the numbers may mean little to some students. Is 2.6% GDP growth significantly better than 2.4%? Is a 5% unemployment rate high, low, or normal? Why is 20% inflation so bad? In this paper, we describe experiments to relate the numbers to social experience, by generating virtual diaries and newspaper reports showing the effects on everyday life. The generator uses artificial intelligence techniques, and attempts to impose a narrative structure on the output to make it more compelling. The paper includes an analysis of the different ways in which we believe the macroeconomic effects should be interpreted to students.
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.
The quotation above 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 towns full 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, and 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.
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!
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 Beharrell et al. (1999) 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 10-year forecast for the change’s effects on the macro economy. 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.
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 that 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!’ and ‘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 that 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 from 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 inflation catastrophe ‘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.)
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.
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.
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’ and ‘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 atypically 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 Shiner and Sterling (n.d.)). 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.
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.
Christopher Hart (1998) 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.
There seem to be several intertwined concepts here. In part, there’s the sense of involvement that 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 alternative 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: for example, 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 that 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 (n.d.), 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 empathise 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.
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 scenery, savouring the narrative. Explorability is important to game designers, as the Oxford games company Rebellion has 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.)
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.
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 work in a few years’ time), and our programming language Prolog.
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’.
In my introduction, I suggested that 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, the computer games company Elixir has been working on ‘Republic’, a game set in the fictional post-Soviet-break-up country of 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 that ‘Republic’ contains 1 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 with Jonathan Mayer (n.d.) 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 techniques are easily implemented in Prolog, our next topic.
Everything can be expressed in predicate calculus, even irony.
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 that 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, 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’ by Flanders and Swann (1977), 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 (Paine, n.d.b), enhanced from ‘The science fiction horror movie pocket computer’ (Wilson, 1972). 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.
‘And all the papers have reports from three or four agencies?’
‘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.’
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, such as ‘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 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 they 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 reflect those 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, 2002), 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 adviser 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 adviser 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 earlier under the bullet point ‘The significance of each macroeconomic variable’ were inserted here, generated from the variables’ values using fuzzy control (Kosko, 1994). We did this by associating words (or phrases) such as ‘marginal’ with the interval that 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 (Paine, n.d.a). Unfortunately, without funding for the project, we could not persuade anybody to spend time filling it 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 adviser 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, 1999) and Have I Got News For You (Deayton et al., 1994). To make the generator select an appropriate headline, we used another database that 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 fillers, putting them at the end of the paper to provide a sense of closure. For example, there is an Andy Capp cartoon (Smythe, 1982) 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, such as 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, 1995) 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., n.d.) 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 a 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.
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.
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 (2002); on the documentary, Polly Toynbee’s Hard Work: Life in Low-pay Britain (2003), reviewed by Peter Kilfoyle (2003); on the autobiographical, John O’Farrell’s Things Can Only Get Better: Eighteen Miserable Years in the Life of a Labour Supporter, 1979–1997 (1999) and Mark Steel’s Reasons to be Cheerful (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.
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, n.d.), using sheaf semantics (a beautifully elegant way of formalising the notion of object and system) (Goguen, 1992) 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, n.d.), and a clear account of how one designs the closely related fuzzy state machines in Gough et al. (n.d.) An article on hierarchical task networks is Charles et al. (2002).
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 that 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 Callaway and Lester, n.d.) 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.
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.
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 Franklin (1994), 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.
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.
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 given by Gervás (n.d.).
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 Narrative Fiction, n.d.) 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 references list a number of useful online 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 appears to have begun the analysis, splitting stories into a beginning, middle and end. The nineteenth-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?
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 (Rhodes and Maes, 1995), we shall illustrate with reference to the story of the ‘Three Little Pigs’ (Heiner, n.d.): 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 that 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 proposing 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 this entry in Shiner and Sterling’s Turkey City Lexicon). 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 (n.d.) calls a linguistic ‘shell game’. 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 – 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, n.d.) where the poster advocates reducing the grain size of the text fragments. Useful general hints on writing interactive fiction can be found in van Egmond (n.d.).
The second caution is that by imposing these narrative structures, we are making our histories less realistic. As Phil Goetz (1994) 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 sustaining 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.
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.
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.
The work described here had two objectives. The first was to generate accounts of the social circumstances accompanying 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. I am discussing with comedian Mark Steel (one of whose books I used as a source of examples) the possibility of his writing some of the text, should funding become available.
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.
Thanks to Peter Creak for interesting discussion and for writing some of the story fragments.
The URLs listed here were checked on 26 June 2003.
Aristotle (n.d.) Poetics, translated by S. H. Butcher. Available online at http://classics.mit.edu/Aristotle/poetics.html .
Barger, J. (n.d.) IF, AI, and the Confabulating-arranger Model of Interactive Fiction. Available online at http://www.robotwisdom.com/ai/ifdesign.html .
Barton Moss Secure Education Unit (n.d.) Hyperinflation. Available online at http://www.pfeg.org/PDF/Hyperinflation%2017.pdf .
Baughn, J.; patches by F. Hirsch and P. Suschlik (n.d.) The Nonsense Random Text Generator. Available online at http://nonsense.sourceforge.net/ . The Nonsense newspaper generator can be tried at http://nonsense.sourceforge.net/demo/newspaper/ .
Beharrell, A., Church, K., Paine, J. and Stark, G. (1999) ‘The virtual economy’, Computers in Higher Education Economics Review, 13(1), pp. 32–4. Available online at http://www.economicsnetwork.ac.uk/cheer/ch13_1/ch13_1p32.htm
Be Your Own Chancellor (2003) Available online at http://news.bbc.co.uk/nol/shared/spl/hi/uk/03/budget/byoc/html/byoc.stm
Brownlee, J. (n.d.) A Finite State Machine Framework. Available online at http://ai-depot.com/FiniteStateMachines/FSM-Framework.html .
Callaway, C. B. and Lester, J. C. (n.d.) Narrative Prose Generation. Available online at http://tcc.itc.it/people/callaway/papers/npg-ijcai01.ps .
Charles, F., Mead, S. J. and Cavazza, M. (2002) Generating Dynamic Storylines Through Characters’ Interactions. Available online at http://wheelie.tees.ac.uk/users/f.charles/publications/journals/2002/ijigs2002.pdf .
Crawford, C. (n.d.) Chris Crawford’s ‘Erasmatron’ Story Engine. Available online at http://www.robotwisdom.com/ai/crawford.html .
Curry, C. (2002) Writing for Soaps, London: A&C Black.
Deayton, A., Hislop, I., Merton, P., Swash, C. and Thompson, H. (1994) Have I Got News For You, London: BBC Books.
Elixir Studios, http://www.elixirstudios.co.uk/ .
Elliott, C. (n.d.) Why Boys Like Motorcycles: Using Emotion Theory to Find Structure in Humorous Stories. Available online at http://www.ai.mit.edu/people/jvelas/ebaa99/elliott-ebaa99.html .
Fernquest, J. (n.d.) World of Programming Examples Weblog: An Open Source To-Do List. Available online at http://www.geocities.com/bayinnaung/progexampweblog.html .
Flanders, M. and Swann, D. (1977) The Songs of Michael Flanders and Donald Swann, London: Elm Tree Books and St George’s Press.
Franklin, J. (1994) Writing for Story, New York: Plume.
Gasperini, J. (1990) ‘An art form for the interactive age’, Art Com, 10(10), December. Available online at http://www.mud.co.uk/richard/ifan194.htm .
Gasperini, J. (n.d.) Hidden Agenda. Available online at http://www.mcli.dist.maricopa.edu/proj/sw/games/hidden-agenda.html .
Gervás, P. (n.d.) GNL, Narracíon y Poesía. Available online at http://calisto.sip.ucm.es/people/pablo/teaching/gln/sesion4.pdf .
Goetz, P. (1994) Interactive Fiction and Computers, London: Crashing Boar Books.
Goguen, J. (1992) ‘Sheaf semantics for concurrent interacting objects’, Mathematical Structures in Computer Science, 2, pp. 159–91. Available online at http://www.cs.ucsd.edu/users/goguen/ps/sheaf.ps.gz .
Gough, N. E., Suliman, H. and Mehdi, Q. H. (n.d.) Fuzzy State Machine Modeling of Autonomous Agents For Games. Available online at: http://pers-www.wlv.ac.uk/~in6543/fzsm.pdf .
Graves, D. (1988) ‘Bringing characters to life’, Journal of Computer Game Design, 2(2), pp. 10–11. Available online at ftp://ftp.gmd.de/if-archive/programming/general-discussion/Graves.2 .
Graves, D. (1991) ‘Plot automation’, Journal of Computer Game Design, 5(1), pp. 10–12. Available online at http://www.tela.bc.ca/tads/authoring/articles/graves3.html .
Hall, R. (1995) The Cartoonist’s Workbook, London: A&C Black.
Hart, C. (1998) Drawing on the Funny Side of the Brain, New York: Watson-Guptill.
Heiner, H. A. (compiler) (n.d.) The Annotated Three Little Pigs. Available online at http://www.surlalunefairytales.com/threepigs/index.html .
Kilfoyle, P. (2003) ‘Still the poor relations’, Observer, 26 January. Available online at http://books.guardian.co.uk/reviews/politicsphilosophyandsociety/0,6121,882172,00.html .
Kosko, B. (1994) Fuzzy Thinking, London: Flamingo.
Lang, R. R. (n.d.) A Declarative Model for Simple Narratives. Available online at http://www-2.cs.cmu.edu/afs/cs/user/michaelm/www/nidocs/Lang.pdf .
Lott, T. (2002) Rumours of a Hurricane, London: Viking.
Maunder, P., Myers, D., Wall, N. and Miller, R. L. (1995) Economics Explained, London: Collins.
Mayer, J. (n.d.) Interview on AI in Republic. Available online at http://www.strategyplanet.com/republic/ai.shtm .
Montfort, N. (n.d.) Interfacing with Computer Narratives: Literary Possibilities for Interactive Fiction, Part IV. Available online at http://nickm.com/writing/bathesis/srth9.html .
Nelson, G. (n.d.) A Short History of Interactive Fiction. Available online at http://www.inform-fiction.org/manual/html/s46.html .
Novistrana (n.d.) The Republic of Novistrana Embraces Internet! Available online at http://www.novistrana.com/ .
O’Farrell, J. (1999) Things Can Only Get Better: Eighteen Miserable Years in the Life of a Labour Supporter, 1979–1997, London: Black Swan.
The Oz Project, http://www-2.cs.cmu.edu/afs/cs.cmu.edu/project/oz/web/oz.html .
Paine, J. (n.d.a) Knowledge-engineering Spreadsheet for Virtual Mail. Available online at http://www.j-paine.org/KE.xls .
Paine, J. (n.d.b) Web-based Science Fiction Plot Generator. Available at http://www.j-paine.org/cgi-bin/spin.php .
Perry, J. and Roberts, N. (1999) Hold Ye Front Page! 2,000 years of history in THE SUN, London: HarperCollins.
Pohl, F. (1966) The Tunnel Under the World, Alternating Currents, Harmondsworth: Penguin.
Pratchett, T., Stewart, I. and Cohen, J. (2003) The Science of Discworld II: The Globe, London: Ebury.
Rhodes, B. and Maes, P. (1995) ‘The stage as a character: automatic creation of acts of God for dramatic effect’, paper presented at the AAAI ’95 Spring Symposium on Interactive Story Systems: Plot and Character. Available online at http://xenia.media.mit.edu/~rhodes/Papers/aaai95.html .
Robbins, T. (1994) Even Cowgirls Get the Blues, Manchester: No Exit Press.
Shiner, L. and Sterling, B. (n.d.) Turkey City Lexicon: A Primer for SF Workshops. Available online at http://www.sfwa.org/writing/turkeycity.html .
Simpson, J. (2002) News From No Man’s Land, London: Pan.
Smythe, R. (1982) Laugh at Life with Andy Capp: Andy Capp No. 46, London: Mirror Books.
Steel, M. (1996) It’s Not a Runner Bean, London: The Do-Not Press.
Steel, M. (2001) Reasons to be Cheerful, London: Simon and Schuster.
Stern, A. (n.d.) Chopped Fresh, Not Canned. Available online at http://steel.lcc.gatech.edu/grandtextauto/archives/000013.html .
SWI-Prolog, http://www.swi-prolog.org/ .
Theune, M., Faas, S., Nijholt, A. and Parlevink, D. H. (n.d.) The Virtual Storyteller: Story Creation by Intelligent Agents. Available online at http://wwwhome.cs.utwente.nl/~anijholt/artikelen/cve_2002 .
Toynbee, P. (2003) Hard Work: Life in Low-pay Britain, London: Bloomsbury.
van Egmond, S. (n.d.) Game Design and Aesthetics. Available online at 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/ .
Waugh, E. (2000) Scoop, Harmondsworth: Penguin.
Wilson, G. (1972) ‘The science fiction horror movie pocket computer’, in H. Harrison and B. Aldiss (eds), The Year’s Best Science Fiction No. 5, London: Sphere.
Virtual Worlds Group
Tel: +44 (0)7768 534 091