playMaker

Author Topic: Simple AI  (Read 2234 times)

shinodan

  • Full Member
  • ***
  • Posts: 180
    • Shinozone
Simple AI
« on: April 15, 2012, 03:05:18 AM »
Will i be able to construct a simple ai with playmaker or do i need more resources?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Simple AI
« Reply #1 on: April 15, 2012, 05:35:52 AM »
Yes. State machines are great for AI. Start by breaking your AI down into discrete states: Idle, Patrol, Alerted, Scared... whatever your game needs.

Then think about what triggers transitions between those states: timeouts, a trigger, a collision, collecting an item...

You should be able to sketch this out in the editor, then fill in each state with actions: play an animation, go to a waypoint, move towards target...

Remember you can alt-click transitions in the editor to test different states. It can be easier to get each state working separately, then worry about triggering the transitions at the right time.

Also be sure to check Debug in the State panel to see variable values. And expose key AI variables in the Inspector for easy access (e.g., moveSpeed, attackSpeed, idleTimeout...).

One final tip: start simple, get something working, then add more states as you play the game.