| View previous topic :: View next topic |
SteveB

Joined: 17 Jan 2009 Posts: 230 Location: Chicago
|
Posted: Thu Sep 03, 2009 6:40 pm Post subject: |
|
|
|
Sweet.
...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 |
|
|
sturestone
Joined: 20 Oct 2007 Posts: 456 Location: Sweden
|
Posted: Thu Sep 03, 2009 6:50 pm Post subject: |
|
|
|
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 |
|
|
SteveB

Joined: 17 Jan 2009 Posts: 230 Location: Chicago
|
Posted: Thu Sep 03, 2009 7:42 pm Post subject: |
|
|
|
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.
-Steve _________________ Steve Bodnar
FlipFrame Animation |
|
| Back to top |
|
|
sturestone
Joined: 20 Oct 2007 Posts: 456 Location: Sweden
|
Posted: Sat Sep 05, 2009 8:25 am Post subject: |
|
|
|
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
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 |
|
|
SteveB

Joined: 17 Jan 2009 Posts: 230 Location: Chicago
|
Posted: Sat Sep 05, 2009 7:19 pm Post subject: |
|
|
|
Hi Aron!
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.
-Steve _________________ Steve Bodnar
FlipFrame Animation |
|
| Back to top |
|
|
sturestone
Joined: 20 Oct 2007 Posts: 456 Location: Sweden
|
Posted: Sun Sep 06, 2009 8:34 pm Post subject: |
|
|
|
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
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 |
|
|
SteveB

Joined: 17 Jan 2009 Posts: 230 Location: Chicago
|
Posted: Sun Sep 06, 2009 11:09 pm Post subject: |
|
|
|
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.
-Steve _________________ Steve Bodnar
FlipFrame Animation |
|
| Back to top |
|
|
sturestone
Joined: 20 Oct 2007 Posts: 456 Location: Sweden
|
|
| Back to top |
|
|
SteveB

Joined: 17 Jan 2009 Posts: 230 Location: Chicago
|
Posted: Mon Sep 07, 2009 5:53 pm Post subject: |
|
|
|
Well if you need someone to test it let me know! Hahaha...
...but really thats a significant addition IMHO so bravo Aron, wow.
-Steve _________________ Steve Bodnar
FlipFrame Animation |
|
| Back to top |
|
|
liverol
Joined: 10 Feb 2009 Posts: 50
|
Posted: Tue Sep 08, 2009 8:49 am Post subject: |
|
|
|
| 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 |
|
|
sturestone
Joined: 20 Oct 2007 Posts: 456 Location: Sweden
|
Posted: Tue Sep 08, 2009 7:12 pm Post subject: |
|
|
|
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 |
|
|
liverol
Joined: 10 Feb 2009 Posts: 50
|
Posted: Thu Sep 10, 2009 3:08 am Post subject: |
|
|
|
| just like the warcraft moving,is that possible? |
|
| Back to top |
|
|
nikemerlino
Joined: 02 Jul 2008 Posts: 18
|
Posted: Tue Nov 03, 2009 5:49 pm Post subject: |
|
|
|
| The project seems to have some problems in Unity 2.6. Is it only my problem? |
|
| Back to top |
|
|
sturestone
Joined: 20 Oct 2007 Posts: 456 Location: Sweden
|
|
| Back to top |
|
|
sturestone
Joined: 20 Oct 2007 Posts: 456 Location: Sweden
|
Posted: Tue Nov 03, 2009 8:48 pm Post subject: |
|
|
|
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 |
|
|