Index: code/branches/campaignHS15/data/levels/AITest.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10952)
+++ code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10953)
@@ -38,5 +38,10 @@
     <TeamSpawnPoint team=0 position="2000, 2000, 2000" lookat="1,1,-1" spawnclass=SpaceShip pawndesign=spaceshipassff />
        
-    
+    <Pawn position = "100000, 100000, 100000">
+      <controller>
+        <MasterController>
+        </MasterController>
+      </controller>
+    </Pawn>
 <!--     
     <PickupSpawner pickup=largedamageboostpickup position="0,0,0" triggerDistance="20" respawnTime="30" maxSpawnedItems="10" />
Index: code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw	(revision 10952)
+++ code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw	(revision 10953)
@@ -1026,5 +1026,11 @@
     </Pawn>
     <!--SHIPS -->
-
+    <!-- one Controller to rule them all -->
+    <Pawn position = "100000, 100000, 100000">
+      <controller>
+        <MasterController>
+        </MasterController>
+      </controller>
+    </Pawn>
     <!--Allied units-->
 
Index: code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10953)
@@ -32,5 +32,4 @@
 #include <algorithm>
 #include "worldentities/Actionpoint.h"
-
 namespace orxonox
 {
@@ -40,7 +39,4 @@
     ActionpointController::ActionpointController(Context* context) : FightingController(context)
     {
-        this->actionpointControllerId_ = 0;
-        ActionpointController::sTicks_ = 0;
-        ActionpointController::nextActionpointControllerId_ = 0;
         this->ticks_ = 0;
         this->bPatrolling_ = false;
@@ -75,5 +71,4 @@
         parsedActionpoints_.clear();
         actionpoints_.clear();
-        this->actionpointControllerId_ = 0;
 
     }
@@ -82,19 +77,8 @@
         if (!this || !this->getControllableEntity() || !this->isActive() || this->stop_)
             return;
+
         ++this->ticks_;
-        // orxout (internal_error) << "this id = " << this->actionpointControllerId_ << endl;
-        if (ActionpointController::sTicks_ < this->ticks_)
-        {
-            // orxout (internal_error) << "total id's = " << ActionpointController::nextActionpointControllerId_ << endl;
-            ++ActionpointController::sTicks_;
-        }
-
-        if (!this || !this->getControllableEntity())
-            return;
-
-        if (ActionpointController::sTicks_ == 1)
-        {
-
-            this->actionpointControllerId_ = ActionpointController::nextActionpointControllerId_++;
+        if (this->ticks_ == 1)
+        {
             std::reverse(parsedActionpoints_.begin(), parsedActionpoints_.end());
             std::reverse(actionpoints_.begin(), actionpoints_.end());
@@ -103,5 +87,4 @@
                 this->action_ = Action::FIGHTALL;
             }
-            //orxout (internal_error) << "first tick was called by id = " << this->actionpointControllerId_ << ", total = " << ActionpointController::nextActionpointControllerId_ << endl;
         }
 
@@ -113,6 +96,4 @@
             this->moveToTargetPosition(dt);
         }
-        if (!this || !this->getControllableEntity())
-            return;
         else if (this->bLookAtTarget_)
         {
@@ -125,20 +106,16 @@
 
         if (timeout_ <= 0)
+        {    
             this->bFiredRocket_ = false;
-        
-
-        if (!this || !this->getControllableEntity())
-            return;
-        if (this->timeout_ > 0 && this->bFiredRocket_)
+        }
+        else if (this->bFiredRocket_)
         {
             --this->timeout_;
         }
-   
-
-        if (!this || !this->getControllableEntity())
-            return;
-        //maneuver every 0.25 sec -> 
-        int step =  4;
-        if (ActionpointController::sTicks_ % 100 <= 10)
+
+        if (!this || !this->getControllableEntity())
+            return;
+
+        if (this->ticks_ % 80 <= 10)
         {
             this->bDodge_ = false;
@@ -148,42 +125,12 @@
             this->bDodge_ = true;
         }
-        if (!this || !this->getControllableEntity())
-            return;
-        if (ActionpointController::sTicks_ % 100 == step * this->actionpointControllerId_ + 1)
-        {
-            //orxout (internal_error) << "Team " << this->getControllableEntity()->getTeam() << (this->hasTarget() ? ", got " : ", don't have") << " target" << endl;
-            this->action();
-        }
-
-
-        if (!this || !this->getControllableEntity())
-            return;
-       /* orxout (internal_error) << "id = " << this->actionpointControllerId_ << ", in total # ids = " << ActionpointController::nextActionpointControllerId_ 
-        << ", I " << (this->hasTarget() ? "have" : "don't have") << " a target, my team is " << this->getControllableEntity()->getTeam() << endl;
-       */ if (this->hasTarget() &&  ActionpointController::sTicks_ % (ActionpointController::nextActionpointControllerId_ + 1) == (this->actionpointControllerId_))
-        {
-
-         
-            if (!this || !this->getControllableEntity())
-                return;
-            this->maneuver();
-            if (!this || !this->getControllableEntity())
-                return;
-            this->bShooting_ = this->canFire();
-
-            if (!this || !this->getControllableEntity())
-                return;
-
-            if (this->bShooting_)
-            {
-                this->doFire();
-            }
-            if (!this || !this->getControllableEntity())
-                return;
-            this->deltaHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth() - this->previousHp;
-            this->previousHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth();
-        }
-        
-
+
+        if (!this || !this->getControllableEntity())
+            return;
+     
+        if (this->bShooting_)
+        {
+            this->doFire();
+        }
         SUPER(ActionpointController, tick, dt);
     }
