Index: code/branches/AI_HS15/src/orxonox/controllers/CommonController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/CommonController.cc	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/controllers/CommonController.cc	(revision 10725)
@@ -51,5 +51,4 @@
 
         RegisterObject(CommonController);
-
         //this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&LeaderController::action, this)));
     }
@@ -60,4 +59,36 @@
     }
 
+    void CommonController::moveToPosition(const Vector3& target)
+    {
+        if (!this->getControllableEntity())
+            return;
+
+        Vector2 coord = get2DViewCoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+        float distance = (target - this->getControllableEntity()->getPosition()).length();
+        float rotateX = clamp(coord.x * 10, -1.0f, 1.0f);
+        float rotateY = clamp(coord.y * 10, -1.0f, 1.0f);
+
+        
+        if (this->target_ || distance > 10)
+        {
+            this->getControllableEntity()->rotateYaw(-1.0f * 0.8f * rotateX);
+            this->getControllableEntity()->rotatePitch(0.8f * rotateY);
+        }
+
+        if (this->target_ && distance <  200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+        {
+            this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
+        } 
+        else if (distance > 100)
+            this->getControllableEntity()->moveFrontBack(0.8f);
+        
+
+
+        if (distance < 100)
+        {
+            this->positionReached();
+            bHasTargetOrientation_=false;
+        }
+    }
  
 
Index: code/branches/AI_HS15/src/orxonox/controllers/CommonController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/CommonController.h	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/controllers/CommonController.h	(revision 10725)
@@ -39,5 +39,10 @@
     {
         public:
-           
+            enum FormationMode {VEE,FINGER4,DIAMOND, WALL};
+            virtual void setFormationMode(FormationMode val)
+                { this->formationMode_ = val; }
+            inline FormationMode getFormationMode() const
+                { return this->formationMode_; }
+
             CommonController(Context* context);
             virtual ~CommonController();
@@ -45,9 +50,44 @@
             virtual bool setWingman(CommonController* wingman);
             virtual bool hasWingman();
-            CommonController* myWingman_;
+            Vector3* desiredRelativePosition_;
 
-            CommonController* myLeader_;
 
         protected:
+            void moveToPosition(const Vector3& target);
+            virtual void positionReached() {}
+
+        /*    void moveToTargetPosition();
+            void absoluteMoveToPosition(const Vector3& target);
+            void copyOrientation(const Quaternion& orient);
+            void copyTargetOrientation();
+
+            void spin();
+            void turn180();
+            void follow();
+            void setTargetPosition(const Vector3& target);
+
+            void setTargetOrientation(const Quaternion& orient);
+            void setTargetOrientation(Pawn* target);
+
+
+
+            void setTarget(Pawn* target);
+
+            void searchNewTarget();
+            void forgetTarget();
+
+            void targetDied();
+*/
+            bool bHasTargetPosition_;
+            Vector3 targetPosition_;
+            bool bHasTargetOrientation_;
+            Quaternion targetOrientation_;
+
+            WeakPtr<ControllableEntity> target_;
+            bool bShooting_;
+
+            FormationMode formationMode_;
+
+
 
             //void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot.    
Index: code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc	(revision 10725)
@@ -34,25 +34,33 @@
 
     RegisterClass(DivisionController);
+    static const float ACTION_INTERVAL = 1.0f;
 
     DivisionController::DivisionController(Context* context) : LeaderController(context)
     {
         RegisterObject(DivisionController);
+        this->setFormationMode(WALL);
+
         bIsDivisionLeader_ = true;
+        this->myFollower_ = 0;
+        this->myWingman_ = 0;
+        this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&DivisionController::action, this)));
+
     }
 
     DivisionController::~DivisionController()
     {
-        if (this->isInitialized())
-        {
-            if (this->myFollower_)
-                this->myFollower_->myDivisionLeader_ = 0;
-            if (this->myWingman_)
-                this->myWingman_->myLeader_ = 0;
-        }
-    } void DivisionController::tick(float dt)
+      
+    } 
+    void DivisionController::tick(float dt)
     {
         SUPER(DivisionController, tick, dt);
 
     }
