playMaker

Author Topic: Simple Basic Wandering AI?  (Read 2218 times)

ShinfoKensei

  • Playmaker Newbie
  • *
  • Posts: 22
Simple Basic Wandering AI?
« on: October 12, 2014, 05:29:09 AM »
I've really only used PM once or twice, and never to much effect in the end.

I tried following the Basic AI tutorial video series by BadSeed but I got a little lost because I'm not really looking for all the attacking, line of sight, etc.

I've got a few animals. One example is a frog, the idea is for it to be still, play idle animation, after a few seconds for it to play the jump animation and start moving (jumping), for it to play the mid air animation whilst in air, and play the land animation when it lands, then start again from the top. It really only needs to follow the X axis, as what I'm working on is side scroller.

Second example is a bird, simply flying around in random circles switching between a flap animation and soar animation, landing on a collider occasionally with a land animation into idle animation, the take off and start again.

Maybe it's just me, but the getting started area on the website doesn't really seem easily accessible, given that there are a multitude of options.

TheBadFeeling

  • Junior Playmaker
  • **
  • Posts: 66
Re: Simple Basic Wandering AI?
« Reply #1 on: October 12, 2014, 05:42:36 AM »
For a simple approach, the Wait action is you friend.
Set up states with a Wait timer on each, and move on to the next when you want to change animation or move.
The Force is with you, young Playmaker – but you are not a C# senpai yet.

ShinfoKensei

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Simple Basic Wandering AI?
« Reply #2 on: October 12, 2014, 06:07:09 AM »
I set up a wait state, and 5 move to states, each of the move states move to an empty gameobject. The frog and the empties are nested under an empty parent as I want to make this a prefab and use it multiple times.



Problem here is that it slides back to it's original position, whereas I'd need it to keep going. Also, for some reason it's stopping midway between Target 4 and 5, so going back to 0 on the Y axis.

Edit: Actually it seems to be sliding back to somewhere between target 1 and 2, rather than the original position.
« Last Edit: October 12, 2014, 06:09:16 AM by ShinfoKensei »

ShinfoKensei

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Simple Basic Wandering AI?
« Reply #3 on: October 12, 2014, 06:28:20 AM »
Alright, what I might do is have the prefab delete itself after a short wait once it's finished (fixed the strange offset with an offset in the move to field in the last target btw).

Now to figure out how to continuously spawn in the prefabs as clones in random directions at random times...