XIM Community

Online editor and viewer for ballistics curves  (Read 53366 times)

Offline MuKen

  • Member
  • *
  • Posts: 173
    • View Profile
Online editor and viewer for ballistics curves
« on: 01:42 PM - 02/27/14 »
https://googledrive.com/host/0B8EFYcEZMa4deTNOUjM2OTlKTVU/xim4ballisticscurvetool.html

Hi everyone, with much thanks to abc123 for helping to update things, the ballistics curve editor is now working for XIM4 codes.

There's also now a new method for editting curves that more visually oriented people should like.  Basically when you first load up the tool, it begins with a single line "segment", which is a straight line from 0,0 to the maximum 20,100.  If you look below the chart, you'll see a box labelled "Insert", as long as it stays that way, you can add new segment points by clicking on the chart.  I.e. if you click somewhere in the middle, it will split the segment into two segments: a straight line to the point you clicked and another segment leading to where the old segment originally led from there.

After laying out all the general places you want to hit with straight segments, you can switch the box from "Insert" to "Curve".  In this mode, if you click an area, instead of adding a new segment, it will attempt to curve one of the existing segments to get as close to that point as possible using linear acceleration or deceleration as appropriate.  You can switch back and forth between these modes as you see fit.

For the time being, only linear curves are supported, so the types of curvature you can create are limited by that.  I may add more types of curves in the future.  If you are having trouble bending curves the way you like, try clicking in different areas (i.e. closer to the beginning or endpoints of the segment you are curving versus in the middle, etc.).

If you prefer the old method of working with the generation code, it still works and you can use both interchangeably.  I.e. you can use the visual point and click method to get started, then adjust the text of the code to tweak things, and go back to make some more changes by clicking, etc.  The chart images can still also be downloaded by clicking the icon in the upper right, or hosted on imgur and pasted into a forum post by clicking the button on the bottom.

The generation code is a little simpler since the XIM4 doesn't include hip and ads in a single code and also doesn't store sensitivity.  So for example, you can enter the following:

Code: [Select]
0.2 0.3 lineardeceleration 0.4
0.7 0.8 linear
1 1 lineardeceleration 0.6

Try it out and see what happens.  Basically, we have created a simple boost curve for pushing past auto-aim, using linear deceleration curves at the bottom and top to smooth it out.  The first line starts with "0.2 0.3", saying we wish to move through the point 20% along the X axis and 30% up the Y-axis.  This is followed by "lineardeceleration", stating the type of curve we wish to use to get to that point, along with a parameter specific to linear deceleration curves.  Different functions will take different types and numbers of parameters.  The next line connects us to the point "0.7 0.8" with a straight line.  And the third line finishes off by reaching the top right corner of the graph.

When specifying points, you can enter "?" as the Y coordinate.  When doing so, the tool will calculate the curve that would have led to the previous point, then extend it to the new X coordinate and use the Y coordinate that would have naturally resulted.  This should not be used on the first point.  Note that using this method will prevent the visual graph click editting method from working.

Currently the following functions are supported:

linear - connect two points with a straight line, no parameters

linearacceleration - use a linear acceleration curve, 1 parameter (must be >0).  The sensitivity at the endpoint is fixed, and the parameter indicates what the factor of sensitivity rampup from start to end to reach it was.  For example a factor of 2 will add twice the starting sensitivity from beginning to end, so the sensitivity at the end of the range will be triple the start.

lineardeceleration - use a linear deceleration curve, 1 parameter (must be >0).  The sensitivity at the endpoint is fixed, and the parameter indicates what the factor of sensitivity lowering from start to end to reach it was.  For example a factor of 2 will start at an additional twice the ending sensitivity, so the sensitivity at the end of the range will be triple at the start.

logarithmic - a logarithmic curve, 1 parameter (must be >0) indicating the domain range that should be set to match the endpoint (higher values will make for a steeper start, lower values will make the curve straighter)

exponential - an exponential growth curve, 1 parameter (must be >0) indicating the domain range that should be set to match the endpoing (higher values will make for a steeper start, lower values will make the curve straighter)

The three parameters are designed so that if you operate on a region twice as wide, you should double the parameter to achieve a similar curve nature.  So looking at the example script, the parameter was raised by 50% for the second deceleration section, because that section covers an area 50% wider, resulting in similar curves.

Curve generation will also create a save link to come back to your work, and forum code to post the results, as will viewing of xim-pasted curves.  Following either method, if you want to add images of the graphs to the forum code, you can do so by clicking the button at the bottom of the page.  This takes some time, wait until it automatically selects the text to let you know it is complete.

I make no promises about what might happen if you enter weird things (incorrect parameters, points out of order or out of bounds or not reaching the end, etc).  Suggestions on what to work on next or bug reports are welcome.
« Last Edit: 01:48 PM - 02/27/14 by MuKen »

Offline roads

  • MVP
  • *
  • Posts: 19556
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #1 on: 02:00 PM - 02/27/14 »
Very nice Muken much easier to generate a curve than on the Andoid app. There is one problem though, you cant edit points in the Androids browser. This would be very convenient to draw the curve and copy/paste it in the XIM App. At least as long as Obsiv does not make the apps ballistic usable.

