Index: code/branches/campaignHS15/data/levels/AITest.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10904)
+++ code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10906)
@@ -157,5 +157,5 @@
 <!-- HERE STARTS DEMO FOR FIGHTING -->
     
-
+<!-- 
     <SpaceShip position="-4000, 1500, -1000" lookat="0,0,0" team=0 name="d1sd1">
       <templates>
@@ -195,4 +195,41 @@
       </controller>
     </SpaceShip>
+    <SpaceShip position="-5000, 1500, -1000" lookat="0,0,0" team=0 name="d1s1d1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=0 formationMode="WALL">
+
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-5000, 1900, -1000" lookat="0,0,0" team=0 name="d1s1s1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <SectionController team=0>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-5000, 2100, -1000" lookat="0,0,0" team=0 name="d1s1w1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-5000, 2400, -1000" lookat="0,0,0" team=0 name="d1s1w2">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
 
     <SpaceShip position="2000, -1500, 1000" lookat="0,0,0" team=1  name="d2sd1">
@@ -225,4 +262,41 @@
     </SpaceShip>
     <SpaceShip position="2000, -2400, 1000" lookat="0,0,0" team=1 name="d2sw2">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=1>
+        </WingmanController>
+      </controller>
+    </SpaceShip> 
+    <SpaceShip position="1000, -1500, 1000" lookat="0,0,0" team=1  name="d2s1d1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=1 formationMode="WALL">
+
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="1000, -1900, 1000" lookat="0,0,0" team=1 name="d2s1s1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <SectionController team=1>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="1000, -2100, 1000" lookat="0,0,0" team=1 name="d2s1w1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=1>
+        </WingmanController>
+      </controller>
+    </SpaceShip> -->
+    <SpaceShip position="1000, -2400, 1000" lookat="0,0,0" team=1 name="d2s1w2">
       <templates>
         <Template link=spaceshipassff />
Index: code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw	(revision 10904)
+++ code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw	(revision 10906)
@@ -42,6 +42,6 @@
     <?lua
 
-        enemies = 4
-        allies = 4
+        enemies = 2
+        allies = 2
 
         radSector = 12000
Index: code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10904)
+++ code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10906)
@@ -53,5 +53,6 @@
         this->squaredaccuracy_ = 2500;
         this->bFirstTick_ = true;
-
+        this->bStartedDodging_ = false;
+        this->timeDodged_ = 0;
         RegisterObject(ActionpointController);
 
@@ -78,4 +79,16 @@
             this->timeout_ -= dt;
         }
+        if (this->bStartedDodging_)
+        {
+            this->timeDodged_ += dt;
+            if (this->timeDodged_ > 2.0f)
+            {
+                this->bStartedDodging_ = false;
+                this->timeDodged_ = 0;
+            }
+        }
+        maneuverCounter_ += dt;
+        if (maneuverCounter_ > 6.0f)
+            maneuverCounter_ = 0;
         if (timeout_ <= 0)
             this->bFiredRocket_ = false;
@@ -110,5 +123,10 @@
             this->bFirstTick_ = false;
         }
-
+        if (this->hasTarget())
+        {
+            this->maneuver();
+            if (static_cast<int>(this->maneuverCounter_*100) % 3 == 0)
+                this->bShooting_ = this->canFire();
+        }
         SUPER(ActionpointController, tick, dt);
     }
@@ -123,4 +141,5 @@
         this->deltaHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth() - this->previousHp;
         this->previousHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth();
+
         // if (this->actionCounter_ % 2 == 0)
         //No action -> pop one from stack
@@ -236,8 +255,5 @@
             }
         }
-        if (this->hasTarget())
-        {
-            this->maneuver();
-            this->bShooting_ = this->canFire();
+
             // Vector3 healthPosition = bestHealthPickup((this->target_->getWorldPosition() - this->getControllableEntity()->getWorldPosition()).length());
             // if ((this->getControllableEntity()->getWorldPosition() - healthPosition).length() < this->tolerance_)
@@ -252,5 +268,5 @@
             // //----fire if you can----
             // this->bShooting_ = this->canFire();  
-        }
+         
         this->actionCounter_ += this->actionCounter_ < 100000 ? 1 : -this->actionCounter_ ;
 
