playMaker

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

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v808)
« Reply #120 on: March 10, 2013, 12:30:27 PM »
I've done a couple of tests. Apparently the example scenes can be corrupted very easily (seems pretty hazardously to me). That can account for some of the recent confusion. @Lane I could not import your scene though since it gave me a fatal error each time.
Furthermore I was so concentrated on making everything work flawlessly with the pro version now that we have a couple of pro users here, that I totally forgot to check compatibility with the free version. Stupid bugs, It's fixed now I think.

Since everyone including me agrees that the current setup is annoying and prone to errors I got permission from Aron to share a modified version of the free astar package here. Pro users will still need to install everything the old way though.
Alex told me before that as long as the PlayMaker.dll is not included, entire projects can be shared here. But unless there are errors there too I'll leave PlayMaker to you, so you can use whichever version you like best.

So from now on it's:
1) Install PlayMaker
2) Install this package

This should solve a lot of potential issues I think :D

https://docs.google.com/file/d/0BwrgibYeepavRXdUZ1FBM3R2dlU/edit?usp=sharing

EDIT:
Forgot the vector thingy, will be in the next release, maybe this evening.
Best,
Sven

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: A* pathfinding (stable 0v808)
« Reply #121 on: March 10, 2013, 03:17:53 PM »
Ok sounds good, what version of unity are you using? Not sure why the package wouldn't import.. I'm using 4.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v808)
« Reply #122 on: March 10, 2013, 04:49:05 PM »
that may very well be it. I didn't muster the menu for the update yet  ::)
Best,
Sven

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: A* pathfinding (stable 0v808)
« Reply #123 on: March 10, 2013, 08:13:16 PM »
How do you get objects to orient themselves forward while moving along a path, or rather look down the path, or orient z+ to the direction of movement?
« Last Edit: March 10, 2013, 08:16:47 PM by Lane »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v808)
« Reply #124 on: March 11, 2013, 03:41:37 AM »
I use smooth look for that. Just put it right behind the movement action and use the direction value it gives you.
Best,
Sven

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v808)
« Reply #125 on: March 11, 2013, 04:54:26 PM »
Alright, I fixed whatever I could find. The movement actions should work now, even the auto movement should work properly in any case I could think of. I edited some actions so they once again only accept very specific object types after I've changed every output so it won't return anything else. I could not detect any stuttering in the follow target action, so I don't know if that's fixed.

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

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: A* pathfinding (stable 0v808)
« Reply #126 on: March 11, 2013, 04:57:52 PM »
I'll check it out in a few hours when I get home.

Thanks, Sven.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: A* pathfinding (stable 0v808)
« Reply #127 on: March 11, 2013, 10:11:25 PM »
https://dl.dropbox.com/u/38606641/Unlimited/WebBuild.html

Really can't figure out the problems Move and Follow are giving me. It's super jittery and in some cases the agent will move extremely slow for no apparent reason, often completely ignoring the speed variable. I wanted to use the pathfinding to make the dummy follow the mouse, then it would never enter an unwalkable tile and collide or be able to be placed illegally but its always just acting really strange and unpredictably. When it wasn't falling through the floor (evidently flush planes are considered intersecting so they MUST be non-planar to walk on it) then it walks weird.

The examples seem to work fine in the same project and I'm doing the exact same thing as them. I've tried placing things extra high, letting them drop onto the floor, tried new floors, reimported packages.. erg.. I can't figure out why its acting so much differently than the examples when its the same arrangement and actions.
« Last Edit: March 11, 2013, 10:13:21 PM by Lane »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v808)
« Reply #128 on: March 13, 2013, 10:15:06 AM »
my finals will be done in exactly one week from now. I'll create a tutorial for you then. Right now I'm at my limits  :o
PS: I just remembered that I had similar problems when I started using the pathfinding package. I copied an example scene and used that as my basis. In retrospect I think I didn't set up the AstarPath (the one on the A* gameObject) component right.
Best,
Sven

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: A* pathfinding (stable 0v808)
« Reply #129 on: March 13, 2013, 10:53:16 AM »
Ohhh nice, finals - you're almost done! ;)

