Adam's Lair Forum

game development and casual madness
It is currently 2020/02/25, 05:19

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: 2015/04/02, 10:42 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 354
Location: Out there
Role: Hobbyist
I've been reading your big post, and enjoyed immensely. I couldn't stop noticing that the first algorithms created very short, synthetic sentences, not even punctuation. The most recent have a more natural flow. Of course, the fact that you can intervene in them makes them less procedurally generated and more user supported, which kind of destroys the whole thing.

If you have to create something from scratch, you are bound to have a lot of useless garbage, and little usable content.

It's interesting to see how hard it is to implement a set of known rules in an algorithm and still not have decent text. ;)

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
PostPosted: 2015/04/02, 13:17 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
Quote:
It's interesting to see how hard it is to implement a set of known rules in an algorithm and still not have decent text. ;)


Indeed. ^^ I think we often don't expect complexity in those things, because they come naturally to us as humans, but seem alien for a synthetic algorithm.

eyeliner wrote:
Of course, the fact that you can intervene in them makes them less procedurally generated and more user supported, which kind of destroys the whole thing.


This is an interesting point actually - what does procedural generation mean in the context of user or developer intervention? Is the result of an algorithm somehow less procedurally generated when a developer had to step in and modify it to prevent a certain kind of output? Actually, procedural is kind of the wrong word here, because the answer to the above question would clearly be "No", as development is a natural prerequisite of a working algorithm. But would that algorithm be considered less creative, the more human input is required?

In a way, yes - because that means leveraging human creativity and proficiency to step in where algorithmic qualities can not live up to the required quality standards. And in a way, both the "old" narrative algorithms and (even more!) my own approach rely heavily on human input, be it through defining a knowledge database or pre-written text fragments. It is a way of experimenting with one aspect of storytelling and faking the rest in the process in order to allow that experiment to be meaningful.

If I hadn't done that before, I would have abandoned the idea of a truly creative algorithm writing texts that I couldn't have imagined at the latest when I did my research on previous works, because that clearly showed how incredibly complex writing text actually is. There's a whole lot of domains to be covered:

  • World Knowledge: To write about something, or be creative, you first have to know things. Everything. What is a sheep, what does it look like? Why would it be "herded" and what does herding mean? Why would a wolf cause harm to sheep, and what purpose does it serve? And it goes on.
  • "Meta" Knowledge: A cat is an animal, fine - but what does a cat mean to us, as humans? There is an incredible amount of associations and "hidden knowledge" in addition to bland, factual relationships, that somehow has to be conveyed to an algorithm as well.
  • Reasoning: To be creative, an algorithm needs to not only have knowledge, but to infer new knowledge from existing one.
  • Inspiration: Why would you even start to write? Maybe in order to convey a certain moral. Maybe because you encountered a situation in life that made you think about a certain topic. But why would an algorithm start to write? Would it require real-world input and a "thinking" loop of sorts?
  • Planning: Most stories have some kind of underlying concept, often to reinforce the readers engagement in actually reading it. A writer needs to come up with one.
  • Writing: But even when everything else is in place, a writer needs to actually write text - and that is a very challenging skill of its own. Creating purely functional sentences is easy (yet not for algorithms), but creating a text with a nice reading flow, metaphoric elements and allegory weaved subtly into its wording is a whole different beast.

And all of this would have been mastered by a truly creative writing algorithm - when requiring that it runs without any outside help. Assuming that someone actually managed to create something like this, I think the jump from there to a sentient AI wouldn't be that far. And we all know how incredibly far away we are from that milestone :D

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/04/03, 19:12 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 354
Location: Out there
Role: Hobbyist
Actually, I envision Procedural Generation of Text exactly like what WideRuled does, but a bit less, as in, you set a few simple parameters and press the magic button.

I was yesterday night thinking about this:
A king, asking a minstrel to tell him a tale for his amusement. He would set the characters and what they would do (or choose from a known pool of resources) and the minstrel would do his best.

