+ All Categories
Home > Documents > Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560...

Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560...

Date post: 17-Aug-2019
Category:
Upload: duongdang
View: 218 times
Download: 1 times
Share this document with a friend
27
Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Artificial Intelligence Author: Kevin Crockett Lecturer: Peter Strazdins Due 27 October, 2017
Transcript
Page 1: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Australian National Univerity

CSPROJECTS

COMP4560

Creative Writing WithArtificial Intelligence

Author:Kevin Crockett

Lecturer:Peter Strazdins

Due 27 October, 2017

Page 2: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Contents

1 Executive Summary 2

2 Introduction 2

3 Project Overview 23.1 Hypothesis (Proposed Idea) . . . . . . . . . . . . . . . . . . . 2

3.1.1 Context to Primary Goal . . . . . . . . . . . . . . . . . 23.1.2 Software Vision . . . . . . . . . . . . . . . . . . . . . . 3

3.2 Findings/Results (Project Outcome) . . . . . . . . . . . . . . 53.2.1 Artefact . . . . . . . . . . . . . . . . . . . . . . . . . . 53.2.2 AI Prototype . . . . . . . . . . . . . . . . . . . . . . . 11

3.3 Evaluating/Validating . . . . . . . . . . . . . . . . . . . . . . 163.4 Discussion/Implications . . . . . . . . . . . . . . . . . . . . . 18

3.4.1 Project Potential . . . . . . . . . . . . . . . . . . . . . 183.4.2 Growth Plan . . . . . . . . . . . . . . . . . . . . . . . 193.4.3 Reflection . . . . . . . . . . . . . . . . . . . . . . . . . 19

4 Conclusion 21

5 Acknowledgements 22

6 Appendix 22

A 8-Puzzle Problem 22

B A* Algorithm 23

C Fast Forward (FF) Algorithm 24

D Scribblenaughts 25

1

Page 3: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

1 Executive Summary

After a year of development attempting to a Visual Planning DefinitionDomain Language (PDDL) Simulator, this artefact still remains unfinishedbecause of poor time management, unbalanced priorities between the over-whelming workload scope of both Artificial Intelligence (AI) prototyping andsoftware developing. The current artefact submitted contains two parts: theGUI software artefact, and the AI prototype. If more time was given to com-plete development, these two parts would have been combined and testedwith authors and see if it can serve as an aggregate imagination assistingtool in their idea phase of story writing. Regardless, the experience of work-ing on this project has definitely brought about a luxury of knowledge andprogramming practices that will be taken on board in future career develop-ment.

2 Introduction

This paper documents an attempt in constructing a manually unfolding storyline software prototype that may have commercial interest for authors in theidea phase of story generation. The primary goal proposed however was toprototype an original state-of-the-art self-generating narrative within a yearstime-frame. The logistics of acheiving this without prior experience in AI isclearly unfeasable. This paper still however provides a project idea with agrowth plan that encompasses the primary goal if this idea was to continuedevelopment. Keeping in mind the idea is intended to encourage and inspireinterest for the passion of creative writing instead of trying to supersede it.This paper also documents an outline of practices and knowledge developedof programming techniques used in the C programming language to buildthis project to its currently submitted state.

3 Project Overview

3.1 Hypothesis (Proposed Idea)

3.1.1 Context to Primary Goal

The main idea of this project is to essentially inspire contribution to thefield of using AI for creative writing. This idea does not directly achieve theassigned primary goal of a self-automated narrative generation, but insteadmay inspire further research towards it. This was chosen because of the

2

Page 4: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

present time constraints along with the agreed workload scope having noprior experience with AI.

The currently existing contributions of self-generating narratives havebeen struggling to get AI to build context understanding of the story to makea holistically flowing narrative. Typically, these solutions retrieve relevantindividual ideas for the story but have minimum to no vision of the narrativeflow around itself. This paper does not provide a contending solution to this.Instead, the purpose is to give story writers a more interesting dimensiontowards tackling the idea phase of story writing.

There was a choice of adopting existing AI planner such as Glaive (Ware2017), but it was decided to start the whole project idea from an empty folder.This was chosen because, the AI planning prototype idea requires a uniquelevel of AI integration to brace the assurance of fitting to a volatile vision.Despite this causing a significant increase in workload and time management,it seen more importantly gives required control for the vision without riskinglimitations of imported high-level interfaces causing significant delay andrepairs relative to unexpected changes.

