Index: code/branches/presentation2011/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/AIController.cc	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/controllers/AIController.cc	(revision 8980)
@@ -74,57 +74,5 @@
             }
 
-            // search enemy
-            random = rnd(maxrand);
-            if (random < (15 + botlevel_* 20) && (!this->target_))
-                this->searchNewTarget();
-
-            // forget enemy
-            random = rnd(maxrand);
-            if (random < ((1-botlevel_)*6) && (this->target_))
-                this->forgetTarget();
-
-            // next enemy
-            random = rnd(maxrand);
-            if (random < (botlevel_*20) && (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();
-
-            // shoot
-            random = rnd(maxrand);
-            if (!(this->passive_) && random < (75 + botlevel_*25) && (this->target_ && !this->bShooting_))
-                this->bShooting_ = true;
-
-            // stop shooting
-            random = rnd(maxrand);
-            if (random < ((1 - botlevel_)*25) && (this->bShooting_))
-                this->bShooting_ = false;
-
-            // boost
-            random = rnd(maxrand);
-            if (random < botlevel_*100 )
-                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();
-
+            this->defaultBehaviour(maxrand);
         }
 
@@ -136,6 +84,4 @@
         if (this->state_ == MASTER)
         {
-
-
             this->commandSlaves();
 
@@ -170,58 +116,7 @@
                     this->searchNewMaster();
 
-                // search enemy
-                random = rnd(maxrand);
-                if (random < (botlevel_)*25 && (!this->target_))
-                    this->searchNewTarget();
-
-                // forget enemy
-                random = rnd(maxrand);
-                if (random < (1-botlevel_)*6 && (this->target_))
-                    this->forgetTarget();
-
-                // next enemy
-                random = rnd(maxrand);
-                if (random < 10 && (this->target_))
-                    this->searchNewTarget();
-
-                // fly somewhere
-                random = rnd(maxrand);
-                if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
-                    this->searchRandomTargetPosition();
-
-
-                // fly somewhere else
-                random = rnd(maxrand);
-                if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
-                    this->searchRandomTargetPosition();
-
-                // shoot
-                random = rnd(maxrand);
-                if (!(this->passive_) && random < 25*(botlevel_)+1 && (this->target_ && !this->bShooting_))
-                {
-                    this->bShooting_ = true;
-                    this->forceFreeSlaves();
-                }
-
-                // stop shooting
-                random = rnd(maxrand);
-                if (random < ( (1- botlevel_)*25 ) && (this->bShooting_))
-                    this->bShooting_ = false;
-
-                // boost
-                random = rnd(maxrand);
-                if (random < botlevel_*100 )
-                    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();
+                this->defaultBehaviour(maxrand);
             }
         }
-
     }
 
@@ -321,6 +216,7 @@
         {   //Vector-implementation: mode_.back() == ROCKET;
             if(controllable)
-            {
-                if(controllable->getRocket())//Check wether the bot is controlling the rocket and if the timeout is over.
+            {//Check wether the bot is controlling the rocket and if the timeout is over.
+                if(controllable->getIdentifier() == ClassByString("Rocket"))
+
                 {
                     this->follow();
@@ -342,3 +238,71 @@
     }
 
+    void AIController::defaultBehaviour(float maxrand)
+    {       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();
+    }
+
 }
Index: code/branches/presentation2011/src/orxonox/controllers/AIController.h
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/AIController.h	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/controllers/AIController.h	(revision 8980)
@@ -44,13 +44,14 @@
             virtual ~AIController();
 
-            virtual void tick(float dt);
+            virtual void tick(float dt); //<! Carrying out the targets set in action().
 
         protected:
-            virtual void action();
+            virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
+            void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot.
 
         private:
             static const float ACTION_INTERVAL;
 
-            Timer actionTimer_;
+            Timer actionTimer_; //<! Regularly calls action(). 
     };
 }
Index: code/branches/presentation2011/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/ArtificialController.cc	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/controllers/ArtificialController.cc	(revision 8980)
@@ -42,4 +42,5 @@
 #include "gametypes/TeamDeathmatch.h"
 #include "gametypes/Dynamicmatch.h"
+#include "gametypes/Mission.h"
 #include "controllers/WaypointPatrolController.h"
 #include "controllers/NewHumanController.h"
@@ -92,5 +93,5 @@
         this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
         this->bSetupWorked = false;
