[Published] Spline Plus Core - Spline Plus Animation - Spline Plus Mesh

@Colin_MacLeod Hi, yes i believe you can build up a traffic system with the help of spline plus,
the most important thing you need to have control over is speed for each follower separately which the thing that spline+ offers, you can also know on which branch each follower is currently on as well “if that will help”,
for followers reacting to each other is something you need to develop yourself , it’s not included in spline plus but i can gladly help you achieve this if you decide to use spline +, i can provide you with a function that you can call to decrease the speed gradually , something in this pattern for an example void DecreaseSpeed(float newSpeed,float time) but you need to correctly play with this to get to the result you want,
for followers crossing path , the issue will be detecting when the collision is about to happen ,i guess you will need to do some raycasting to detect that, the speed control thing can easily be done using spline+,
let me know in case you have any other question,
regards,

Hey, thanks for getting right back to me.

Yes, I understand this will require custom code - that’s fine. I’m just trying to work out whether it goes “with the grain” of Spline Plus.

I have a few more questions:

  1. Am I right in thinking there can be multiple spline branches, with many paths leaving (or joining) at the same point (for my intersections)?
  2. Do I have full control over via custom game logic which branch to follow at any time?
  3. Is it possible for one follower to overtake another?
  4. Finally, is there a way to get the angle of the tangent to the curve at any given point in the spline? I need some way to set the direction of the vehicle wheels.

Thanks again!

hello,

  1. yes, you can have an unlimited number of branches at an intersection
  2. yes,you a have full control over which branch your follower will switch to at an intersection,
    there is currently 3 options available in spline+
    Random branch picking,
    Defined branch picking"you pick which branch you want your follower to take"
    keyboard branch picking “your follower will pick the next branch based on keyboard inputs”
  3. for the moment this feature is unavailable ,there is an offset option available but i don’t think that it will be useful in this case,
  4. yes you have access to tangents and normals at any point of the spline

Hey elseforty,

I’m curious about this spline product and I had a quick question: Say I have 3 straight line splines (lanes) and my character decides to go to one of the other lanes. Could I disable the current lane the character was on, causing the character will automatically interpolate to the closest lane?

Edit: the character would be moving constantly in the lanes

@sandBucket2 Hi, i’m not sure if i fully understood what you mean by " Could I disable the current lane"
do you mean if the branch the follower is currently on was disabled then would the follower move automatically to next branch,
well this behavior does not exist currently in spline+ but it could easily be achieved with some extra coding,
i can help you achieve this if you decide to use spline+ , let me know if you do
regards,

Thats exactly what I need it to do, I’ve made a couple of typos (im just gonna use linear splines for 3 lanes the player will follow, but it will be curved eventually). I want it to be seamless, not a sudden interrupt, but rather a smooth transition from one spline to the next while keeping the illusion of momentum with the character.

EDIT: the concept of the game is similar to an endless runner.

i see , but i’m not sure about how the transition will look like if the branch curvature is smooth and not a strait line
can you explain this so i can have a better idea to answer you ?

Hi,
here is new spline + update
i managed to create this new path following mode that i’m sure you will find use of in your projects , i’ll include this in the next version

1 Like

Hi,
version 1.41 was approved by asset store team today, this version contains important fixes for some issues that was detected by users , please update to this version ,
have a nice day you all ;

Hi. Very interested in your product but had a few questions based on our needs.

  1. We want to create “paths” around an island etc that the NPCs will loosely follow during pathfinding. We are using a* pathfinding found here A* Pathfinding Project currently with his navigation/movement scripts. The idea would be to do normal pathfinding but when near a spline that will take us further along the nodes from a* we will follow the spline and then hop off and continue back on a* nodes. I can see someways to do simply by following the a* nodes backward from the end point and seeing if any splines are near, then following the splines back to character and doing a rough distance calc to see if the spline would make sense. Just wanted your thoughts on how and if that makes sense with your product. Might also be a nice hook for you btw to incorporate spline pathfinding with the main pathfinding tools out there like a* etc.

  2. Along with #1 ie following paths wondering if your crowd option would work to avoid NPCs following the same paths/spline from colliding or overlapping one another.

Every thing else we would use it for seems pretty straight forward ie entering exiting door ways. Just move to a starting point near the spline and hop on, let the spline system take over and then hop off again.

Thanks.

