   agent formations
  I haveabasic isometric nvironment with obstacles and the usual clutter, the user has a sprite which they move around with the mouse as you might expect and a selection of enemy agents/sprites or whateveryou fancy calling them attempt to intercept the user.  Pathfinding is achieved by means of the good ''ol A* algorithm.  My problem is thus, i don''t want my sprites to simply charge headlong towards the user.  At the moment they attempt to remain outside of the users line of sight (via s simple vector equation), however I want to keep them in a rough formation, in order to ensnare the user and later on to maximise fields of fire. Of course terrain ges in the way of formations, soi need to know how to get my spritestowanderaround things, thenreturn to a loose formation.  So far my only though is to give each agent a maximum distance value which they must endevour to stay within, in relation to the next sprite.  This however strikes me a something of a bug waiting to happen, so iwould be most gratefull for anyones input ona better means of achieving sprite formations.  Anyone decompiled age of empires recently?  
  There a a number of ways you could achieve this effect, depending on the formation desired.  If you aren''t looking for a strict formation (ie. wedge, line, etc) you can do a google on boids and flocking.  You could have a leader referenced formation, ie. all the other agents try to stay a given distance away from the leader, or have the formation be based on locality the locality of the neighbor  I would encourage you do google robot based formations for a wide variety of simple to complex schemes for inspiration.  Here is one result to get you started: http://www.daimi.au.dk/~chili/Formations/journalpaper.pdf  