Index: code/branches/AI_HS15/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/AIController.cc	(revision 10651)
+++ code/branches/AI_HS15/src/orxonox/controllers/AIController.cc	(revision 10652)
@@ -61,4 +61,8 @@
             if (this->formationFlight_)
             {
+                //When this is a master and was destroyed, destructor might complain that there are slaves of this, although this was removed from formation
+                //race conditions?
+                //destructor takes care of slaves anyway, so no need to worry about internal_error
+
 
                 //changed order -> searchNewMaster MUSTN'T be called in SLAVE-state (bugfix for internal-error messages at quit)
@@ -68,11 +72,14 @@
 
                 // return to Master after being forced free
-                if (this->freedomCount_ == 1)
+                if (this->freedomCount_ == ACTION_INTERVAL)
                 {
                     this->state_ = SLAVE;
-                    this->freedomCount_ = 0;
-                }
-            }
-
+                    this->freedomCount_ = 0; // ACTION_INTERVAL is 1 sec, freedomCount is a remaining time of temp. freedom
+                }
+            } else{
+                //form a formation 
+                if (!this->forcedFree())
+                    this->searchNewMaster();
+            }
             this->defaultBehaviour(maxrand);
 
@@ -82,21 +89,14 @@
         {
             // search enemy
-            random = rnd(maxrand);
-            if (random < (botlevel_*100) && (!this->target_))
+            if ((!this->target_))
                 this->searchNewTarget();
 
-            // next enemy
-            random = rnd(maxrand);
-            if (random < (botlevel_*30) && (this->target_))
-                this->searchNewTarget();
-
+            
             // shoot
-            random = rnd(maxrand);
-            if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_))
+            if ((this->target_ && !this->bShooting_))
                 this->bShooting_ = true;
 
             // stop shooting
-            random = rnd(maxrand);
-            if (random < (1-botlevel_)*50 && (this->bShooting_))
+            if (this->bShooting_ && !this->target_)
                 this->bShooting_ = false;
 
@@ -105,4 +105,7 @@
         if (this->state_ == MASTER)
         {
+
+            this->setFormationMode(ATTACK);
+            
             this->commandSlaves();
 
@@ -127,9 +130,11 @@
                    this->followRandomHumanInit();
 */
+               /*
                  // lose master status (only if less than 4 slaves in formation)
                 random = rnd(maxrand);
                 if(random < 15/(this->slaves_.size()+1) && this->slaves_.size() < 4 )
                    this->loseMasterState();
-
+                */
+               
                 // look out for outher masters if formation is small
                 random = rnd(maxrand);
@@ -149,5 +154,4 @@
         if (!this->isActive())
             return;
-
         float random;
         float maxrand = 100.0f / ACTION_INTERVAL;
@@ -189,7 +193,5 @@
                         {
                             this->aimAtTarget();
-                            random = rnd(maxrand);
-                            if(this->botlevel_*70 > random && !this->isCloseAtTarget(100))
-                                this->follow();  //If a bot is shooting a player, it shouldn't let him go away easily.
+                            this->follow();  //If a bot is shooting a player, it shouldn't let him go away easily.
                         }
                     }
@@ -252,82 +254,14 @@
         }//END_OF ROCKET MODE
 
+
         SUPER(AIController, tick, dt);
     }
 //**********************************************NEW
     void AIController::defaultBehaviour(float maxrand)
-    {      
-             if (!this->target_)
-                this->searchNewTarget();
-             if (!(this->passive_) && (this->target_ && !this->bShooting_))
-                    this->bShooting_ = true;
-            /*
-            float random;
-            // search enemy
-            random = rnd(maxrand);
-            if (random < (botlevel_* 100) && (!this->target_))
-                this->searchNewTarget();
-
-            // forget enemy
-            random = rnd(maxrand);
-            if (random < ((1-botlevel_)*20) && (this->target_))
-                this->forgetTarget();
-
-            // next enemy
-            random = rnd(maxrand);
-            if (random < (botlevel_*30) && (this->target_))
-                this->searchNewTarget();
-
-            // fly somewhere
-            random = rnd(maxrand);
-            if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
-                this->searchRandomTargetPosition();
-
-            // stop flying
-            random = rnd(maxrand);
-            if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
-                this->bHasTargetPosition_ = false;
-
-            // fly somewhere else
-            random = rnd(maxrand);
-            if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
-                this->searchRandomTargetPosition();
-
-            if (this->state_ == MASTER) // master: shoot
-            {
-                random = rnd(maxrand);
-                if (!(this->passive_) && random < (100*botlevel_) && (this->target_ && !this->bShooting_))
-                {
-                    this->bShooting_ = true;
-                    this->forceFreeSlaves();
-                }
-            }
-            else
-            {
-                // shoot
-                random = rnd(maxrand);
-                if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_))
-                    this->bShooting_ = true;
-            }
-
-            // stop shooting
-            random = rnd(maxrand);
-            if (random < ((1 - botlevel_)*50) && (this->bShooting_))
-                this->bShooting_ = false;
-
-            // boost
-            random = rnd(maxrand);
-            if (random < botlevel_*50 )
-                this->boostControl();
-            */
-
-            
-            // update Checkpoints
-            /*random = rnd(maxrand);
-            if (this->defaultWaypoint_ && random > (maxrand-10))
-                this->manageWaypoints();
-            else //if(random > maxrand-10) //CHECK USABILITY!!*/
-            if (this->waypoints_.size() == 0 )
-                this->manageWaypoints();
-
+    {  
+        if (!this->target_)
+            this->searchNewTarget();
+        if (!(this->passive_) && (this->target_ && !this->bShooting_))
+            this->bShooting_ = true;
             
     }
Index: code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h	(revision 10651)
+++ code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h	(revision 10652)
@@ -53,5 +53,5 @@
                 { return this->botlevel_; }
             static void setAllBotLevel(float level);
-            //WAYPOINT FUNCTIONS
+            //WAYPOINT FUNCTIONS`
             void addWaypoint(WorldEntity* waypoint);
             WorldEntity* getWaypoint(unsigned int index) const;
Index: code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc	(revision 10651)
+++ code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc	(revision 10652)
@@ -105,4 +105,5 @@
                         orxout(internal_error) << this << " is still master in " << (*it) << endl;
                         it->myMaster_ = 0;
+                        it->state_ = FREE;
                     }
 
@@ -472,5 +473,5 @@
         Vector3 dest = this->getControllableEntity()->getPosition();
 
-        // 1 slave: follow
+        // only 1 slave: follow
         if (this->slaves_.size() == 1)
         {
