Duck Gets Dog a Stick: SUCCESS!

Happy New Year!

After toiling away at this for over a week, I’m declaring this a success! (See the previous post for the backstory behind this.) Here’s the generated story:

# evaluated: 7, score: 110, eval: 0

Best score: 110
Donica Duck moved the stick down from the tree to the ground.
Deruiter Dog took the stick from the ground.
Deruiter Dog expressed appreciation to Donica Duck.

I first had expressed the rules in Prolog and threw both my self-made Prolog interpreter as well as an open source Prolog interpreter at this, but it turned out to be too slow, so I did the move generation by hand. I also cannibalized a chess program I had previously written, generalizing the concepts of “board”, “move”, etc. so that the chess board is the story universe and a move is an event in this universe. The current evaluation function simply maximizes happiness but can later be made more sophisticated by introducing drama, misery, etc.

Although I’m ecstatic this worked, I’m not 100% sold on this approach because:

  • if the branching factor is too great, the maximum achievable search depth will be greatly restricted
  • this doesn’t intuitively feel like the way stories are created by humans

That said, a hybrid approach might be possible. And as long as my goal of creating an entirely new art form (computer-generated fiction that humans find engaging) is achieved, I don’t care by what mechanism that ends up happening.

Duck Gets Dog a Stick?

Even the goals I outlined for myself in November, 2015 are too ambitious for the time I have at my disposal. Let’s try something simpler.

Dogs enjoy sticks because they can run around with them. There’s a stick in a tree that would be perfect for a dog but it can’t reach it. A duck could fly to the tree and get the stick for the dog, though, thereby making the dog happy.

Let’s make a set of rules and inferences for this and see if we can get Harible to generate a pleasurable story by processing these.

Next Ambitious Mini-Project: Use Searching and Inference

I’ve been procrastinating on my next mini-project because it’s more ambitious. It involves taking a stock list of animals, then generating a story based on their likes and dislikes. They will push a button and go to different habitats, where different animals living in those habitats may be, then join each other and interact with both each other and their world based on their preferences. Random events will also occur. Their actions will also ideally be based on hypothetical simulations. (For example, a duck doesn’t necessarily care for a stick, but if it can retrieve it from a place inaccessible to a dog and give it to the dog, it can make the dog happy.)

Here’s a brain dump of what I have so far, in a format that is only meant to be understood by me:

- likes chasing small moving things
- hates water
- purrs when it's happy
- is afraid of dogs
- is afraid of larger animals
- can inflict damage with claws
- likes treats
- likes food
- likes to chase cats
- likes to please its owner
- likes belly rubs
- likes to swim in water
- likes treats
- likes food
- loves water
- can fly
- likes treats
- likes food
- likes the sun
- hates water
random universe elements
- random landscape
 - pond
 - no pond
- random events
push a button - go somewhere else
random events
- rain
- sunny
- snow
- hail
things you can find in these places
attitudes towards events and things
if X and Y and Z, then occurs({Q:probability, R:probability, NOTHING:probability})
if X then utter({Q:probability, R:probability, NOTHING:probability})
want to do nice something for the other
generate story timeline events

Animal Names / Story 00002

Found this gem:

Based on this, I concocted a primitive phonetic matching algorithm to generate random animal names. Here are some of Harible’s next┬ástories, which involve two randomly-generated animals being the best of friends:

Furniture Ferret and Conover Crayfish were the best of friends.
Longacre Lion and Diviney Dove were the best of friends.
Satagaj Swan and Pas-de-deux Piglet were the best of friends.
Jenninger Jaguar and Faraha Fox were the best of friends.

Next Assignment: Animals

OK – here’s my next assignment. We’re going to start small, with children’s stories. I think I have a good handle on how to write a decent children’s story myself.

We’ll start the attack like this:

  • Gather a list of common animals. (Done)
  • Come up with a way to generate cute prefixes for the names of these animals in English (Janga Jackal, Kiminy Kangaroo, or something like that – no idea how I’m going to do this).
  • Handcode some basic knowledge about each of the animals in this list that will give rise to goals that a given animal would want to accomplish within a story (a mole wants dark and to burrow, a cat wants to chase things).

After the above, I’ll figure out what to do next.

Story = Theorem

One of my goals of this project is to have a story be spit out in the same way a theorem is proved or a the next move of a chess game is computed by searching lots of possibilities. There’s also an element of probability that needs to come in to play too, of course. (If everything were 100% deterministic, you’d get the same story each time.)

Here are a couple of resources I found that might help in modeling all of this. I’m not sure whether they’re too low-level for what I’m trying to accomplish, though:

Personality Types

I think the next step after random name generation is assigning a personality type to each of the generated characters. I’ve found this, which appears to be a good start:

Hopefully I won’t run afoul of any copyright laws using this internally.

Once a personality type is assigned, then different world events can trigger different reactions based on personality type. Also, a character needs to have goals which are consistent with their personality type. Not sure how I’m going to do this yet.