I am trying to create a conversation system for a crowd simulation AI. The way I am currently approaching this is by doing a check if bot1 sees bot2, than I pick a point for them to meet and they meet at that point. Start a conversation. The problem is that not many times two agents happen to see each other.
I want to introduce a sociability level for each bot which represents how sociable (how much he wants to get engaged in conversation) he is.
The problem is that I try to make use of this variable by adding a variable
sociabilityLevel which varies from 1 to 10. Whenever two bots see each other I pick a random integer value between 1 and 10, call it
randomValue <= sociabilityLevel, for both of the agents, than they actually meet. For example: bot1 has sociability level of
9(high) and bot2 has
5(medium), assuming they both see each other in this frame,I pick a random value which happens to be
4. This means that the meeting is possible,otherwise for a random value of say '8' than the meeting will be cancelled because it does not satisfy bot2 requirement.
My goal is to make the agents with high sociability level talk with each other very probable, and agents with low sociability level talk with each other very unlikely. And any other combination with medium etc.
The problem is that with my current approach is that the
sociabilityLevel variable does not reflect the actual chance of that agent of talking. The reason is because the condition of the agents to see each other is much more powerful than the
randomValue <= sociabilityLevel condition.
Furthermore, if two agents come from direct opposite directions they will see each other on several frames, which means that the check
randomValue <= sociabilityLevel will be executed as long as they see each other. This results in picking several random numbers pretty fast and it is quite likely that an agent with a level of
2 sociability will agree to the meeting.
I thought of introducing a 0.25 let's say delay for the agent to check if he sees another agent and vice-versa. This does not seem the right way to solve the problem.
Let's I remove the check for them to see each other and create a sort of event (like in this post : Design pattern for AI cooperation), where bot1 asks "Do you want to meet me?", and bot2 answers "Yes, I do". The issue is that how can I get the meeting point right? Because they have to face one each other and I am not pretty sure how to do this. Moreover, I only need to send the "Do you want to meet me?", only to a close bot, otherwise will mean a disaster, one agent wait hours for the other agent to come up.