playMaker

Author Topic: A* pathfinding (stable 0v841)  (Read 230548 times)

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #210 on: August 23, 2013, 05:54:55 PM »
Can you post a list of distinct features you want? I got around to buying unity 4, but so far all my characters only use the same speed value for the animator and the astar actions. This way I can set the controller to none, use smooth look at direction and set the speed variable of the animator every frame to control the mecanim movement. I understand that this isn't taking any node cost into account, and I can add that in the next update , but apart from that I don't see any major holes. But then again, perhaps I just don't use mecanim the way its' supposed to be used :D
Best,
Sven

SteveB

  • Playmaker Newbie
  • *
  • Posts: 29
Re: A* pathfinding (stable 0v83)
« Reply #211 on: August 23, 2013, 06:04:59 PM »
Haha the only feature I was hoping for was a tiny bit of direction on to use your add-on with Mecanim! :D

From what I'm gathering you're describing, you're getting the next 'waypoint' of the A* generated path, smoothLook towards it and then fire off the movement speed to mecanim, which would essentially drive the actor in the direction of the waypoint and the waypoints after that.

That about it? If there's more to it than that maybe a brief writeup or screenshot?

Thanks for the quick reply kiriri!

-Steve

PS ...and what was it that hannibalov did to the MoveToTarget.cs on the first page? Why was it necessary then for him to modify that file if it's available in your version? I think thats where my confusion came in...that things were required to tweak your add-on to work with Mecanim...
« Last Edit: August 23, 2013, 06:06:39 PM by SteveB »

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #212 on: August 23, 2013, 06:13:02 PM »
that's exactly what I meant :) The next waypoint direction is available as an output at the bottom of the moveTo action (in any movement mode).
Please take into account that this plugin has now been developed for about half a year, and loads of things have changed. Back then, there was no direction output available for example, and no different movement modes (you were forced to use character controllers).
But yeah, I'll add the current speed setting. Even if  you won't use it, someone else might... For the rest just use the actions Alex was referring to.
« Last Edit: August 23, 2013, 06:19:02 PM by kiriri »
Best,
Sven

SteveB

  • Playmaker Newbie
  • *
  • Posts: 29
Re: A* pathfinding (stable 0v83)
« Reply #213 on: August 23, 2013, 06:34:10 PM »
Awesome that sounds good and I'll go and give it a shot!

BTW (to you, Jean and Alex and pretty much everyone here) I've really been impressed with both the speed of response and helpfulness of this forum. Rock on guys and thank you. :D

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83, 0v84 RC1)
« Reply #214 on: August 26, 2013, 07:48:37 PM »
Ok here's the RC1 for 0v84.
Changelog :
- Installer/Updater/Pro Updater script [done]
- GetNodeInfo now features a graph shortcut [done]
- Get Set Graph Info : Custom Editor and custom output for PointGraphs and GridGraphs [done]
- fix jigger/slowdown issue on follow mode and then unify the speed settings again... [done? at least better now]
- smooth turns option [done, needs perfecting for follow]
- replace all regular distance calculations with sqr dist where possible, to save performance.[done]
- Added speed output variable to the movement action [done]

Requirements : This new release requires python 3.0 or newer. Download it here :
http://www.python.org/download/

Installation :
0) Install Python, Download https://docs.google.com/file/d/0B45ng4mYiP6Zb3k2RWNZZzVNY0E/edit?usp=sharing
1) Extract, then put the "AstarPlayMakerInstaller" folder inside your Assets folder of your project.
2) double click on the Setup.py file to execute it.
3) Answer the few settings that come up. The setup can setup the free version of Aron's Astar for you, or you can install the pro (or free) version prior to the setup(no need for you to make it js compatible anymore, as the installer can handle that too, though doing so manually will cause no problems). Either way, it will detect your version and install the necessary components in both cases automatically. You can even install PlayMaker after installing this, though unity will prompt some errors until you do install it.
4) done :)

