Okay, so regarding this
What is your process of coming up with this kind of process?
Is it tacked on from all parts of Google, then painstakingly f5'd over and over until it has the desired effect or did you completely know what it's doing in the first place?
I just can't make sense of that.. :/
Well, I actually used the suggested sin(x) - sin(2.5x), believe it or not. XNA uses Math.Sin, and I needed to cast it to a float. The 0.8f is just a scaling factor (how big the steps are), which I got by messing around with.
I also wanted to scale the step size by how quickly the unit is moving, and it has to be in the correct direction anyway, which explains the velocity (which is a 2-D Vector) / maxSpeed factor.
I *also* wanted to scale the step *speed* by how fast the unit was moving, so that explains the scaling factor inside the Math.Sin of Utility.getMagnitude(velocity), which just returns the unit's speed, basically. The 0.075, when multiplied by the maximum velocity of 80, will return 6. The 0.1875, when multiplied by the maximum velocity of 80, will return 15. So, sin(6x) - sin(15x), which is an equivalent function to sin(x) - sin(2.5x), I just sped it up. Got the "6" factor from just messing around.
It looks complicated, it isn't. A real coder in a team environment would get shot for making something this unreadable, but I'm the only coder, so whatever. = D