-        this->botlevel_ = 0.2f;
+        this->botlevel_ = 0.5f;
         this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT);
         this->timeout_ = 0;
@@ -998,4 +999,14 @@
         }
 
+        Mission* miss = orxonox_cast<Mission*>(gametype);
+        if (miss)
+        {
+            if (entity1->getPlayer())
+                team1 = miss->getTeam(entity1->getPlayer());
+
+            if (entity2->getPlayer())
+                team2 = miss->getTeam(entity2->getPlayer());
+        }
+
         TeamBaseMatchBase* base = 0;
         base = orxonox_cast<TeamBaseMatchBase*>(entity1);
@@ -1110,5 +1121,5 @@
         {
             Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
-            if(pawn)
+            if(pawn && pawn->isA(Class(SpaceShip))) //fix for First Person Mode: check for SpaceShip
             {
                 this->weaponModes_.clear(); // reset previous weapon information
Index: code/branches/presentation2011/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/ArtificialController.h	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/controllers/ArtificialController.h	(revision 8980)
@@ -51,5 +51,5 @@
             void abandonTarget(Pawn* target);
 
-            inline void setTeam(int team)
+            inline void setTeam(int team) //TODO: write through to controllable entity.
                 { this->team_ = team; }
             inline int getTeam() const
Index: code/branches/presentation2011/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/HumanController.cc	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/controllers/HumanController.cc	(revision 8980)
@@ -195,6 +195,6 @@
             this->boosting_ = true;
             this->boostingTimeout_.startTimer();
-            
-            this->controllableEntity_->boost(this->boosting_);
+            if(this->controllableEntity_)
+                this->controllableEntity_->boost(this->boosting_);
 //            orxout() << "Start boosting" << endl;
         }
@@ -209,6 +209,6 @@
         this->boosting_ = false;
         this->boostingTimeout_.stopTimer();
-
-        this->controllableEntity_->boost(this->boosting_);
+        if(this->controllableEntity_)
+            this->controllableEntity_->boost(this->boosting_);
 //        orxout() << "Stop boosting" << endl;
     }
Index: code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.cc	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.cc	(revision 8980)
@@ -42,5 +42,4 @@
         RegisterObject(WaypointPatrolController);
 
-        //this->team_ = 0;
         this->alertnessradius_ = 500;
 
@@ -53,5 +52,4 @@
 
         XMLPortParam(WaypointPatrolController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
-//        XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
     }
 
Index: code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.h
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.h	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.h	(revision 8980)
@@ -46,9 +46,4 @@
             virtual void tick(float dt);
 
-           /* inline void setTeam(int team)
-                { this->team_ = team; }
-            inline int getTeam() const
-                { return this->team_; } */
-
             inline void setAlertnessRadius(float radius)
                 { this->alertnessradius_ = radius; }
@@ -59,5 +54,4 @@
             void searchEnemy();
 
-            //int team_;
             float alertnessradius_;
             Timer patrolTimer_;
Index: code/branches/presentation2011/src/orxonox/gametypes/CMakeLists.txt
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/CMakeLists.txt	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/gametypes/CMakeLists.txt	(revision 8980)
@@ -9,3 +9,5 @@
   LastManStanding.cc
   LastTeamStanding.cc
+  TeamGametype.cc
+  Mission.cc
 )
Index: code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc	(revision 8980)
@@ -85,4 +85,5 @@
         this->dedicatedKillBots_ = createConsoleCommand( "dedicatedKillBots", createExecutor( createFunctor(&Gametype::killBots, this) ) );
         /* HACK HACK HACK */
+        //this->numberOfPlayers_ = 0;
     }
 
@@ -132,5 +133,5 @@
                     this->gtinfo_->playerReadyToSpawn(it->first);
             }
-                    
+
             this->checkStart();
         }
@@ -439,5 +440,5 @@
             if(player->isHumanPlayer())
                 this->gtinfo_->playerSpawned(player);
-            
+
             this->playerPostSpawn(player);
         }
Index: code/branches/presentation2011/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Gametype.h	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/gametypes/Gametype.h	(revision 8980)
@@ -123,9 +123,6 @@
                 { return this->gtinfo_->getHUDTemplate(); }
 
-            void addBots(unsigned int amount);
+            virtual void addBots(unsigned int amount);
             void killBots(unsigned int amount = 0);
