05-20-2014, 12:08 PM
Hi,
the SplineWalkerCon, though still working, will become obsolete once the new Networking featues are in (Connections will only be used to visually connect curves then). But even then using a network map might be a bit overkill unless you need pathfinding etc.
I would go the FollowSpline route: Create your custom controlle as a subclass of FollowSpline and overwrite some logic (Refresh()!) to manage your connections. E.g. if you move with the PingPong clamp option, you are able to detect the end of spline easily by checking if the direction changed. If so, check the last CP and if connected to another Spline, switch splines and add the delta movement to the new spline. In Pseudocode:
Another topic is smooth transition between splines midway. One way would be to drag the player toward the final position where he should be. See the EndlessPlayer example. It doesn't use a FollowSpline based controller, but you'll get the trick. Basically uncouple direct movement for your player if he's in "switch Lane" mode and drag him toward the desired target position until he completed the transition. Another way would be to "move" on two splines and lerp the results while in "Switch" mode.
Does that help?
the SplineWalkerCon, though still working, will become obsolete once the new Networking featues are in (Connections will only be used to visually connect curves then). But even then using a network map might be a bit overkill unless you need pathfinding etc.
I would go the FollowSpline route: Create your custom controlle as a subclass of FollowSpline and overwrite some logic (Refresh()!) to manage your connections. E.g. if you move with the PingPong clamp option, you are able to detect the end of spline easily by checking if the direction changed. If so, check the last CP and if connected to another Spline, switch splines and add the delta movement to the new spline. In Pseudocode:
Code:
override Refresh()
{
MoveBy(ref tf, ref dir,...,CurvyClamping.PingPong);
if (dir==-1) { // <=this assumes you're normally moving forward only. If not you'll need to handle start of splines as well, but the concept remain the same
tf=1-tf;
dir=1;
// Find new Spline
var lastCP=spline[spline.Count-1];
var con=lastCP.ConnectionAny;
if (con!=null) // connected? then get new spline
spline=con.GetCounterpart(lastCP).Spline;
else
LetMeCrashOrDieOrElse();
}
}Another topic is smooth transition between splines midway. One way would be to drag the player toward the final position where he should be. See the EndlessPlayer example. It doesn't use a FollowSpline based controller, but you'll get the trick. Basically uncouple direct movement for your player if he's in "switch Lane" mode and drag him toward the desired target position until he completed the transition. Another way would be to "move" on two splines and lerp the results while in "Switch" mode.
Does that help?

