Here is a set of flocking components for Delphi:
http://www.riversoftavg.com/flocking.htm
It is based on Steven Woodcock's article, "Flocking: A Simple Technique for Simulating Group Behavior," in "Game Programming Gems 1". It also adds formations - something for RTS people.

I found this while searching for information on formation making in RTS - I am trying to implement something similar to unit behaviour in Total War series, so far without much success

Oh, I did not notice that this link was already given.