A* Pathfinding Project Released
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Unity Community Index // Showcase
View previous topic :: View next topic  
Author Message
SteveB



Joined: 17 Jan 2009
Posts: 230
Location: Chicago

PostPosted: Thu Sep 03, 2009 6:40 pm    Post subject: Reply with quote
Sweet. Smile

...and at the begining of my last post, could you point out where controller.StartPath is in your Seeker.cs script?


Too bad about multiple floors but, how 'high' can the terrain be? Is there a limit in the "Z axis" (if your grid were X and Y)? What is the criteria for an object to be considered an 'obstacle'? Interpenetration with the terrain or merely it's position above?

-Steve

_________________
Steve Bodnar
FlipFrame Animation
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
sturestone



Joined: 20 Oct 2007
Posts: 456
Location: Sweden

PostPosted: Thu Sep 03, 2009 6:50 pm    Post subject: Reply with quote
public AstarPath.Path StartPath (Vector3 start, Vector3 end) {

Line 49

There is no limit in z axis.
The script has several options for calculation if a node is walkable or not.
See http://www.arongranberg.com/unity/a-pathfinding/docs/interface/
(Capsule option is not added)

Overlap: Uses Physics.OverlapSphere to check if the node is walkable

Touch: Uses Physics.CheckSphere to check if the node is walkable (haven't found any differences between Touch and Overlap yet though)

Capsule (recomended) : Uses Physics.CheckCapsule, checks if any obstacles is inside or touching a capsule with a defined height.

Raycast: Raycasts down on/up from the terrain to see if it hits something. This will only return true if the obstacle touches the middle of the node.

_________________
UnityPaint - Easy drawing on textures
A* Pathfinding - Out-of-the-box pathfinding
Sture The Stone aka Aron Granberg
Back to top
View user's profile Send private message Visit poster's website
SteveB



Joined: 17 Jan 2009
Posts: 230
Location: Chicago

PostPosted: Thu Sep 03, 2009 7:42 pm    Post subject: Reply with quote
Awesome. I appreciate your patience in answering what may seem like simple questions. Rest assure I'm doing my best to work for the solution before asking, but again thank you so much. Smile


-Steve

_________________
Steve Bodnar
FlipFrame Animation
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
sturestone



Joined: 20 Oct 2007
Posts: 456
Location: Sweden

PostPosted: Sat Sep 05, 2009 8:25 am    Post subject: Reply with quote
Hi

Now I'm working on the next version of the A* pathfinding project.
I would like to know what features you would like to have added.
Please give a lot of suggestions, because I'm running out of ideas Wink


This will be in the next update:
Support for changing environments (like placing a building in runtime)
Flood Fill Area calculation : avoid to calculate a path when there is no way we can travel between start and end.

_________________
UnityPaint - Easy drawing on textures
A* Pathfinding - Out-of-the-box pathfinding
Sture The Stone aka Aron Granberg
Back to top
View user's profile Send private message Visit poster's website
SteveB



Joined: 17 Jan 2009
Posts: 230
Location: Chicago

PostPosted: Sat Sep 05, 2009 7:19 pm    Post subject: Reply with quote
Hi Aron! Very Happy

The most significant addition I can see is the ability to 'connect' grids to allow for multiple levels.

As discussed in the Visual Logic Editor thread, Virtools uses grids to both visualize pathfinding (similar to yours at run-time but these are interactive and have editing capabilities to define up to 256 layers and to 'paint' your own obstacles, etc).

The thing they allow are 'Linker' squares that connect two grids to each other for more complex environments. One example they have is an elevator that takes the character up from one grid on the ground floor to a grid way up high; the grid squares in front of the elevator on both levels are marked as 'Linkers' that essentially connect the two grids despite being separate and at two different locations.

To expand this, it could be nice to have an option to edit the grid again like in Virtools so we could 'paint' attributes into the grid such as triggers.

I'll think more on this, but let me know if this is even feasible. Smile


-Steve

_________________
Steve Bodnar
FlipFrame Animation
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
sturestone



Joined: 20 Oct 2007
Posts: 456
Location: Sweden

PostPosted: Sun Sep 06, 2009 8:34 pm    Post subject: Reply with quote
Hi

I have also been thinking about linker nodes.
The script uses an array of all the neighbor nodes so basically I can add any node to that array and those nodes will be linked.
I have edited the code so it now uses a 3 dimensional array for the nodes instead of a 2 dimensional, so now I can have as many layers/floors as I want.
Tomorrow or in a couple of days I will add a node linking utility so I can execute pathfinding over multiple floors.
So linked nodes and multiple floors might be added to the next update Very Happy

PS: I couldn't find anything about pathfinding with Virtools though, only one line in the thread.

_________________
UnityPaint - Easy drawing on textures
A* Pathfinding - Out-of-the-box pathfinding
Sture The Stone aka Aron Granberg
Back to top
View user's profile Send private message Visit poster's website
SteveB



Joined: 17 Jan 2009
Posts: 230
Location: Chicago

PostPosted: Sun Sep 06, 2009 11:09 pm    Post subject: Reply with quote
Wow sounds fantastic Aron! Looking forward to it...

...and yea my sentence was poorly constructed; I meant the conversation about "Virtools", not specifically pathfinding in Virtools...my bad. Smile

-Steve

_________________
Steve Bodnar
FlipFrame Animation
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
sturestone



Joined: 20 Oct 2007
Posts: 456
Location: Sweden

PostPosted: Mon Sep 07, 2009 5:40 pm    Post subject: Reply with quote
I have managed to get 3d pathfinding between two grids now.
Works great. Very Happy
Now there is only the linking utility left, currently it's hard coded.

_________________
UnityPaint - Easy drawing on textures
A* Pathfinding - Out-of-the-box pathfinding
Sture The Stone aka Aron Granberg
Back to top
View user's profile Send private message Visit poster's website
SteveB



Joined: 17 Jan 2009
Posts: 230
Location: Chicago

PostPosted: Mon Sep 07, 2009 5:53 pm    Post subject: Reply with quote
Well if you need someone to test it let me know! Hahaha... Very Happy

...but really thats a significant addition IMHO so bravo Aron, wow.


-Steve

_________________
Steve Bodnar
FlipFrame Animation
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
liverol



Joined: 10 Feb 2009
Posts: 50

PostPosted: Tue Sep 08, 2009 8:49 am    Post subject: Reply with quote
hi,sturestone,thanks for your great work,i hope this can be implemented in next version:control lots of units at the same time and they can wait when the destination is blocked and continue to move when free,all in a word,a mature RTS path moving solution,if possible,i would like to pay for a commercial license!
Back to top
View user's profile Send private message
sturestone



Joined: 20 Oct 2007
Posts: 456
Location: Sweden

PostPosted: Tue Sep 08, 2009 7:12 pm    Post subject: Reply with quote
I think I can implement multiple units calculating the path simultaneously. Waiting for the path to get free from other units is very simple, but depending on how realistic you want it it becomes increasingly complicated, it is also very project dependent, often you have a moving script already in the project and wants the A* script to fit it, so it's hard to write something that works in all cases.
_________________
UnityPaint - Easy drawing on textures
A* Pathfinding - Out-of-the-box pathfinding
Sture The Stone aka Aron Granberg
Back to top
View user's profile Send private message Visit poster's website
liverol



Joined: 10 Feb 2009
Posts: 50

PostPosted: Thu Sep 10, 2009 3:08 am    Post subject: Reply with quote
just like the warcraft moving,is that possible?
Back to top
View user's profile Send private message
nikemerlino



Joined: 02 Jul 2008
Posts: 18

PostPosted: Tue Nov 03, 2009 5:49 pm    Post subject: Reply with quote
The project seems to have some problems in Unity 2.6. Is it only my problem?
Back to top
View user's profile Send private message
sturestone



Joined: 20 Oct 2007
Posts: 456
Location: Sweden

PostPosted: Tue Nov 03, 2009 7:33 pm    Post subject: Reply with quote
Nope, mine too.
I will release an update soon, and I will put in some new features too Very Happy

_________________
UnityPaint - Easy drawing on textures
A* Pathfinding - Out-of-the-box pathfinding
Sture The Stone aka Aron Granberg
Back to top
View user's profile Send private message Visit poster's website
sturestone



Joined: 20 Oct 2007
Posts: 456
Location: Sweden

PostPosted: Tue Nov 03, 2009 8:48 pm    Post subject: Reply with quote
I must have missed that with warcraft moving, but here's an answer.

Yes, it is possible, it's very hard to make it fast enough though (working on it). Check out my new RTS demo (very early stage) here : http://arongranberg.com/wp-content/uploads/rts/rts
It uses the A* system version 2.2 (not yet released, although it is very similar to 2.0), the movement is very similar to warcraft movement.
You can select units by click n drag (it is not visible if you have selected a unit or not though), attack move with A + click and simple move with M + click or right click.

_________________
UnityPaint - Easy drawing on textures
A* Pathfinding - Out-of-the-box pathfinding
Sture The Stone aka Aron Granberg
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    Unity Community Index // Showcase All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum