Behaviour A.I.

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

MatW
Posts: 0
Joined: Thu Jul 01, 2004 5:15 pm

Behaviour A.I.

Post by MatW »

I`m currently working on adding a behaviour system to blender.
The idea is that behaviours/actions can be added to objects and other objects can be set as agents/people which will perform actions on the various objects to meet their (user changable) needs.

The code for new Actions/behaviours at the moment needs to be added to the source code, but I`ve nearly finished a python module so they can be programmed in that.
Then these actions can be attached to objects.

I`m just posting this to see if there are many people who think this might be useful to them, and to see if anybody has any ideas for built in generic actions which might be useful.
I`m not sure how good I have been at describing this so a easy way to think of it is kind of like the system in the game "the sims".
A object can have actions which the agents can perform on them to meet their needs.
I see it being useful in a animation of a village where the background characters would move around performing these actions without direct animation.

Money_YaY!
Posts: 442
Joined: Wed Oct 23, 2002 2:47 pm

Post by Money_YaY! »

dude beyond usefull. ! Could ,make test dummy figures then or all sorts of stuff

Statik
Posts: 0
Joined: Fri Apr 16, 2004 2:05 pm
Location: Nova Scotia Canada
Contact:

Post by Statik »

You might want to check with the guy doing blender people http://www.harkyman.com/bp.html

It would rock to have both of these working together.

Statik

clevo2
Posts: 0
Joined: Wed Feb 05, 2003 4:44 am

Post by clevo2 »

I'm working with an animation research group looking at generative animation algorithms for character personalities. We were considering using Blender as the platform for testing in the game mode. We are exploring the posibility of attaching scripts to keyframes so animations are produced on the fly. I would be interested in talking to you, you can reach me at p.cleveland@griffith.edu.au.

harkyman
Posts: 98
Joined: Fri Oct 18, 2002 2:47 pm
Location: Pennsylvania, USA
Contact:

Post by harkyman »

Do you mean talking to Statik, or talking to me (the BlenderPeople guy)?

MatW
Posts: 0
Joined: Thu Jul 01, 2004 5:15 pm

Post by MatW »

Harkyman,
I`m not sure who they want to talk to. At first I thought they meant me, but now you bring it up it could of been either you or Statik.

Anyway maybe me and you should talk sometime to see if there is any code or ideas we can share. I`ve tried to move my system away from doing battles as though that was a idea at first once I saw your system , I tried to make it so mine didn`t overlap yours too much.

I know most of your work is in python even though you have added a few functions in C, where I have added most of mine in C and am now adding a few python functions to allow some features to be controled from that. Still there might be some areas we can share or at least ideas.
My background is in A.I and robotics rather than 3d graphics.

I also hope to add a animation within the next few days so people can get more of a idea of what my system (which doesn`t have a name yet) does. As right now from the replies so far I don`t know that there is the demand for me to put in the work what is needed to make it more userfriendly as right now it does most of what I need it to do but isn`t at all user friendly.

Oso
Posts: 17
Joined: Sat Oct 19, 2002 2:03 pm
Location: Massachusetts, USA
Contact:

Post by Oso »

I don't know if this really applies to what you're doing, but have you checked out these sites?

http://www.h-anim.org/
http://www.vhml.org/
http://www.cs.vu.nl/~eliens/research/re ... tform.html

Maybe there's something that can be used/extended into Blender.

Statik
Posts: 0
Joined: Fri Apr 16, 2004 2:05 pm
Location: Nova Scotia Canada
Contact:

Post by Statik »

Don't talk to me about it, I'm just an idea guy. I don't actually do any programming with Blender. I've barely gotten started using blender, even tho I've been following it for years.
Talk to harkyman.

Statik

harkyman
Posts: 98
Joined: Fri Oct 18, 2002 2:47 pm
Location: Pennsylvania, USA
Contact:

Post by harkyman »

Yeah, it sounds you what you're working on is very interesting, and it doesn't sound like there's a lot of overlap. As I explain on the BlenderPeople page, I'm not really trying for a realistic modelling of human behavior. I'm going for quickly simulated group dynamics that look good. It doesn't have to be battle, but it is definitely optimized for crowds. In fact, that's why I use an external database to keep track of everyone - queries on things like nearest opponent/ally, mean location coords of a certain subset of actors, etc. can be performed lightning-fast by the db, much faster than any python implementation could hope to match.

But am I correct in assuming that you're making complex character animation based on simple rule sets? If you have any info you're ready to show, I'd love to see it. The BlenderPeople documentation is fairly comprehensive and will give you a good idea of what it can do and what it is useful for.

MatW
Posts: 0
Joined: Thu Jul 01, 2004 5:15 pm

Post by MatW »

