In the game, there is a forest and animals living in it. The interaction of the animals is just a background ambiance.

When googling I found Goal-Oriented Action Planning pattern.

And this pattern seems to solve the issue. If we give goals to the animals while achieving their goals they can behave realistically for the ambiance.

After more research, I found a paper which is advising extending GOAP with smart ambiance objects to make agents behave context aware. "Feeling the Ambiance: Using Smart Ambiance to Increase Contextual Awareness in Game Agents"

For example, think of an adventure game, the player is searching for clues/items in the forest.

Meanwhile, a bird (non-player character) is looking for a fruit on the tree to eat. Bird sees a fruit on the tree but also saws a snake danger close to the fruit. So bird afraid and do not decide to eat that fruit...

Are there other algorithms/patterns that you can remind to solve this need?

  • 1
    \$\begingroup\$ Can you describe the need in more detail? A vague question tends to lead to vague answers — what specific animals do you need and what specific actions and interactions do they need to perform? \$\endgroup\$ – DMGregory Sep 16 '17 at 20:55
  • 1
    \$\begingroup\$ Sounds mostly like just implementing a random movement plan where the animals spend a few moments at a location, once done solve a path to a nearby random location and execute the transfer (somehow check that they don't move through each other!). Get removed into a pool if they are too far from the player, and re-spawn from the pool at a nicely covered location (eg. behind a bush) if there are too few of them nearby the player. Check for pool in/out etc. to happen once in a while, for example every 10 secs, performed by a que system, individually per npc. Otherwise more detail needed. \$\endgroup\$ – Stormwind Sep 17 '17 at 7:18
  • \$\begingroup\$ @DMGregory I didn't think detailly about specific animals and their interactions yet. At this stage, I want to choose a backbone for this kind of scenarios... \$\endgroup\$ – Serdar Buyuktemiz Sep 17 '17 at 10:07
  • \$\begingroup\$ @Stormwind yes I am looking for randomization with minimum hardcoded parameters... \$\endgroup\$ – Serdar Buyuktemiz Sep 17 '17 at 10:09
  • 1
    \$\begingroup\$ You really described the pattern you could use. All you need is perhaps bake data into NavMesh and after picking a goal, perhaps just check nearby environment for data such as snake and decide to actually carry out the goal or not? \$\endgroup\$ – ChaoSXDemon Sep 17 '17 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.