Jump to content


Photo

Random story/plot generation


  • Please log in to reply
26 replies to this topic

#1 Digisynth

Digisynth

    GMC Member

  • Validating
  • 55 posts

Posted 14 February 2012 - 06:52 PM

Happy Valentine's Day everyone! :GM080:

Let's discuss how to generate a random text.
Random sentence generators work by choosing a sentence structure and then filling in parts with words/phrases from a list of things that a programmer has made.

But how do you generate a whole text?

- You can of course just row random sentences behind each other, but that wouldn't make any sense at all.
- You could chose a subject that is repeated over and over in the sentences that come - but that doesn't solve the problem either.
- The biggest problem is that a computer doesn't understand things and therefore doesn't know it is rendering gibberish.

Do you have any suggestions to how this might work?

Edit:
One could make a list of sentences, where there are places to fill in things that are the same over all the sentences

Edited by Digisynth, 14 February 2012 - 06:58 PM.


#2 jonathanz

jonathanz

    GMC Member

  • GMC Member
  • 86 posts
  • Version:Unknown

Posted 27 February 2012 - 08:29 PM

Give me a little background, what kinda context? A dungeon game etc?? The less random the easier it will be.

There must be a structure behind the words.

Since the program wont know the difference between words, You'll need to have them sorted into groups
based on what type of words they are.
Once you have sorted a group of words into types such as PN, V etc. Get the program to make a noun phrase (nouns) and a relative clause to that noun phrase.
eg The man (noun phrase) Who wasn't there (RC)
And combine this with a Verb phrase.

Play around with it a bit. The way I'm thinking, do a tree like structure in terms of how the sentance is build.

I hope that gets ya started

Edited by jonathanz, 27 February 2012 - 08:31 PM.

  • 0

#3 jonathanz

jonathanz

    GMC Member

  • GMC Member
  • 86 posts
  • Version:Unknown

Posted 27 February 2012 - 08:33 PM

Since you want to make a whole text. It cannot be completely random.
There will have to be some relation between a sentance and the sentance that follow (of course)
So add some conditions

Edited by jonathanz, 27 February 2012 - 08:33 PM.

  • 0

#4 R8bit

R8bit

    GMC Member

  • New Member
  • 9 posts

Posted 28 February 2012 - 02:44 AM

I imagine if I were to do this then I should like to try this with tags. That is, each stored segment of text would have a particular hierarchy of tags. So, as of for instance, the sentence "But there is much more to be seen." would follow the tag path Thesis->Main Point->Transition->Subordinate. Less complex/topical sentences would therefore be able to fit in more sections.

Then I would create a thesis generator. That is, what exactly I want my bit of text to say (its purpose). This would be randomly picked from a list and a thesis sentence would be generated. Next would be a randomly generated outline. This is how I want my thesis to be explained. Each sentence of the outline would randomly chosen from their tags.

One such outline might look like:

Thesis->Hook
Thesis->Hook->Transition
Thesis->Main Point
Thesis->Main Point->Transition
Thesis->Main Point
Thesis->Main Point->Transition
Thesis->Main Point
Thesis->Main Point->Transition
Thesis

After the thesis is defined then applicable text simply fills the rest of the outline as randomly choosen from the pre-made/tagged lists.
  • 0

#5 Digisynth

Digisynth

    GMC Member

  • Validating
  • 55 posts

Posted 02 March 2012 - 06:15 PM

Okay, I'll upload the plot generator soon.

@jonathanz: It's an art project. Out theme was 'sleep' and I'm working on a program that randomly generates dreams. The more random the story, the better.

Let me explain my current idea:
I have a file that is used as database. It contains complete sentences with 'gaps' that are then populated with random words. The gaps indicate what kind of word should be inserted, but are not entirely random:
-> The program accesses the database and chooses three characters, three items and three places, which are then inserted into the gaps.
-> The result is that the plot contains items, characters and so on. This way the plot can stick more together.

