Adaptive Automated Storytelling Based on Audience Response

. To tell a story, the storyteller uses all his/her skills to enter-tain an audience. This task not only relies on the act of telling a story, but also on the ability to understand reactions of the audience during the telling of the story. A well-trained storyteller knows whether the audience is bored or enjoying the show just by observing the spectators and adapts the story to please the audience. In this work, we propose a methodology to create tailored stories to an audience based on personality traits and preferences of each individual. As an audience may be composed of individuals with similar or mixed preferences, it is necessary to consider a middle ground solution based on the individual options. In addition, individuals may have some kind of relationship with others that inﬂuence their decisions. The proposed model addresses all steps in the quest to please the audience. It infers what the preferences are, computes the scenes reward for all individuals, estimates their choices independently and in group, and allows Interactive Storytelling systems to ﬁnd the story that maximizes the expected audience reward.


Introduction
Selecting the best events of a story to please the audience is a difficult task.It requires continued observation of the spectators.It is also necessary to understand the preferences of each individual in order to ensure that the story is able to entertain and engage as many spectators as possible.
Whereas an interactive story is non-linear, because it has several possible branches until the end, the objective of a storyteller is to find out the best ones considering an audience profile, the dramatic tension and the emotions aroused on the individuals.
Empathy is the psychological ability to feel what another person would feel if you were experiencing the same situation.It is a way to understand feelings and emotions, looking in an objective and rational way what another person feels [2].Based on the empathy, it is possible to learn what the audience likes.This allows selecting similar future events along the story and, therefore, to maximize the audience rating.
The proposed method aims to select the best sequence of scenes to a given audience, trying to maximize the acceptance of the story and reduce drop outs.The idea behind this approach is to identify whether the audience is really in tune with the story that is being shown.A well-trained storyteller can realize if the audience is bored or enjoying the story (or presentation) just looking at the spectators.
During story writing, an author can define dramatic curves to describe emotions of each scene.These dramatic curves define how the scene should be played, its screenshot, lighting and soundtrack.After the current scene, each new one has a new dramatic curve which adds to the context of the story [1].
The reactions of the audience are related to the dramatic curves of the scene.If the audience readings of the emotions are similar to the emotions defined by the dramatic context, then there is a connection (empathy) between audience and what is being watched [6,7].
In this work, we propose a methodology to create tailored stories to an audience based on personality traits and preferences of each individual.The global objective is to maximize the expected audience reward.This involves considering a middle ground solution based on the individual options of the audience group.In addition, individuals may have some kind of relationship with others, characterizing an interaction among the audience and ultimately influencing their decisions.
The proposed model addresses all steps in the quest to please the audience.It infers what the preferences are, computes the scenes reward for all individuals, estimates their choices independently and in group, and allows Interactive Storytelling systems to find the story that maximizes the expected audience reward.
This paper is organized as follows.Section 2 discusses on emotion modeling and on its application to audience characterization and behavior expectation.The following section presents the main aspects of automated storytelling.Section 4 is dedicated to modeling the expected audience reward maximization.The interaction of individuals in the audience is the object of section 5. Section 6 proposes a heuristic to solve the optimization model in section 5. Analysis and conclusions are drawn in the last section.

Emotions and Audience
During film screening, the audience gets emotionally involved with the story.Individuals in the audience reacts according to their preferences.When an individual enjoys what is staged, he/she tends to reflect the same emotions that are proposed by the story.The greater the identification between the individual and the story, the greater are the emotions experienced.
As an audience can be composed of individuals who have very different preferences, it is important that the storyteller identifies a middle ground to please as many as possible.Knowing some personality traits of each individual helps to get the story closer to the audience.

