HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 22 May 2013 05:30 PM |
I know how pathfinding works, but I've run into an issue: I don't want units going through other units. Which means when pathfinding I'll have to treat other units as walls. Which means that when a group of units are going straight in a single file line, they'll move around strange because they'll think the place in front of them is occupied.
Solutions? |
|
|
| Report Abuse |
|
|
|
| 22 May 2013 05:32 PM |
| I know nothing about pathfinding, but if you're using moving parts then you could try using magnitude to sense if a certain object is in front of a part. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 22 May 2013 05:33 PM |
| There will be no physics involved, only a grid where squares units are moved around with CFrames. |
|
|
| Report Abuse |
|
|
Rustdude
|
  |
| Joined: 12 Apr 2008 |
| Total Posts: 1286 |
|
|
| 22 May 2013 05:35 PM |
| I don't know anything of pathfinding but I am interested in this subject matter as well. If anyone had a quick explanation of it for me that'd be AWESOME. But I'm always interested in learning new scripts. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 22 May 2013 05:39 PM |
| Look up Dijkstra's algorithm. |
|
|
| Report Abuse |
|
|
Rustdude
|
  |
| Joined: 12 Apr 2008 |
| Total Posts: 1286 |
|
|
| 22 May 2013 05:40 PM |
| Where can I find this Algorithm? Catalog? Google? Sorry new to scripting, but thanks for the help! |
|
|
| Report Abuse |
|
|
|
| 22 May 2013 05:50 PM |
ROBLOX wiki.
Also I would like to know how to do this for a update in one of my games. |
|
|
| Report Abuse |
|
|
Rustdude
|
  |
| Joined: 12 Apr 2008 |
| Total Posts: 1286 |
|
|
| 22 May 2013 05:51 PM |
| Yeah... Is the guy a user or what... |
|
|
| Report Abuse |
|
|
Rustdude
|
  |
| Joined: 12 Apr 2008 |
| Total Posts: 1286 |
|
|
| 22 May 2013 05:52 PM |
Just googled it.
Would I be able to use the code he wrote and just insert it into a Script and put that into the model or? |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 22 May 2013 05:57 PM |
None of you are of any use.
|
|
|
| Report Abuse |
|
|
|
| 22 May 2013 06:09 PM |
| Sorry, but when someone famous on ROBLOX post something that they need help with other people are interested. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
| |
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 22 May 2013 10:45 PM |
Well you said your using squares of cframe right? Why not make a table, if the ray ends, add that "square" to the table But if the ray ends IN one of those squares on the table, don't use that path |
|
|
| Report Abuse |
|
|
|
| 22 May 2013 10:51 PM |
I made a pathfinding AI once. However, it used pre-made Nodes e.e
So like
If I wanted it to come to me
It would go to every part called "Node" in a sequence that would get to me as fast as it could.
~One must risk everything to find the truth. Even if the truth isn't what you want it to be, it is better than living a lie.~ |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 22 May 2013 11:23 PM |
To be honest, I think it's fine if the units try to walk through an army. I don't personally use it, but before I attack someone's base they usually plunge their horde of units right into mine, meaning one troop doesn't have all the fire concentrated on him at once. I don't know. Kind of a classic thing to me I guess.
~ The ATR Fishie ~ |
|
|
| Report Abuse |
|
|
|
| 22 May 2013 11:31 PM |
Not sure if you want to use magnitude or not, but I would use ray.new, and calculate all directions with a for loop and math.rad/math.pi
Also you could take the direction of the lookVector of whatever the current unit hit is and see if that unit is moving aswell via velocity |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 23 May 2013 01:00 AM |
@shot, define "famous" because there are no real "famous" people on ROBLOX.
Life is an endless nightmare |
|
|
| Report Abuse |
|
|
|
| 23 May 2013 01:02 AM |
| I 'am meaning he has vary popular games most people consider you famous if you have popular games. |
|
|
| Report Abuse |
|
|
|
| 23 May 2013 02:28 AM |
U will prolly be fine if u just throw a smattering of Logic at it (a few if..thens). And never "worry" about how it will look; prolly look fine just do it and see what 'effect' it looks like. Keep it or tweek it....
This is from SpeedAI. It may not help 'cause it's for a comando type Avatar, but u can get some logic ideas from it.
(Problem: U can't just say Jump, if abut to run into a friendly: They may be on a collision coRSE, so tehy both jump into each other.... (I made the EastWest "Avoid" a 'swerv' instead of Jump just 4 Variety))
elseif Hit.Parent.Name == AIName then -- friendly? -- if Xdir > 0 then -- if going ?North? then ignore, else (?South?); Jump -- Hit = nil -- ignore -- elseif Xdir == 0 then -- else swerve (only while in logic). EAST-WEST if Xdir == 0 then Hit = Aitorso-- this should result in Hit = true-but-don't-attemp-a-jump, so swerve; doesn't check floor! -- return hit -- Swerve, without checking to jump. elseif Hit.Velocity.y > 1 then Hit = nil -- ignore, if other AI is already jumping; else check to Jump end -- East -West collisions - swerve. North/South, check-to-jump. end -- endifs |
|
|
| Report Abuse |
|
|
|
| 23 May 2013 02:36 AM |
| As u can see from the commented-out bit, I changed it to simply "Jump if the other guy isn't already jumping", but u can really make it any conditions u can dream-up...... |
|
|
| Report Abuse |
|
|
|
| 23 May 2013 03:36 AM |
| Ignore my post, just adding it here so I can remember to look up Dijkstra's algorithm tomorrow. |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 23 May 2013 07:41 PM |
@Guest, just have it notify you (it doesn't really do it but it puts it on the top of your page in MyForums.
Life is an endless nightmare |
|
|
| Report Abuse |
|
|