3.1.2 Software Vision

The software solution envisioned aims to give an author capabilities of sculpt-ing a state unfolding storyline using a handful of optionally specified param-eters at each state defining a world scenario. The world is essentially definedby a global PDDL state (set of descriptive keywords) and changes through AIchoosing from a defined set of possible actions. It is designed to be visuallyintuitive and easy to learn. By placing multiple AI driven bodies (agents)with customisable icons, their interactions can reate an unfolding story ex-perience that the author can make use of in their own projects. They shouldbe able to rewind the story. They can remove, add and change world enti-ties, to redirect the story unfolding by the AI planner. In the first workingprototypes of this software, world scenarios would have to be manually gen-erated, but as more features are added, the world scenarios should soon beautomatically defined from small to no parameters via database retrievalsfrom open source knowledge-bases including ConceptNet (see Appendix ??).

The following diagram shows a concept sketch of an example world sce-nario depicting the software’s usage:

3

Page 5: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Figure 1: A concept sketch of an example state of the visual PDDL simulator.

From Figure 1 above, the software can create two entities from the buttoninterface (a), a box (a3) and a node (a2). A box (f) contains an objects thatcan define agents or actions into the world space. In this case, the diagramnodes (d) are geological ideas that are hardcoded to be able to hold agents(e) at their locations and join to other nodes. The next state transition (a1)is the button is used transition the world state to the next new state andthe changes to the agents are anounced in the notification dash board (b).The world scenario (c) has zooming, drag and drop mechanics, and open-world information editing of the boxes to make organising world scenarioseasier to grasp. In the process of software construction, Figure 1 is used as anillustrative heading towards the encapsulation of the visual PDDL simulator.Only after user-testing, the vision would be adjusted to fit the needs of thestory writers.

In the perspective of the AI prototype, the hueristical methods in dis-tinguishing character traits of agents is through a stored set of belief states,containing keywords that cause either gravitational or repulsve behaviour.

4

Page 6: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

This set of belief states should be queried during each world state transi-tion as they also can change. During this step, computational processingof AI developed context understanding of its surroundings. This is donethrough data mining a given knowledge base building a feeling graph. Thisgraph supposedly weighs the comparisons between gravitations and repul-sions. A real life example analogy is the deciding of enterng an abandonedbuilding with ”Danger: Keep Out.” Characters of lesser repulsions towardsthe keyterm ”danger” would favour entering, even more so if ”danger” wasa gravitational term. This feeling graph would output positive or negativeconclusions towards general string-interpreted inputs and give the agent afavouring choice. Using this belief state mechanism with an AI planner, thiscan define a unique pathway to the agent’s goal state. As an additional dy-namic, the unfolding of surrounding events of other agents or introducingnew locations, actions or objects by database retrieval similar to the gameScribblenaughts (Appendix D) can also play a major influence the uniquenessin an agent achieving their goal state .

In summary, this visual PDDL simulator strives to be an entertaining orexplorive way to produce narratives through a step-by-step unfolding decisionmaking process that includes the author as a role-playing master that candestroy and create AI role-playing agents with specific or random uniquebelief traits and entities that the agents can interact with. This unfoldingstoryline role-playing observed from the software controlled by the authorhas the potential to give assistance to story writers in the idea phase of storygeneration.

3.2 Findings/Results (Project Outcome)

3.2.1 Artefact

The current state of the GUI artefact is currently unfinished and not usable.This is because it was decided in the effort of obtaining full control of theproject, that the artefact was to be developed starting with an empty folder.This was not later changed because of not realising the size of the intendedworkload scope and starting over was not affordable with the time left fordevelopment. The following image is a screenshot of the current artefact:

5

Page 7: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Figure 2: A screenshot of the current software GUI artefact.

By the software development screenshot of the outcome shown in Fig-ure 2 above, the following sections expands on all the features and internalstructures made beginning this project from an empty folder.

File Structure

The GUI artefact is composed of 3 libraries: rendering (rnd), world(wrld), utility (util). These libraries are compiled and linked to a clientrunning executable (t). All source files are stored in ’src’ with the headerfiles separated from their paired C file, in the folders for their particularlibrary, and named for their particular functional idea.

The project is complied via GNU makefile scripts, where each library is

6

Page 8: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