Model of Emotions
The emotional notation used to describe the scenes of a story is based on the model of "basic emotions" proposed by Robert Plutchik [9,10].Plutchik's model is based on Psychoevolutionary theory.It assumes that emotions are biologically primitive and that they evolved in order to improve animal reproductive capacity.Each of the basic emotions demonstrates a high survival behavior, such as the fear that inspires the fight-or-flight.In Plutchik's approach, the basic emotions are represented by a three-dimensional circumplex model where emotional words were plotted based on similarity [11].Plutchik's model is often used in computer science in different versions, for tasks such as affective human-computer interaction or sentiment analysis.It is one of the most influential approaches for classifying emotional responses in general [4].
Each sector of the circle represents an intensity level for each basic emotion: the first intensity is low, the second is normal and the third intensity is high.In each level, there are specific names according to the intensity of the emotion, for example: serenity at low intensity is similar to joy and ecstasy in a higher intensity of the instance.
Plutchik defines that basic emotions can be combined in pairs to produce complex emotions.These combinations are classified in four groups: Primary Dyads (experienced often), Secondary Dyads (sometimes perceived), Tertiary Dyads (rare) and opposite Dyads (cannot be combined).
Primary Dyads are obtained by combining adjacent emotions, e.g., Joy + Trust = Love.The Secondary Dyads are obtained by combining emotions that are two axes distant, for example, Joy + Fear = Excitement.The Tertiary Dyads are obtained by combining emotions that are three axes distant, for example, Joy + Surprise = Doom.The opposite Dyads are on the same axis but on opposite sides, for example, Joy and Sorrow cannot be combined, or cannot occur simultaneously [11].Complex Emotions -Primaries Dyads: antecipation + joy = optimism joy + trust = love trust + fear = submission fear + surprise = awe surprise + sadness = disappointment sadness + disgust = remorse disgust + anger = contempt anger + antecipation = aggression This model assumes that there are eight primary emotions: Joy, Anticipation, Trust, Fear, Disgust, Anger, Surprise and Sadness.It is possible to adapt the Plutchik's model within a structure of 4-axis of emotions [13,1] as shown in Figure 1.
The Plutchik's model describes a punctual emotion and it is used to represent an individual or a scene in a specific moment.In order to describe the emotions of a scene, the Plutchik's model is converted to a time series of emotions called "dramatic curve".The dramatic curve describes the sequence of emotions in a scene in an interval of one second per point.It follows the structure of 4-axis based on Plutchik's wheel and maps the variation of events in a story.

Audience Model
In Psychology, there are many models to map and define an individual's personality traits.One of the most used is called Big Five or Five Factor Model, developed by Ernest Tupes and Raymond Christal in 1961 [15].This model was forgotten until achieving notoriety in the early 1980s [12] and defines a personality through the five factors based on a linguistic analysis.It is also known by the acronym O.C.E.A.N. that refers to five personality traits.
The personality of an individual is analyzed and defined throughout answers to a questionnaire that must be completed and verified by factor analysis.Responses are converted to values that define one of the factors on a scale of 0 to 100.In this work only two traits are used to create the individual profile: Openness to experience O ∈ [0, 1] and Agreeableness (Sociability) A ∈ [0, 1].Each personality trait is described as follows: Openness to experience The openness reflects how much an individual likes and seeks for new experiences.Individuals high in openness are motivated to seek new experiences and to engage in self-examination.In a different way, closed individuals are more comfortable with familiar and traditional experiences.They generally do not depart from the comfort zone.[5] Agreeableness (Sociability) Agreeableness reflects how much an individual like and try to please others.Individuals high on agreeableness are perceived as kind, warm and cooperative.They tend to demonstrate higher empathy levels and believe that most people are decent, honest and reliable.On the other hand, individuals low on agreeableness are generally less concerned with others' wellbeing and demonstrate less empathy.They tend to be manipulative in their social relationships and more likely to compete than to cooperate.[5]

Concept of Empathy
According to Davis [2], "empathy" is defined by spontaneous attempts to adopt the perspectives of other people and to see things from their point of view.Individuals who share higher empathy levels tend to have similar preferences and do things together.In this work, he proposes a scale of "empathy" to measure the tendency of an individual to identify himself with characters in movies, novels, plays and other fictional situations.Also, the emotional influence of a movie to the viewer can be considered "empathy".It is possible to identify a personality based on the relationship between an individual and his favorite movies and books.Furthermore, it is possible to suggest new books or movies just knowing the personality of an individual [7].Following these ideas, it is possible to relate empathy to a rating index.During an exhibition, if the viewer is enjoying what he is watching, there is an empathy between the show and the spectator.This information is used to predict what the spectator likes and dislikes.