Of course, I think a machine can't create a story from scratch that can even remotely be considered "correct". I believe the machine NEEDS to know the 3 narrative arcs (introduction, development, conclusion, as I call them) and work from there, possibly backwards, so that characters don't kill themselves and do something impossible later in the story. It also needs to know some building blocks to create the story. And grammar, even in it's most simple form.

But coming to think of it, isn't what we need to create a story?
"A pirate goes on a quest for treasure. In the end, he gets eaten by an orca."
A character, his purpose, his final destination. Input that in an algorithm and let the machine regale us with more details.

What would the machine know at this point?
The main character is a pirate - He does pirate-y things (good or bad, the machine will decide)
He goes searching for treasure - Of what kind? And what for? (the machine would fill these blanks)
He dies, eaten by an orca - Would the orca come out of nowhere? Would the pirate invade the orca's space? (let the machine create this with the rules set by the algorithm)

We can tell a machine that an orca can eat X animals, that a man can indeed kill orcas, though both these events might fail, that a pirate wants treasures, all pretty basic things for us to know, but a machine needs to know before hand, so in a way, we need to educate a computer about the laws of the stories we tell, because if we go to a fairy tale, all rules become different, and orcas can talk, and what not.

Not easy. Not at all impossible. A lot of work? Oh, yes.

PS: I have never been so participant in anyone's work before, and I'm probably rambling things you don't need to read and deviate from your purpose.

Sorry about that, but you chose a fascinating subject. :)

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
PostPosted: 2015/04/09, 10:31 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
eyeliner wrote:
I was yesterday night thinking about this:
A king, asking a minstrel to tell him a tale for his amusement. He would set the characters and what they would do (or choose from a known pool of resources) and the minstrel would do his best.


Yep, this is kind of the situation a story generator would fill up. :) I was thinking something similar, but approaching it from a slightly different angle: Coming from the "pen & paper Rpg" realm, the role of a story generator always reminded me of the game master's one. There are these 3-4 players who can pretty much do and ask whatever they want and the game master, while having a rough story sketch in mind, will have to dynamically react to them in a top-down approach:

Taking your example of pirates, treasure and orcas, there are likely some broad plot points that the game master intends to incorporate, but it's not entirely up to him to decide how exactly this will all take place, because of the players erratic nature. It's like you have a story template with a lot of blanks and the players "querying" those blanks in a specific way, while the game master is a "fill in the blank" director.

Maybe the players want to get inside a castle, fine. That goal might have been set by the game master, but he can't just tell them how to get in. So the players do some inquiries in the nearby town and the game master comes up with something the citizens would say. They decide to search for the old and lost secret entrance and the game master may fill in that blank by allowing them to find it. Next, they will investigate the cave tunnels beneath, and another blank is filled.

As you can see, in the beginning, there might not have been a town, a secret entrance, a tunnel and all of its contents - they are the product of an interaction-based fill-in-the-blank process, beginning at the broadest possible scope and getting as fine as it needs to.

eyeliner wrote:
Of course, I think a machine can't create a story from scratch that can even remotely be considered "correct". I believe the machine NEEDS to know the 3 narrative arcs (introduction, development, conclusion, as I call them) and work from there, possibly backwards, so that characters don't kill themselves and do something impossible later in the story. It also needs to know some building blocks to create the story. And grammar, even in it's most simple form.

But coming to think of it, isn't what we need to create a story?
"A pirate goes on a quest for treasure. In the end, he gets eaten by an orca."
A character, his purpose, his final destination. Input that in an algorithm and let the machine regale us with more details.

What would the machine know at this point?
The main character is a pirate - He does pirate-y things (good or bad, the machine will decide)
He goes searching for treasure - Of what kind? And what for? (the machine would fill these blanks)
He dies, eaten by an orca - Would the orca come out of nowhere? Would the pirate invade the orca's space? (let the machine create this with the rules set by the algorithm)