Index: code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10904)
+++ code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10906)
@@ -118,7 +118,5 @@
         if ( !this->target_ || !this->getControllableEntity())
             return;
-        maneuverCounter_++;
-        if (maneuverCounter_ > 5)
-            maneuverCounter_ = 0;
+
 
         Vector3 thisPosition = this->getControllableEntity()->getWorldPosition();
@@ -128,5 +126,5 @@
         float diffLength = diffVector.length();
         Vector3 diffUnit = diffVector/diffLength;
-        bool bTargetIsLookingAtThis = CommonController::isLooking (this->target_, this->getControllableEntity(), math::pi/15.0f)
+        bool bTargetIsLookingAtThis = CommonController::isLooking (this->target_, this->getControllableEntity(), math::pi/10.0f)
             || this->deltaHp < 0;
 
@@ -140,5 +138,40 @@
             this->setTargetPosition(this->positionOfTarget_ - diffUnit * 100.0f);
         }
-        //too close? How do u expect to dodge anything? Just attack!
+        else
+        {
+            this->bKeepFormation_ = false;
+            // if (this->actionCounter_ % 3 == 0)
+            if (maneuverCounter_ <= 1.2)
+            {
+                // orxout(internal_error) << "attacking" << endl;
+                this->setTargetPosition(this->positionOfTarget_ - diffUnit * 50.0f);   
+                return;
+            }
+            else if (bTargetIsLookingAtThis || diffLength < 700.0f)
+            {
+                // orxout(internal_error) << "dodging" << endl;
+                if (!this->bStartedDodging_)
+                {
+                    this->bStartedDodging_ = true;
+                    dodge(thisPosition, diffLength, diffUnit);        
+                }
+            }
+            else
+            {
+                if (diffLength < 1000)
+                {
+                // orxout(internal_error) << "looking" << endl;                    
+                    this->stopMoving();
+                    this->startLookingAtTarget();
+
+                }
+                else
+                {
+                // orxout(internal_error) << "closing up" << endl;                    
+                    this->setTargetPosition(this->positionOfTarget_ - diffUnit * 300.0f);
+                }
+            }
+        }
+        /*//too close? How do u expect to dodge anything? Just attack!
         else if (diffLength < 1000)
         {   
@@ -146,8 +179,9 @@
 
             //at this point, just look and shoot
-            if (diffLength < 500)
+            if (diffLength < 1000)
             {
                 this->stopMoving();
                 this->startLookingAtTarget();
+
             }
             else
@@ -160,5 +194,5 @@
         {
             this->bKeepFormation_ = false;
-            this->setTargetPosition(this->positionOfTarget_ - diffUnit * 300.0f);
+            this->setTargetPosition(this->positionOfTarget_ - diffUnit * 900.0f);
         }
         //That's unfortunate, he is looking and probably shooting... try to dodge what we can...  
@@ -168,10 +202,10 @@
             if (maneuverCounter_ == 0)
             {
-                this->setTargetPosition(this->positionOfTarget_ - diffUnit * 100.0f);   
+                this->setTargetPosition(this->positionOfTarget_ - diffUnit * 900.0f);   
                 return;
             }
             if (this->actionCounter_ % 3 == 0)
-                dodge(thisPosition, diffUnit);
-        }
+                dodge(thisPosition, diffLength, diffUnit);
+        }*/
     }
     void FightingController::dodgeTowards (Vector3& position)
@@ -200,12 +234,21 @@
         this->boostControl();
     }