Edit: Sorry it is very well possible to edit the curve on the Android device! Its not Bezier but this would be totally enough in the XIM app. The thing is just you can not set several points but only one. The vertical point under your finger should be changed. Like you set the curve by pointing along it. Oh thatís the "insert" :D
You cant set it on the Android cellular the screen is not distinguishing points well enough.
« Last Edit: 02:10 PM - 02/27/14 by roads »
Crusade atm: none

Offline roads

  • MVP
  • *
  • Posts: 19556
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #2 on: 02:14 PM - 02/27/14 »
Also in insert mode you cant go back after you have set a point. I cant seem to set each point some are not reacting.
Crusade atm: none

Offline MuKen

  • Member
  • *
  • Posts: 173
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #3 on: 02:24 PM - 02/27/14 »
Thanks for the feedback, I've added a "delete" mode for removing points.  Clicking an area will delete the segment nearest where you click (in other words the "point" to the right of it).

Can you give me a little more detail on where the point sets are not reacting?  (i.e. insert vs curve, where you're clicking, what the code looks like before and after, etc)

Offline BionicTbag

  • MVP
  • *
  • Posts: 2609
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #4 on: 02:33 PM - 02/27/14 »
i think it needs some work.. but good work so far.


many curves I have seen so far take the raw values 1-20 and the first 3-4 values will go directly up the far left side.


so far in your editor I do not know how ot, or you cannot do this.


also, care to elaborate on the other values besides "linear" we can use ?


you cannot create this:


« Last Edit: 02:41 PM - 02/27/14 by BionicTbag »
sorry but its time to leave.... goodbye all!

Offline roads

  • MVP
  • *
  • Posts: 19556
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #5 on: 02:34 PM - 02/27/14 »
I will try to give you more details but after setting the curve wrong with insert very few points react, a delete should not be necessary if re-setting points.
Crusade atm: none

Offline roads

  • MVP
  • *
  • Posts: 19556
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #6 on: 02:37 PM - 02/27/14 »
Best would maybe be if we could set by insert and a curve button would smooth out and correct points that strafe out.
Crusade atm: none

Offline BionicTbag

  • MVP
  • *
  • Posts: 2609
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #7 on: 02:44 PM - 02/27/14 »
i think it needs some work.. but good work so far.


many curves I have seen so far take the raw values 1-20 and the first 3-4 values will go directly up the far left side.


so far in your editor I do not know how ot, or you cannot do this.


also, care to elaborate on the other values besides "linear" we can use ?


you cannot create this:





I think it because you have pre-determined our "x" value and are only allowing for the raw values to alter the "Y" value...it requires us the ability to set both x and y values to be ale to move points along the left side....
sorry but its time to leave.... goodbye all!

Offline MuKen

  • Member
  • *
  • Posts: 173
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #8 on: 02:51 PM - 02/27/14 »
I will try to give you more details but after setting the curve wrong with insert very few points react, a delete should not be necessary if re-setting points.

There's now a "move" mode for moving points around, try that out and tell me if it's what you were looking for.

you cannot create this:




For the time being you can't do things like that with the visual mode, I will look into it soon.  In the meantime, you can do it by manually changing the code values in the codebox to the left to something like this:

Code: [Select]
0 0.2 linear
0.8 1 linear
1 1 linear

Offline roads

  • MVP
  • *
  • Posts: 19556
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #9 on: 02:53 PM - 02/27/14 »
will try tomorrow dead tired, can you add a dropdown with yours from the other threads?
Crusade atm: none

Offline MuKen

  • Member
  • *
  • Posts: 173
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #10 on: 03:05 PM - 02/27/14 »
Sure thing.  What do you mean by a dropdown?

Offline roads

  • MVP
  • *
  • Posts: 19556
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #11 on: 10:48 PM - 02/27/14 »
Oh a dropdown in UI programming language is a box you click on and several choices drop down in a list. It doesnít take up much space but gives all choices.

The visual mode is the interesting part or you can simply go to the Android XIM app and be tortured by the input method there. That Highcharts thing is not working. With whatever method it does not do what you intend to do. You cant move the points or draw a graph as you desire.
Crusade atm: none

Offline MuKen

  • Member
  • *
  • Posts: 173
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #12 on: 10:55 PM - 02/27/14 »
I think I'm not understanding what you're asking for exactly, do you not see a dropdown as it is now?  Maybe it has something to do with the platform, what are you running the page on?  It should be a dropdown right now of insert, move, delete, and curve.

Offline roads

  • MVP
  • *
  • Posts: 19556
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #13 on: 11:03 PM - 02/27/14 »
Yes that one is visible. I was speaking of a dropdown with your premade curves, a small library to start from if you want. But first of all visual editing the curve is not possible right now.
Crusade atm: none

Offline roads

  • MVP
  • *
  • Posts: 19556
    • View Profile
Re: Online editor and viewer for ballistics curves
« Reply #14 on: 11:07 PM - 02/27/14 »
Tried move again and it works better now. Did you do something? Problem is only there are sometimes more than one point moved straighting out the line. I would remove everything except move.
Crusade atm: none