What you describe requires a lot of knowledge and planning. Resorting to templates for certain plot fragments which are then "instantiated" resembles the old MINSTREL and UNIVERSE systems a bit. This is not the road I'll be going, because I explicitly don't have planning. My system can't "come up" with new stuff, it can only try to engineer the most suitable story instance, given a set of parameters - for example the main character being a pirate, as you said.

In this way, your description also resembles the more "query-based" system I'm trying to implement, where you've got certain constraints ("pirate") and try to fill in the blanks of a template while satisfying them.

"{MainActor} goes on a journey to find {MainActorGoal}" could be resolved as a pirate going on a journey to find treasure - or a philosopher going on a journey to find meaning, and so on.

eyeliner wrote:
We can tell a machine that an orca can eat X animals, that a man can indeed kill orcas, though both these events might fail, that a pirate wants treasures, all pretty basic things for us to know, but a machine needs to know before hand, so in a way, we need to educate a computer about the laws of the stories we tell, because if we go to a fairy tale, all rules become different, and orcas can talk, and what not.

Not easy. Not at all impossible. A lot of work? Oh, yes.


Not impossible, but the devil's in the details. You mention domain-specific knowledge, like the one for fairytales. This is one issue, but a solvable one. It gets a lot harder when it comes to story templates that are below a certain level of "generic-ness" A character searching for his goal is easy - but fleshing out the details and being creative about it? That's a whole different story and it is one point where most algorithms fail due to a lack of human "common sense" and creativity.

Take the example about MINSTREL doing nonsense:

Quote:
The reader can imagine a Knight who is sewing his socks and pricked himself by accident; in this case, because the action of sewing produced an injury to the Knight, Minstrel would treat sewing as a method to kill someone.


The author of MINSTREL actually responded to this in a very old blog posting and he (in my optinion) was spot-on with his observation on the culprit of this. Killing someone by sewing is a pretty creative idea - this is not where MINSTREL failed. You can definitely write a story about that, and even one that is convincing - just use the context of fables, psycho killers or similar.

The point of failure here really was MINSTREL simply not being able to flesh out the details like a human would. As long as being on an abstract domain, it's easy to come up with things. But going down to the detailed level, maintaining consistency, reflecting motives and all that? That's quite a problem.

eyeliner wrote:
PS: I have never been so participant in anyone's work before, and I'm probably rambling things you don't need to read and deviate from your purpose.

Sorry about that, but you chose a fascinating subject. :)


Don't worry - getting some input really helps, even if (or especially when?) it's not on the same line that I am with my prototype :)

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/04/11, 13:42 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
In the past two weeks I've mostly been busy with writing. Not writing program code, but writing actual text for the thesis. And drawing pictures whenever I got too tired of it. I can't explain why exactly, but I really like neat diagrams, which sometimes results in me pouring hours and hours into getting one single picture just right. Not that it always works out, but I try :D

So, instead of bothering you all with ten pages of text, I'll instead just post the three pictures I've been working on and comment them:

Image

In the short introductory chapter about "Procedural Generation in Games" I'm identifying three broad kinds of generation that are applied in various forms to different use cases: Creation, Adaption and Recombination.

By Creation, I mean algorithms that can throw around some mathematical terms, apply some calculations on it and voilà, you've got some usable content. Generating terrain like in Minecraft or maps like in Civilization would be good examples for that.
On the opposite side, Recombination doesn't really create anything new, but rather attempts to combine existing elements in a meaningful way. The Binding of Isaac is one prime example, where levels are generated by arranging and configuring pre-defined room templates.
And right in the middle of it, there is Adaption. It takes pre-defined elements and modifies them dynamically - like Inverse Kinematics or animal variation in "No Man's Sky" are great examples for this.

Of course, none of them are rigid. They form a continuous spectrum on which many applications for procedural generation exist - and as for the names and kinds listed above, I just made them up to give some structure to the average reader who will probably not be into the topic.

Image

