Skip directly to content

artificial intelligence

Creating a Sensory Input-Based Monster AI, Part I

on Tue, 05/30/2006 - 12:58

As a thought experiment I am putting together a generic artificial intelligence which I can use for bad guys/NPCs in a variety of different games. There are myriad paths I could follow in creating AI, so for right now I am going to concentrate on two inter-related tasks: awareness and morale. In other words, when does X become aware of another entity, and what does X do in response to that awareness?

For the purposes of this essay there will be two entities: a deer and a wolf. I will discuss the reactions of the deer.

The first step is to create a triggering event. In this case, proximity. Using whatever senses are available to it, somehow, at some point as the wolf approaches, the deer becomes aware of it. This could be something like a twig snapping, or movement in shadows, or wolf-smell on the wind. In any case, the first level of this system is Awareness.

Once the deer is aware that Something is out there, the next step is to determine what that thing is. It could be another deer, or a faun, or a human, or the wolf. Without making that determination the deer cannot react appropriately. It might run in terror from the faun, or stand still while the wolf attacks. So the second level of the system is Recognition.

Once the approaching entity is recognized, the deer can take the appropriate action; in this case, run in terror from the wolf. Or if the deer is protecting a faun, move to attack/distract the wolf while the faun flees. This level of the system is Reaction.

So: Awareness to Recognition to Reaction. Think of them as concentric rings centered on the deer. As the wolf enters these rings its proximity triggers different responses. These distances can be displayed as a sequence of numbers; for instance [20/10/5]. [Awareness/Recognition/Reaction].

Awareness will always be the largest number. Without being aware of something, the deer cannot either recognize or react to it.

Either recognition or reaction may be the next largest number, or they may be equal. In any case, neither of them may be larger than the Awareness number, although they may be equal to it.

So: [10/5/10] would be a “legal” description, but [5/10/5] would not.

Using this system a wide variety of behaviors may be put into place with little effort. The following are some examples:

[10/5/2] – Long-range awareness, medium-range recognition, short-range reaction. A semi-tame, slow-moving, not-too-bright animal. A farm cow, for instance. Knows you are there, knows who you are, doesn’t much care.

[10/5/10] – Long-range awareness and reaction, medium-range recognition. Guards at a gate. Something is out there, so immediately set out after it. Once they are close, it may be recognized and perhaps another action performed.

[10/5/1] – Long-range awareness, medium-range recognition, extremely short-range reaction. A bored, disaffected clerk at a store. Knows you are there, knows who/what you are, doesn’t do anything until you actually poke him in the shoulder.

[10/1/10] – Long-range awareness and reaction threshold, contact-range recognition. A rhinoceros during mating season, which charges anything it detects, and only stops when it recognizes “Ooh! That’s a train!”, or something of the like at extremely short range. Basically this is an unthinking reaction to the presence of another entity.

It occurs to me that this could be made less “broad” and more “deep” by changing to a two-level “awareness/reaction” and “recognition/reaction” system. For the purpose of simple- to medium-complexity games I like the three-level approach. In particular playing around with the distance between “recognition” and “reaction”, allowing for simulating different levels of intelligence or bravery, and startle-reactions, such as an enemy suddenly appearing well within the “reaction” threshold, causing a panic reaction; or a particularly slow-witted (think “drunk”) critter standing around gob-smacked while being charged by a bull.

Note that this AI system is for an “initial contact” situation, where another entity is first entering into awareness range, or has been outside of awareness range long enough that the “deer” has forgotten the entity was there. Reactions when actually interacting with another entity will be discussed in an upcoming essay.

Notes on Artificial Life

on Mon, 02/16/2004 - 00:00

To model artificial evolution chromosome for chromosome is impossible. We would have to have an operating system create random strings of digits and try to run them all, and then build upon the successes; e.g. those strings which will perform some function within that hardware.

Instead it is more useful to begin the modeling at a level of sophistication where the beings' interaction with the environment is obvious - when the being is mobile. Mobility is perhaps the fundamental interaction with the environment; the key word there being "interaction". Awareness of the environment is tricky, as it assumes a certain level of self-awareness: "I am not that within which I exist." Interaction and awareness are not quite the same thing.

Interaction begins when there is more than one autonomous being with an environment: There is a thing here which is demonstrably not "I".

Therefore, in modeling interaction, there seems at the moment to be three levels: awareness, regognition, and reaction.

Awareness: there is a thing here which is not-me
Recognition: that thing is of type "X"
Reaction: X is friend/foe/food

...and perhaps there is some resonance between recognition and reaction.

This begs the question: is existence a pre-requisite for awareness? Is the chain:

Existence - awareness - recognition - reaction?

