generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Pathfinding help.

Previous Thread :: Next Thread 
HatHelper is not online. HatHelper
Top 25 Poster
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
Frostglacier is not online. Frostglacier
Joined: 28 Oct 2010
Total Posts: 4177
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 is not online. HatHelper
Top 25 Poster
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 is not online. 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 is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
22 May 2013 05:39 PM
Look up Dijkstra's algorithm.
Report Abuse
Rustdude is not online. 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
shotgreen999 is not online. shotgreen999
Joined: 29 Nov 2009
Total Posts: 376
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 is not online. 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 is not online. 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 is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
22 May 2013 05:57 PM
None of you are of any use.
Report Abuse
shotgreen999 is not online. shotgreen999
Joined: 29 Nov 2009
Total Posts: 376
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 is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
22 May 2013 10:38 PM
bump
Report Abuse
UnBuild is not online. 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
veerstrong is not online. veerstrong
Joined: 23 Jun 2009
Total Posts: 2450
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 is not online. 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
ProjectYeager is not online. ProjectYeager
Joined: 30 Mar 2013
Total Posts: 70
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 is online. 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
shotgreen999 is not online. shotgreen999
Joined: 29 Nov 2009
Total Posts: 376
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
BJCarpenter is online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
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
BJCarpenter is online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
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
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
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 is online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image