Path Movement Behavior

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • But how would you choose paths?

    That would require changing a few things to the behavior, and probably bring up backwards compatibility

    Don't get me wrong it sounds like a good thing to add. I just don't think its as easy as you make it sound.

  • But how would you choose paths?

    That would require changing a few things to the behavior, and probably bring up backwards compatibility

    Don't get me wrong it sounds like a good thing to add. I just don't think its as easy as you make it sound.

    You're right, It's not easy to add these thing to the behavior but that is not what I am saying at all. My point is that the behavior would be better and more productive if these things were in it at some point. So here is a little more detail about what I would like to see.

    when you go to path edit like so.

    <img src="http://img442.imageshack.us/img442/1206/properties110.jpg">

    you would see this

    <img src="http://i25.photobucket.com/albums/c87/TheLastTora/pathedit.jpg">

    But I would like to see it like this

    <img src="http://i25.photobucket.com/albums/c87/TheLastTora/pathedit3.jpg">

    Then you can call the path you want with a action like

    "Set Path" you would have to add the name of the path.

    And get more out of it with conditions like this

    "Compare Node" you would have to put the number of the Node,

    "At Path Start" you would have to add the name of the path,

    "At Path END" you would have to add the name of the path.

    plus some expressions too but I am to sleepy to write the now.

  • Then you can call the path you want with a action like

    "Set Path" you would have to add the name of the path.

    And get more out of it with conditions like this

    "Compare Node" you would have to put the number of the Node,

    "At Path Start" you would have to add the name of the path,

    "At Path END" you would have to add the name of the path.

    plus some expressions too but I am to sleepy to write the now.

    Yes, I think it would be great

  • Looks cool. Will this be an official part of Construct on some day?

  • Looks like an awesome plugin rojo.

    You seem to have covered pretty much all bases with this one.

    My only "concern" (for lack of a better word) would be some things brough up on the first page of posts regarding path transitioning.

    I was thinking of doing a bit of a PC remake of the PS3 game, PixelJunk Racers which involves slot cars that can change lanes.

    Obviously each lane would need a path, but the object would need to be able to jump from path to path easily without relying on nodes as a point of changeover. I haven't actually tried the plugin yet, but was more or less wondering if something like this would be possible without spending a lot of time only to discover it's not.

    I already have an idea how I may be able to "trick" it into working, however I can already forsee issues with my proposed "trick/hack". Having say 5 paths, with 1 car on each path that follow each other exactly around the circuit... then when a lane change occurs simply delete the car from path X and move to path Y, and throw in a "ghost" car for the lane change animation as such.

    Anyway... am I barking up the wrong tree? I frequently do.

    ~Sol

  • I can see where path branching would com in handy for this if the cars can change lanes only at certain locations. Here's a way to do the lane changing at any point of the path:

    EX: http://dl.dropbox.com/u/5426011/examples/lanechange.cap

    The track is defined by one path and other lanes are defined by perpendicular offsets from the path, then the car's path is made as it goes.

  • If im not greatly mistaken, this is awesome for interpolation of online games? (when a new packet arrives you could create a curve based on the starting position and velocity vectors and the end ones?)

  • Would it be possible to add some expressions like nodeX and nodeY and and action for each node?

  • a deceleration thing would be great like if the next node have an angle superior to 90 the sprite will decelerate to avoid out of track.

  • Obviously each lane would need a path, but the object would need to be able to jump from path to path easily without relying on nodes as a point of changeover.

    [...]

    Having say 5 paths, with 1 car on each path that follow each other exactly around the circuit... then when a lane change occurs simply delete the car from path X and move to path Y, and throw in a "ghost" car for the lane change animation as such.

    I'd say have a single path, since if you have many, nothing guarantees they'll stay in synch along the path (at a bend, the paths on the outside will be longer, and they might get behind). Just have a "pace car" object following the path and then place your car offset to the right or left of the proxy a fixed number of units. Make sure road art is sized accordingly and avoid hard turns, as Path Behavior does not do smooth bends and the cars outside the main lane will seem to jump around.

    To smoothen bends, I've thought about making the "pace car" follow another proxy object with the path behavior. The "pace car" would follow the proxy smoothly, thus softening bends. How to do this without getting behind the proxy? I have no idea yet

    I'll appreciate ideas on smooth path following, as I kind of need it for my game

  • Scale path would be an interesting idea.

    Edit:

    Actually you can kind of do that now via image points.

    If you add a bunch of image points to a sprite then arrange them like your track, and name them sequentially, all you would need to do is make a loop, clear the old path, scale the sprite, then do your loop again.

    Add node at imagepoint(loopindex)... blah blah blah

    Edit2:

    Course you would have to come up with some way of tracking where you are on the path, and getting to the new position on the path.

    An actual sale path would be a lot easier.

  • you can scale the position of a proxy object in the path

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think there may be a possible bug with "clear all nodes". Every time I do that it goes back to the starting node, even if I add one right after that, a tick after to boot.

    Also, is there any way to slow the turning on angle to path?

    It would be nice if the sprites rotation was a constant speed.

    And is there a way to set deceleration?

  • [quote:1flgyb0c]I think there may be a possible bug with "clear all nodes". Every time I do that it goes back to the starting node, even if I add one right after that, a tick after to boot.

    It appears to fix it by doing this after you clear then add nodes:

    -> Sprite: Set distance to 0 on the path, moving Object.
    [/code:1flgyb0c]
    
    [quote:1flgyb0c]Also, is there any way to slow the turning on angle to path?
    It would be nice if the sprites rotation was a constant speed.
    
    Disable "Angle to path" for better control.  You can make the max rotation speed of 50 degrees per second with a event like this:
    [code:1flgyb0c]+ System: Always (every tick)
    -> Sprite: Rotate 50*TimeDelta degrees toward (.X+cos(Sprite[PathMovement].GetAngle),.Y+sin(Sprite[PathMovement].GetAngle))
    [/code:1flgyb0c]
    
    [quote:1flgyb0c]And is there a way to set deceleration?
    
    You can cause deceleration by setting the acceleration in the opposite direction as the velocity.  The only catch is it will slow to zero and then accelerate past it.
  • Marvelous!

    The first two worked well, but deceleration is a bit harder.

    Its kinda hard to tell exactly when deceleration should kick in.

    If I go with just speed, I can go with lerp(current speed, (length of path - distance on path) , something*timedelta)

    It works, but its not the curve I was looking for.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)