Current issues :
-Test scenes are broken :( Dunno what to say... this may likely be a longterm problem, though I'm doing my best here.
-Not tested on Mac yet, might not work. If any of you use a mac and know how to use python, please help me out here, its my first ever python experience :D
-Installation directory remains due to certain access restrictions. I tried automatically moving the script outside of the folder and to then delete it, but it didn't work... Again, real python users may be able to help here :)

Please tell me what you think. Tell me if it doesn't work. Heck, tell me if it does work :D
« Last Edit: August 26, 2013, 07:51:34 PM by kiriri »
Best,
Sven

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #215 on: August 27, 2013, 04:51:50 PM »
RC2
- Updater now succesfully removes the old movement editor file and installs the new one. No warning should appear now.
- Editor now hides the rotation stuff if no smooth turns is selected.

https://docs.google.com/file/d/0B45ng4mYiP6ZQ0hJbVYzNDdhNkU/edit?usp=sharing
Best,
Sven

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: A* pathfinding (stable 0v83)
« Reply #216 on: September 01, 2013, 11:02:33 PM »
So after updating to the newest Playmaker, A*, I'm getting the following error -

Assets/Plugins/FsmPathfindingWrappers/FsmPathfindingBase.cs(2,7): error CS0246: The type or namespace name `Pathfinding' could not be found. Are you missing a using directive or an assembly reference?

Looking through my project, can't find any conflicting names or anything to cause this. Any ideas?

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #217 on: September 02, 2013, 05:40:17 AM »
First of all, thank you for reporting this :)

It seems that the script can't find your installation of Aron's pathfinding  package. Did you install it before the update or with the installer ?
Also, did the installer give you a finish message or did it just close without anything? Because that would mean it encountered an error somewhere (I still need to implement messages for errors).

Incase your using Astar free, I uploaded a new package which will give you the option to override your current Astar installation. It should tell you that it has detected a version of Astar, and then if you press Y + enter after the prompt it should override it. If that still doesn't work, can you send me the project?

https://docs.google.com/file/d/0B45ng4mYiP6ZaW5kZ1YtWWtZVTg/edit?usp=sharing
« Last Edit: September 02, 2013, 05:43:12 AM by kiriri »
Best,
Sven

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: A* pathfinding (stable 0v83)
« Reply #218 on: September 02, 2013, 12:34:55 PM »
That seems to have done the trick. I was using A* free, and I did have it installed before the update (just was updating my scene to the latest version of everything). Everything works now. Thanks!

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #219 on: September 02, 2013, 03:49:10 PM »
perfect, btw, are you using mac? I need for a mac user to confirm that this works. I know that mac and windows use different ways of storing their paths, and although I already used absolute paths everywhere, I'm still not sure if my paths make sense to mac os, since I use strings as a representation for the actual pointers (any non coder doesn't have to understand the last part :D ).
So yeah, a thumbs up from a mac user is all that this version still needs.
Best,
Sven

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: A* pathfinding (stable 0v83)
« Reply #220 on: September 06, 2013, 02:43:48 AM »
Nope, PC. Sorry. Although I did notice that the "Smooth Turns" option in the MoveTo action seems to crash my scene too.
« Last Edit: September 06, 2013, 02:45:20 AM by mweyna »

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #221 on: September 06, 2013, 04:37:10 AM »
Although I did notice that the "Smooth Turns" option in the MoveTo action seems to crash my scene too.

oh that is very interesting to hear! Can you send me your scene/ a test scene? (Or else a screenshot might help too)
Smooth turns is one of the more interesting/original concepts I integrated into this package, so I really would like for it to work out well.
Best,
Sven

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: A* pathfinding (stable 0v83)
« Reply #222 on: September 10, 2013, 04:52:22 AM »
So after updating to A*Pro (Thank you Daily Deal!) the smooth path no longer seems to be causing a crash immediately upon selection. However, I'm still not having much success generating the results I want. In my scene, I have my NPC set up to create a path to a grey cube and then navigate the world to it (see scene shot) -


However, at runtime, the path is created successfully, but the NPC does not move or translate across the scene in any fashion. Instead the action immediately FAILS to my confusion.


Any thoughts as to why?

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #223 on: September 10, 2013, 10:38:18 AM »
Ok, let's see. Set "log events" to true to get some feedback in the console. There are several reasons to why a failed event is sent:
1) "Astar Follow Path failed. The path is null" is sent when your path variable does not exist. This is only sent if you didn't plug one in.
2) "Astar Follow Path failed. The path contains no nodes" is sent when the path doesn't contain any waypoints, eg if you have an action that calculates the path and then put your movement action right under it. In that case the path is still being calculated by the first action. In this case you should use the finish event of the Create Path action.
3) "Astar Move To failed. The actor is null" is being sent when the gameObject you want to move along the path is non-existant.
4) "Astar Move To failed. The controller was removed" is obvious :D . Do not remove the controller while the actor still moves.
5) "The final node is too far away from the target position" is supposed to be sent when the distance between the final node and the target position is larger than failureTolerance. Due to some unknown reason, this check disappeared though... I just reintegrated it :D

So yeah, seeing the debug message would help a lot to nail this problem down :)
Best,
Sven

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: A* pathfinding (stable 0v83)
« Reply #224 on: September 18, 2013, 01:59:35 AM »
#2 solved that. By seperating out my Calculate Path to an action earlier it definitely works now. Those subtle delays of Playmaker have definitely been an interesting curveball many a time.