Interactive Storytelling
In recent years, there have been some efforts to build storytelling systems in which authors and audience engage in a collaborative experience of creating the story.Furthermore, the convergence between video games and film-making can give freedom to the player's experience and generate tailored stories to a spectator.Interactive Storytelling are applications which simulates a digital storyteller.It transforms the narrative from a linear to a dialectical form, creating new stories based on audience by monitoring their reactions, interactions or suggestions for new events to the story.[8] The proposed approach of a storytelling system should be able to generate different stories adapted to each audience, based on previously computed sequence of events and knowledge of preferences of each individual on the audience.

Story Model
A story is a single sequence of connected events which represents a narrative.The narrative context may be organized as a decision tree to define different possibilities of endings.During the story writing, the author can define many different ends or sequences to each event (or scene).Each ending option forwards to a new scene and then to new ending options, until story ends.For example, Figure 2  To evaluate the proposed model and algorithm, the tests are performed using an event tree corresponding to a non-linear variation of the fairy tale Little Red Cap [1].The event tree is described in Table 1 and presented in Figure 3.In some events, there are possibilities of branches such as the moment when the girl meets the wolf in the forest.The original story is represented by the sequence of events π : {EV1, EV2, EV3, EV4, EV5, EV7, EV8, EV9, EV10, EV17, EV11, EV13, EV15}.Each scene describes what occurs to the characters and the story, and also has an emotional description called "dramatic curve".The dramatic curves are based on Plutchik's wheel of emotions and describes how emotions should manifest during the scene.Soundtracks, screenshots and lighting can be chosen based on the dramatic curves.
The sequence of scenes tells the story, describes a complete emotional curve and "tags" the story as "genre".

Modeling Emotions to Events
During the story writing, the scenes are described as a tree of events.Each event in the tree is associated to a dramatic curve and must be modeled containing the following information: -Name: unique name for the event (each event has a unique name); -Text: describes what happens during the event; -Dramatic Curves: emotional time series presented on figure 1: Joy/Sadness (axis x), Fear/Anger (axis y), Surprise/Anticipation (axis w) and Trust/Disgust (axis z).
The Tree of events has different paths, connecting to different future events, until the end of the story.When the story is told, it is selected a single branch to each event.The dramatic curves representing the original story sequence of events are demonstrated in Figure 4. Table 2 illustrates the emotions involved in each of 20 events present in the story.Considering the personality traits, individuals who score high in "openness" like a greater variety of genres (often opposed) in comparison to others.Individuals low in "openness" generally prefer the same things and choose the same genres.In this case, there are less options to please individuals low in "openness".
The task of selecting a scene that pleases a person is to find which of the possible options approaches their preferences.The task selection becomes difficult when we try to find the best option that would please the most people in a group.In this case, it is necessary to consider other information about individuals as "agreeableness" and empathy between individuals.Individuals who score high in "agreeableness" try to approach quickly the choices of others and have more patience than others.They sometimes prefer to accept other preferences and decisions just to please them all.
The empathy indicates the level in a relationship that individuals have.For example, when two people like each other, they may want to do things together, thus it indicates a higher level of empathy.In the other hand, people who want avoid each other have a low level of empathy in this relationship.Generally, individuals in a relationship with high empathy choose the same options or a middle ground.

