• Visit Rebornbuddy
  • [TOOL] Smoothify

    Discussion in 'Development' started by mh66, Jun 29, 2016.

    1. mh66

      mh66 Community Developer

      Joined:
      Jun 21, 2016
      Messages:
      1,050
      Likes Received:
      64
      Trophy Points:
      48
      Hello everyone,

      I've scripted a routine that might help some of you making edgy profiles more human-like or even flying routines.








      HOW IT WORKS
      [​IMG]
      Smoothify will replace hotspots with waypaths being way more smooth and curved.








      HOW TO USE
      [​IMG]
      copy/paste hotspots, set your parameters and click on "Smoothify".








      PARAMETERS
      [​IMG]
      MaxDistance: maximum distance between replaced hotspot and new waypath
      Step: minimum distance between added waypoints
      NextCTM: Corresponds to PathPrecision (distance between char and current Click-To-Move-Event when next CTM is triggered)
      Cycle: check if transition between first and last waypoint is desired
      Invert: check if you want to change direction of path

      Notes:
      • Smoothify will autocorrect values for specific waypoints that may cause bottish behaviour
      • If you set MaxDistance to a very hight value (eg "9999"), Smoothify will create a waypath being as curved as possible.
      • If you record your path with ZapRecorder you might want to use a distance of 30









      EXAMPLE
      [​IMG]

      Furthermore, I've attached 2 profiles for "Vale Of Eternal Blossoms":

      View attachment [Smoothify] Edgy.xml
      contains the original edgy flying path

      View attachment [Smoothify] Smoothified (10, 4, Cycle).xml
      contains the smoothified flying path with parameters MaxDistance=10, Step=2, Cycle

      Having uploaded the script on JSFiddle, it's quite easy modifying and adapting the function to your needs. If anyone is interested in the math behind it for improvements and adjustments, let me know and I will provide some notes.

      http://jsfiddle.net/58zt099v/37/embedded/result/


      Sorry for doubleposting. Didn't know where this topic fits more.
       
      Last edited: Aug 20, 2016
      Corleone likes this.
    2. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      This is an interesting project. Anything that can adjust the behavior to be more human-like in appearance is most welcome.

      How does this handle elevation choppiness (aka, when a flight results in flying too low to the ground or vertical zig-zags every few meters). ?
       
    3. Pinteman

      Pinteman Member

      Joined:
      Jun 15, 2013
      Messages:
      56
      Likes Received:
      0
      Trophy Points:
      6
      Nice idea!
      Would it be possible to extend this project to include obstructions (3D blackspots if you will), to avoid collisions with objects when traversing the smoothed path?
       
    4. Kaffee

      Kaffee Member

      Joined:
      Jan 8, 2016
      Messages:
      338
      Likes Received:
      4
      Trophy Points:
      18
      Looks really good! Much appreciated!
       
    5. mh66

      mh66 Community Developer

      Joined:
      Jun 21, 2016
      Messages:
      1,050
      Likes Received:
      64
      Trophy Points:
      48
      What Smoothify actually does, is changing an existing waypath and smoothifies it. If 2 flying points are too far away from each other, HB jumps in and auto-assists by adding additional points according to mesh data (that's what I assume).

      If you want a very smooth flying path, you need to record a quite accurate beforehand. Have you tried the profiles I attached? The first one was recorded with ZapRecorder with a distance of 40m; the second one is the smoothified version of this particular recorded one.

      When I scripted this routine the idea of improving HB flying assist mode came to my mind. If you could catch the last, current and next ClickToMove-Event, you could smoothify the path by creating a plugin, that will add additional flying points on-the-fly.
       
      Last edited: Jul 1, 2016
    6. haze210

      haze210 Member

      Joined:
      Jul 7, 2011
      Messages:
      76
      Likes Received:
      1
      Trophy Points:
      8
      This is very interesting, are you using a B-Spline for the curve fitting?
       
    7. mh66

      mh66 Community Developer

      Joined:
      Jun 21, 2016
      Messages:
      1,050
      Likes Received:
      64
      Trophy Points:
      48
      Way easier than that; these new waypoints lie on an arc

      [​IMG]
      [​IMG]
       
    8. haze210

      haze210 Member

      Joined:
      Jul 7, 2011
      Messages:
      76
      Likes Received:
      1
      Trophy Points:
      8
      ohhhh ok I see what its doing. Is this some kind of interpolation or did you just make this up? It's a cool solution, I like it. Good work!
       
    9. mh66

      mh66 Community Developer

      Joined:
      Jun 21, 2016
      Messages:
      1,050
      Likes Received:
      64
      Trophy Points:
      48
      I've scripted this algorithm myself with some vector geometry and trigonometric functions. I intend to script a plugin that will jump in honorbuddy's click-to-move-events and adds waypoints on the fly So way less edgy flying (that's what I aim for) :)
       
    10. mh66

      mh66 Community Developer

      Joined:
      Jun 21, 2016
      Messages:
      1,050
      Likes Received:
      64
      Trophy Points:
      48
      Updated:
      - NextCTM - Smoothify will consider PathPrecision (distance between char and current Click-To-Move-event when next CTM is triggered) for calculating coordinates
      - Invert: Although users will use the same profile, you can now invert the direction so it's unlikely anyone will see you are using the same profile
       
    11. Gwaren

      Gwaren Member

      Joined:
      Apr 23, 2013
      Messages:
      182
      Likes Received:
      0
      Trophy Points:
      16
      Does this work with ground mount profiles also or just flying? I tried it on my ground mount profile for legion and it just stood there and dident move at all. Or am i doing somting worng, tried 1-4 steps, max distance from 5-15, CTM om 10-50 and cycle
       
    12. mh66

      mh66 Community Developer

      Joined:
      Jun 21, 2016
      Messages:
      1,050
      Likes Received:
      64
      Trophy Points:
      48
      it's actually for flying profiles only as GB won't let you set PathPrecision (the setting NextCTM depends on)
       

    Share This Page