-
-            inline unsigned int getNumberOfPlayers() const
-                { return this->players_.size(); }
 
             virtual void addTime(float t);
@@ -151,8 +148,10 @@
 
             //inline bool getForceSpawn()
-            //  { return this->bForceSpawn_; }       
+            //  { return this->bForceSpawn_; }
 
             virtual void resetTimer();
             virtual void resetTimer(float t);
+            inline unsigned int getNumberOfPlayers()
+              { return this->gtinfo_->getNumberOfPlayers(); }
 
         protected:
@@ -192,4 +191,5 @@
             ConsoleCommand* dedicatedKillBots_;
             /* HACK HACK HACK */
+
     };
 }
Index: code/branches/presentation2011/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Mission.cc	(revision 8980)
+++ code/branches/presentation2011/src/orxonox/gametypes/Mission.cc	(revision 8980)
@@ -0,0 +1,103 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Johannes Ritz
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Mission.h"
+//#include "TeamGametype.h"
+#include "items/Engine.h"
+#include "controllers/ArtificialController.h"
+
+#include "core/CoreIncludes.h"
+#include "network/Host.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(Mission);
+
+    Mission::Mission(BaseObject* creator) : TeamGametype(creator)
+    {
+        RegisterObject(Mission);
+        this->missionAccomplished_ = false;
+        this->lives_ = 10; // should be 1 as default value
+        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
+    }
+
+    void Mission::tick(float dt)
+    {
+        SUPER(Mission, tick, dt);
+
+        if (missionAccomplished_)
+        {
+            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
+            this->end();
+        }
+    }
+
+    void Mission::pawnKilled(Pawn* victim, Pawn* killer)
+    {
+        if (victim && victim->getPlayer() && this->lives_ == 1)
+        {
+            this->missionAccomplished_ = false;
+	    this->end();
+        }
+    }
+
+    void Mission::start()
+    {
+        Gametype::start();
+        this->setTeams();
+        /*for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it != ObjectList<Engine>::end(); ++it)
+            it->setActive(false); // works -> @sr :*/
+        this->gtinfo_->sendAnnounceMessage("Your mission has started!");
+    }
+
+    //void Mission::addBots(unsigned int amount)
+
+    void Mission::end()
+    {
+        Gametype::end();
+	/*if (this->missionAccomplished_) 
+            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
+	else
+            this->gtinfo_->sendAnnounceMessage("Mission failed!");
+	 * */
+    }
+
+    void Mission::setTeams()
+    {//Set pawn-colours
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+        {
+            Pawn* pawn = static_cast<Pawn*>(*it);
+            if(!pawn) continue;
+                this->setDefaultObjectColour(pawn);
+        }
+    }
+
+
+
+}
Index: code/branches/presentation2011/src/orxonox/gametypes/Mission.h
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Mission.h	(revision 8980)
+++ code/branches/presentation2011/src/orxonox/gametypes/Mission.h	(revision 8980)
@@ -0,0 +1,64 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Johannes Ritz
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Mission_H__
+#define _Mission_H__
+
+#include "OrxonoxPrereqs.h"
+//#include "Gametype.h"
+#include "TeamGametype.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Mission : public TeamGametype
+    {
+        public:
+            Mission(BaseObject* creator);
+            virtual ~Mission() {}
+
+            virtual void tick(float dt);
+
+            virtual void start();
+            virtual void end();
+            virtual void setTeams();
+            virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
+            inline void setLives(unsigned int amount)
+                {this->lives_ = amount;}
+            inline unsigned int getLives()
+                {return this->lives_;}
+
+        protected:
+            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+            bool missionAccomplished_; //<! indicates if player successfully finsihed the mission;
+            int lives_; //<! amount of player's lives <-> nr. of retries
+
+    };
+}
+
+#endif /* _Mission_H__ */
+
Index: code/branches/presentation2011/src/orxonox/gametypes/TeamDeathmatch.h
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/TeamDeathmatch.h	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/gametypes/TeamDeathmatch.h	(revision 8980)
@@ -56,5 +56,4 @@
 
             int getTeam(PlayerInfo* player);
-
             inline const ColourValue& getTeamColour(int teamnr) const
                 { return this->teamcolours_[teamnr]; }
