playMaker

Author Topic: Aircraft/Flight AI and pathfinding  (Read 23297 times)

Redhawk

  • Junior Playmaker
  • **
  • Posts: 57
    • View Profile
Re: Aircraft/Flight AI and pathfinding
« Reply #30 on: January 12, 2014, 09:11:31 AM »
Yes, but not totally autonomous.  But that's okay actually.  Still playing with it, but excited it's working.  Also, your set up is really good.  Like I said, a few tweaks and additions and perfect (remember to keep it as simple as possible as AI looks good simple with lots of random choices).

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Aircraft/Flight AI and pathfinding
« Reply #31 on: March 18, 2014, 09:17:59 AM »
Update for this coming along soon..

  • Overhauled the whole arrangement of the systems, fixed a lot of logic flow hangups/bugs in general
  • Made an action to lead targets / compute intercept point
  • Changed to a Spherecast (instead of Raycast) and modified the action to support the system better

I made a lot of progress last Friday on it but squeezing out time to work on it is still hard, I hope to have something available to share this week. Remaining setup for the next iteration is basically just Combat mode, tweaking the aiming, fixing any obvious bugs and setting up the Flee behavior.

This still isn't what I really want, it's basically an improved version of the last package and while it does improve quite a bit on the previous one I'd like to do an even more intuitive system that can path around things better and have more awareness of its surroundings but it would likely require some arrays and interesting weighting of priorities and I want to hold off on arrays for the time being.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Aircraft/Flight AI and pathfinding
« Reply #32 on: March 23, 2014, 04:15:10 PM »
Okie dokie heres a vid on the update.. Download will follow soon.


You can't patch this update in, you will need to replace the whole system. If you have questions feel free to ask.

As far as the update... The Behavior FSM manages what state the agent should be in, and the Locomotion FSM executes steering which should be done in that particular state while the Information FSM uses a spherecast to collect pertinent data in front of the agent such as giant rocks that he might crash into.

There are some hangups that I don't like, and you'll find them in testing it. I think I'm aware of most of the shortcomings but I'm not sure how to approach resolving them just yet.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Aircraft/Flight AI and pathfinding
« Reply #33 on: March 24, 2014, 04:16:43 PM »
.unitypackage Download Link for AI Test r2

You'll see Pink explosions and maybe some other materials and stuff since some of the FX are paid assets pieces.

The Asteroids I made are also included. The spaceship is a free asset redist from the Asset Store.

shyfox

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Aircraft/Flight AI and pathfinding
« Reply #34 on: April 14, 2014, 07:32:46 AM »
Are a bunch of errors like this:
Quote
DudeBad: Combat: Angle Test: MissingAction: Could Not Create Action: GetSignedAngleToTarget (Maybe the script was removed?)
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionReport:LogError(PlayMakerFSM, FsmState, FsmStateAction, Int32, String, String)
HutongGames.PlayMaker.ActionData:LogError(String)
HutongGames.PlayMaker.ActionData:CreateAction(FsmState, Int32)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState)
HutongGames.PlayMaker.FsmState:LoadActions()
HutongGames.PlayMaker.Fsm:InitData()
HutongGames.PlayMaker.Fsm:Init(MonoBehaviour)
PlayMakerFSM:Init()
PlayMakerFSM:Awake()
In the EnemyRail fails to add 2 scripts.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Aircraft/Flight AI and pathfinding
« Reply #35 on: April 14, 2014, 07:40:38 AM »
Odd, I thought I had all the actions in there.


Get Signed Angle To Target is here:

http://hutonggames.com/playmakerforum/index.php?topic=3027.msg13819#msg13819

Not sure what the missing scripts would be. Let me know if adding this action resolves the errors.

