yes, basically, the method you're looking for (for the particles) would be basic interpolation. First, you establish a number to represent the particle density, how far away each trail particle should be from another. You can then use this number in coordination with the delta XYZ of the missile, and with some simple division, you can get solid interpolation. I'd write out the math for you, but that takes the fun out of programming (and you'll learn nothing being spoon-fed algorithms)
In reference to the EntityDistance calls, it's not very laggy, it's just a simple math function. However, people often make the mistake of using this for AI. For example, say there are 10000 enemy AI's, and one good guy AI. You want to make the good guy AI locate which enemy is closest, and attack it. You just ran your head into a concrete wall yesterday, so you decide to call EntityDistance on each enemy AI in reference to the good guy AI. You run it up to find that you're getting 2 frames per second, because, alas, you're performing:
sqr((x-x1)^2 + (y-y1)^2 + (z-z1)^2)
10,000 times per frame
If you must use this command in large amounts, it's much more efficient to do a two dimensional distance function:
sqr((x-x1)^2 + (y-y1)^2)
In reference to the EntityDistance calls, it's not very laggy, it's just a simple math function. However, people often make the mistake of using this for AI. For example, say there are 10000 enemy AI's, and one good guy AI. You want to make the good guy AI locate which enemy is closest, and attack it. You just ran your head into a concrete wall yesterday, so you decide to call EntityDistance on each enemy AI in reference to the good guy AI. You run it up to find that you're getting 2 frames per second, because, alas, you're performing:
sqr((x-x1)^2 + (y-y1)^2 + (z-z1)^2)
10,000 times per frame
If you must use this command in large amounts, it's much more efficient to do a two dimensional distance function:
sqr((x-x1)^2 + (y-y1)^2)