playMaker

Author Topic: Complex AI Behavior - Best practices and is playmaker enough?[SOLVED]  (Read 6454 times)

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Hi all,
I've been using and loving playmaker for a few years now and the more I use it the more I dream of the day we'll be able to place FSMs inside FSMs. The main reason for this comes from trying to create more complex AI behaviors. For example, having a main AI "brain" that gets information from sensors (like detecting a nearby player) and sends events to other systems. All of the AIs main behaviours like idling, hunting, playing, etc were in this main FSM, which seems easy to iterate and debug. But as soon as I get a lot of states it starts to slowdown the inspector and the best practices state that it's best to have an FSM do one specific thing, rather than a lot of things.

Is there a better way to handle complex AI using playmaker? Maybe dividing these behaviors into smaller ones and using send events instead of transitions (which sounds like a mess to iterate and debug, but I could be wrong)
Or maybe it's best to invest in something like behaviour designer to complement playmaker?

« Last Edit: March 03, 2017, 07:01:30 AM by MajorIdea »

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Complex AI Behavior - Best practices and is playmaker enough?
« Reply #1 on: February 28, 2017, 11:18:45 AM »
If you are a Playmaker user I highly recommend using Behavior Designer together with Playmaker- it makes a very powerful and easy to use combination.

Behavior designer also has some useful tasks that allow you to do utility theory decision making which can make for a much more flexible and lifelike AI-

If you do go with behavior designer- here are a bunch of custom Behavior designer tasks I've made- many are Playmaker converts https://github.com/mdotstrange/CustomBehaviorDesignerTasks

And I sell a video tutorial course on Behavior Designer for Playmaker users https://www.youtube.com/watch?v=Nvq9Y2QmW4E
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: Complex AI Behavior - Best practices and is playmaker enough?
« Reply #2 on: February 28, 2017, 07:21:47 PM »
Thanks mdotstrange. Although it was more of a question if something like behaviour designer was almost essential in creating complex AI systems or if I'm doing something the wrong way with playmaker. Honestly part of the reason I'm even considering investing in something like BD was because of your answers here and your fantastic videos. But it's a significant investment for me and one I'm not sure it's needed, hence the question.

rik

  • Full Member
  • ***
  • Posts: 246
Re: Complex AI Behavior - Best practices and is playmaker enough?
« Reply #3 on: February 28, 2017, 11:44:15 PM »
Hi i am thinking of making actions for a behaviour system which was free in asset store it was c# based.
i have tested it can be used for very complex situations.

if you are interested to be tester i will make actions for you to test send me pm if interested.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Complex AI Behavior - Best practices and is playmaker enough?
« Reply #4 on: February 28, 2017, 11:46:37 PM »
Depends. You can see some ai kits people wrote on the asset store for playmaker. Such as battle ai (its all written in playmaker). Its ok, but its pretty complex imo for playmaker. And altering it for your needs is difficult. I personally bought BD to use with playmaker after running into too many limitations. I still find some of the concepts of BD hard, but its more clean and easy to alter for AI.

For me BD was worth the money for the amount of time that I save. Even simple AI tasks in playmaker can take a lot of time to write. Where in playmaker they just exist out of the box.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Complex AI Behavior - Best practices and is playmaker enough?
« Reply #5 on: February 28, 2017, 11:47:22 PM »
Rik, feel free to shoot me a copy if you are looking for another tester.

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: Complex AI Behavior - Best practices and is playmaker enough?
« Reply #6 on: March 01, 2017, 08:02:35 AM »
That helps a lot tcmeric! Especially with that battle ai example. I guess my large FSMs aren't that bad after all and its more of a matter of better managing them and finding ways around the natural limitations of state machines. It seems to me that behavior designer would be nice to have due to its behavior tree approach but a lot of its value seems to come from pre-built tasks which isn't really what I'm looking for. What kind of limitations where you running into that made you invest in BD? I could be missing something.

rik

  • Full Member
  • ***
  • Posts: 246
Re: Complex AI Behavior - Best practices and is playmaker enough?
« Reply #7 on: March 01, 2017, 12:20:48 PM »
i was actually trying to make BD without actions but i dont have an idea to make playmaker itself a BD.
but i was exploring possibilities.

i have made actions like any other Bd but BD whole concept was making actions but i am trying to make it seamless in unity.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Complex AI Behavior - Best practices and is playmaker enough?
« Reply #8 on: March 02, 2017, 12:30:26 AM »
The movement pack that you can buy for BD has the main "actions" that I use.

- Move Towards
- Rotate Towards
- Seek
- Flee
- Pursue
- Evade
- Follow
- Patrol
- Cover
- Wander
- Search
- Within Distance
- Can See Object
- Can Hear Object
- Flock
- Leader Follow
- Queue

I suspect many of these could be built within playmaker, but the time it would take, would be long. And it would take a whole FSM for most. Then trying to string them together so that they change from one to the next as necessary would be hard. Now imagine you wanted to make 5 or 6 variations (for bosses or basic bad guys). Its too much work for me.

Here is a post worth reading. Basically there are other differences between FSMs and Behavior Trees that are worth noting. My person opinion is that you need both if you want decent AI and visual programming.

https://www.scirra.com/forum/what-is-the-difference-between-fsm-and-behavior-trees_t124518