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 - nodes...

Previous Thread :: Next Thread 
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
22 Apr 2013 10:11 PM
Alright, so I've been reading about pathfinding and A* , I think I understand the concept for the most part, currently I've decided upon using a non-grid based set of nodes that I place strategically throughout the map and then cast rays to connect the nodes and store them in a 2d table.
A visual of how the table is set up:

{{origin(x,y,z),pos(x,y,z),pos(x,y,z)},{origin(x,y,z),pos(x,y,z),pos(x,y,z)}}

As you can see the nodes are only refered to by their position, meaning I can’t check adjacent nodes of the nodes stored in the 2nd table. How would I properly reference the nodes in the table?

Here's the script if you need it: pastebin.com/xgwQ2Ete

Report Abuse
rockman5 is not online. rockman5
Joined: 17 Oct 2008
Total Posts: 2852
22 Apr 2013 11:04 PM
Easy fix....do:

{{origin(x,y,z),pos(x,y,z),pos(x,y,z)},you actually thought i knew,{origin(x,y,z),pos(x,y,z),pos(x,y,z)}}
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
22 Apr 2013 11:08 PM
seems legit, However if I could find a way to store each node in the table as a magic variable that contains the information that the table currently holds (the positions of the nodes available from the point of the current node)
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
23 Apr 2013 12:28 AM
I have no idea what u r talking about....

I made a map once and Named the Nodes truncated-Positions (Rounded to the Nearest Integer with math.floor ("Zombie Brains AI" in Catalog (The rest of the script is deprecated)))

Once the numbers are 'handlable" like that, u can check for adjacency. U can use different size grids or 3D chessboards....

Here's a Better AI that uses Ray-casting:

Speed AI

--Brian
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
23 Apr 2013 12:30 AM
*Rounded to the Nearest Integer with math.floor...

after being divided by a 'grid size'.
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
23 Apr 2013 02:15 AM
maybe an if statement would work?

newnode = nil
targetpos = YourTargetPosition
for i,v in pairs(YourTableWithNodes) do
if v[1] == lastnode then
newnode = v
end
end

I hope this works for you. You can't get more help in this really, because there aren't much people who understand pathfinding (me neither). So Good Luck!

Enjoy :)

~sycips~
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
23 Apr 2013 08:49 AM
hmmm.... I think i can store the index of each node in the y axis of the vector, since i don't really need the y axis :3

Hopefully that will work, but I just woke up so i'll figure out if that will work later.
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
23 Apr 2013 11:12 AM
NOW, your cooking with gasoline!

I use the RotVelocity of anchored Parts to store Vector3s....
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
23 Apr 2013 01:11 PM
smart idea there, also for anyone who wants to know, my idea worked :D
nodeContainer[nodeContainer[2][1].y] now gives me the table of the node!
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