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 » Scripters
Home Search
 

Re: Following a Bézier curve

Previous Thread :: Next Thread 
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
23 Oct 2015 08:04 AM
I'm making a path finding system. The path finding already works but I'd like to smooth out the path with quadratic Bézier curves. I don't think that will be a problem, but I'm wondering how to best follow a Bézier curve path with a bot. Any ideas?
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
23 Oct 2015 08:06 AM
Not too knowledgable on creating those curves but my intuition would be just to assign a numeric number to a part's name every so often. Then have the NPC follow the (spaced out) parts :D
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
23 Oct 2015 08:09 AM
i actually worked with these a little while back
i'm kinda curious as to how you intend to do this, though, doesn't it need two points and then a directional point?

-=Robo=-
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
23 Oct 2015 08:12 AM
creating those curves ( look at the animations :3 )
https://en.wikipedia.org/wiki/Bézier_curve#Constructing_B.C3.A9zier_curves

And the Bézier curves will be very close to each other and need to be dynamically created and destroyed (otherwise I would have millions at once of them)

So I don't see my self using spaced out parts or vectors.
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
23 Oct 2015 08:13 AM
Turn the curve into a set of points you can follow. Have the bot follow the points you set up.

More points == higher resolution == more accurate following == more processing
Less points == lower resolution == less accurate following == less processing

Find a good balance between those.
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
23 Oct 2015 08:16 AM
some basic Bézier calculation code:

A = source point
B = direction point (bad naming)
C = target point
t = time (0 to 1)

lerp = A.Lerp

curPoint = lerp(lerp(A, B, t), lerp(B, C, t), t)
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
23 Oct 2015 08:18 AM
@digpoe

But what if the bots are fast enough to reach the point in less then one frame. then the bot will slow down :/
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
23 Oct 2015 08:26 AM
well it's pretty much the same way every game does it so idk
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
23 Oct 2015 11:39 AM
hm... I guess I'll just CFrame move them, wasn't planing on using humanoids anyway.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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