hi @holdingjason
there is certainly a way to do this , there is a bool variable that will allow you to either have control over the follower or let spline plus take control , this is will be more evident in the next version 2.0 that i will be doping in the few coming days , a switcher that will turn path following On/Off for each follower separately,
in code it looks like this

   SPData.Followers[0].IsActive=false;

for the switching part there is a method to achieve this

    public void GoTo(SPData SPData, Follower follower, int branchIndex, PathPoint pathpoint)

all you have to do is define the path point where you want your follower to start path following at ,
the branch index where your path point is located and the follower you want to target ,
of course you need to make sure the transition is smooth ,because once the method above is called then the follower is immediately on path,
you can do a Move Towards and Rotate Towards to achieve that and call the method above when the lerping is done

2- for the crowd question NPCs will not collide with each other if they all move with the same speed

let me know in case you have any other questions i’ll post some new version screens bellow

i have added scene view GUI for path editing, also as some debugging data that are useful

new Inspector menu ,

i have also added a feature that will allow full speed control on every path point, as you can see the spline with green coloring area means that follower will reach max speed, red area means follower will reach min speed there ,
this can be easily set up by selecting the path point from scene view the move the speed slider in scene view GUI

Thanks for the info.

So you have to hop onto the spline path at a path point that you have predefined correct? I can’t for instance just get near the spline at any location and jump on to it anywhere I like. That is not a really big issue as I could just define more granular points to give plenty of spots to hop on. Starting to also just think about laying out splines for the entire island and not even really bothering with other pathfinding except in some open areas where the NPCs can just wander around. That actually might work better.

For crowd control what I really want is to have multiple npcs not following anyone, just all on the same spline “system” (lets say an island with a number of splines interconnected going to various places) and then make sure they dont run into each other. So lets say one NPC stops along a spline for some reason and another needs to go around him or coming in the opposite direction. That raises another question can you go in either direction along the spline? I realize it can work with two splines like a two lane road but that might not always be practical.

Thanks for opening my eyes to some new ideas that might work better then the approach I was using. Just let me know your thoughts on these questions.

UPDATE: After digging into the docs etc not sure this does what I thought it did. So if I create a spline system, say a spline made of a bunch of branches to various houses in a city connected by city streets (splines have various endings at the house driveways) can I ask the system to compute the best path to take given a starting spline point (say nearest to the player) and an ending spline point (house). I would then want to follow the spline from the start to end point. Is that possible, did not appear so based on the docs but maybe I missed something?

hi @holdingjason
yes you can but this is gonna be a little bit expensive i guess since you will loop trough all branches and inside each branch you will loop trough all vertices ,and look for the closest one to your NPC, but you can easily transform the method i mentioned above to do the same job o vertices instead as you wish,
i don’t really know what you’re trying to do ,if you just want your NPC to wonder around then Spline plus is good choice for you , no need for a path finding solution,

for crowds collision i’m afraid you need to implement that yourself , it’s not going to be easy but it’s doable , i think the best way to do this is to have a raycast emitted from your NPCs , once the raycast hits another NPC they both stop following spline and they go around each other and then they go back to the spline again
for the direction , yes you can go on both directions no problem

for your last question , spline plus does not do that ,there is 2 types of path following supported, auto animated and keyboard inputs,
the type of path following you want is my road map as an extension of auto animated type but i’m afraid you have to wait a little bit,if you want to do that yourself let me know so i can guide you , just a hint there a variable on every branch class , it contains exactly the distance of each branch, you can start from there , (this exits only in version 2.0)

How do I enable the scene view GUI?

@jk15 hi,
that’s version 2.0 the version in the asset store is 1.41 i’ll push the new update next week also as some video tutorials explaining how to use the new version,

version 2.0 is now live
stay tuned i’ll post some video tutorials on the new version , in the meantime you can check the documentation
one important thing to mention is that splines that were generated by an inferior version than 2.0 will not be compatible with the new version,
i made a lot of core changes that made the compatibility impossible to keep,
and last the most important thing is that spline + is now the spline system of my other tool Spline mesh deform, this means that now you can procedurally generate meshes along a spline with multiple branches and benefit at the same time from the spline plus features, i’ll update the new version of Spline mesh deform some time this week

considering purchasing… Does Spline + allow for run-time editing of knots ? ( ability to adjust a track’s curvature @ run-time)

@Banksy yes ,knots or path points in spline plus are transforms, you can edit them the way you want during runtime