Why don't you port over the scenes that come with Aaron's package next? I know the one with the spider walking around on the terrain with dynamic obstacles was really interesting but a tutorial would also be a big help. I should probably hold off until there are some docs and more annotation on things because I don't have the understanding of pathfinding to grasp all of the actions' purposes since before download your kit I havent even looked at pathfinding.

I did get a better idea of how it worked and what I needed as an end user i can mention if thats helpful. I wanted it for two things: 1. Testing the ground for legal building placement and updating the graph when structures are built and 2. Building paths for units so they avoid those buildings.

Doing #1 was the more difficult one, I couldn't figure out how to have the dummy floater building get the nearest node, then all nearby nodes (according to the structure size), and test them for walkability. It would be SUPER nice to use a collider to get any nodes it hits and store them.

Doing #2 was much simpler. I think  that what is needed for noobs like me is a choice of 3 variables: Start, Finish and Speed. Anything more should be a different action unless it is totally necessary.

So basically the actions I would hope to see would be a Move To that is simplified as much as possible, Get Nodes In Collider of some kind and Test Node(s) to see if they are walkable and send events if true/false. Maybe thats available now in some form, not sure, but I think a whole lot could be done with those 3 and Update Graph. A lot of the optimization actions that add diversity (such as a lot of the pathfinding in the TD example) are very confusing and while more economical for mobile and that particular single path environment work fine it also makes a lot of noise in the action choices when it seems like something simpler works in most cases. But there are definitely several different types of pathfinding the user may want to do which merit's having different actions in order to be efficient.
« Last Edit: March 13, 2013, 11:17:10 AM by Lane »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v808)
« Reply #130 on: March 21, 2013, 10:25:00 AM »
Alright, I can finally dedicate some time to this again. I agree on the area actions. They do exist is some form atm, but they are very buggy so I won't point them out :D .

Here's my schedule for the next release :
- iOS support (I need feedback on this, like errors etc, otherwise I can't do this because I don't own an iOS device)
- Area node actions (get nodes in area, set/get node walkability in area, all of these as cheaply as possible.)
- Point Graph from children (wanted to do this for some time, so you can finally have more complex graphs)
- fix variable types (potentially the next playmaker release offers some options to integrate the variables more deeply, saving the effort of wrapping everything. Not sure if I'll do this, because the one advantage of the wrappers is that they are all in the same category, which makes them easier to create. We'll see :) )
- A* tutorial (This will be mostly basic for now, explaining what actions do, how to create proper graphs, how to debug, etc. I was thinking of doing this along the lines of a simple towerdefense game, since that's nice and simple.)

Did I forget anything?
Best,
Sven

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: A* pathfinding (stable 0v808)
« Reply #131 on: March 21, 2013, 04:26:27 PM »
I'll help you with iOS support testing, sounds like a solid list :)

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v808)
« Reply #132 on: March 22, 2013, 03:33:16 AM »
I'll help you with iOS support testing, sounds like a solid list :)
Great, can you test the latest package (the beta one from one of my previous posts) for errors? That would be a good start I think :-)
Best,
Sven

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v808)
« Reply #133 on: March 22, 2013, 06:08:16 PM »
alright, have a look at the 2 actions in the attachments. I've put a lot of thought into them. They work the fastest on the grid graph, because the grid graph has a very good structure, but they work on any other node graph too. They only work at one graph per time though (may be changing somewhere in the future, but for now I've burnt myself out on writing a running solution that works on any graph). The set node walkability action will come tomorrow, I'm too tired right now.

Btw, this time the area actions are meant to be simple. I went through a lot of effort to make them not need any setup whatsoever. They still have optional checkboxes, but it should work either way. I'll be continuing to work on hte performance, so let's see. For now there's no every frame.
Comments are welcome :)
Best,
Sven

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: A* pathfinding (stable 0v808)
« Reply #134 on: March 22, 2013, 08:53:16 PM »
iOS - Pro

I get this error -
Assets/Plugins/FsmDummies/RVOControllerDummy.cs(3,14): error CS0101: The namespace `global::' already contains a definition for `RVOController'