+    void DivisionController::action()
+    {
+/*        setDesiredPositionOfFollower();
+        setDesiredPositionOfWingman();*/
+    }
+
     bool DivisionController::setFollower(LeaderController* myFollower)
     {
@@ -67,4 +75,57 @@
         }
     }
+
+   /* void DivisionController::setDesiredPositionOfWingman()
+    {
+        if (!this->myWingman_)
+            return;
+
+        switch (this->formationMode_){
+            case WALL:
+            {
+                myWingman_->desiredRelativePosition_ = new Vector3 (200, 0, 0);   
+                break;
+            }
+            case FINGER4: 
+            {
+                break;
+            }
+            case VEE: 
+            {
+                break;
+            }
+            case DIAMOND: 
+            {
+                break;
+            }
+        }
+       
+    }
+    void DivisionController::setDesiredPositionOfFollower()
+    {
+        if (!this->myFollower_)
+            return;
+
+        switch (this->formationMode_){
+            case WALL:
+            {
+                myWingman_->desiredRelativePosition_ = new Vector3 (-200, 0, 0);   
+                break;
+            }
+            case FINGER4: 
+            {
+                break;
+            }
+            case VEE: 
+            {
+                break;
+            }
+            case DIAMOND: 
+            {
+                break;
+            }
+        }
+       
+    }*/
     void DivisionController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
Index: code/branches/AI_HS15/src/orxonox/controllers/DivisionController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/DivisionController.h	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/controllers/DivisionController.h	(revision 10725)
@@ -48,8 +48,6 @@
 
         	//Using british military aircraft formations
-        	enum FormationMode {VEE,FINGER4,DIAMOND, WALL};
-        	void setFormationMode(FormationMode val);
-     		inline FormationMode getFormationMode() const
-           		{ return this->formationMode_; }
+        	
+     		
 			virtual bool setFollower(LeaderController* myFollower);
 			virtual bool setWingman(CommonController* wingman)
@@ -85,12 +83,10 @@
 
         protected:
+            void setDesiredPositionOfWingman();
+            void setDesiredPositionOfFollower();
+            virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
 
 	     	//Target enemy, set by fleet controller.
-	        WeakPtr<Pawn> target_;
-	        bool bHasTargetPosition_;
-			Vector3 targetPosition_;
-			bool bHasTargetOrientation_;
-			Quaternion targetOrientation_;
-			FormationMode formationMode_;
+	        
 			
 			
@@ -99,4 +95,6 @@
 	    
         private:
+            Timer actionTimer_; //<! Regularly calls action().
+
     };
 }
Index: code/branches/AI_HS15/src/orxonox/controllers/LeaderController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/LeaderController.h	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/controllers/LeaderController.h	(revision 10725)
@@ -63,6 +63,8 @@
                 return true;
             };
-            LeaderController* myFollower_;
-            LeaderController* myDivisionLeader_;
+            WeakPtr<CommonController> myWingman_;
+
+            WeakPtr<LeaderController> myFollower_;
+            WeakPtr<LeaderController> myDivisionLeader_;
 
 
@@ -75,5 +77,4 @@
         private:
             
-            WeakPtr<Pawn> target_;
             
             
Index: code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc	(revision 10725)
@@ -38,7 +38,13 @@
     {
         RegisterObject(SectionController);
+                this->setFormationMode(WALL);
+
         bIsDivisionLeader_ = false;
         this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&SectionController::action, this)));
-
+        this->myWingman_ = 0;
+        this->myDivisionLeader_ = 0;
+        this->desiredRelativePosition_ = 0;
+
+        orxout(internal_error) << this << "Was created" << endl;
 
     }