Maximizing the Audience
Given a tree of events, each ending (a leaf of the tree) uniquely determines a sequence of scenes or the story to tell.This corresponds to the path from the root of the tree to ending leaf.Finding the most rewardable path for a given audience amounts to evaluate an utility function that captures how the audience feels rewarded by the scenes and also the choices the audience makes at each branch.The tree of event can be represented as follows: Let S be the finite set of events (scenes) of a story.Let also Γ + (s) be a subset of S containing the child nodes of node s.The utility function is given by E(s, i) which determines the expected value of state s for individual i and represents a measure of similarity between 0 and 1.Finally, let P rob(s l−1 , s l , i) be the probability with which individual i chooses state s l to follow state s l−1 .Remark that the probabilities P rob(s l−1 , s l , i)) must add one for each branch and for each individual, since one branch must be selected on each state.
Consider now a sequence of states π = {s 0 , . . ., s k } that represents a path from the root to a leaf.The proposed model evaluates path by computing its expected utility which is given by the expression: Let R(s) be the maximum expected utility that can be obtained starting from state s.The following recursion determines R(s).where p(s) is the predecessor of s.By computing R(s 0 ), the root's reward, an optimal sequence π * , with maximum expected reward, can be retrieved in a straightforward way.We conclude the model by proposing an evaluation for the individual probabilities of choice on each story branch.This is done by assuming this probability is proportional to the expected individual reward of the branches.This leads to the expression: where IR(s, i) is the expected reward at state s for individual i, which is given by: IR(s , i).P rob(s, s , i) This model allows determining the best sequence of scenes for and audience provided there is no interaction within the audience.We address this case in the following section.
To create tailored stories for an individual it is just necessary to check what he/she likes most, based on its own probabilities but when an individual participates of a group he/she needs to deal a middle ground.The dynamic of choosing the best story to an audience is based on the fact that the individuals will watch the same story, share a minimal intimacy and want spend sometime together.In a similar way, it is possible to say that they are trying to watch television and need to choose a television program that please the entire group.During this interaction, each individual tries to convince others about his preferences.Some individuals may agree with these suggestions based on the relationship they share, but others may introduce some limits.After some rounds, some individuals give in and accept to approach other preferences [14].The decision of accepting others' do not eliminate personal preferences but introduce a new aspect to the options.According to the proposed model some options that originally are not attractive will be chosen because of the induced social reward imposed by the probability function of choosing it.This means that for some individuals, it is better to keep the group together than take advantage of their preference.Furthermore, as explained in section 2.2, individuals high in "openness" do not care so much about their own preferences because they like to experiment new possibilities.They may be convinced by friends or relatives and will tend to support their preferences.
In order to model the audience behavior, we propose an algorithm based on a spring-mass system.Consider that all preferences are modeled by the real coordinate space ( 2 ) and each individual of the audience is represented by a point positioned on his preferences.Each point (individual) is connected to n springs (where n is the number of individuals).A spring is connected to its original position and other n−1 springs are connected to the other points.Then, we have a total of n×(n+1) 2 springs.The objective function aims to approach each point, considering the constraints of the springs.Each spring is modeled based on the individual personality traits and relationship levels between them.
Let K ii = (1 − O i ), be the openness level of each individual i and K ij = A ij be the agreeableness level for each pair of individuals i and j.In this model, we are assuming that "agreeableness" may also be influenced by the relationship between i and j and it is possible to describe an individual resistance by others' preferences.After some experiments, we realize that it is possible to start an audience from A ij = A i and fine tuning A ij after some rounds.
Given e ij ∈ [−1, 1], the empathy level between each pair of individuals, and x 0 i , the original position in space for each individual i, let d 0 ij = x 0 i − x 0 j be the original distance between individuals and let L ij = (1 − e ij ).d 0 ij be a weighted empathy level.The objective of the following model is to find the final positions x i minimizing the distances between the individuals d ij , weighted by their agreeableness level K ij and considering L ij .min i∈A j∈J:i =j The constraints (6) link the distance variables d ij with the coordinate variables x i and x j when individuals i and j are different.Constraints (7) are used to obtain the distance d ii which each individual has moved from its original position.Figure 5 describes the operation of the Spring-mass system with 2 individuals.
Since this model is not linear, it is not possible to use a linear solver to obtain the optimal solution.Therefore, we use a meta-heuristic approach based on simulated annealing to obtain a good approximate solution.The simulated annealing algorithm is presented in Section 6. 6 Solving the audience interaction model Simulated annealing is a meta-heuristic for optimization problems based on thermodynamics.Given a large solution space, it solves the optimization problem by finding a good solution near the global optimum [3].At each iteration of the algorithm, it changes the current solution within a neighborhood and considers the new solution as the current one if there is any improvement on the objective function or, if there is no improvement, it may consider it based on a randomized criteria.
The neighborhood used for the audience problem is defined by all possible movements of each individual in other to minimize the distances between all individuals according to spring constraints.Let − → a be the current position of individual a, − → b be the referential position based on all relationships between the individuals and s a be the "agreeableness" level of the personality of individual a.It is possible to calculate the step of a movement δ x for individual a using equations ( 8)- (10).
The final position after moving the individual a is given by − → a f inal as follows: The simulated annealing method is shown in Algorithm 1.The algorithm receives as input an initial solution S 0 , limits on the number of iterations M , on the number of solution movements per iteration P and on the number of solution improvements per iteration L. During its initialization, the iteration counter starts with 1, the best solution S starts equal to S 0 and the current temperature T is obtained from the function InitialT emp(), which returns a value based on the instance being solved.On each iteration, the best solution is changed within the neighborhood by function Change(S) and the improvement is calculated on ∆F i .This solution is then accepted or not as the new best solution and, at the end of the iteration, the temperature is updated given the factor α.
The proposed methodology was initially applied on students of our graduate program in order to evaluate the emotional characteristics of the individuals.This allowed a positive view of techniques and validated the initial hypothesis.Then, the final experiments were conducted using 20 generated audience1 instances with 20 individuals each on instances divided in three groups: 8 entirely mixed audiences with 60% of individuals supporting an emotion, 8 audiences with similar individuals and 4 mixed audiences with one opinion leader.The opinion leader instances were generated by describing an influential individual to others2 .This starting point permitted a qualitative evaluation of the application of the whole methodology based on discussion among the ones involved in the experience.
The resulting story endings for each audience are presented on Table 3. Stories generated to mixed audiences before interaction considered average preferences while stories generated after interaction (SA) tend to select the majority preference.The proposed Red Cap story has a natural tendency for a Sadness + Angry endings (EV12, EV18, EV19, EV20) since there are more final events of these emotional features than Joy + Angry endings (EV15 only).However, the proposed method was able to select expected story endings according to the audience preferences.Also, the preliminary evaluation of an opinion leader suggested there is a sound basis for results that may effectively converge to the choice of audience rewarding paths.Next step amounts to carrying out more thorough and relevant experiments which requires not only larger groups but also stories that truly draws the audience.In this preliminary analysis, an evaluation of the model parameters also allowed to conclude that their determination may lead to conditions which can represent a wide range of groups, thus leading to a representative model.
Our evaluation is that the proposed methodology can still incorporate more factors of emotional behavior, group interaction and storytelling aspects.The goal is to experiment thoroughly on a wide spectrum of stories and audiences.

Fig. 3 .
Fig. 3. Little Red-Cap story as a decision tree

Fig. 4 .
Fig. 4. Dramatic Curves of Little Red-Cap original sequence of Scenes s ) i∈I (E(s, i).P rob(p(s), s, i)), for s a leaf i∈I E(s, i) + max s ∈Γ + (s) R(s ), for s the root (2)

Table 1 .
Little Red-Cap story events

Table 2 .
Dramatic Curves for Little Red-Cap eventsEvery time an individual likes a scene or story, he/she tells what he/she likes and what does not.This information is then used to analyze and determine which are the individual preferences.The information from the dramatic curve indicates the emotion that has been liked and is used to classify genres.The favorite scenes of an individual are used to ascertain which are the emotions that stand out.The genres of the stories are set primarily by the main emotions of the scenes.Throughout readings of emotions which stand out, it is possible to know which genres the individual prefers and which scenes of a new story are emotionally similar.

Table 3 .
Selected Story Endings for Audiences