shyfox

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Aircraft/Flight AI and pathfinding
« Reply #36 on: April 14, 2014, 07:59:29 AM »
Quote
DudeBad: Locomotion: Steer For Combat: MissingAction: Could Not Create Action: LeadTarget (Maybe the script was removed?)
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionReport:LogError(PlayMakerFSM, FsmState, FsmStateAction, Int32, String, String)
HutongGames.PlayMaker.ActionData:LogError(String)
HutongGames.PlayMaker.ActionData:CreateAction(FsmState, Int32)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState)
HutongGames.PlayMaker.FsmState:LoadActions()
HutongGames.PlayMaker.Fsm:InitData()
HutongGames.PlayMaker.Fsm:Init(MonoBehaviour)
PlayMakerFSM:Init()
PlayMakerFSM:Awake()

SphereCast also but I found it on forum:
http://hutonggames.com/playmakerforum/index.php?topic=3718.msg17246;topicseen#msg17246

Edit:

Found it. It´s on your post:
http://hutonggames.com/playmakerforum/index.php?topic=6681.0
« Last Edit: April 14, 2014, 08:07:01 AM by shyfox »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Aircraft/Flight AI and pathfinding
« Reply #37 on: April 14, 2014, 08:08:25 AM »
Oh my, really sorry it seems the package doesn't have the custom actions! Check the attached file for all of them, I'm also updating the dropbox package so they'll be included.

Sorry for the inconvenience =/

shyfox

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Aircraft/Flight AI and pathfinding
« Reply #38 on: April 14, 2014, 09:34:15 AM »
No prob.  ;)
And this is the image:
https://onedrive.live.com/redir?resid=715587158481670B!2872&authkey=!AEtsb51PDGb2eO8&v=3&ithint=photo%2c.png

I tried to open the file in hex and search the name of the script but I couldn´t find either.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Aircraft/Flight AI and pathfinding
« Reply #39 on: April 14, 2014, 09:46:25 AM »
Leftovers from an FX asset I stripped out, theres actually just the FSM there in the latest so I'm thinking they're safe to remove.

shyfox

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Aircraft/Flight AI and pathfinding
« Reply #40 on: April 14, 2014, 09:55:20 AM »
Something is wrong ... I must look into Playmaker ... it just flees in straight line. And when it encounters a obstacle ... it stops. I think it´s something with the steering system

Edit:
I forgot that I disabled some things in the Playmaker actions Lol  ;D
Now it works. I shall test it in full and keep in touch.
Thanks
« Last Edit: April 14, 2014, 10:14:46 AM by shyfox »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Aircraft/Flight AI and pathfinding
« Reply #41 on: April 14, 2014, 10:41:42 AM »
I forgot that I disabled some things in the Playmaker actions Lol  ;D
Now it works. I shall test it in full and keep in touch.
Thanks

Let me know how you get along, I've only had time to do minor testing outside of the original environment and still have a lot of work to do on it so any feedback or issues would be good to hear about =)

shyfox

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Aircraft/Flight AI and pathfinding
« Reply #42 on: April 17, 2014, 04:42:28 PM »
I didn´t have much time to test but from what I saw I like it. Also it seems that it still gets stuck sometimes ... must use more the debugger and stress that AI a little. ;D Also adding a missile detector would be great (I´ll start something in my spare time) than add a transition to evade it. Also I was thinking in adding a little more at your project - two new steering behaviors: queue and leader. I´m still learning the steering behaviors and I also have very little time but when I have something I am more than happy to share it here and make this a full system.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Aircraft/Flight AI and pathfinding
« Reply #43 on: April 17, 2014, 08:04:21 PM »
Yeah some intermediate level behaviors still need to be added for sure, this is a decent dummy Foundation for various types of enemies without getting into too much unique customization.

One way I thought we may have trouble scaling the steering system is that we currently need to provide a vector position to head towards instead of steering in a vector direction so that impacts how we proceed resolving targets and obstacles in all behaviors.

I've noticed when they get stuck is usually when a missile is invoked and has pushed them off course. This will go away when throttle control based on the raycast hit distance is added because the full constant throttle is what's making them stick and unable to turn.

shyfox

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Aircraft/Flight AI and pathfinding
« Reply #44 on: April 21, 2014, 04:06:34 AM »
I know that I am missing something but I can´t see where do you set the velocity?
« Last Edit: April 21, 2014, 04:08:42 AM by shyfox »