Ok I`m going to describe my work a bit.

I`m not trying to realistic model human behaviour , more trying to allow for background characters to move around performing actions while looking like they have some sort of intelligence without them being individually animated by the designer/blender user.
I`ve tried to make it as modular as I can so I can change the way part of it works, so at the moment fairly large parts of it are changing daily.

The idea started as a way to easily animate background characters .
The basic idea was for most of the "intelligence" (or really just scripted behaviours) to be in behaviour/action objects but which could then be attached to 3d objects in blender.
Then other objects could be set as agents which would decide which behaviour to perform.
Agents could also have action objects attached to allow agents to fight/kiss/whatever each other.

The main reason I`ve tried to seperate the actions from the "decision/planning" ai is to allow new actions to be added easily, one of the areas which needs more work is to allow new actions to be in a python script.
So I`ve tried to make it so the agent doesn`t know about each action rather they can tell what the result of a action might be.
As I did start with the idea of using it for battles, a agent can be part of a group and will move with that group either in one of a few preset formations or using flocking then at times a agent can leave the group to do another action such as fight after which they can rejoin the group, but I`n now stopped most work on this part as I think it would mostly be just redoing what you are doing with blenderpeople.
The other way it allows for group behaviour is that more than one agent can be performing a action at a time and a action can keep track of which agents are currently performing it. One simple way I haved used this so far is if there is say a vending machine which more than one agent wants to use at a time then the action can include code to make the others wait in line untill it`s their turn. There`s lots of other uses I can think of.

There is also a basic event system so some actions can generate a event which other agents might react to , eg.. say two agents start fighting this could generate a fight event which other agents might react to , some might run away while other might stop and watch.
Also the user can add events at certain frames , so a explosion event might be added to frame 100 which the agents would react to even though there might not be any object which they are aware of which exploded or caused the event.

One of the main reasons I don`t know if many people would find this useful is because a lot of the ideas would normaly fit in more with game or simulation a.i. even though I`m not using the game engine part of blender.

I`m currently working on allowing more user direction of what actions a agent should perform as I think this would be more useful than the a.i. deciding all the actions to perform.
So at the first level a agent can be told to do certain actions at certain times while at other times leaving it upto the a.i.
I`m trying to expand this into more of a general scheduling system so a list of action might be given without setting the times or even order to do them in and also to tell the agent that it should be in certain areas at certain times. I also want to add group types to the actions so that they can be told to perform actions in a certain group at set times.
Also the needs of each agent can be changed.

I`m also adding a decision tree so the user can change the setting in this.


I hope this has given people more of a idea of what my system does and where I see it going. I`m a bit short of time right now and am not that good at describing things so I`m sure parts of this still doesn`t make much sense.

I`m not ready to release this yet mainly because the GUI need a lot of work , in so much as right now there isn`t that much of one , most of the features are set through python functions. Right now I`m unsure if to spend my time adding new features what are useful to me or to spend it on the GUI and make it user friendly so I can release it.So if anybody thinks it might sound like it would be of use please say so as the more people who say so , the more time I will spend on the GUI.

kencanvey
Posts: 0
Joined: Mon Jun 02, 2003 7:54 am
Location: Smethwick West Midlands UK

Post by kencanvey »

This sounds great, Blender Extras!, as far as I understand, say I wanted to do my own version of SW attack of the clones Corascant scene, this would be able to deal with all the background trafic etc? or if I needed say an asteroid field were the rocks in the background could actually bang into each other instead of going through?

Have I got it, if so yippeeee :D

Ken

MatW
Posts: 0
Joined: Thu Jul 01, 2004 5:15 pm

Post by MatW »

It could be used to control traffic in a Coruscant type scene without much problem.
But it wouldn`t really work in a asteroid belt as it`s not a physics engine .

I think I need to stop trying to describe it as I`m not doing that very well, so I`m going to try it get it into at least a semi easy to use state and release it as soon as I can so people can play around with it.

harkyman
Posts: 98
Joined: Fri Oct 18, 2002 2:47 pm
Location: Pennsylvania, USA
Contact:

Post by harkyman »

Can you generate a simple animation showing this in action? I think that would do better than 3 pages of descriptive posting. :D

Statik
Posts: 0
Joined: Fri Apr 16, 2004 2:05 pm
Location: Nova Scotia Canada
Contact:

Post by Statik »

The reason I suggested Harkyman, is because I had the impression, MatW, that your extension was designed more for intellgent milling, etc. Like the background action in a city scene. It would control the 'extras' as it were. While I see Harkyman's extension as dealing with directed action, like battles where squads and groups move together, yet act separately.

Where I could see them interfacing would be, for example, a large agricultural scene where the intelligent milling has the defenders busy at work farming the land, people in the background threshing, milking cows, etc. Harkyman's extension controls a group of attackers who approach and attack. One by one the defenders step from the milling extension into the BP extension, forming into a counter attack.

I'm sure there are tons of other ways these things could be interfaced.

Statik

MatW
Posts: 0
Joined: Thu Jul 01, 2004 5:15 pm

Post by MatW »

While I have suggested my system would be best used for background characters, it could also be used for directed action. My goal when I started it was for directed action and a big part of that was for battles and such, then I saw blender people and decided to try to move toward other areas so I wasn`t repeating the work Harkyman had already done and also to not step on his toes.
I`ve looked at the code from Blender people and in some areas we have had the same ideas , but right now I have stopped work on most of the group behaviour to focus on individual character behaviours.
To be honest I see both this and Blender People to be used more for background animation as I think most of the main characters will still be animated in normal ways.
As such one of my main aims is to be able to add a character and tell it in general terms what to do , such as tell it perform a action on a object then to go and have a conversation with another character . Then it will do this without the need for key frames and such to be set, it will look around for the object and move towards where ever it is and do the action be then it will go to the other character while using the correct animations.
One area what I think some people have been confused about is thinking that the animation are built on the fly as the characters move around . While I have done a bit of work on that , the main way for animations is for them to be stored in normal Blender actions and these are then used to set the pose for each frame.


Right now my system still is at a kind of early stage and I am open to suggestions to what people would want it to do , and I do hope at the very least we can make sure that it and Blender people can be used together in the same animation even if there is no direct interface , but again I`m open to trying to see if we can build some type of interface.

I was going to include a link for a early version of my system (I really need to think of a name for it) here , so people could at least get a basic idea of what it does, but that version is a very early one and I`m not sure if it would confuse people even more. Also as my code is in C and not python it is a complied version of blender rather than a python script so I`m not sure if people would download it.
If anybody is interested let me know.
I don`t really think including a animation will do much as my strength isn`t in creating animations or modeling.
Last edited by MatW on Sat Jul 10, 2004 9:34 pm, edited 2 times in total.

Post Reply