Index: code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc	(revision 8980)
+++ code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc	(revision 8980)
@@ -0,0 +1,327 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Johannes Ritz
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "TeamGametype.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "infos/PlayerInfo.h"
+#include "interfaces/TeamColourable.h"
+#include "worldentities/TeamSpawnPoint.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/ControllableEntity.h"
+#include "controllers/ArtificialController.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(TeamGametype);
+
+    TeamGametype::TeamGametype(BaseObject* creator) : Gametype(creator)
+    {
+        RegisterObject(TeamGametype);
+
+        this->teams_ = 2; //most team gametypes use two different teams
+        this->allowFriendlyFire_ = false;
+        //this->playersPerTeam_ = 0;
+        this->maxPlayers_ = 2; //TEST
+        this->setConfigValues();
+    }
+
+    void TeamGametype::setConfigValues()
+    {
+        SetConfigValue(teams_, 2);
+
+        static ColourValue colours[] =
+        {
+            ColourValue(0.2f, 0.2f, 1.0f),
+            ColourValue(1.0f, 0.1f, 0.1f),
+            ColourValue(0.3f, 1.0f, 0.3f),
+            ColourValue(1.0f, 1.0f, 0.0f),
+            ColourValue(0.0f, 1.0f, 1.0f),
+            ColourValue(1.0f, 0.0f, 1.0f),
+            ColourValue(7.0f, 7.0f, 7.0f),
+            ColourValue(2.0f, 2.0f, 2.0f)
+        };
+        static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
+
+        SetConfigValue(teamcolours_, defaultcolours);
+    }
+
+    void TeamGametype::playerEntered(PlayerInfo* player)
+    {
+        Gametype::playerEntered(player);
+        if(player == NULL) return;
+        this->findAndSetTeam(player);
+        if( this->players_.size() <= maxPlayers_ || maxPlayers_  ==  0)
+        {
+            this->allowedInGame_[player]= true;
+        }
+        else
+        {
+            this->allowedInGame_[player]= false;
+            orxout() << "not allowed in game: players = " << this->players_.size() << " > maximum: " << maxPlayers_ << endl;
+        }
+    }
+
+    void TeamGametype::findAndSetTeam(PlayerInfo* player)
+    {
+         std::vector<unsigned int> playersperteam(this->teams_, 0);
+
+        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+            if (it->second < static_cast<int>(this->teams_) && it->second >= 0)
+                playersperteam[it->second]++;
+
+        unsigned int minplayers = static_cast<unsigned int>(-1);
+        size_t minplayersteam = 0;
+        for (size_t i = 0; i < this->teams_; ++i)
+        {
+            if (playersperteam[i] < minplayers)
+            {
+                minplayers = playersperteam[i];
+                minplayersteam = i;
+            }
+        }
+
+        this->teamnumbers_[player] = minplayersteam;
+
+    }
+
+    bool TeamGametype::playerLeft(PlayerInfo* player)
+    {
+        bool valid_player = Gametype::playerLeft(player);
+        if( (this->players_.size() >= maxPlayers_) && (allowedInGame_[player] == true) ) // if there's a "waiting list"
+        {
+            for (std::map<PlayerInfo*, bool>::iterator it = this->allowedInGame_.begin(); it != this->allowedInGame_.end(); ++it)
+            {
+                 if(it->second == false) // waiting player found
+                 {it->second = true; break;} // allow player to enter
+			}
+		}
+
+        if (valid_player)
+        {   // clean up the maps
+            this->teamnumbers_.erase(player);
+            this->allowedInGame_.erase(player);
+        }
+
+
+        return valid_player;
+    }
+
+    void TeamGametype::spawnDeadPlayersIfRequested()
+    {
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)\
+        {
+            if(allowedInGame_[it->first] == false)//check if dead player is allowed to enter
+            {
+				continue;
+            }
+            if (it->second.state_ == PlayerState::Dead)
+            {
+                if ((it->first->isReadyToSpawn() || this->bForceSpawn_))
+                {
+                   this->spawnPlayer(it->first);
+                }
+            }
+        }
+    }
+
+
+    bool TeamGametype::allowPawnHit(Pawn* victim, Pawn* originator)
+    {// hit allowed: if victim & originator are foes or if originator doesnot exist or if friendlyfire is allowed
+        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
+    }
+
+    bool TeamGametype::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
+    }
+
+    bool TeamGametype::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
+    }
+
+    SpawnPoint* TeamGametype::getBestSpawnPoint(PlayerInfo* player) const
+    {
+        int desiredTeamNr = -1;
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end())
+            desiredTeamNr = it_player->second;
+
+        // Only use spawnpoints of the own team (or non-team-spawnpoints)
+        std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_;
+        for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+        {
+            if ((*it)->isA(Class(TeamSpawnPoint)))
+            {
+                TeamSpawnPoint* tsp = orxonox_cast<TeamSpawnPoint*>(*it);
+                if (tsp && static_cast<int>(tsp->getTeamNumber()) != desiredTeamNr)
+                {
+                    teamSpawnPoints.erase(it++);
+                    continue;
+                }
+            }
+
+            ++it;
+        }
+
+        SpawnPoint* fallbackSpawnPoint = NULL;
+        if (teamSpawnPoints.size() > 0)
+        {
+            unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
+            unsigned int index = 0;
+            // Get random fallback spawnpoint in case there is no active SpawnPoint.
+            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
+            {
+                if (index == randomspawn)
+                {
+                    fallbackSpawnPoint = (*it);
+                    break;
+                }
+
+                ++index;
+            }
+
+            // Remove all inactive SpawnPoints from the list.
+            for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+            {
+                if(!(*it)->isActive())
+                {
+                    teamSpawnPoints.erase(it++);
+                    continue;
+                }
+
+                ++it;
+            }
+
+            randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
+            index = 0;
+            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
+            {
+                if (index == randomspawn)
+                    return (*it);
+
+                ++index;
+            }
+
+            return fallbackSpawnPoint;
+        }
+
+        return 0;
+    }
+
+    void TeamGametype::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
+    {
+        if (!player)
+            return;
+
+        this->setTeamColour(player,pawn);
+    }
+
+    bool TeamGametype::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2)
+    {
+        if (pawn1 && pawn2)
+        {
+            std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
+            std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer());
+
+            if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end())
+                return (it1->second == it2->second);
+        }
+        return false;
+    }
+
+    int TeamGametype::getTeam(PlayerInfo* player)
+    {
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end())
+            return it_player->second;
+        else
+            return -1;
+    }
+
+    void TeamGametype::setTeamColour(PlayerInfo* player, Pawn* pawn)
+    {
+        // Set the team colour
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < static_cast<int>(this->teamcolours_.size()))
+        {
+            this->colourPawn(pawn, it_player->second);
+        }
+    }
+
+    void TeamGametype::setDefaultObjectColour(Pawn* pawn)
+    {
+        if(pawn == NULL)
+            return;
+
+        int teamnumber = pawn->getTeam();
+
+        if(teamnumber >= 0)
+        {
+            this->colourPawn(pawn, teamnumber); return;
+        }
+        //get Pawn's controller
+        ControllableEntity* entity = orxonox_cast<ControllableEntity*>(pawn);
+
+        Controller* controller = 0;
+        if (entity->getController())
+            controller = entity->getController();
+        else if (entity->getXMLController())
+            controller = entity->getXMLController();
+        else
+            return;
+
+        ArtificialController* artificial =  orxonox_cast<ArtificialController*>(controller);
+        //get Teamnumber - get the data
+        if(artificial == NULL)
+            return;
+        teamnumber= artificial->getTeam();
+
+        //set ObjectColour
+        this->colourPawn(pawn, teamnumber);
+    }
+
+    void TeamGametype::colourPawn(Pawn* pawn, int teamNr)
+    {// catch no-colouring-case and wrong input
+        if(teamNr < 0 || pawn == NULL) return;
+        pawn->setRadarObjectColour(this->teamcolours_[teamNr]);
+
+        std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
+        for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
+        {
+            if ((*it)->isA(Class(TeamColourable)))
+            {
+                TeamColourable* tc = orxonox_cast<TeamColourable*>(*it);
+                tc->setTeamColour(this->teamcolours_[teamNr]);
+            }
+         }
+    }
+
+}
Index: code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.h
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.h	(revision 8980)
+++ code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.h	(revision 8980)
@@ -0,0 +1,82 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Johannes Ritz
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TeamGametype_H__
+#define _TeamGametype_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <vector>
+#include "Gametype.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamGametype : public Gametype
+    {
+        public:
+            TeamGametype(BaseObject* creator);
+            virtual ~TeamGametype() {}
+
+            void setConfigValues();
+
+            virtual void playerEntered(PlayerInfo* player);
+            virtual void findAndSetTeam(PlayerInfo* player);
+            virtual bool playerLeft(PlayerInfo* player);
+            virtual void spawnDeadPlayersIfRequested(); //!< Prevents players to respawn.
+
+            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+
+            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
+
+
+            int getTeam(PlayerInfo* player);
+
+            inline const ColourValue& getTeamColour(int teamnr) const
+                { return this->teamcolours_[teamnr]; }
+
+        protected:
+            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
+            bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
+
+            bool allowFriendlyFire_; //!< friendlyfire is per default switched off: friendlyFire_ = false;
+            std::map<PlayerInfo*, int> teamnumbers_;
+            std::vector<ColourValue> teamcolours_;
+            unsigned int teams_; //!< Number  of teams. Value 0 : no teams!
+            //unsigned int playersPerTeam_; //!< Defines Maximum for players per team. Value 0: no maximum!
+            unsigned int maxPlayers_; //!< Defines Maximum for number of players. Value 0 : no maximum!
+            std::map<PlayerInfo*, bool> allowedInGame_; //!< Only those players are allowed to spawn which are listed here as 'true'.
+            void setTeamColour(PlayerInfo* player, Pawn* pawn);
+            void setDefaultObjectColour(Pawn* pawn);
+            void colourPawn(Pawn* pawn, int teamNr);
+    };
+}
+
+#endif /* _TeamGametype_H__ */
Index: code/branches/presentation2011/src/orxonox/infos/GametypeInfo.h
===================================================================
--- code/branches/presentation2011/src/orxonox/infos/GametypeInfo.h	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/infos/GametypeInfo.h	(revision 8980)
@@ -119,4 +119,7 @@
             inline const std::string& getHUDTemplate() const
                 { return this->hudtemplate_; }