-    void FightingController::dodge(const Vector3& thisPosition, Vector3& diffUnit)
+    void FightingController::dodge(const Vector3& thisPosition, float diffLength, Vector3& diffUnit)
     {
         //d.x*x + d.y*y + d.z*z == 0
         //z = 1/d.z * (-d.y*y - d.x * x)
-        float x = CommonController::randomInRange (100, 800) * (CommonController::randomInRange(0,1) <= 0.5 ? 1 : -1);
-        float y = CommonController::randomInRange (100, 800) * (CommonController::randomInRange(0,1) <= 0.5 ? 1 : -1);
+        float x = CommonController::randomInRange (300, 800) * (CommonController::randomInRange(0,1) <= 0.5 ? 1 : -1);
+        float y = CommonController::randomInRange (300, 800) * (CommonController::randomInRange(0,1) <= 0.5 ? 1 : -1);
         float z = diffUnit.z == 0 ? 0 : (1/diffUnit.z) * (-x * diffUnit.x - y * diffUnit.y);
-        this->setTargetPosition(thisPosition + Vector3(x,y,z) + (this->deltaHp < 0 ? -diffUnit * 450.0f : diffUnit * 100.0f));
+        if (diffLength < 150.0f)
+        {
+            this->setTargetPosition(this->positionOfTarget_ + Vector3(z,x,y));
+        }
+        else
+        {
+        this->setTargetPosition(thisPosition + Vector3(x,y,z) + (this->deltaHp < 0 ? -diffUnit * 450.0f : 
+            (diffLength < 700.0f ? -diffUnit*700.0f : diffUnit * 50.0f)));
+
+        }
         this->boostControl();
 
@@ -225,5 +268,5 @@
         }
 
-        return squaredDistanceToTarget() < this->attackRange_*this->attackRange_ && this->isLookingAtTarget(math::pi / 20.0f);
+        return squaredDistanceToTarget() < this->attackRange_*this->attackRange_ && this->isLookingAtTarget(math::pi / 10.0f);
     }
 
Index: code/branches/campaignHS15/src/orxonox/controllers/FightingController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FightingController.h	(revision 10904)
+++ code/branches/campaignHS15/src/orxonox/controllers/FightingController.h	(revision 10906)
@@ -67,5 +67,5 @@
             void maneuver(); //<! sets this->targetPosition_, which is a Vector3 of where this ship flies. Decision is made based on
                              //<! the distance to enemy, if being attacked, dodge() is called, otherwise ship just flies towards this->target_.
-            void dodge(const Vector3& thisPosition, Vector3& diffUnit); //<! choose a random Vector3 perpendicular to the difference vector between
+            void dodge(const Vector3& thisPosition, float diffLength,  Vector3& diffUnit); //<! choose a random Vector3 perpendicular to the difference vector between
                                                                         //<! this and target_ plus or minus some amount in difference vector direction,
                                                                         //<! depending on whether it is better to close up or survive.
@@ -84,8 +84,10 @@
             int attackRange_;
             bool bShooting_;
-            int maneuverCounter_;   
+            float maneuverCounter_;   
             bool bLookAtTarget_; 
             float deltaHp;
             float previousHp;
+            bool bStartedDodging_;
+            float timeDodged_;
             //WEAPONSYSTEM DATA
             int rocketsLeft_;
Index: code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10904)
+++ code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10906)
@@ -125,6 +125,6 @@
                 if (this->hasTarget())
                 {
-                    this->maneuver();
-                    this->bShooting_ = this->canFire();
+                    // this->maneuver();
+                    // this->bShooting_ = this->canFire();
                     // Vector3 healthPosition = bestHealthPickup((this->target_->getWorldPosition() - this->getControllableEntity()->getWorldPosition()).length());
                     // if ((this->getControllableEntity()->getWorldPosition() - healthPosition).length() < this->tolerance_)
Index: code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10904)
+++ code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10906)
@@ -112,6 +112,6 @@
                 if (this->hasTarget())
                 {
-                    this->maneuver();
-                    this->bShooting_ = this->canFire();
+                    // this->maneuver();
+                    // this->bShooting_ = this->canFire();
                     // Vector3 healthPosition = bestHealthPickup((this->target_->getWorldPosition() - this->getControllableEntity()->getWorldPosition()).length());
                     // if ((this->getControllableEntity()->getWorldPosition() - healthPosition).length() < this->tolerance_)