@@ -193,7 +140,9 @@
     void ActionpointController::action()
     {
-        if (!this || !this->getControllableEntity())
-            return;
-
+        if (!this || !this->getControllableEntity() || !this->isActive())
+            return;
+
+        this->deltaHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth() - this->previousHp;
+        this->previousHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth();
         if (this->bDefaultPatrol_ || (this->action_ != Action::FLY && this->action_ != Action::NONE))
         {
@@ -798,5 +747,3 @@
         }
     }
-    unsigned int ActionpointController::nextActionpointControllerId_ = 0;
-    unsigned int ActionpointController::sTicks_ = 0;
 }   
Index: code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.h	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.h	(revision 10953)
@@ -35,4 +35,6 @@
 #include "../modules/pickup/PickupSpawner.h"
 #include <map>
+
+#include <boost/shared_ptr.hpp>
 
 
@@ -246,9 +248,6 @@
                 bool bDefaultPatrol_;
                 bool stop_;
-                static unsigned int sTicks_;    //<! a hack? I don't want action() and maneuver() to be called multiple times in a tick, so I keep
-                                                //<! track of ticks and if current tick is "assigned" to this object, than I call maneuver()/action()
-                static unsigned int nextActionpointControllerId_;    //<! if level has 16 ActionpointControllers, than this variable equals to 17 after first tick 
-                unsigned int actionpointControllerId_;   //<! integer from 0 to nextActionpointControllerId_, different for every ActionpointController in level
                 unsigned int ticks_;     //<! local tick counter            
+
     };
 }
Index: code/branches/campaignHS15/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/CMakeLists.txt	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/CMakeLists.txt	(revision 10953)
@@ -18,3 +18,4 @@
   FlyingController.cc
   FightingController.cc
+  MasterController.cc
 )
Index: code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc	(revision 10953)
@@ -40,5 +40,4 @@
 
     RegisterClass(CommonController);
-
     CommonController::CommonController(Context* context): Controller(context)
     {
@@ -93,4 +92,6 @@
         if (controller)
         {
+            if (controller->getIdentifier()->getName() == "MasterController")
+                return true;
             CommonController* ac = orxonox_cast<CommonController*>(controller);
             if (ac)
@@ -104,4 +105,6 @@
         if (controller)
         {
+            if (controller->getIdentifier()->getName() == "MasterController")
+                return true;
             CommonController* ac = orxonox_cast<CommonController*>(controller);
             if (ac)
Index: code/branches/campaignHS15/src/orxonox/controllers/CommonController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/CommonController.h	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/CommonController.h	(revision 10953)
@@ -49,5 +49,5 @@
             CommonController(Context* context);
             virtual ~CommonController();
-
+            virtual void action(){}; //<! action() is called in regular intervals managing the bot's behaviour.
             static float randomInRange(float a, float b);
             static float distance(const ControllableEntity* entity1, const ControllableEntity* entity2);
Index: code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc	(revision 10953)
@@ -65,4 +65,5 @@
         if (!this->isActive())
             return;   
+        
         SUPER(DivisionController, tick, dt);
         
Index: code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10953)
@@ -143,5 +143,5 @@
         else
         {   
-            bool bTargetIsLookingAtThis = CommonController::isLooking (this->target_, this->getControllableEntity(), math::pi/10.0f)
+            bool bTargetIsLookingAtThis = CommonController::isLooking (this->target_, this->getControllableEntity(), math::pi/20.0f)
                 || this->deltaHp < 0;
             this->bKeepFormation_ = false;
@@ -220,5 +220,5 @@
         }
 
-        return squaredDistanceToTarget() < this->attackRange_*this->attackRange_ && this->isLookingAtTarget(math::pi / 10.0f);
+        return squaredDistanceToTarget() < this->attackRange_*this->attackRange_ && this->isLookingAtTarget(math::pi / 20.0f);
     }
 
Index: code/branches/campaignHS15/src/orxonox/controllers/FightingController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FightingController.h	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/FightingController.h	(revision 10953)
@@ -55,5 +55,9 @@
                 { return this->target_; }
             bool bKeepFormation_;   //even if action_ == FIGHT, you might still want to keep formation if far enough form the target
-           
+            virtual 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_.
+            bool bShooting_;
+            bool canFire(); //<! check if target_ is in radius and if this is looking at target_
+
         protected:
             void setTarget(ControllableEntity* target); //set a target to shoot at
@@ -65,11 +69,8 @@
             void lookAtTarget(float dt);    //<! rotate yourself towards target
 
-            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, 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.
             void dodgeTowards (Vector3& position);  //fly towards position and awoid being hit
-            bool canFire(); //<! check if target_ is in radius and if this is looking at target_
             void doFire();  //<! choose weapon, set aim at target_ and fire
             WeakPtr<ControllableEntity> target_;
@@ -84,5 +85,4 @@
             bool bDodge_;
             int attackRange_;
-            bool bShooting_;
             bool bLookAtTarget_; 
             float deltaHp;
Index: code/branches/campaignHS15/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FormationController.cc	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/FormationController.cc	(revision 10953)
@@ -970,4 +970,6 @@
         if (controller)
         {
+            if (controller->getIdentifier()->getName() == "MasterController")
+                return true;
             FormationController* ac = orxonox_cast<FormationController*>(controller);
             if (ac)
@@ -981,4 +983,6 @@
         if (controller)
         {
+            if (controller->getIdentifier()->getName() == "MasterController")
+                return true;
             FormationController* ac = orxonox_cast<FormationController*>(controller);
             if (ac)
Index: code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10952)
+++ code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10953)
@@ -95,8 +95,5 @@
         if (!this->myLeader_)
         {
-           ActionpointController::action();
-            if (!this || !this->getControllableEntity())
-                return;
-
+            ActionpointController::action();
         }
         else if (this->myLeader_)