@@ -46,13 +52,33 @@
     SectionController::~SectionController()
     {
-        if (this->isInitialized())
-        {
-            if (this->myDivisionLeader_)
-                this->myDivisionLeader_->myFollower_ = 0;
-            if(this->myWingman_)
-                this->myWingman_->myLeader_ = 0;
-        }
-    }
-   
+       
+    }
+    /*void SectionController::setDesiredPositionOfWingman()
+    {
+        if (!this->myWingman_)
+            return;
+
+        switch (this->formationMode_){
+            case WALL:
+            {
+                myWingman_->desiredRelativePosition_ = new Vector3 (-200, 0, 0);   
+                break;
+            }
+            case FINGER4: 
+            {
+                break;
+            }
+            case VEE: 
+            {
+                break;
+            }
+            case DIAMOND: 
+            {
+                break;
+            }
+        }
+       
+    }
+*/
     LeaderController* SectionController::findNewDivisionLeader()
     {
@@ -112,10 +138,10 @@
             LeaderController* newDivisionLeader = findNewDivisionLeader();
             this->myDivisionLeader_ = newDivisionLeader;
-            /*if (newDivisionLeader)
+            if (newDivisionLeader)
                 orxout(internal_error) << "new DivisionLeader set" << endl;
-            else
-                orxout(internal_error) << "0 division leader" << endl;*/
-        }
-    }
+
+        }
+/*        setDesiredPositionOfWingman();
+*/    }
     /*
     Wingmen and Leaders attack target_, which is a member variable of their classes.
@@ -132,31 +158,32 @@
 
     */
+   /* void SectionController::keepDivisionTick()
+    {
+
+
+        if (this->myDivisionLeader_ && this->myDivisionLeader_->getControllableEntity() && desiredRelativePosition_)
+        {
+
+            Vector3 desiredAbsolutePosition = ((this->myDivisionLeader_->getControllableEntity()->getWorldPosition()) + 
+                (this->myDivisionLeader_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_)));
+            this->moveToPosition (desiredAbsolutePosition);
+        }
+    }*/
     void SectionController::tick(float dt)
-    {/*
+    {
+        
+
+       /* 
         if (!this->isActive())
             return;
         
         //--------------------------Stay in division--------------------------
-        this->keepDivisionTick();*/
-        /*keepDivisionTick(){
-            if (this->divisionLeader_ && this->divisionLeader_->getControllableEntity() && desiredRelativePosition_){
-                Vector3 desiredAbsolutePosition = ((this->divisionLeader_->getControllableEntity()->getWorldPosition()) + 
-                    (this->divisionLeader_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_)));
-                this->moveToPosition (desiredAbsolutePosition);
-            }
-        }
+        this->keepDivisionTick();
         */
-        /*//If ordered to attack -> follow target and shoot
-        if (this->bAttackOrder_)
-        {
- 
-        } 
         //If ordered to move -> move to a target Point
         
         //No orders -> Don't move, but shoot at whatever is close, unless Boss is shooting at it. 
         //(Section shoots same target, Boss's section shoots another target) 
-        {
-
-        }*/
+        
 
         //orxout(internal_error) << "my Wingman is " << this->myWingman_ << endl;
Index: code/branches/AI_HS15/src/orxonox/controllers/SectionController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/SectionController.h	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/controllers/SectionController.h	(revision 10725)
@@ -53,5 +53,6 @@
                     return false;
                 }
-            };
+            }
+
             virtual bool hasWingman()
             {
@@ -68,5 +69,6 @@
 
         protected:
-
+            void setDesiredPositionOfWingman();
+            void keepDivisionTick();
             //A division is the biggest block of spaceships.
             //In division one section is leading, the other one always stays on the same position
@@ -83,5 +85,4 @@
             Timer actionTimer_; //<! Regularly calls action().
             
-            Vector3* desiredRelativePosition_;
 
     };
Index: code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc	(revision 10725)
@@ -40,10 +40,11 @@
         RegisterObject(WingmanController);
         this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&WingmanController::action, this)));
+        this->myLeader_ = 0;
+        this->desiredRelativePosition_ = 0;
     }
 
     WingmanController::~WingmanController()
     {
-        if (this->myLeader_)
-            this->myLeader_->myWingman_ = 0;
+
     }
 