built from the compiled objects stored in ’build’ compiled from the sourcecode. The libraries stored in the ’bin’ and the executable file refers to thebin libraries at application startup in order to run. The following sequenceof command-lines is used to make the executable program from the sourcefiles:

make obj // Compile object files from C files.

make lib // Compile libraries containing object files.

make client // Link libraries and build executable.

The first two lines are called and rebuilds only the library and objectfiles that have changed C files from lasted built version. This allows for fasttesting with small changes during development. This technique was madebecause before this modification, recompiling for small changes would requirecomplete rebuilding of the executable file with all libraries stored within itand made the compilation time frustratingly difficult to develop with.

When making new library components, the following command line calledto attach the library to the compilation script:

make soset // Generate sub makefile script.

Utility Library (util)

The util library is independent to the other libraries and contains allsophisticated useful material that can be used that is not found in standardC. The following is a list of all the utility features implemented from stratchand stored in this library:

(a) Id Dispenser (id)

(b) Linked List Data Structure (lnkd)

(c) Folder or Directory Reader (drnt)

(d) PNG Importer (png)

(e) OpenGL Shader Loader (sha)

(f) Texture Loader (tx)

(g) BMP Image and Text File Loader (io)

(h) Miscellaneous and Debugging Tools (utl)

7

Page 9: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

(i) AVL Tree Data Structure (tr/avl)