The sentences or group of sentences of the database have a number assigned to them. The number is something between between 1 and 4.

Sentences with number 1:
- Characters 1 & 2 are introduced.
- Character 1 has item 1.
- Optional: This happens in place 1.

Sentences with number 2:
- Character 3 is introduced.
- Character 3 leaves/is left behind/dies/etc.
- Optional: Item 2 is mentioned.

Sentences with number 3:
- Characters 1 & 2 go to/are brought to/etc. place 2.
- Optional: Place 2 is mentioned.

Sentences with number 4:
- Optional: Character 2 leaves/is left behind/dies/etc.
- Optional: Place 3 is mentioned.
- Optional: Item 3 is mentioned.

The program basically chooses a sentence/group of sentences with the number 1, then 2, then 3, and optionally 4. The gaps are filled with words and there you have it:

A seemingly random story.

#6 Digisynth

Digisynth

    GMC Member

  • Validating
  • 55 posts

Posted 03 March 2012 - 03:36 PM

Here you go:

GMK file (10.8kb):
http://www.box.com/s...2ei0004koaj3t3a

Database file (2.2kb):
http://www.box.com/s...ivi860i4oyjagnu

Make sure both files are in the same folder.

Database isn't well populated yet, but results work.

Please tell me what you think.

Edited by Digisynth, 03 March 2012 - 05:48 PM.


#7 Robert3DG+

Robert3DG+

    Designer

  • GMC Member
  • 1925 posts
  • Version:GM:Studio

Posted 04 March 2012 - 09:32 PM

Nice demo, the results were actually pretty good. Is the goal to generate the gameplay around the randomly generated story? Or just to make the plot?
  • 0

#8 chance

chance

    GMC Member

  • Global Moderators
  • 6805 posts
  • Version:GM:Studio

Posted 05 March 2012 - 12:29 PM

Here you go:

<files>

Please tell me what you think.

It functions, but it just strings together pre-fab sentences which you've constructed to serve as intro, descriptions, or events. I'm not saying it's useless, but it won't generate anything you haven't already constructed yourself.

If you want to dig deeper, you might be interested in articles from this blog about various approaches to storyline generation. Some are combinatorial approaches like yours. Others are heuristic, or based on simple AI.

It's an interesting field.

.

Edited by chance, 05 March 2012 - 12:30 PM.

  • 0

#9 Digisynth

Digisynth

    GMC Member

  • Validating
  • 55 posts

Posted 05 March 2012 - 02:43 PM

Nice demo, the results were actually pretty good. Is the goal to generate the gameplay around the randomly generated story? Or just to make the plot?


Thanks! It's an art project (I'll upload the pretty version with big database later). It should just make the plot.



Here you go:

<files>

Please tell me what you think.

It functions, but it just strings together pre-fab sentences which you've constructed to serve as intro, descriptions, or events. I'm not saying it's useless, but it won't generate anything you haven't already constructed yourself.

If you want to dig deeper, you might be interested in articles from this blog about various approaches to storyline generation. Some are combinatorial approaches like yours. Others are heuristic, or based on simple AI.

It's an interesting field.

.


Thanks for the link - I'll look at it now. The reason why I used this approach is because it is the least complicated. By using 'gaps' that are filled with specific words, it won't be entirely pre-fab, so if my database is big enough it will take a very long time until plots start to become repetitive.

#10 Digisynth

Digisynth

    GMC Member

  • Validating
  • 55 posts

Posted 05 March 2012 - 02:52 PM

I imagine if I were to do this then I should like to try this with tags. That is, each stored segment of text would have a particular hierarchy of tags. So, as of for instance, the sentence "But there is much more to be seen." would follow the tag path Thesis->Main Point->Transition->Subordinate. Less complex/topical sentences would therefore be able to fit in more sections.