+            
+            inline unsigned int getNumberOfPlayers() const
+                {  return this->spawnedPlayers_.size(); }
 
             void sendAnnounceMessage(const std::string& message);
Index: code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.cc	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.cc	(revision 8980)
@@ -74,5 +74,4 @@
         this->bMouseLook_ = false;
         this->mouseLookSpeed_ = 200;
-        this->bIsRocket_ = false;
 
         this->server_position_         = Vector3::ZERO;
@@ -88,4 +87,5 @@
         this->setPriority( Priority::VeryHigh );
         this->registerVariables();
+	this->team_ = -1;
     }
 
@@ -120,4 +120,5 @@
         SUPER(ControllableEntity, XMLPort, xmlelement, mode);
 
+        XMLPortParam(ControllableEntity, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
         XMLPortParam(ControllableEntity, "hudtemplate", setHudTemplate, getHudTemplate, xmlelement, mode);
         XMLPortParam(ControllableEntity, "camerapositiontemplate", setCameraPositionTemplate, getCameraPositionTemplate, xmlelement, mode);
Index: code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.h	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.h	(revision 8980)
@@ -163,6 +163,9 @@
                 { return this->target_.get(); }
             void setTargetInternal( uint32_t targetID );
-            inline bool getRocket() const
-                { return this-> bIsRocket_; }
+
+	    inline void setTeam(int team)
+	        { this->team_ = team; }
+	    inline float getTeam() const
+	        { return this->team_; }
 
         protected:
@@ -183,5 +186,4 @@
 
             Ogre::SceneNode* cameraPositionRootNode_;
-            bool bIsRocket_; //Workaround to see, if the controllable entity is a Rocket.
 
         private:
@@ -240,4 +242,6 @@
             CameraPosition* reverseCamera_;
             WeakPtr<WorldEntity> target_;
+
+	    int team_ ; //<! teamnumber
     };
 }
Index: code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc	(revision 8980)
@@ -129,4 +129,6 @@
         XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0);
         XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
+
+
     }
 
@@ -455,5 +457,5 @@
         SUPER(Pawn, changedActivity);
 
-        this->setRadarVisibility(this->isActive());
+        this->setRadarVisibility(this->isVisible());
     }
 
Index: code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.h	(revision 8977)
+++ code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.h	(revision 8980)
@@ -53,4 +53,5 @@
             inline bool isAlive() const
                 { return this->bAlive_; }
+
 
             virtual void setHealth(float health);
@@ -194,4 +195,5 @@
                 { return NULL; }
 
+
             float health_;
             float maxHealth_;