@@ -69,8 +70,4 @@
                 continue;
 
-
-
-          
-
             float distance = (it->getControllableEntity()->getPosition() - this->getControllableEntity()->getPosition()).length();
             if (distance < minDistance && !(it->hasWingman()))
@@ -79,11 +76,5 @@
                 minDistance = distance;
             }
-            /*// is pawn in range?
-            if (distance < RADIUS_TO_SEARCH_FOR_LEADER)
-            {
-
-                if (it->setWingman(this))
-                    return *it;
-            }*/
+           
         }
         if (closestLeader)
@@ -110,6 +101,4 @@
         else
         {
-
-            //orxout(internal_error) << "already have a Leader" << endl;
 
         }
@@ -155,61 +144,38 @@
             }*/
 
-      /*  void FormationController::setDesiredPositionOfSlaves()
+     
+    /*void WingmanController::keepSectionTick()
     {
-        if (this->state_ != MASTER)
-            return;
-        switch (this->formationMode_){
-            case ATTACK:
-            {
-                float i = 0;
-                for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
-                {
-                    (*it)->desiredRelativePosition_ = new Vector3 ((i-slaves_.size()/2)*200, 0, 0);
-                    i++;
-                }
-                break;
-            }
-            case NORMAL: 
-            {
-                break;
-            }
-            case DEFEND: 
-            {
-                break;
-            }
+        if (this->myLeader_ && this->myLeader_->getControllableEntity())
+                            //orxout(internal_error) << "MOVING" << endl;
+
+        if (this->myLeader_ && this->myLeader_->getControllableEntity() && desiredRelativePosition_)
+        {
+            Vector3 desiredAbsolutePosition = ((this->myLeader_->getControllableEntity()->getWorldPosition()) + 
+                (this->myLeader_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_)));
+            this->moveToPosition (desiredAbsolutePosition);
         }
-       
     }*/
     void WingmanController::tick(float dt)
     {   
-        //-------------------------------------------------------
+       /* //-------------------------------------------------------
            
-        /*
+        
         if (!this->isActive())
             return;
         //--------------------------Stay in formation--------------------------
-        if (bFollowLeader_)
+        this->keepSectionTick();*/
+            
+        
+        //--------------------------Attack same target as the Leader--------------------------
+
+        /*if (this->target_)
         {
-            this->keepSectionTick();
-            
-            keepSectionTick(){
-                if (this->sectionLeader_ && this->sectionLeader_->getControllableEntity() && desiredRelativePosition_){
-                    Vector3 desiredAbsolutePosition = ((this->sectionLeader_->getControllableEntity()->getWorldPosition()) + 
-                        (this->sectionLeader_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_)));
-                    this->moveToPosition (desiredAbsolutePosition);
-                }
-            }
-            
-            
-            //--------------------------Attack same target as the Leader--------------------------
-
-            if (this->target_)
-            {
-                this->aimAtTarget();
-                this->doFire();
-            }
+            this->aimAtTarget();
+            this->doFire();
         }
-        */
-         //orxout(internal_error) << "I am " << this << endl;
+*/
+        
+        //orxout(internal_error) << "I am " << this << endl;
 
         
Index: code/branches/AI_HS15/src/orxonox/controllers/WingmanController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/WingmanController.h	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/controllers/WingmanController.h	(revision 10725)
@@ -57,4 +57,5 @@
 
         protected:
+            WeakPtr<CommonController> myLeader_;
 
             virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
@@ -65,6 +66,6 @@
         private:
             //const float ACTION_INTERVAL;
-            
-            WeakPtr<Pawn> target_;
+            void keepSectionTick();
+
             //LeaderController* leader_;
 
Index: code/branches/AI_HS15/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/worldentities/pawns/Pawn.cc	(revision 10722)
+++ code/branches/AI_HS15/src/orxonox/worldentities/pawns/Pawn.cc	(revision 10725)
@@ -320,5 +320,4 @@
     }
 
-
     void Pawn::death()
     {