(j) Polynomial Tree Data Structure (tr/*)

(k) Mathematical Tools in Geometry, Matrix Transformations, Trigonome-try and Vectors (mth/*)

Rendering Library (rnd)

This component displays all assets of the software to the user. Its internalswork with OpenGL’s framework using vertex and fragment shader renderingof two vertex array objects (VAO) bounding four vertex buffer objects arrayedfor storing vertices, textures, colours and indices respectively. The first VAOis for orthogonal rendering and the latter is for projectional rendering. TheX11 window client (main.c) binds the OpenGL context to the window frame.Designing rendering based on OpenGL allows ease of cross-platforming infuture development as most platforms support the OpenGL framework.

The following list is all interface features that the graphics library:

(a) Line Primitive specifications

(b) String Primitive spefications

(c) Filled Rectangle Primitive specifications

(d) Setting visibility of specified entities

(e) Change colour of specified entities

(f) Optionally specify a filled rectangle to have a texture by name of one ofthe textures in the resource folder (res/tx/ico)

When specifying the creation of primitives, the graphics engine requiresthe selection of one of two types of rendering: orthogonal for the interfacedrawings such as the button interface (specified with ITRF); and projectionalfor the 3D defined world (board or brd) where 2D primitives are renderedand bounded to the Z axis origin (specified with BRD). Using OpenGL’sprojection matrix to define a 3D environment allows for the zooming mecha-nisms of the board. The inverse of this matrix transformation was manuallywritten to still accurately project mouse click selections of entities on theboard at any zoomed distance. Because the creation of box primitives isa common entity drawn, techniques were made (in bset.c) to faciliate thefrequent information juggle of frequent primitive creating and deleting.

8

Page 10: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

The following list gives the break down of the file structure inside theworld library:

(a) Projectional Specifics (brd)

(b) Box Set Tool (bset)

(c) Orthogonal Specifics (itrf)

(d) String Entity (str)

(e) Main System Library Interface (sys)

World Implementation (wrld)

The world library is the application level library that interacts stronglywith the rendering engine. Its purpose is defining application control me-chanics to facilitate the vision. The following list gives the break down ofthe file structure inside the world library:

(a) Interface Defining (itrf)

(b) Dialog Utility (itrf/dlg)

(c) Button Utility (itrf/btn)

(d) Text Field Utility (tfld)

(e) Agent Objects (obj)

(f) Box Entity (brd/box)

(g) Node Entity (brd/node)

(h) Main System Library Interface (sys)

From the list above, the world library defines many utility objects specifi-cally for defining reusable entities for the world. The textfield was defined onits own and in general because there are texts fields in both the orthogonaland projectional rendering being requested and saves code redundency. Thedialog utility is used when the user right-clicks the entity to open a propertiesmenu and to edit their traits through the text field utility.

9

Page 11: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Minimum Viable Product

From the minimum viable product (MVP), it clearly still has many fea-tures to implement. From the submitted artefact, the following list shows allof the completed application-level features:

(a) Create Box and Node Entities

(b) Buttons Interface Present

(c) World Map Zooming and Right-Click Dragging

(d) Box and Node Renaming

(e) Box and Node Property Editting

(f) Box and Node Item Dragging

(g) Boxes Resizable

The implementations of all these features were based of the interactionsbetween the world (wrld) and graphics (rnd) libraries.

The following list shows the list of the features left for the MVP:

(h) World State Saving and Loading

(i) Node and Box Deleting

(j) Node Connecting Paths for World Map

(k) A Working AI Planner Prototype

(l) Keyword Traversing on ConceptNet for Influence of Agent Decision Mak-ing

As shown above, the MVP almost only had the AI prototype left. Feature(i) has been implemented with the bug where deleting entities other than thelatest one created causes the application to crash.

10

Page 12: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

3.2.2 AI Prototype

The AI prototype is stored in the AI (ai) and database query (web) libraries.They are compiled along side the GUI artefact but run separately from themain GUI artefact. The prototype’s example outputs a basic scenario in theconsole when the main GUI artefact runs.

Starting with no prior experience with AI, the first steps towards the im-plementing of a working self-deciding mechanism was by first implementinga simillar problem. From solving the 8-Puzzle problem (Appendix A), usingthe A* graph plan algorithm with breadth-first searching (Appendix B), thecurrent AI prototype was able to be implemented with A*’s variant of en-forced hill climbing (EHC). The only differences is that EHC expands betterhueristical valued nodes without further branch checking. This is accompa-nied sophisticated heuristical value technique of Fast Forward (FF) Planning(Hoffmann 2001) to accurately and efficiently find pathway solutions to thegoal state (Appendix C).

Artificial Intelligence Library (ai)

The artificial intelligence library encapsulates all the prototype’s mechan-ics from parsing example world scenario definition files (found in res/ai) toconstructing the path to contain specifed goal states. The following list sum-maries its file structure:

(a) Main interface with EHC (ai/sys)

(b) FF Hueristic Computing (ai/ff)

(c) World Scenario Script Parser (ai/prsr)

The current AI prototype does not connect to the main GUI artefact’sdefined world, instead a script file parser inputs a simplified PDDL syntaxthat defines an example case world scenario. The submitted example caseillustrates potential AI behaviour of how character entities will behave in aworking system.

The example script case submitted defines the basic scenario of a dockworker robot moving containers in a shipping establishment stored in thescript file res/ai/dock-worker-robot3.def. The diagram of its label structureis shown in the following Figure 3 below.

11

Page 13: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Figure 3: A diagram of the example world defined by the script file:res/ai/dock-worker-robot3.def.

From the diagram above, the world is defined by world predicates, actions,initial states and goal states listed from the Figures 4, 5, 6 and 7 respectively.

Figure 4: The world definition space in the dock worker example scenario.

12

Page 14: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

The world definition space was simplied from the typical PDDL syntaxto make illustrating world space and easier task. By constricting the ele-ment types to only ’has a’ or ’can be’ informs the protoype strictly to whichproperties either will always be present or can be toggled respectively.

Figure 5: The actions definition space of the dock worker example scenario.

As shown above, the actions work like normal imperative functions con-taining to sets of data, the precondition and effect states each having theirdesignated line. The following actions do the following events in the dockworker world scenario:

(a) Move - Robot r moves from location l-1 to l-2.

(b) Unload - Robot r unloads container c to crane k at location l.

(c) Load - Crane k loads container c onto robot r at location l.

(d) Take - Crane k takes container c on pile p at location l with containerc-e as the next container to be on top of pile p.

(e) Put - Crane k puts container c onto pile p at location l with containerc-e the container currently on top of pile p.

13

Page 15: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Figure 6: The inital state definition space of the dock worker example sce-nario.

The defined inital and goal states have the main action predicate con-taining functions as parameters with their unique entity identifiers. Thesefunctions only serve as english interpretation assistence for readers. Thisis because their unique entity identity parameter is information complete,containing both the type and label therefore having the syntax form of”comment(type-label)”. As another addition for convenience, having the firstparameter in front of the function predicate serves interpreting the states asobject-oriented assigning of the possessive idealogical effects.

Figure 7: The goal state definition space of the dock worker example scenario.

14

Page 16: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

By running the currently submitted program (t), the prototype immedi-ately parses and computes the solution produces the following output shownin the Figure 8 below.

Figure 8: The console output printing the ordered actions along with param-eters required to get the inital state to the goal state.

Due to time constraints, this current AI prototype unfortunately hasnumerous faults in many input case scenarios. The prototype also leaksmemory for everytime a state space is duplicated for processing. This goalstate case was chosen only to demonstrate the prototypes intentive behaviour.With its internel integrity very fragile, any slight errors in the scripting syntaxcauses undefined behaviour and larger goal state inquiries are likely to notbe able to find a solution when it in theory should. Never the less, the coremechanics and data structures of the FF Planning procedure are in place.

Web Interface Library (web)

The web interface library was supposed to be the interface functionally forthe explorative prototyping with an exterier knowledge-source. Due to timeconstrictions and time management issues, this libraries is never used, butdemonstrates the potential faciliation of exterier knowledge sources throughbasic HTTP inquires to traverse node-space data.

This example uses the suggested open-source knowledge base Concept-Net5 (www.conceptnet.io) as the HTTP domain. From further investigationswith Conceptnet, it is observed that its datastructure is too inconsistent tobe an integral part of the automative path-finding processing. For example,it is very difficult to work with spontaneous nodes that connect words as

15

Page 17: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

well as phrases including ”work for human being” and ”room for sleeping”being individual nodes. In addition, ”doesn’t want” is a spontaneous cater-gory that not every node contains. The world scenario defined in Figure 4is an example of the desired consistently structured information that can beeasily interpreted by node-traversing protocols. If there was a open-sourceknowledge base like that, or if the world scenario from Figure 4 was furtherexpanded upon into a large knowledgebase, this library will be able to serveas the interface for interacting with this source. Never the less in the contextof the vision, ConceptNet can still serve as a useful suggestions-input panelwhen users are defining new world definitions. Although overall, Concept-Net is difficult to use as a knowledge-source for AI path-finding and decisionbecause of its inconsistent node-traversing structure.

3.3 Evaluating/Validating

From the results, the current artefact clearly has no value to proving the po-tential of the commerical level idea. Therefore the evaluation of this projectwill be determined by the analysis from the following investigative researchof the plausibility towards this idea contributing to the world.

All successful author’s are driven by the passion of inspiration from theirown life experiences and observations to write compelling story tales. With-out this inspiration, writing otherwise feels more chore-like to further committo (Novel 2016). This justifies the most challenging phases in story writingthough is the extending past a blank page (Weihardt 2017). Finding thatsource of inspiration is one of the toughest challanges in creative writing.Even after writing half a novel, authors still are victims of the writer’s block(cannot further progress) (Cook 2015). These events happen because theinspirations of the writers need to be rekindled. From numerous experiencedauthors, their suggested techniques all emphasis the value of idea generation.They suggest, ”start collecting words, phrases, images and object that inspireyou so that when writer’s block strikes, you have a place to turn.” (Weihardt2017) Or, ”whatever comes to mind shold be written.” (Weihardt 2017) Pastmemories or even recycled material. (Weihardt 2017) Victor (2017) suggestsa technique to start short story writing with three random elements. Forexample ”A stolen ring, fear of spiders, and a sinister stranger.” (Victor2017)

The visual PDDL simulator is designed specialised for this type of issues.It can search through a knowledge-base and make inferences developing aworld scenario that can be modified with to rediscover the inspirations neededto further write. This software creates experiences by pieces, and ideas ran-domly generated and planned, the story writer can make similar connections

16

Page 18: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

of simulated events that fits well from software generated content. It is un-likely that a whole unfolded story outcome generated by the system woulddeem useful. But passionate story writers will still make use of such outputs.From developed fragments of two inspirational ideas connecting dots, notingdown interesting events, scenes or imagery that can be implied. The notingdown can also be stored away for usage in future inspirations.

The greatest ideas are derived from unique personal experiences. Pastexperiences can become inspirations. Many artists use past experiences inte-grated into their works in all creative practices. Past experiences defines theidentity author attach to their characters. This near-conscious-level influenceis very difficult to algorithmically craft into an AI body. In the subject of AIcompeting against author’s for story originality, the best and most originalstories will always be the ones guided by this non-deterministic inspirationalprocessing of the author’s mind. This software acknowledges this and focusesits values as support to keeping interest to the author. In addition, it’s vi-sually friendly nature having icons for each entity further assists the authorsimagination of potential events, scenes and characters in the story, because”a picture is worth a thousand words.”

17

Page 19: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

3.4 Discussion/Implications

3.4.1 Project Potential

Figure 9: An example open-ended story event exploring experience for findingcreative story ideas.

This software’s open ended possibilities (shown in Figure 9 above) in theinterest to creative writers allows the opportunity of extending the MVP. Theprimary goal is a perfect example. In an agile development plan, because theproposed idea is still open ended and ready to be adjusted and specialisedfor the needs of story writers. A potential future feature example could bea database retrieval of image icons of agents, locations and actions only bylooking up their names. In addition, from a gesture of random key words, thesystem could randomly generate a whole world scenario to be experimentedwith. From this example, it clearly shows that newly added features cancontinuely enable more potential for more complex features to be added tothe idea.

18

Page 20: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

An example case usage of the software, the author should have enoughcontrol in the software to play Dungeons and Dragons individually. Startingwith an empty world, the global specification of a number of keywords woulddetermine a theme or scope of the random selection pool to decide whatkind of entities are retrieved from the source knowledge-base to feed intothe world. After defining a protagonist agent with basic characteristics andsimple open-ended goal-state: ”rich, happy, alive”, the author can then watchthe character’s interactions unfold at each step through the next-state button.Sometimes, it may be impossible to achieve their goal because not enoughactions and or entities have been introduced into the world yet. The AIretriever would construct an approximated pathway towards introducing thekeywords of the goal-state into the world scenario. During this process, theauthor records observations for future usage.

If this software is constructed carefully and correctly, it is believed tohave the potential to develop more interest into this field of tackling similarAI problems that can make a positive impact to a contributing user-basecommunity. A community in which well fostered could even develop into acommerical level enterprise.

3.4.2 Growth Plan

The realistic view of achieving this idea is essentially in the growth plan.Planning to implement the full working idea from the beginning will notwork as the development plan is not agile. The development plan has to beco-produced with the writers interested as their suggestions bring sole valueto the idea. By starting the visual PDDL planner from simple manual op-erations with basic AI planning first, development then continues iterativelyadding new features comfirmed by the users. This adds the features for au-tomation and assures a steady growth potential. This steady developmentplan can assure the investment in achieving the assigned primary goal.

3.4.3 Reflection

This project is at most an aspiring attempt in making the idea that wasproposed. In addition being a student project, the purpose was also forpersonal interests of gaining practice in C programming. This experiencein developing and working with a large scale project has definiely helped indeveloping familiarity for working with large-scale ideas.

Although, there were numerous issues that slowed developement. Thisoutcome was the result of the bow wave effect (shown in Figure 10 below).

19

Page 21: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Figure 10: Software Engineering Institute Acquisition Archetypes: The BowWave Effect.

The freedom of a full year of creating a workplan resulted in the workloadnot being estimated accurately because of no prior experience. The difficulttasks were not tackled first because of an optimistically inaccurate view ofthe workload. There was also unexpected postponements due to other coursework and also a presence of feature creeping (resizable boxes as an example).Another factor that slowed progress down was programming developmentenvironment using vim with vim and bash scripting to help facilitate pro-gramming, showing a screenshot in Figure 11 below.

20

Page 22: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Figure 11: The setup of the workspace environment.

All of these issues caused the delay in relieving schedule pressure increas-ing complex functionality postponement, system risk, design decisions beingmade and system modifiability. Over time accumulating the demand of theability to generate new capabilities for the most complex functionalities.

The bow wave system archetype has many leverage points however thatcan solve all of the issues mentioned. If a pessimistic workload view wasadopted, built the complex AI prototype first instead of the end, and planneda much stricter MVP, this would have utilmately avoided the small changesand decisions made that led to the larger consequences at the latter stagesof development.

If more time was given to develop the project, more time would be spentin the development of the AI prototype, it has to be unique in order toeffectively communicate with any open-source knowledge base. The optionof outsourcing the AI functionality such as existing planners cannot workbecause their purpose constraints will not be speciliased to fit the needs of avery agile idea.

4 Conclusion

The project has taken many unexpected turns being unable to acheive aworking submission of the desired vision. Despite this, the idea in this paperwas written as a chance for further research despite this paper’s conclusion.Regardless of any future outcome, it still is a successfull project becauseof the experience and knowledge gained out of an opportunity to combine

21

Page 23: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

all retained knowledge from previous courses and focusing it on a singleobjective. A practice that no typical courses can teach but is a vital skill forthe success of any future career. The choice of pursuing computer science asa degree was decided from its infinite creative potential from only an idealrequirement of a home desktop computer. Beginning this project from anempty folder further emphasises the notion of how knowledge in computerscience can bring about something incredible from nothing. The outcome ofthe project was not incredible, but it was at least something to me.

5 Acknowledgements

I would like to greatly thank Patrik Haslum for providing an incredibleproject outline and always giving useful advice and directions when needed.I would also like to greatly thank Peter Strazdin and Weifa Lang for facil-itating the course opportunity and support at all times in completing thecourse challenges given. Also not forgetting to greatly thank Eric McCreathfor turning up to both of my presentations during this project.

6 Appendix

A 8-Puzzle Problem

The 8-Puzzle problem is the solving a 3 by 3 grid by shifting blocks intoascending numbers from the top shown in Figure 12 below. The only movesallowed are shifting the numbers adjacent to the empty cell.

Figure 12: The 8Puzzle Problem.

22

Page 24: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

The program show in Figure 13 below is an aggregate solution prior tothe attempt in building the main AI prototype.

Figure 13: The 8 Puzzle Problem Solver.

B A* Algorithm

The A* is a state-space searching algorithm through nodes to find the goalstate. The search prioritises the state search by assigning each node anapproximated heuristical value defined by the heuristical function (f(n)) asthe sum of current distance from the initial node (g(n)) and the approximateddistance from the goal node (h(n)) shown below.

23

Page 25: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

f(n) = g(n) + h(n)

There are two different variations of A*: tree searching and graph search-ing. Their only differences is that tree searching is optimal but costs more incomputation as it searches previous nodes numerous times. The graph searchis more computationally conservative but does not guarantee to find the mostoptimal solution because a hash list is used to remember each traversed node.

C Fast Forward (FF) Algorithm

The fast forward algorithm is a PDDL interpreting AI planner that can solvegeneric AI problems consisting of actions, entities and goal states. Figures14 and 15 below come from Univeristy of Edinburgh’a open AI course slides(Wickler and Tate 2014) and was used as the guidelines in implementing theAI prototype.

Figure 14: Psuedo algorithm for generating the relaxed planning graph forthe FF heuristical value.

24

Page 26: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

Figure 15: Psuedo algorithm for extracting the FF hueristical value usingthe relaxed planning graph.

D Scribblenaughts

Scribblenaughts is 2D platformer game that encompasses a unique gamefeature of spawning interactive entities from query searching a knowledgedatabase via keyword searching (screenshot shown in Figure 16). This similarmechanism can be used in the visual PDDL simulator.

Figure 16: Three interactive entities spawned by keywords searching theirnames.

25

Page 27: Creative Writing With Arti cial Intelligence · Australian National Univerity CSPROJECTS COMP4560 Creative Writing With Arti cial Intelligence Author: Kevin Crockett Lecturer: Peter

References

Cook, Donna (2015). The Messy Middle - 6 Fixes When You’re Stuck Writ-ing Your Novel. http://donnacookauthor.com/the-messy-middle-6- fixes- when- stuck- writing- your- novel/. [Online; accessed 15-October-2017].

Hoffmann, Jorg (2001). The Fast-Forward Planning System. http://www.aistudy.com/paper/aaai_journal/AIMag22-03-005.pdf. [Online;accessed 20-October-2017].

Novel, Now (2016). How to start writing a novel if stuck: 8 steps. https://www.nownovel.com/blog/how-to-start-writing-a-novel-8-

steps/. [Online; accessed 16-October-2017].Victor, William (2017). Fort-Four Short Story Ideas. http://www.creative-

writing- now.com/short- story- ideas.html. [Online; accessed 14-October-2017].

Ware, Stephen G. (2017). The Glaive Narrative Planner. https://nil.cs.uno.edu/projects/glaive/. [Online; accessed 15-October-2017].

Weihardt, Ginny (2017). Creative Writing Exercises for New Short StoryIdeas. https://www.thebalance.com/creative-writing-exercises-for-new-short-story-ideas-1277588. [Online; accessed 15-October-2017].

Wickler, Dr. Gerhard and Prof. Austin Tate (2014). Aritificial IntelligencePlanning. https://www.youtube.com/watch?v=7XH60fuMlIM&list=PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2 & index = 65. [Online; accessed20-October-2017; 4.10 - The FF Planner].

26


Recommended