intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Oct 19, 2018 5:24 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu May 10, 2018 4:12 am 
Offline

Joined: Thu May 10, 2018 3:54 am
Posts: 1
Hello Everyone, I have a text generation framework I built in PHP that stores text in an array of possibilities an rebuilds the content when accessed so that the text is never the same twice.

It takes much longer than writing a paragraph one time, but its much much much shorter than paraphrasing the same paragraph millions of times to get every possible unique combination of words.

It was actually my own dream to create an Interactive Fiction game using this technique which sparked me to do some research before I started building the entire game engine from nothing.

Now the problem is that PHP is not compatible with the technologies that are commonly being used.

So I'm going to need to rewrite it to extend the current framework, or provide it as a module, which is the thing I am specifically looking for advice on in this thread.

So is this something anyone would be interested in having?

I can describe the basic functionality of the class below.

Class word soup:

function words: store a word list, usually a list of synonyms.
function sentences: store sentences lists, usually the same sentence used.

Inside a sentences word lists are templated into the sentences using tildes ~word_list~.

The tildes have a bunch of operators that include

+ capitalise the first letter of the word returned from the word list

@ if the words in the word list have some letters beginning with a you can dynamically switch between an apple and a banana

& a list such as : I have a, b, and c where a,b, and c appear in any order.

There are other various functions that handle building sentences into paragraphs and assigning probabilities for certain phrases to appear and the specific order they do appear.

I really believe these could entirely revolutionise all video games as now there is the possibility for NPC's to never have stale text that reads twice the same way.

I am very keen on some feedback, so looking forward to some replies.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu May 10, 2018 8:49 am 
Offline

Joined: Thu Aug 13, 2015 1:34 am
Posts: 110
Location: Kemerovo
You can post it as a composer module. You never know what tech stack could become the next big thing, and PHP is not a niche language.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu May 10, 2018 11:29 am 
Offline
User avatar

Joined: Mon Oct 03, 2011 12:03 pm
Posts: 1045
Location: Southampton
If you're interested in current projects that use generative text, there's a recent list here.

There are games that make use of generative text in current languages. Begspace in Twine, and Apocalypse Fuel in Inform 7 both come to mind.

Inform 7 includes tools for text variation that maintain readability of the code while allowing different kinds of random variation. So for instance:

Code:
say "[one of]Today[or]Yesterday[at random] [one of]I[or]we[or]they[then purely at random] [one of]went to[or]visited[or]robbed[as decreasingly likely outcomes] [one of]the bank[or]the cornershop[or]my mother's drawing room[sticky random]."


Tracery is a scripting tool underlying the cheap bots done quick twitter bot creation website. It allows word lists list with each randomised word (or sentence) able to be drawn from unique lists which can themselves contain randomised elements.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 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
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group