Next up, this is a quick overview on how the story generation algorithm in Tale-Spin works. It is far from accurate, but should be read as an abstract depiction on how (what I believe to be) the most relevant Components interact. It took me a lot of reading from different sources to figure this out, so hopefully, this will allow the reader to get a quick first impression right away. There's text to it, but I think you already get the essence of it just by looking at the picture - hopefully at least ^^

Image

Lastly, this is my favorite one. It took me three hours to create and countless (well, maybe 15-25) more to research all the information that was required to draw something like this. It is an overview of all the story generator systems that are presented in the chapter, and it shows when each of them was created, what broad "category" they fall into and what their individual focus was during development and analysis. Each of them is explained in the text, but the picture will (hopefully) allow to form an impression on the first glance.

That's it for now. I'll focus on writing now, until I either hit a roadblock or get to the part about the prototype I'm developing. Once I reach it, I will need to come up with a nice use case example - or more than one of them - and most importantly, some kind of "evaluation criteria". The first important part of the thesis will be to describe what I have done and what exactly my achievement in all of this is. The second one will be to reflect on my results and take a critical look at them - but what will be the benchmarks on which I will base that evaluation? That's going to be tricky - but one thing at a time ^^

Feedback, questions and critique are very welcome.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/04/19, 12:44 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
Twenty pages in and struggling with every paragraph. :rly: I really should stop worrying about wording and just write for a while. Surprisingly hard to do.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/04/30, 10:41 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
35 pages of content. By now, I've reached the part where I talk about internal design decisions of the various components of my prototype, for which I've chosen the name "Scribe" - it is "One who writes", yet focused on the practical aspect and not so much on the creative one.

Since I've also started searching for proof readers and reviewers to polish things a bit, I have uploaded an excerpt of my work here. It's the first eight pages, including part of the introduction and part of the previous works. Feel free to criticize my writing style, wording, thoughts and conclusions and point me towards mistakes of any kind. ^^

Also, in case you're interested in reading a bit more of it early, feel free to message me - I could really use some feedback.

While I continue writing on the system's internals and taking notes for potential improvements, I really need to find a representative use case for evaluating the system and concept as a whole. Does anyone of you happen to know a neat one-page short story that I could use as an example for variation? Changing the mood, switching out props, that kind of stuff.

Also, I thought about maybe trying to generate some Wikipedia article stubs for non-existent topics, but since English is the most complete language on Wikipedia, that is probably not going to work - maybe I could choose a category of topics that already has existing articles and pretend they didn't exist. Choosing a more obscure language would be a better way, but unfortunately, I don't happen to speak any of those. :|

If you have any other ideas for sample cases that fit nicely into the scope of 1-2 months, let me know. :D

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/04/30, 23:07 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 354
Location: Out there
Role: Hobbyist
I wanna read, but only after monday.

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
PostPosted: 2015/05/14, 12:29 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
So I've stopped writing at about fifty pages now and turned back to programming and prototyping. I really need to test what I have on some solid cases, the more the better. As part of that process, I have created a prototype UI to play around with.

Image


You can select a root template and enter a random seed, and it will generate a text in pretty stylesheet-powered wrapping paper. You can also switch the display style to diagnostics mode that displays the internal structure of the text and allows you to let the system re-generate individual nodes of the text by clicking on them.

You can download it here. Limited offer ;)


As the system is purely data-driven, feel free to modify Templates, Ontology data and Dictionaries and mess around with all you like.

But bear in mind that this is not release-ready production software - it is a prototype, and nothing more. When you do something unexpected, it will simply crash and burn and it might not even show you a stack trace. When you edit data files and introduce syntax errors, they might not parse and the program could refuse to load. All of this is expected.

If that doesn't scare you - experiment with it! It would be awesome to see some of your own creations, and to hear about what you think :)

@eyeliner:
Did you get around to it? Any feedback would be welcome - trying to improve the text and narrative as much as possible.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/05/15, 11:17 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
Adam wrote:
You can download it here. Limited offer ;)


YOINK!

Cool :D

by the way, you have a typo in Grammar.Gender.dct
Code:
Column: Grammar:Gender, mine/hiss, his

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group