Advertisement

Emergent Behavior

Started by August 02, 2006 09:50 PM
12 comments, last by Ebola0001 18 years, 3 months ago
To amuse my currently unemployed self, I decided it'd be fun to go play around with emergent behavior systems. Haven't done anything to show off yet, but I was curious as to how many of you guys have done work with them, have stories/demos of your work that you'd care to share. (I'm also on the lookout for good discussions/articles on the topic as well)
emergent behaviour is very very cool.

A simple flocking system is a great place to start.

I was building HL1 multiplayer bot AI, which was based on each bot having a list of simple "directives" such as "avoid getting shot" which would make the bot try and strafe if it saw a gun aimed at it.
This made it easy to add a new directive "flock" which implemented the basic flocking rules.

Once i put enough of these simple directives together they formed some very complex AI behaviours ;)
Allways question authority......unless you're on GameDev.net, then it will hurt your rating very badly so just shut the fuck up.
Advertisement
I believe AI-Junkie (http://www.ai-junkie.com/ai-junkie.html) had a competition a few years back titled "Emergent Behavior", not sure if they're still hosting the entries though.
Allways question authority......unless you're on GameDev.net, then it will hurt your rating very badly so just shut the fuck up.
I actually did some real world robotics programming that with our software had a couple emergent behaviors. Here are two cases I can describe with our emergent behaviors.

1) The robots standard behavior for getting out of a corner is to turn slightly in the direction it thought was more open...in an attempt to steer out of the corner. In some cases it would sit and go back and forth and back and forth for a minute trying to decide which way would be better to get out. Later this was fixed to a better routine where it more gracefully looked and escaped from a corner.

2) The robot would be told to go to a particular coordinate. It just so happens one time we told it to go to the middle of a table in the room. The emerging behavior was pretty sweet, the robot paced back and forth and sometimes did a lap around the table looking for a way to get to its location it was told.
That's not what I would call emergent behaviour (the APs post). That is just a transient error in robot state due to inadequacies of the control system to deal with the problem posed. Flocking is a good example of emergent behaviour because flocks show cohesion (among other system wide properties), which is a property of the system that no individual in the flock displays. Indeed, it doesn't even make sense to define cohesion for a single entity.

[Edited by - Timkin on August 3, 2006 11:30:26 PM]
Depends on what you call emergent behavior I guess. People can define emergent behavior as simply an action or reaction that was not initially programmed into the system but comes about because of the way other behaviors work together (or against each other). After all, if you program for the outcome of every possible scenario for a behavior and the combinations of behaviors reacting with each other, I dont think there would be emergent behaviors, every outcome would be known. Flocking I am not sure how that is emergent because part of the behavior for flocking is essentially following a neighboring entity. Can you explain how flocking is an emergent behavior? Emergent behaviors and behavior control are definately interesting topics!
Advertisement
It's not that the units of the flock go together which is emergent, its how their individual navigational behaviors influence the global flock in unexpected ways to create a more intelegent system. (where intelegnece = complexity of useful behavior)
Try this. http://www.omnisu.com/files/demo.zip

Nowhere did I write code to make the hexes line up so nice, and yet they do.
Quote: Original post by Anonymous Poster
Depends on what you call emergent behavior I guess.


We've had this discussion in the past in this forum (although it's been a few years) and there has often been disagreement. I hold to the predominant view within A-life literature. To summarise, that emergent behaviour is that which is not predictable given the encoding of the agent function, be that a single agent or one of a system of agents. Your example of the robot stuck in the corner, twitching back and forth, is easily predicted given the rules you described and simple geometric analysis of a corner. The example of the robot unable to reach its goal is also easily predicted. It will at best find a state 'closest' to the goal, but without any mechanism to recognise its search failure, it will reject this solution and continue to search. If it does not remember rejected results, it will find them again, in essence doing the same thing as the previous example: oscillating within a finite region of the state space with a non-zero transient error between its state and the goal state.

Quote:
People can define emergent behavior as simply an action or reaction that was not initially programmed into the system but comes about because of the way other behaviors work together (or against each other).

I wouldn't classify that as emergent behaviour, but rather the normal operations of an agent: an entity that acts based on its perceptions and beliefs. In essence, a data driven response. I doubt you've juggled dead fish. However, you might have juggled balls. I would not say that the ability to juggle dead fish is encoded within you, but if I saw you doing it, I wouldn't call it emergent behaviour, because part of the required ruleset was encoded within you. You were able to apply it by analogy.

Of course, these are my opinions. Other people may arrive at a different opinion even after reading the same literature. It is because we don't have a universal definition of emergence that we also have difficulty understanding it (although Wolfram claims to have solved it in his recent tome "A New Kind Of Science").


Quote: Can you explain how flocking is an emergent behavior? Emergent behaviors and behavior control are definately interesting topics!


Quote: Original post by Ultimape
It's not that the units of the flock go together which is emergent...


Actually, the cohesion of the flock is an emergent property. Maintaining this cohesion in the face of perturbations on the position and velocity of individuals within the flock would be a good example of an emergent behaviour. So when we talk about a flock, we're talking about a collection of individuals that display the property of cohesion and the ability to maintain this while acting as individuals. The emergence comes about because the individual's rules are written in terms of other individuals. If no other individuals are around, the rules are not violated and the individual can continue its actions without change. It is only when several individuals are in close proximity that they start to influence the behaviour of each other. While we can easily predict the first order interactions (between two units), predicting second and higher order interactions is extremely difficult (and basically we don't have a good mathematical system for doing that).

This has long been a problem in physics when trying to describe the properties of a system (like a gas, liquid or solid) in terms of the behaviours of individual elements (atoms). The only reasonable answer found by physicists was statistical mechanics (that is, describe the system based on the statistical measures of the elements within it). So, temperature of a gas, for example, is the average translational kinetic energy. You can't predict temperature from the measurements of the speed of a single atom and the speed of each atom will depend on its interactions with other atoms in the gas. Similarly, you cannot predict the existance of a flock by watching the motion of one individual. But when you see a group of individuals with a correlated velocity flow around an object and maintain that correlated velocity on the other side, you know you've seen a flock.


Quote: , its how their individual navigational behaviors influence the global flock in unexpected ways to create a more intelegent system. (where intelegnece = complexity of useful behavior)


Personally I don't like that definition of intelligence.

Cheers,

Timkin

Realtime n-body particle systems have interesting emergent patterns with simple formula and an element of error in computation. I wrote one that uses non-linear attraction to set the velocity, then jump the position to the next frame (which is linear). Instead of collision detect then momentum transfer, I simply did collision detect then reverse the same formula to repel. The result was little bodies orbitting each other and bouncing like flubber. So I added linear resistence to each frame. Then made dialogues to tap into parts of the equations.

One interesting setting was placing hundreds of uniform particles on a slightly resistent medium. They would coalesce into clumps, then join clumps together. Remember the flubber effect? Well when you have a clump where all inner particles are resisting and outer particles are attracting, it squeezes down until the linear jumps propelled by nonlinear repel overtake the linear resistence of the medium. In other words... eventually clumps of certain size would reach critical pressure and explode, spreading out individual particles only to slow down, coalesce into small clumps, and combine again and again.

Another interesting thing was to combine different particle types with different attraction/repulsion parameters and weaken the forces to minimize the flubber errors, then see what patterns emerged.

This topic is closed to new replies.

Advertisement