Then I would create a thesis generator. That is, what exactly I want my bit of text to say (its purpose). This would be randomly picked from a list and a thesis sentence would be generated. Next would be a randomly generated outline. This is how I want my thesis to be explained. Each sentence of the outline would randomly chosen from their tags.

One such outline might look like:

Thesis->Hook
Thesis->Hook->Transition
Thesis->Main Point
Thesis->Main Point->Transition
Thesis->Main Point
Thesis->Main Point->Transition
Thesis->Main Point
Thesis->Main Point->Transition
Thesis

After the thesis is defined then applicable text simply fills the rest of the outline as randomly choosen from the pre-made/tagged lists.


I like your idea, but it will take a while before you get your first results and I don't have that much time :dry: . I'll try to add your algorithm thereafter and make the program choose either between your or my approach, because a thesis generator might be a little stiff in it's sentence structure.

#11 land of games

land of games

    han solos friend

  • GMC Member
  • 467 posts
  • Version:GM:HTML5

Posted 06 March 2012 - 03:46 AM

this is very cool. i might look into the topic in the future. (for now working on somthing else)
note: i think your generator likes when its raining outside & fires.http://gmc.yoyogames.com/public/style_emoticons/dark/thumbsup.gif
  • 0

#12 land of games

land of games

    han solos friend

  • GMC Member
  • 467 posts
  • Version:GM:HTML5

Posted 06 March 2012 - 03:50 PM

well my smilie diddnt work......
oh well.
suppose you had an ini file with all of the word classifactaions. verb, noun ect.
then further clasifacations. (food,entertainment,sports)
and then have a database of sentance structures.
noun verb noun ect.
you would have hundreds of sentance structures that the machine picks randomly. once the structure is decided on the subject (random or picked by the user) of the paragraph. words in the same classifacations as the words in the first sentance are far more likely to reappear.
thus simulation complex random aragraphs that dont completely go off on a tangent. o.o
  • 0

#13 Digisynth

Digisynth

    GMC Member

  • Validating
  • 55 posts

Posted 07 March 2012 - 07:14 AM

well my smilie diddnt work......
oh well.
suppose you had an ini file with all of the word classifactaions. verb, noun ect.
then further clasifacations. (food,entertainment,sports)
and then have a database of sentance structures.
noun verb noun ect.
you would have hundreds of sentance structures that the machine picks randomly. once the structure is decided on the subject (random or picked by the user) of the paragraph. words in the same classifacations as the words in the first sentance are far more likely to reappear.
thus simulation complex random aragraphs that dont completely go off on a tangent. o.o


Surely that will work, but this only works best with random Sentence generation. If I would do this, then the story wouldn't make any sense anymore.

My current database has only 9 sentences (I think).

I'll upload another database with 180 sentences today. (I'm almost done) :thumbsup:

#14 chance

chance

    GMC Member

  • Global Moderators
  • 6805 posts
  • Version:GM:Studio

Posted 07 March 2012 - 01:05 PM

My current database has only 9 sentences (I think).

I'll upload another database with 180 sentences today. (I'm almost done) :thumbsup:

More sentences will produce more possible combinations... but it's still not really satisfying. I think you're on the wrong track here.

Instead of combining pre-fab sentences to create a readable paragraph, try to construct a story "framework" from basic elements. (Don't worry about readability -- you can flesh it out later.)

1. establish a scene/situation
You can still use random elements to fabricate a situation. Like a person driving through town, or a couple on vacation, or two people exploring a cave. This part can be random.

2. introduce conflict / tension
Your conflict can still have some randomness, but choose it based on some element of the "situation". For example, for people driving through town, you could have someone become ill/die, or be kidnapped. For an outdoor setting you could have some natural disaster, or have someone get lost. Or introduce an antagonist, or some unexpected "object".

3. built action to a climax
The types of action can be random, but they must be linked to the situation and conflict in steps (1) and (2). For example, your "action elements" could be running away, searching, hiding, fighting, etc. But the details are linked to (1) and (2).

4. resolve the conflict
Again you can have random outcomes / resolutions, but they must be related to the same action chosen for (3). For example, if your action in (3) was fighting, the outcome can be winning, losing, escaping. If your action in (3) was searching, your outcome can be finding, getting lost and dying, giving up.

Basically you're using a branching structure. But the only truly random details are the elements chosen in step (1). After that, the branches are limited to what makes sense for those particular details. So as the story progress, the randomness becomes more structured.

Granted, I haven't thought about exactly how to do this. But I think it's a better approach.
  • 0

#15 Digisynth

Digisynth

    GMC Member

  • Validating
  • 55 posts

Posted 07 March 2012 - 08:07 PM


My current database has only 9 sentences (I think).

I'll upload another database with 180 sentences today. (I'm almost done) :thumbsup:

More sentences will produce more possible combinations... but it's still not really satisfying. I think you're on the wrong track here.

Instead of combining pre-fab sentences to create a readable paragraph, try to construct a story "framework" from basic elements. (Don't worry about readability -- you can flesh it out later.)

1. establish a scene/situation
You can still use random elements to fabricate a situation. Like a person driving through town, or a couple on vacation, or two people exploring a cave. This part can be random.

2. introduce conflict / tension
Your conflict can still have some randomness, but choose it based on some element of the "situation". For example, for people driving through town, you could have someone become ill/die, or be kidnapped. For an outdoor setting you could have some natural disaster, or have someone get lost. Or introduce an antagonist, or some unexpected "object".

3. built action to a climax
The types of action can be random, but they must be linked to the situation and conflict in steps (1) and (2). For example, your "action elements" could be running away, searching, hiding, fighting, etc. But the details are linked to (1) and (2).

4. resolve the conflict
Again you can have random outcomes / resolutions, but they must be related to the same action chosen for (3). For example, if your action in (3) was fighting, the outcome can be winning, losing, escaping. If your action in (3) was searching, your outcome can be finding, getting lost and dying, giving up.

Basically you're using a branching structure. But the only truly random details are the elements chosen in step (1). After that, the branches are limited to what makes sense for those particular details. So as the story progress, the randomness becomes more structured.

Granted, I haven't thought about exactly how to do this. But I think it's a better approach.


So what you're suggesting is basically like a big flow-chart. I like the idea, but because the computer cannot understand the text it is producing, it cannot compute plausable consequences from actions/situations - unless you tell the computer what is or is not possible beforehand. In other words it won't be entirely random.

I have another idea though:
This might sound bizarre at first, but to achieve true randomness, one has to make the program understand the text it is producing.

This is how:
- The program has to have a large dictionary of all english words that describes the word type and gives possible synonyms.
- The program has to be able to analyse all possible sentence structures by using its dictionary.
- Now a lot of children's books have to be analysed by the program and a file of events and consequences has to be made.
- Now the outputted file has to be analysed: Similar situations with two different outcomes can be seen as two possible outcomes of a situation and depending on how often a specific outcome comes from a situation, a likelyhood can be calculated.
- A large flow-chart appears.
- Using collected data, the program can process more and more complicated books, because it 'understands' consequences.
--> In the end, the program generates a path inside the enormous flow-chart and a truly random story is generated.

Sorry guys, but I'll only be able to upload the new database tomorrow. :/

#16 land of games

land of games

    han solos friend

  • GMC Member
  • 467 posts
  • Version:GM:HTML5

Posted 07 March 2012 - 08:24 PM

hmmmm
what i men is that you would have sentance structure that clearly explains how the sentance is build (gramatically correct) but does not fill the words out. there is NO WORDS at all. so instead of:
i was _________ with __________
we have
person, sentance structure, past tense verb, sentance structure, person
so instead of just being able to generate somthing like
i was eating with henrey
it could randomly generate
john cant play without henrey.
its much simpler than having to define specific syntax rules for english and with some work could create just as complex paragraphs.

now also suppose that every word has different classifacations other than just noun verb ect.
somthing like sport, entertainment, ect.
now suppose that you have eveb more in depth classifacations: baseball, documentarys ect.
you would define the word to the subject baseball (multiple subjects for different words) then the program would know that if you define baseball then the word als falls into the sport category.
now we can branch out with huge numbers of classifacations......
suppose that we have 5 variables.
subject_1
subject_2
subject_3
subject_4
subject_5

these are the subjects of the paragraph.
if subject 1 = baseball
then the likelyhood of seeing baseball related words come up in the paragraph.
if subject 2 = food
then the system will be less likely to use food reated words than baseball related words but still br likely to use food.
the computer will be most likely to use words that fall into the baseball and food categorys.
so the system might pick....
cracker jacks.

this gives the programmer 3 choices on how to define the 5 variables.
1: let the user define them.
this gives us obvious problems. the user might pick the subjects military and indian cuisine. this would likely result in the computer generating a random mess of sentances that make no sense because the 2 dont have many words that fall into both categorys. of corse it also allows the user to have a much more interactive experiace. this also opens up applications such as therapy or entertainment.
2: let the computer pick them randomly.
some of the same programs as 1 (the computer can pick random pointless stuff too.) but it is easier to fix(ie the computer only picks related subjects)
3: have the computer generate a random sentance then base the subject on the words.
suppose the computer has a small chance to pick words outside the subject. the subject could change as the computer gos along. this would create the nice flow that feels more organic from one subject to the nest.

somthing between 1 & 3 is IMO the best. the subject is picked then the computer can alter the tect making it feel organic. also you could go so far as to have the computer be less likely to continue to use subject_2 if it is the oposite of the rest.
again a technolegy that works in such a way would be perfect for therapy.



of corse you need a huge database first.

suppose you have a server that can modify the database & a client that tells the server how to do it. somebpdy (or alot of somebodys) could caloborate to make a huge database.

database makers > client > server > ini file(database) > generation tool.


or you could just OPEN YOU DICTIONARY to make the database. (and spend the next 20 years!!!)


hmmmm
i would ry such a project but i dont know 39dll.dll T_T

HOLY WALL OF TEXT BATMAN
  • 0

#17 chance

chance

    GMC Member

  • Global Moderators
  • 6805 posts
  • Version:GM:Studio

Posted 07 March 2012 - 09:53 PM


...<snip>...
Basically you're using a branching structure. But the only truly random details are the elements chosen in step (1). After that, the branches are limited to what makes sense for those particular details. So as the story progress, the randomness becomes more structured.

I like the idea, but because the computer cannot understand the text it is producing, it cannot compute plausable consequences from actions/situations - unless you tell the computer what is or is not possible beforehand. In other words it won't be entirely random.

It can still be random, but not entirely stochastic. It must have constraints. At each plot juncture, the story can branch to a randomly selected branch -- but only those branches that make sense based on the previous conditions.

Storylines are not "random walks". They can have random elements, but those elements must be conditional -- based on the previous events. Otherwise, the story is just an incoherent ramble.
  • 0

#18 _250968

_250968

    GMC Member

  • New Member
  • 28 posts

Posted 08 March 2012 - 04:30 AM

you would need to have differnt basic sentence structures
for example
"the"+choose("man","woman","kid","old man","dog","king","boy") +"is" +choose("there","here","down the street","in the room","in the house")
which could output the following
the man is here
the kid is in the room
the dog is there
.......
or
[code=auto:0]"hand over your" +choose("money","cash","gold",'book","sword") + "or die!!"
which can output the following
hand over your money or die!!
hand pver your book or die!!
.....
  • 0

#19 land of games

land of games

    han solos friend

  • GMC Member
  • 467 posts
  • Version:GM:HTML5

Posted 08 March 2012 - 04:34 AM

i see what your doing there. hmmmmm. similar to my idea but simpler (and probably just as good) :medieval: XD
  • 0

#20 Digisynth

Digisynth

    GMC Member

  • Validating
  • 55 posts

Posted 08 March 2012 - 05:04 AM

you would need to have differnt basic sentence structures
for example

"the"+choose("man","woman","kid","old man","dog","king","boy") +"is" +choose("there","here","down the street","in the room","in the house")
which could output the following
the man is here
the kid is in the room
the dog is there
.......
or
[code=auto:0]"hand over your" +choose("money","cash","gold",'book","sword") + "or die!!"
which can output the following
hand over your money or die!!
hand pver your book or die!!
.....


Cool idea! I can integrate this in no time.

#21 twelveways

twelveways

    GMC Member

  • GMC Member
  • 1383 posts

Posted 08 March 2012 - 05:15 AM

But thats not a story, its just random sentences.

You would need a massive database that allows you to 'tag' words with locations, attributes, verbs etc that you might commonly associate wit hthem. You would also need to keep track of which words (and tags) have been used so that you can refer to them later.

The example above is nothing more than a game of madlibs.
  • 0

#22 chance

chance

    GMC Member

  • Global Moderators
  • 6805 posts
  • Version:GM:Studio

Posted 08 March 2012 - 11:41 AM

But thats not a story, its just random sentences.

You would need a massive database that allows you to 'tag' words with locations, attributes, verbs etc that you might commonly associate with them. You would also need to keep track of which words (and tags) have been used so that you can refer to them later.

Yes, that's the problem. That's what I meant by "a story is not a random walk". A story can have random elements, but it must follow a common thread. Most importantly, the randomness must decrease as the story approaches its conclusion.

I think twelveways' "word/tag tracking" idea could work. So for example, once the story branches to location[3], with object[1] and object[4], and antagonist[2], then those same elements must persist as the game progresses.

Otherwise, you might be in a subterranean cave being chased by troglodytes... and suddenly attacked by mafia hitmen riding camels in the Gobi desert. Might be funny, but it's not very interesting if it happens all the time.
  • 0

#23 twelveways

twelveways

    GMC Member

  • GMC Member
  • 1383 posts

Posted 08 March 2012 - 02:19 PM

Something ilke this, if done properly, would be extremely hard work, especially in english which is one of the most complicated languages to learn. you would basically need to teach the program how English grammar works as well as associating words together and linking causes and effects. It would be a huge job. I think I read a news article once where scientists made a program that could write a book, this was a team of scientists and it took them a long time and still the book didn't make much sense.

I fail to see how this project could be considered art anyway, art is all about emotion and feelings, a computer generated story is, by definition, not that.

A better art project would be to allow people to input their own words (like madlibs again), say an input box that asks for a scary location, one that asks for a scary person, one that asks for a scary feeling. the results from everybody would be stored in a massive database and called up randomly when the program is run. At least this way it would be drawing from other peoples experiences.
  • 0

#24 Digisynth

Digisynth

    GMC Member

  • Validating
  • 55 posts

Posted 22 March 2012 - 06:46 PM

Okay, here's some new stuff:
- You can download the updated database - Should still work with old viewer.
- You can download the new viewer - big file - this is my art project.

Here's a pretty viewer (17.6 MB):
http://www.box.com/s...ed4a8a28d5a46ec

Here's the updated database (15.0 KB):
http://www.box.com/s...ivi860i4oyjagnu

Keep in same folder!!

Enjoy. :thumbsup:

#25 Yal

Yal

    Gun Princess

  • Global Moderators
  • 6962 posts
  • Version:GM8.1

Posted 23 April 2012 - 11:48 AM

I like the idea, but because the computer cannot understand the text it is producing, it cannot compute plausable consequences from actions/situations - unless you tell the computer what is or is not possible beforehand. In other words it won't be entirely random.

That depends. You shouldn't worry about what words you will actually use on this stage; you should worry about what type of words you use. I mean, try to start at a really high level (such as the setting->event->climax->resolve plan, which splits the story into four big chunks) and then work down. Like a tree, you begin with the trunk and then work downwards with multiple branches until you eventually put down leaves.

I imagine you should not just store the word strings you plan to use, but also some other properties of words. Assuming you want to have build-ups and climaxes, you should give each word properties like what class of word it is (person name, verb, place, event, etc) and also give it a "goodness" value ranging between -1 and 1, where -1 means "really, really bad" and +1 means "totally awesome!". For instance, compare the words scent and stench - which one would you prefer to breathe in? Most words has a charge like that, but some have a stronger or weaker charge, and it can be positive and negative.

Typically, you can build up tension by applying multiple words of stronger and stronger charge when you're at the sentence construction stage (the bottom level) so it can be really powerful if used correctly.

Also, you could give words a "tension weight", that ranges between 0 and 1. The higher the tension weight, the more tension does the word create. This would be used in a similar way, to create build-ups.



So, if we agree that my method is good, we have an idea about where to start and we have an idea about where to end up... but the middle-levels, between the trunk and the leaves... we have no real idea about what to do there. I think the middle part is dependant about how long you want the average random story to be; if it's just one page, you could begin assigning sentences to the four parts at once; if it's longer you might have to divide it down to paragraph level or so before you start generating sentences.



One thing that springs to my mind for making more complicated novels... you could use a "event stack", and every now and then you may push a new event on the stack; to go on with resolving an event, all events pushed on top of it must be resolved first. If an event of higher "severity" is pushed on top of a low-severity event, the low-severity event will be destroyed immediately and left out once the high-severe event has been resolved (for instance, the protagonist is going over the street while carrying a hurt puppy and gets hit by a truck; when he awakes on the hospital the puppy is gone and the plot will never mention it again). If multiple events of equal severity is pushed on each other they should both be referenced until the top one is resolved; for instance if the protagonist is diving, gets low on air, gets trapped in a ship wreck, and gets chased by a shark inside the shipwreck, all these events basically take time simultaneously since they're all of maximal severity. The "environment severity" (highest severity in the stack right now) could be used to cut down low-severity events after few sentences; for instance if the hero finds a minor gold coin while escaping the shark, it's just briefly mentioned, if he finds a strange key it's briefly mentioned but not as briefly as the coin; if he finds a dead end there's a long account about it.

Also, there should be a limit to how many events you can stack. Finally, sometimes you can empty the stack completely. If that happens you should write a pretty comforting resolve passage and end the chapter. You can push on more events in the next chapter, if you want the plot to go on.
  • 0

#26 toboozy1234

toboozy1234

    GMC Member

  • GMC Member
  • 19 posts
  • Version:Mac

Posted 02 October 2012 - 05:39 AM


you would need to have differnt basic sentence structures
for example

"the"+choose("man","woman","kid","old man","dog","king","boy") +"is" +choose("there","here","down the street","in the room","in the house")
which could output the following
the man is here
the kid is in the room
the dog is there
.......
or
[code=auto:0]"hand over your" +choose("money","cash","gold",'book","sword") + "or die!!"
which can output the following
hand over your money or die!!
hand pver your book or die!!
.....


Cool idea! I can integrate this in no time.


An even easier way to do this is to make an array full of nouns, an array full of verbs and so forth. than have the basic story structure. eg. (a (noun) (verb) and (verb) its (noun)). You need variables to select the index of these arrays by a simple choose or floor(random()) function. Hope this helps :)
  • 0

#27 Yal

Yal

    Gun Princess

  • Global Moderators
  • 6962 posts
  • Version:GM8.1

Posted 02 October 2012 - 10:16 AM

I still think, as stated above a fair few months ago, that using random() to pick truly random words won't give you any interesting random plots - you'll get the text equivalence of white noise. To actually get meaningful output, you need to have some sort of underlying structure that chooses what to do.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users