Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developing AI "Intelligent" Behaviour #110

Open
Jacob-Rueckert opened this issue Nov 9, 2022 · 2 comments
Open

Developing AI "Intelligent" Behaviour #110

Jacob-Rueckert opened this issue Nov 9, 2022 · 2 comments
Assignees
Labels
Topic: AI Requests, Issues and Changes related to pathfinding, behaviors, etc. Type: Improvement Request for or addition/enhancement of a feature

Comments

@Jacob-Rueckert
Copy link
Contributor

In order to improve in Intelligent AI behaviour this issue is meant to give examples of intelligent behaviour.
I already made an example tree for an not so intelligent behaviour like a sheep.

Tree Stupid Sheep

This is based on the high level overview Tree from https://github.com/Terasology/Behaviors/wiki/High-Level-Overview
For me the line to make a entity feeling intelligent isnt the behaviour to the player certanly. So as you can see a stupid sheep will follow the player no matter what. That in my mind is non intelligent behaviour. What if a wolf shows up and kills the sheep. Would it still follow the player? I dont think so.
Although the logic of non intelligent behaviour towards the player is restricted to peacefull entitys.
If we think about modern shooters, hostile entitys will behave intelligent, like seeking cover when shot at or firing grenades when youre in cover.
Still i wouldnt restrict such behaviours towards the player and try to make a interacting approach like the sheep-wolf example.

Therefore environmental behaviour is what i want to mostly concentrate in intelligent behaviour.
What can be environmental conditions is the first to think about:

  1. Day & Night Cycle
  2. Weather Conditions (Rain, Mist, Sunshine, Snow)
  3. Events (Forestfire, Thunderstrike, Avalanches, Wolf Hunt, Explosions)
  4. Sounds ( Walking, Dying Sounds, Block Break Sounds, Firework)
  5. Entity Visability (Seeing an Entity (not Player) )

All of the above are the first one coming to mind and which i think are able to implement in someway in the current behaviour system.
For sake of workflow i will ad some written concepts since making the visual trees right now is laborious.
IWolf , Sheep, Rabbit, Bear) Intelligent

@Jacob-Rueckert Jacob-Rueckert added Type: Improvement Request for or addition/enhancement of a feature Topic: AI Requests, Issues and Changes related to pathfinding, behaviors, etc. labels Nov 9, 2022
@Jacob-Rueckert Jacob-Rueckert self-assigned this Nov 9, 2022
@skaldarnar
Copy link
Contributor

Discussed in a call on Discord with @Jacob-Rueckert @skaldarnar and @jdrueckert :

  • use better tools to draw behavior trees, e.g., https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio
  • how to break down and generalize (partial) behavior trees, e.g., needsSleep -> sleeping place where the target position is dependent on the entity (a bat would choose the ceiling of a cave, a sheep a random grass block, ...)
  • focus on the (generic) tree for now, not the causes for changes (we'll need them eventually, but for now we need to figure out how to interpret them)

Until Friday, November 11:

  • extend and improve the example tree for a more intelligent entity
  • detail out leaf nodes "Hungry->Eat", "Tired->Sleep"
  • subtrees for Timid, Guard, and Chaser

Until next Tuesday, November 15:

  • incorporate feedback

@Jacob-Rueckert
Copy link
Contributor Author

I made new subtrees for the suggested Timid, Chaser and Guard
I added in parathesis behind the subtree an possible use case for these subtrees.

Lets start with Timid.
I believe a rabbit wouldnt be scared from a fly or an caterpillar.
Therefore we first need to realise which Entity is nearby and if the rabbit would be scared from it.
Also a Rabbit wouldnt instantly run from the Entity. This is an usual behaviour among animals. Only when they reach a certain range or make a fast / dangerous move, timid creatures would start to flee and they wouldnt stop as long as the Entity is still in a certain range.
Therefore you maybe need to add a second configuration for "Entity Near". One which is the range the timid Entity starts fleeing, and one for the time / range / visibility of the scary Entity so its stops fleeing.
Timid Rabbit

Next one is the Guard.
I would specify my image of a guard not as a stational but as an dynamic one.
Therefore the example of a sheep dog. If a herd is moving his first priority should be staying near to the flock.
A Guard wouldnt attack just out of visibility. Therefore i would make an state "Alert" in which we can add sounds / animations to intimidate an enemy entity. I declare nemesis in this case since players might be fine for a sheep dog but bears / wolfs wouldnt. So we need to declare a certain group of entitys the sheep dog is hostile against while hes peacefull to any other entity.
Lastly we have to get back into a alert spot while the nemesis is still nearby but not dead.
Guard

Lastly the Chaser is the same as Guard and Timid. We look out for the nemesis and if hes in range. If hes not, the chaser trys to get in range and checks if he can attack. This will be continiousily iterated till the nemesis is dead. Since we dont have to care about a home / guard spot we dont have to implement an get_home behaviour in chaser it self. Although a wolf would probably have an own den so he shoud have one. But not particulary in chaser itself.
Chaser

Jacob-Rueckert added a commit that referenced this issue Nov 25, 2022
source files for tree visualisations in issue:#110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: AI Requests, Issues and Changes related to pathfinding, behaviors, etc. Type: Improvement Request for or addition/enhancement of a feature
Projects
Status: Brainstorming
Development

No branches or pull requests

2 participants