The answer seems to be "yes", for (in the realm of AI/ALife) a thing must exist before it can be made aware of any other thing. And it must be aware of a thing for it to recognize that thing. And it must recognise a thing before it can react to that thing.

And here we must make a distinction reflex action and re-action. The action of X is its existence/proximity, and it is to that which I am re-acting.

In modeling an entity we can approximate Awareness with a simple distance calculation: You are this close to me, therefore I am aware of you.

Recognition requires a more refined set of senses, say, sight/smell/hearing. This can be another distance calculation, or combine distance with (say) sight in a particular direction.

Using this as a beginning allows us to add a great many modifiers onto the base behavior:

  • fight/flight
  • arbitrary reaction to different Xs
  • different senses
  • - some senses broadcast (sight) - active
  • - some senses receive (smell) - reactive
  • reflex (pre-recognition) actions at different levels

This brings up another question: Does a thing actively broadcast its existence or do other things become passively aware of its existence?

Could be some of both; call it "signalling".
Active: noise, colors
Passive: smell, body heat

...all of which allows different senses to react to different stimuli at different levels. It also suggests a slight change to the structure of awareness:

Exist -- ?
Awareness -- Reflex
Recognition -- Reaction

This is a good starting point; the rest is just code.

Generative Poetry

on Tue, 01/29/2002 - 19:00

Had a long, interesting conversation with Scott today, regarding the problems inherent in duplicating the creative process. He is building an application which, he hopes, will be able to write poetry based on an understanding of the concepts behind language. I cannot imagine a more difficult task than to teach a computer to 'think' in metaphors. There is so much we don't understand about our own thought processes when it comes to recognition and cognition, that modeling such behavior can easily devolve into educated guesswork. Questions come up; hard questions, like: What does it mean to 'perceive'? To 'conceive'? To 'recognize'?

Isaac Asimov once stated that any sufficiently advanced technology would be indistinguishable from magic. Borrowing this idea, could it be said that any sufficiently complex pattern of behavior would be indistinguishable from intelligence? Computers do not ACT. They await input, in whatever form it may be, and then do what they are told to do with that input. They do not autonomously decide what to do with unfamiliar data. They can search for patterns which match patterns of familiar data, but they will not search for patterns which we have not told them to search for. It goes back to my comment regarding Fluid Concepts and Creative Analogies : a computer will not try to creatively figure out a problem. It does not care that {1,4,9,16,25} is a series of perfect squares. It will spend eternity trying to untie the knot where Alexander would simply cut it with his sword.

The questions about intelligence which arise from this train of thought tend toward the unsettling. Is there such a thing as action, or is there only re-action? Is human behavior a reaction to a profoundly complex set of behaviours, or, in being self-aware, do we transcend re-action to the point that we behave autonomously?

Throwing in the question of free will vs. predestination complicates the process of teaching a computer to recognise poetry. But without teaching a computer to think symbolically, the best machine-written poem will, in reality, be the result of complex pattern-matching.

My project is, for the near future, much less complex than Scotts. I am building a machine to model evolution and genetic drift. Ultimately I plan to explore the question of emergent behavior and hive-mind patterns. I say 'less complex' because the a-life I work with does not need to think; it only needs to re-act.

Ellipsis

on Mon, 01/21/2002 - 19:00

I have been crazy busy at work. A project which we started this past Thursday needs to be finished tomorrow night. This will not be a problem. I am just that good.

Nothing new to report of the memetics front, other than this: Have you ever noticed that when you develop an interest in something, that something seems to pop up all over the place? I am reading The Cassini Division by Ken MacLeod, wherein memetic viruses are used as a kind of instant post-hypnotic suggestion to either frighten enemies or keep servants in line. And get this: They seem to be transmitted by 'swirling patterns' on the hulls of ships, or in visual broadcasts. Could they be using archetypal symbols to cause this effect?

In other news my two Hofstader books ( Metamagical Themas and Fluid Concepts and Creative Analogies ) have arrived. I started reading FCCA yesterday.

The chapter titled "To Seek Whence Cometh a Sequence" explores the methods by which patterns are recognised, and the processes we use to extend those patterns beyond the information we are given. The idea being, I suppose, that what humans and computers consider meaningful are not at all the same thing. If I see a sequence {1,2,3,5,7,11,13} I know from experience that these are prime numbers. A computer doesn't care if they are prime numbers. It won't discover that they are primes unless we ask it to test the sequence for the possibility that they are primes.

And that is the fundamental conceptual stumbling block in building a thinking machine. Computers don't out of habit, attach significance to symbols. Things are not "interesting". They don't have subconscious biases toward recognising familiar patterns.

Or maybe they do. What do I know?