Index: code/trunk/data/defaultConfig/keybindings.ini
===================================================================
--- code/trunk/data/defaultConfig/keybindings.ini	(revision 9525)
+++ code/trunk/data/defaultConfig/keybindings.ini	(revision 9526)
@@ -55,5 +55,5 @@
 KeyLeftBracket=
 KeyLeftControl=mouseLook
-KeyLeftShift=
+KeyLeftShif
 KeyLeftWindows=
 KeyLessThan=
@@ -141,8 +141,8 @@
 KeyWebSearch=
 KeyWebStop=
-KeyX=
+KeyX="selectClosest"
 KeyY=
 KeyYen=
-KeyZ=
+KeyZ="selectNext"
 
 [MouseButtons]
Index: code/trunk/data/levels/bigshipPresentation.oxw
===================================================================
--- code/trunk/data/levels/bigshipPresentation.oxw	(revision 9526)
+++ code/trunk/data/levels/bigshipPresentation.oxw	(revision 9526)
@@ -0,0 +1,34 @@
+<LevelInfo
+ name = "bigship Presentation"
+ description = "A level with absolutely nothing in it."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/bigship.oxt")
+?>
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=bigship />
+    
+  </Scene>
+</Level>
+
Index: code/trunk/data/levels/collateralDamageDemo.oxw
===================================================================
--- code/trunk/data/levels/collateralDamageDemo.oxw	(revision 9526)
+++ code/trunk/data/levels/collateralDamageDemo.oxw	(revision 9526)
@@ -0,0 +1,36 @@
+<LevelInfo
+ name = "Collateral Damage Demo"
+ description = " "
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipCollateralDamage.oxt")
+?>
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipcollateraldamage />
+    
+  </Scene>
+</Level>
+
Index: code/trunk/data/levels/gallery.oxw
===================================================================
--- code/trunk/data/levels/gallery.oxw	(revision 9525)
+++ code/trunk/data/levels/gallery.oxw	(revision 9526)
@@ -68,5 +68,5 @@
       <Model position="0,20,-40" yaw="90" pitch="-90" roll="0" scale="2" mesh="LightningGun.mesh" />
       <Model position="0,40,-40" yaw="90" pitch="-90" roll="0" scale="2" mesh="LightningGun-s.mesh" />
-      <Model position="0,60,-40" yaw="90" pitch="-90" roll="0" scale="1.5" mesh="laserbeam.mesh" />
+      <Model position="0,60,-40" yaw="90" pitch="-90" roll="0" scale="1.5" mesh="LaserBeam.mesh" />
       <Model position="0,80,-40" yaw="90" pitch="-90" roll="0" scale="2" mesh="rocket.mesh" />
       <Model position="0,-20,-40" yaw="90" pitch="-90" roll="0" scale="5" mesh="hs-w01.mesh" />
Index: code/trunk/data/levels/includes/weaponSettingsCollateral.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsCollateral.oxi	(revision 9526)
+++ code/trunk/data/levels/includes/weaponSettingsCollateral.oxi	(revision 9526)
@@ -0,0 +1,47 @@
+    <weaponslots>
+      <WeaponSlot position="-15.0,-1.5,0" />
+      <WeaponSlot position=" 15.0,-1.5,0" />
+      <WeaponSlot position="    0,   0,0" />
+    </weaponslots>
+    <weaponsets>
+      <WeaponSet firemode=0 />
+      <WeaponSet firemode=1 />
+      <WeaponSet firemode=2 />
+      <WeaponSet firemode=3 />
+    </weaponsets>
+    <weapons>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+          <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+          <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
+          <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
+        </links>
+
+        <Weapon>
+          <attached>
+            <!--Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="5,-1.3,0" /--> <!-- ROCKET LAUNCHER -->
+            <!--Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" /--> <!-- THING BETWEEN -->
+            <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="90" yaw="-90" position="-1.5, 1, -0.3" scale=0.6 /> <!-- MACHINE GUN -->
+          </attached>
+          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+          <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+        </Weapon>
+
+        <Weapon>
+          <attached>
+            <!--Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" /-->
+            <!--Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" /-->
+            <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="90" yaw="-90" position="1.8, 1, -0.3" scale=0.6 /> <!-- MACHINE GUN -->
+          </attached>
+          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+          <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+        </Weapon>
+        <Weapon>
+          <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
+          <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+        </Weapon>
+      </WeaponPack>
+    </weapons>
Index: code/trunk/data/levels/includes/weaponSettingsEscort.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsEscort.oxi	(revision 9525)
+++ code/trunk/data/levels/includes/weaponSettingsEscort.oxi	(revision 9526)
@@ -14,22 +14,10 @@
         </links>
         <Weapon>
-          <attached>
-            <!--Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,0,0" />
-            <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
-            <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 /-->
-          </attached>
-          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
-          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
-          <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam.mesh" />
+          <!--HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" projectileMesh="LaserBeam.mesh" /-->
         </Weapon>
         <Weapon>
-          <attached>
-            <!--Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,0,0" />
-            <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
-            <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 /-->
-          </attached>
-          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
-          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
-          <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+          <HsW01 mode=0 munitionpershot=0 delay=0     damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam.mesh" />
+          <!--HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" projectileMesh="LaserBeam.mesh" /-->
         </Weapon>
       </WeaponPack>
Index: code/trunk/data/levels/includes/weaponSettingsTurret.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsTurret.oxi	(revision 9526)
+++ code/trunk/data/levels/includes/weaponSettingsTurret.oxi	(revision 9526)
@@ -0,0 +1,22 @@
+    <weaponslots>
+      <WeaponSlot position="0,0,0" />
+    </weaponslots>
+    <weaponsets>
+      <WeaponSet firemode=0 />
+    </weaponsets>
+    <weapons>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+        </links>
+        <Weapon>
+          <attached>
+            <Model mesh="sphere.mesh" position="3,3,-2.2" scale=0.6 />
+          </attached>
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 3, 3,-2.2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 3,-3,-2.2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-3, 3,-2.2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-3,-3,-2.2" />
+        </Weapon>
+      </WeaponPack>
+    </weapons>
Index: code/trunk/data/levels/includes/weaponSettingsbigship.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsbigship.oxi	(revision 9526)
+++ code/trunk/data/levels/includes/weaponSettingsbigship.oxi	(revision 9526)
@@ -0,0 +1,48 @@
+    <weaponslots>
+      <WeaponSlot position="-1.5,-5,-3" />
+      <WeaponSlot position=" 1.5,-5,-3" />  
+      <WeaponSlot position="    0,   0,0" />
+    </weaponslots>
+    <weaponsets>
+      <WeaponSet firemode=0 />
+      <WeaponSet firemode=1 />
+      <WeaponSet firemode=2 />
+      <WeaponSet firemode=3 />
+    </weaponsets>
+    <weapons>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+          <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+          <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
+          <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
+        </links>
+        <Weapon>
+          <attached>
+          </attached>
+          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+          <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+        </Weapon>
+        <Weapon>
+          <attached>
+           
+          </attached>
+          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+          <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+        </Weapon>
+        <Weapon>
+          <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
+          <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+        </Weapon>
+      </WeaponPack>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+        </links>
+        <!--Weapon>
+          <EnergyDrink mode=0 munitionpershot=0 delay=0  material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
+        </Weapon-->
+      </WeaponPack>
+    </weapons>
Index: code/trunk/data/levels/pong.oxw
===================================================================
--- code/trunk/data/levels/pong.oxw	(revision 9525)
+++ code/trunk/data/levels/pong.oxw	(revision 9526)
@@ -93,5 +93,5 @@
 <!-- TODO: Create a Pong Score Sound and include it here.
 This WorldSound works, but doesn't make sense, since it is played together with ambient/moodDependedDirectory/Ganymede.ogg -->
-            <!--WorldSound name="scoreSound" position="0,0,0" source="ambient/default/Earth.ogg" >
+            <!--WorldSound name="scoreSound" position="0,0,0" source="sounds/PongScore_cut.ogg" >
               <events>
                 <play>
Index: code/trunk/data/levels/presentationHS12.oxw
===================================================================
--- code/trunk/data/levels/presentationHS12.oxw	(revision 9526)
+++ code/trunk/data/levels/presentationHS12.oxw	(revision 9526)
@@ -0,0 +1,501 @@
+<!-- NEW FEATURES:
+- Three new Spaceships: collateralDamage; planetDestroyer; lightEscortship;
+- Shaders (not included here, since the ogre plugin is missing on Ubuntu)
+- Sound Effects (not included)
+- Animation (not included)
+- HUD aiming assistant
+- Turret
+- Racing Bots
+-->
+<LevelInfo
+ name = "Presentation HS 2012"
+ description = "New Features: new Spaceships, Racing AI, HUD Aiming Assistant, Turret, Shaders, Sound Effects"
+ tags = "presentation"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipEscort.oxt")
+  include("templates/bigship.oxt")
+  include("templates/spaceshipTurret.oxt")
+  include("templates/spaceshipCollateralDamage.oxt")
+?>
+
+<Level
+  gametype = SpaceRace
+>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <NotificationQueueCEGUI
+    name="narrative"
+    targets="simpleNotification"
+    size=1
+    displayTime=30
+    position="0.2, 0, 0.1, 0"
+    fontSize="24"
+    fontColor="0.3, 1, 0.2, 0.8"
+    alignment="HorzCentred"
+    displaySize="0.6, 0, 0, 0"
+    />
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/skyBoxMoreNebula"
+  > <!-- Orxonox/Starbox -->
+    <?lua
+      include("includes/pickups.oxi")
+    ?>
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="-900,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+    <!--SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=bigship /-->
+    <!--SpawnPoint team=0 position="-900,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipcollateraldamage /-->
+    <!--SpawnPoint team=0 position="6000,0,2000" lookat="1,1,0" spawnclass=SpaceShip pawndesign=spaceshipcollateraldamage /-->
+    
+    <SpaceRaceManager>
+        <checkpoints>
+            <RaceCheckPoint name="checkpoint1" position="000,0,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="0" islast="false" nextcheckpoints="1,2,3">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+                </attached>
+            </RaceCheckPoint>
+<!--- first three alternative paths --->
+            <RaceCheckPoint name="checkpoint2" position="1300,0,-800" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="1" islast="false" nextcheckpoints="7,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90/>
+                </attached>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint3" position="1200,-400,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="2" islast="false" nextcheckpoints="4,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+                </attached>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint4" position="1200,100,700" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="3" islast="false" nextcheckpoints="5,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+                </attached>
+            </RaceCheckPoint>
+
+<!--- second three alternative paths --->
+            <RaceCheckPoint name="checkpoint5" position="2000,0,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="4" islast="false" nextcheckpoints="7,8,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+                </attached>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint6" position="2000,-500,400" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="5" islast="false" nextcheckpoints="9,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+                </attached>
+            </RaceCheckPoint>
+
+
+<!--- third generation --->
+
+            <RaceCheckPoint name="checkpoint7" position="5000,0,-3000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="6" islast="false" nextcheckpoints="11,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=135 />
+                </attached>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint8" position="3500,800,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="7" islast="false" nextcheckpoints="10,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+                </attached>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint9" position="3500,-800,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="8" islast="false" nextcheckpoints="10,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+                </attached>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint10" position="3500,0,1000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="9" islast="false" nextcheckpoints="11,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+                </attached>
+            </RaceCheckPoint>
+
+<!-- Intermediate Solo Gate -->
+            <RaceCheckPoint name="checkpoint11" position="4500,0,-100" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="10" islast="false" nextcheckpoints="11,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+                </attached>
+            </RaceCheckPoint>
+
+<!----  First Common Point  ---->
+            <RaceCheckPoint name="checkpoint12" position="6000,0,2000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="11" islast="false" nextcheckpoints="12,14,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=45 />
+                </attached>
+            </RaceCheckPoint>
+
+<!-- Two Paths (1) -->
+            <RaceCheckPoint name="checkpoint13" position="7500,-1500,2500" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="12" islast="false" nextcheckpoints="14,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=130 roll=1 />
+                </attached>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint14" position="7500,-1500,1500" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="13" islast="false" nextcheckpoints="15,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=90 />
+                </attached>
+            </RaceCheckPoint>
+
+<!-- Two Paths (2) -->
+            <RaceCheckPoint name="checkpoint15" position="9000,-3000, 3000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="14" islast="false" nextcheckpoints="16,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=130 roll=1 />
+                </attached>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint16" position="9000,-3000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="15" islast="false" nextcheckpoints="16,-1,-1">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=110 />
+                </attached>
+            </RaceCheckPoint>
+
+<!-- GOAL -->
+            <RaceCheckPoint name="checkpoint17" position="12000,-4000,2000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="16" islast="true">
+                <attached>
+                    <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=135 />
+                </attached>
+            </RaceCheckPoint>
+        </checkpoints>
+    </SpaceRaceManager>
+
+
+<!-- Simplify paths -->
+    <!-- PORTALS -->
+
+    <Template name=PortalDefault>
+        <PortalEndPoint>
+            <attached>
+                <Billboard material="Portals/Default" scale="3"/>
+            </attached>
+        </PortalEndPoint>
+    </Template>
+
+    <PortalEndPoint position="2000,0,-1000" id="3" distance="60" target="MobileEntity" design="PortalDefault" />
+    <PortalEndPoint position="4500,0,-3400" id="4" distance="60" target="MobileEntity" design="PortalDefault" />
+    <PortalLink fromID="3" toID="4" />
+    <PortalLink fromID="4" toID="3" />
+
+
+    <!-- ForceField -->
+800,400,0
+        <ForceField position="1200,-400,0" direction="8,4,0" diameter=500 velocity=2000 length=500 />
+        <MovableEntity position="1200,-400,0">
+            <attached>
+                <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.1,0.1,0.1" scale=1/>
+                <?lua for i=0,4,1 do ?>
+                    <Billboard position="<?lua print(i*200) ?>,<?lua print(i*100) ?>,-100" material="Examples/Flare" colour="0.1,0.1,0.1" scale=1/>
+                    <Billboard position="<?lua print(i*200) ?>,<?lua print(i*100) ?>,100" material="Examples/Flare" colour="0.1,0.1,0.1" scale=1/>
+                <?lua end ?>
+                </attached>
+        </MovableEntity>
+
+
+   <!-- Pickup -->
+   <PickupSpawner pickup=smallspeedpickup position="5300,0,-2300" triggerDistance="60" respawnTime="10" maxSpawnedItems="99" scale="12" />
+
+
+<!--- SCENERY --->
+    <!-- @Objects: HYDROGEN FARMER-->
+    <StaticEntity position="5700,0,-3700" mass=10000 >
+      <attached>
+        <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=50 />
+        <ParticleEmitter position="0,0,0" source="Orxonox/ThrusterFire" scale=1.2 />
+   <!-- <Model mesh="cube.mesh" mass=10 position="-560,0,0" scale3D="115,100,245"  />
+        <Model mesh="cube.mesh" mass=10 position="290,0,-480" scale3D="115,100,245" yaw=-120 />
+        <Model mesh="cube.mesh" mass=10 position="290,0,480" scale3D="115,100,245" yaw=-240 />
+        <Model mesh="cube.mesh" mass=10 position="-280,0,0" scale3D="163,50,50" />
+        <Model mesh="cube.mesh" mass=10 position="140,0,-240" scale3D="163,50,50"  yaw=-120/>
+        <Model mesh="cube.mesh" mass=10 position="140,0,240" scale3D="163,50,50" yaw=-240/>
+        <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" />
+        <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" yaw=-120/>
+        <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" yaw=-240/>
+        <Model mesh="cube.mesh" mass=10 position="0,400,0" scale3D="43,110,26" yaw=-30 />
+        <Model mesh="cube.mesh" mass=10 position="-200,100,0" scale3D="26,50,43" />
+        <Model mesh="cube.mesh" mass=10 position="100,100,-173" scale3D="43,50,26" yaw=-30/>
+        <Model mesh="cube.mesh" mass=10 position="100,100,173" scale3D="43,50,26" yaw=30/>
+        <Model mesh="cube.mesh" mass=10 position="-100,264,0" scale3D="26,105,43" roll=-49/>
+        <Model mesh="cube.mesh" mass=10 position="50,264,-87" scale3D="26,105,43" roll=-49 yaw=-120/>
+        <Model mesh="cube.mesh" mass=10 position="50,264,87" scale3D="26,105,43" roll=-49 yaw=-240/>     -->
+      </attached>
+      <collisionShapes>
+        <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
+        <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
+        <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
+        <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
+        <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
+        <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
+        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
+        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
+        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
+        <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
+        <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
+        <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
+        <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
+        <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
+        <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
+        <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
+      </collisionShapes>
+    </StaticEntity>
+
+    <StaticEntity position="2800,0,0" mass=10000 pitch=0 roll=45 yaw=240 >
+      <attached>
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsBody.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsDuseL.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsDuseR.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsKuppelV.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsKuppelK.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsAntL.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsAntR.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsGarage.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsStation.mesh" />
+
+	<BlinkingBillboard position="20,-24,160" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+      	<BlinkingBillboard position="-20,-24,160" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="20,-25,190" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=40 quadratic=1 />
+      	<BlinkingBillboard position="-20,-25,190" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=40 quadratic=1 />
+	<BlinkingBillboard position="20,-25,220" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=80 quadratic=0 />
+      	<BlinkingBillboard position="-20,-25,220" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=80 quadratic=0 />
+	<BlinkingBillboard position="20,-26,250" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=120 quadratic=0 />
+      	<BlinkingBillboard position="-20,-26,250" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=120 quadratic=0 />
+	<BlinkingBillboard position="20,-26,28" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=160 quadratic=0 />
+      	<BlinkingBillboard position="-20,-26,28" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=160 quadratic=0 />
+	<BlinkingBillboard position="29,-35,142" material="Examples/Flare" colour="1, 0.4, 0.4, 0.1" amplitude=0.2 frequency=30 phase=0 quadratic=0 />
+      	<BlinkingBillboard position="-29,-35,142" material="Examples/Flare" colour="1, 0.4, 0.4, 0.1" amplitude=0.2 frequency=30 phase=0 quadratic=0 />
+      </attached>
+    </StaticEntity>
+
+   <!-- Docking -->
+    <Dock position="2830,20,50" roll=0 yaw=0 >
+        <animations>
+            <MoveToDockingTarget target="destroyer" />
+        </animations>
+        <effects>
+            <DockToShip target="spaceShip" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="dockMe" />
+            </execute>
+            <activity>
+                <EventListener event=notGameEnd />
+            </activity>
+        </events>
+        <attached>
+                    <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
+	<BlinkingBillboard position="10,0,0" material="Examples/Flare" colour="1, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="20,0,0" material="Examples/Flare" colour="1, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="30,0,0" material="Examples/Flare" colour="1, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="0,10,0" material="Examples/Flare" colour="0.3, 1, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="0,20,0" material="Examples/Flare" colour="0.3, 1, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="0,30,0" material="Examples/Flare" colour="0.3, 1, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="0,0,10" material="Examples/Flare" colour="0.3, 0.3, 1, 1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="0,0,20" material="Examples/Flare" colour="0.3, 0.3, 1, 1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="0,0,30" material="Examples/Flare" colour="0.3, 0.3, 1, 1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+            <DistanceTrigger position="0,0,0" distance="200" target="Pawn"
+                beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
+            />
+        </attached>
+
+    </Dock>
+    <SpaceShip
+        template            = "spaceshipcollateraldamage"
+        team                = "0"
+        position            = "2890,-40,6"
+        orientation         = "-0.14, 0.68, 0.68, 0.223"
+        lookat              = "0,0,0"
+        roll                = "180"
+        name                = "collateralDamage"
+        radarname           = "Collateral Damage" >
+        <!--
+        pitch               = "90"
+        yaw                 = "0"-->
+      <attached>
+        <DockingTarget name="spaceShip" />
+        <DistanceTriggerBeacon name="bcnDestroyer" />
+        <DockingTarget name="destroyer" />
+      </attached>
+    </SpaceShip>
+
+    <!-- triple large belt around the planet  -->
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
+    ?>
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
+    ?>
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
+    ?>
+
+    <Planet
+      position="15000,0,-1000"
+      scale="5000"
+      collisionType="dynamic"
+      linearDamping="0.8"
+      angularDamping="0"
+      mass="10000000"
+      pitch="0"
+      mesh="planets/ganymede.mesh"
+      atmosphere="atmosphere1"
+      rotationaxis="1,0,0"
+      rotationrate="1.0"
+      atmospheresize="80.0f"
+      imagesize="1024.0f"
+      collisiondamage = 2
+      enablecollisiondamage = true
+    >
+      <attached>
+        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="5000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+<StaticEntity position="6750,-750,2000" yaw=0 pitch=0>
+    <attached>
+        <Model position="0,0,0" mesh="turretSocketFront.mesh" scale3D="10,10,10" />
+        <Model position="0,0,0" mesh="turretSocketIn.mesh" scale3D="10,10,10" />
+        <Model position="0,0,0" mesh="turretSocketTop.mesh" scale3D="10,10,10" />
+        <Model position="0,0,0" mesh="turretSocketLeft.mesh" scale3D="10,10,10" />
+        <Model position="0,0,0" mesh="turretSocketRight.mesh" scale3D="10,10,10" />
+    </attached>
+</StaticEntity>
+<SpaceShip position="6750,-740,2000" pitch="90" yaw="0" roll="0" radarname="Automatic Turret">
+    <templates>
+        <Template link=spaceshipturret />
+    </templates>
+    <controller>
+        <WaypointPatrolController alertnessradius=1000 team=10>
+        </WaypointPatrolController>
+     </controller>
+</SpaceShip>
+
+
+    <!--- Some Randomn Asteroids  --->
+    <?lua
+      for i = 1, 250, 1
+      do
+      j = math.random()
+    ?>
+
+    <MovableEntity
+      position = "<?lua print(math.random()* 15000 - 1000) ?>,<?lua print(math.random() * 12000 - 4000) ?>,<?lua print(math.random() * 12000 - 4000) ?>"
+      collisionType = dynamic
+      linearDamping = 0.8
+      angularDamping = 0
+      scale = "<?lua print(j * 150)?>"
+      collisiondamage = 1
+      enablecollisiondamage = true
+    >
+      <attached>
+        <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="<?lua print(j * 350) ?>" />
+      </collisionShapes>
+    </MovableEntity>
+
+    <?lua
+      end
+    ?>
+
+
+
+
+
+
+<!-- INTERACTIVE PART -->
+    <DistanceTrigger name="start" position="-900,0,0"  target="Pawn" distance=100 stayActive="true" delay=0.5 />
+    <DistanceTrigger name="spawnBots" position="-900,0,0"  target="Pawn" distance=100 stayActive="true" delay=4.5 />
+    <DistanceTrigger name="creditPetar" position="2000,0,0"  target="Pawn" distance=100 stayActive="true" delay=0.5 />
+    <DistanceTrigger name="creditDario" position="4500,0,-100"  target="Pawn" distance=200 stayActive="true" delay=5 />
+
+    <SimpleNotification message="Sound Effetcs by Mike." broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=start />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Racing Bots by Michael." broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=spawnBots />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Planetary Destroyer by Petar." broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=creditPetar />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Collateral Damage by Raphael." broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=dockMe />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Automatic Turret by Dario." broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=creditDario />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <Script code="addBots 3" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event=spawnBots />
+            </trigger>
+        </events>
+    </Script>
+
+
+<!-- SOUNDS & MUSIC -->
+            <WorldSound name="scoreSound" position="-920,0,0" source="sounds/ReadyGo.ogg" >
+              <events>
+                <play>
+                  <EventListener event="start" />
+                </play>
+              </events>
+            </WorldSound>
+
+
+
+
+  </Scene>
+</Level>
+
Index: code/trunk/data/levels/templates/bigship.oxt
===================================================================
--- code/trunk/data/levels/templates/bigship.oxt	(revision 9526)
+++ code/trunk/data/levels/templates/bigship.oxt	(revision 9526)
@@ -0,0 +1,146 @@
+<Template name=bigship>
+  <SpaceShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = bigshipcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   shieldhealth        = 100
+   initialshieldhealth = 30
+   maxshieldhealth     = 50
+   shieldabsorption    = 0.8
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 30
+   auxilaryThrust    = 30
+   rotationThrust    = 10
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 30
+   boostPowerRate        = 1.5
+   boostRate             = 4
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 9
+
+   collisionType     = "dynamic"
+   mass              = 1000
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+  >
+    <engines>
+      <MultiStateEngine position=" 15, 0, 0" template=bigshipengine />
+      <MultiStateEngine position="-15, 0, 0" template=bigshipengine />
+    </engines>
+    <attached>
+
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsBody.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsDuseL.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsDuseR.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsKuppelV.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsKuppelK.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsAntL.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsAntR.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsGarage.mesh" />
+	<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsStation.mesh" />
+
+	<BlinkingBillboard position="2,-2.4,16" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=0 quadratic=1 />
+      	<BlinkingBillboard position="-2,-2.4,16" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=0 quadratic=1 />
+	<BlinkingBillboard position="2,-2.5,19" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=40 quadratic=1 />
+      	<BlinkingBillboard position="-2,-2.5,19" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=40 quadratic=1 />
+	<BlinkingBillboard position="2,-2.5,22" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=80 quadratic=0 />
+      	<BlinkingBillboard position="-2,-2.5,22" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=80 quadratic=0 />
+	<BlinkingBillboard position="2,-2.6,25" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=120 quadratic=0 />
+      	<BlinkingBillboard position="-2,-2.6,25" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=120 quadratic=0 />
+	<BlinkingBillboard position="2,-2.6,28" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=160 quadratic=0 />
+      	<BlinkingBillboard position="-2,-2.6,28" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=160 quadratic=0 />
+	<BlinkingBillboard position="2.9,-3.5,14.2" material="Examples/Flare" colour="1, 0.4, 0.4, 0.1" amplitude=0.02 frequency=30 phase=0 quadratic=0 />
+      	<BlinkingBillboard position="-2.9,-3.5,14.2" material="Examples/Flare" colour="1, 0.4, 0.4, 0.1" amplitude=0.02 frequency=30 phase=0 quadratic=0 />
+
+
+
+<!--	<Model position="0,8,17" yaw=0 pitch=180 roll=0 scale3D="8, 10, 10" mesh="cube.mesh" />
+	<Model position="0,0,22" yaw=0 pitch=180 roll=0 scale3D="18, 2, 10" mesh="cube.mesh" />
+	<Model position="0,0,9" yaw=0 pitch=180 roll=0 scale3D="12, 2, 20" mesh="cube.mesh" />
+	<Model position="0,0,-18" yaw=0 pitch=180 roll=0 scale3D="6, 2, 18" mesh="cube.mesh" />
+-->
+
+    </attached>
+    <collisionShapes>
+	<BoxCollisionShape position="0,8,17"      halfExtents="8,10,10" />
+	<BoxCollisionShape position="0,0,22"      halfExtents="18, 2, 10" />
+	<BoxCollisionShape position="0,0,9"      halfExtents="12, 2, 20" />
+	<BoxCollisionShape position="0,0,-18"      halfExtents="6, 2, 18" />
+      
+    </collisionShapes>
+<?lua
+  include("../includes/weaponSettingsbigship.oxi")
+?>
+  </SpaceShip>
+</Template>
+
+<Template name=bigshipcameras defaults=0>
+  <SpaceShip>
+    <camerapositions>
+      <CameraPosition position="0,30, 50" drag=true mouselook=true />
+      <CameraPosition position="0,10,80" drag=true mouselook=true />
+      <CameraPosition position="0,40,120" drag=true mouselook=true />
+    </camerapositions>
+  </SpaceShip>
+</Template>
+
+<Template name=bigshipengine baseclass=MultiStateEngine>
+  <MultiStateEngine
+   boostfactor    = 2
+
+   speedfront     = 150
+   speedback      =  50
+   speedleftright =  50
+   speedupdown    =  50
+
+   defEngineSndNormal = "sounds/Engine_low.ogg"
+   defEngineSndBoost = "sounds/Engine_high.ogg"
+
+   accelerationfront     = 10
+   accelerationbrake     = 10
+   accelerationback      =  10
+   accelerationleftright =  10
+   accelerationupdown    =  10
+  >
+    <EffectContainer condition="idle">
+      <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+    </EffectContainer>
+    <EffectContainer condition="not idle">
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="-7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+    </EffectContainer>
+    <EffectContainer condition="normal or brake">
+    </EffectContainer>
+    <EffectContainer condition="normal or boost">
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 10.5, 0, 32" colour="0.2, 0.65, 1.0, 1.0" width=10 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-10.5, 0, 32" colour="0.2, 0.65, 1.0, 1.0" width=10 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 2.5, 13, 26.5" colour="0.2, 0.65, 1, 0.4" width=5 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-2.5, 13, 26.5" colour="0.2, 0.65, 1, 0.4" width=5 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+    <EffectContainer condition="boost">
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 10, 0, 32" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-10, 0, 32" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+    </EffectContainer>
+<!--    <EffectContainer condition="brake">
+      <FadingBillboard mainstate=activity active=false scale=0.3 position=" 8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.3 position="-8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position=" 8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position="-8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+    </EffectContainer>
+-->
+  </MultiStateEngine>
+</Template>
Index: code/trunk/data/levels/templates/lodInformation.oxt
===================================================================
--- code/trunk/data/levels/templates/lodInformation.oxt	(revision 9525)
+++ code/trunk/data/levels/templates/lodInformation.oxt	(revision 9526)
@@ -15,4 +15,6 @@
       <MeshLodInformation mesh=CuboidLandingZone.mesh enabled=false/>
       <MeshLodInformation mesh=HydroHarvester.mesh enabled=false />
+      <MeshLodInformation mesh=turretHead.mesh enabled=false />
+      <MeshLodInformation mesh=LaserBeam.mesh enabled=false/>
 
       <!-- disable LOD for some debris meshes which caused a crash (fixed in Ogre 1.7.3) -->
Index: code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt	(revision 9526)
+++ code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt	(revision 9526)
@@ -0,0 +1,142 @@
+<!-- keuschr /-->
+<Template name=spaceshipcollateraldamage>
+  <SpaceShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipCDcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 200
+   maxhealth         = 400
+   initialhealth     = 200
+
+   shieldhealth        = 30
+   initialshieldhealth = 30
+   maxshieldhealth     = 50
+   shieldabsorption    = 0.8
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 100
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 15
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 12
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+  >
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipCDengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipCDengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=-90 pitch=0 roll=0 scale=4 mesh="collateralDamage.mesh" />
+      
+      <BlinkingBillboard position="18.5,0.5,1.5" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=.5 quadratic=1 />
+      <BlinkingBillboard position="-18.5,0.5,1.5" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=.5 phase=180 quadratic=1 />
+
+	<!--Model mesh="cube.mesh" mass=10 position="0,0,0" scale3D="18,2,14" /-->
+	<!--Model mesh="cube.mesh" mass=10 position="0,2.5,0" scale3D="8,2.5,14" /-->
+
+    </attached>
+
+    <collisionShapes>
+      	<BoxCollisionShape position="0,0,0" halfExtents="18,2,14" />
+	<BoxCollisionShape position="0,2.5,0" halfExtents="8,2.5,14" />
+
+
+
+
+    </collisionShapes>
+
+
+
+<?lua
+  include("../includes/weaponSettingsCollateral.oxi")
+?>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipCDcameras defaults=0>
+  <SpaceShip>
+    <camerapositions>
+      <CameraPosition position="0,10, 40" drag=true mouselook=true />
+      <CameraPosition position="0,20, 80" drag=true mouselook=true />
+      <CameraPosition position="0,30,120" drag=true mouselook=true />
+      <CameraPosition position="0,50,150" drag=true mouselook=true />
+    </camerapositions>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipCDengine baseclass=MultiStateEngine>
+  <MultiStateEngine
+   boostfactor    = 5
+
+   speedfront     = 150
+   speedback      =  50
+   speedleftright =  50
+   speedupdown    =  50
+
+   defEngineSndNormal = "sounds/Engine_low.ogg"
+   defEngineSndBoost = "sounds/Engine_high.ogg"
+
+   accelerationfront     = 500
+   accelerationbrake     = 500
+   accelerationback      =  125
+   accelerationleftright =  125
+   accelerationupdown    =  125
+  >
+
+    <EffectContainer condition="idle">
+      <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+    </EffectContainer>
+    
+<EffectContainer condition="not idle">
+      <FadingBillboard mainstate=activity active=false scale=0.05 position="1, 0.5, 14" colour="1.0, 0.65, 0.2, 1.0" material="Examples/Flare" turnontime=0.2 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.05 position="-1, 0.5, 14" colour="1.0, 0.65, 0.2, 1.0" material="Examples/Flare" turnontime=0.2 turnofftime=0.5 />
+    </EffectContainer>
+    <EffectContainer condition="normal or brake">
+    </EffectContainer>
+
+    <EffectContainer condition="normal or boost">
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 1, 0, 17" colour="1, 0.4, 0.15, 1.0" width=6 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1.5 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-1, 0, 17" colour="1, 0.4, 0.15, 1.0" width=6 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1.5 turnofftime=1 material="Flares/ThrusterFlare1" />
+    </EffectContainer>
+
+    <EffectContainer condition="normal or boost">
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 8, 0, 12" colour="1, 0.8, 0, 0.3" width=6 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=3 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-8, 0, 12" colour="1, 0.8, 0, 0.3" width=6 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=3 turnofftime=1 material="Flares/ThrusterFlare1" />
+
+      <FadingBillboard mainstate=activity active=false scale=0.05 position="8, -1, 12" colour="1, 0.8, 0, 0.3" material="Examples/Flare" turnontime=1 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.05 position="-8, -1, 12" colour="1, 0.8, 0, 0.3" material="Examples/Flare" turnontime=1 turnofftime=0.5 />
+
+    </EffectContainer>
+
+
+    <EffectContainer condition="boost">
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 3, 0, 20" colour="0.8,0.4,0, 0.15" width=5 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1.5 turnofftime=0.5 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-3, 0, 20" colour="0.8,0.4,0, 0.15" width=5 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1.5 turnofftime=0.5 material="Examples/Flare" />
+    </EffectContainer>
+
+<!--    <EffectContainer condition="brake">
+      <FadingBillboard mainstate=activity active=false scale=0.3 position=" 8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.3 position="-8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position=" 8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position="-8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+    </EffectContainer>
+-->
+  </MultiStateEngine>
+</Template>
Index: code/trunk/data/levels/templates/spaceshipEscort.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipEscort.oxt	(revision 9525)
+++ code/trunk/data/levels/templates/spaceshipEscort.oxt	(revision 9526)
@@ -2,5 +2,5 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
-   camerapositiontemplate = spaceshipassffcameras
+   camerapositiontemplate = spaceshipescortcameras
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -39,6 +39,6 @@
   >
     <engines>
-      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
-      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipescortengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipescortengine />
     </engines>
     <attached>
@@ -62,9 +62,9 @@
 </Template>
 
-<Template name=spaceshipassffcameras defaults=0>
+<Template name=spaceshipescortcameras defaults=0>
   <SpaceShip>
     <camerapositions>
-      <CameraPosition position="0,13, 40" drag=true mouselook=true />
-      <CameraPosition position="0,20, 80" drag=true mouselook=true />
+      <CameraPosition position="0,15, 60" drag=true mouselook=true />
+      <CameraPosition position="0,20, 90" drag=true mouselook=true />
       <CameraPosition position="0,30,120" drag=true mouselook=true />
     </camerapositions>
@@ -72,5 +72,5 @@
 </Template>
 
-<Template name=spaceshipassffengine baseclass=MultiStateEngine>
+<Template name=spaceshipescortengine baseclass=MultiStateEngine>
   <MultiStateEngine
    boostfactor    = 2.2
Index: code/trunk/data/levels/templates/spaceshipTurret.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipTurret.oxt	(revision 9526)
+++ code/trunk/data/levels/templates/spaceshipTurret.oxt	(revision 9526)
@@ -0,0 +1,60 @@
+<Template name=spaceshipturret>
+  <SpaceShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipturretcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   shieldhealth        = 30
+   initialshieldhealth = 30
+   maxshieldhealth     = 50
+   shieldabsorption    = 0.8
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 100
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 15
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 9
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+  >
+    <attached>
+        <Model position="0,0,0" yaw="90" roll="-90" mesh="turretHead.mesh" scale3D="10,10,10"/>
+    </attached>
+    <collisionShapes>
+        <SphereCollisionShape radius="10"   position = "0,0,0"/>
+    </collisionShapes>
+<?lua
+  include("../includes/weaponSettingsTurret.oxi")
+?>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipturretcameras defaults=0>
+  <SpaceShip>
+    <camerapositions>
+      <CameraPosition position="0,10, 40" drag=true mouselook=true />
+      <CameraPosition position="0,20, 80" drag=true mouselook=true />
+      <CameraPosition position="0,30,120" drag=true mouselook=true />
+    </camerapositions>
+  </SpaceShip>
+</Template>
Index: code/trunk/data/levels/turretTest.oxw
===================================================================
--- code/trunk/data/levels/turretTest.oxw	(revision 9526)
+++ code/trunk/data/levels/turretTest.oxw	(revision 9526)
@@ -0,0 +1,61 @@
+<LevelInfo
+ name = "turret Test"
+ description = "A level with a turret in it."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipTurret.oxt")
+?>
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+
+
+<StaticEntity position="0,0,0" yaw=0 pitch=0>
+    <attached>
+        <Model position="0,0,0" mesh="turretSocketFront.mesh" scale3D="10,10,10" />
+        <Model position="0,0,0" mesh="turretSocketIn.mesh" scale3D="10,10,10" />
+        <Model position="0,0,0" mesh="turretSocketTop.mesh" scale3D="10,10,10" />
+        <Model position="0,0,0" mesh="turretSocketLeft.mesh" scale3D="10,10,10" />
+        <Model position="0,0,0" mesh="turretSocketRight.mesh" scale3D="10,10,10" />
+    </attached>
+</StaticEntity>
+
+
+
+<Turret position="0,10,0" pitch="90" yaw="0" roll="0">
+    <templates>
+        <Template link=spaceshipturret />
+    </templates>
+    <controller>
+        <WaypointPatrolController alertnessradius=100 team=10>
+        </WaypointPatrolController>
+     </controller>
+</Turret>
+
+
+
+    
+  </Scene>
+</Level>
+
Index: code/trunk/data/overlays/HUD.oxo
===================================================================
--- code/trunk/data/overlays/HUD.oxo	(revision 9525)
+++ code/trunk/data/overlays/HUD.oxo	(revision 9526)
@@ -52,5 +52,5 @@
    value      = 0
   >
-    <BarColour position = 0.7 colour = "0.2,0.7,0.2" />
+    <BarColounar position = 0.7 colour = "0.2,0.7,0.2" />
     <BarColour position = 0.4 colour = "0.7,0.5,0.2" />
     <BarColour position = 0.1 colour = "0.7,0.2,0.2" />
@@ -63,5 +63,5 @@
    textSize      = 0.05
    navMarkerSize = 0.03
-   aimMarkerSize = 0.04
+   aimMarkerSize = 0.02
   />
 
Index: code/trunk/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/trunk/data/overlays/HUDTemplates3.oxo	(revision 9525)
+++ code/trunk/data/overlays/HUDTemplates3.oxo	(revision 9526)
@@ -105,5 +105,5 @@
      textsize      = 0.05
      navMarkerSize = 0.03
-     aimMarkerSize = 0.04
+     aimMarkerSize = 0.02
     />
 
Index: code/trunk/src/modules/gametypes/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/gametypes/CMakeLists.txt	(revision 9525)
+++ code/trunk/src/modules/gametypes/CMakeLists.txt	(revision 9526)
@@ -5,4 +5,6 @@
   OldSpaceRace.cc
   OldRaceCheckPoint.cc
+  SpaceRaceBot.cc
+  SpaceRaceController.cc
 )
 
Index: code/trunk/src/modules/gametypes/GametypesPrereqs.h
===================================================================
--- code/trunk/src/modules/gametypes/GametypesPrereqs.h	(revision 9525)
+++ code/trunk/src/modules/gametypes/GametypesPrereqs.h	(revision 9526)
@@ -67,4 +67,7 @@
     class SpaceRace;
     class OldSpaceRace;
+    class SpaceRaceManager;
+    class SpaceRaceBot;
+    class SpaceRaceController;
 }
 
Index: code/trunk/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.cc	(revision 9525)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.cc	(revision 9526)
@@ -43,8 +43,8 @@
     CreateFactory(RaceCheckPoint);
 
-    RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceMultiTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
+    RaceCheckPoint::RaceCheckPoint(BaseObject* creator) : DistanceMultiTrigger(creator),
+            RadarViewable(creator, static_cast<WorldEntity*> (this))
     {
         RegisterObject(RaceCheckPoint);
-
         this->setDistance(100);
         this->setBeaconMode("off");
@@ -60,11 +60,14 @@
         this->bIsLast_ = false;
         this->timeLimit_ = 0;
-        this->player_ = NULL;
-    }
-
-
-   RaceCheckPoint::~RaceCheckPoint()
-   {
-   }
+        //this->players_ = vector<PlayerInfo*>();
+
+        myPosition_= this->getPosition(); //eingefuegt
+        //orxout(user_status) << "test" << std::endl;
+    }
+
+    RaceCheckPoint::~RaceCheckPoint()
+    {
+
+    }
 
     void RaceCheckPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -86,5 +89,5 @@
             ControllableEntity* entity = orxonox_cast<ControllableEntity*>(originator);
             if (entity)
-                this->player_ = entity->getPlayer();
+                this->players_.push_back(entity->getPlayer());
         }
     }
@@ -95,6 +98,6 @@
         if (this->timeLimit_ != 0)
         {
-            std::string message =  "You have " + multi_cast<std::string>(this->timeLimit_)
-                        + " seconds to reach the check point " + multi_cast<std::string>(this->checkpointIndex_ + 1);
+            std::string message = "You have " + multi_cast<std::string>(this->timeLimit_)
+            + " seconds to reach the check point " + multi_cast<std::string>(this->checkpointIndex_ + 1);
             this->getGametype()->getGametypeInfo()->sendAnnounceMessage(message);
             ChatManager::message(message);
@@ -102,4 +105,38 @@
     }
 
+    //Must not be called before setNextCheckpointsAsVector3 at least once has been called
+    void RaceCheckPoint::setNextVirtualCheckpointsAsVector3(const Vector3& checkpoints){
+        /*std::set<int> lastcheckpoints=this->nextCheckpoints_;
+        nextCheckpoints_.clear();
+        std::set<int>::iterator it = lastcheckpoints.begin();
+        if(checkpoints.x<-1){
+            virtualToRealCheckPoints_.insert(std::pair<int,int>(checkpoints.x,(*it)));
+            it++;
+        }
+        if(checkpoints.x!=-1)
+            this->nextCheckpoints_.insert(static_cast<int>(checkpoints.x + 0.5)); // the red number has the type double and for the cast (to int) is added 0.5 so that the cast works correctly
+
+        if(checkpoints.y<-1){
+                    virtualToRealCheckPoints_.insert(std::pair<int,int>(checkpoints.y,(*it)));
+                    it++;
+        }
+        if(checkpoints.y!=-1)
+            this->nextCheckpoints_.insert(static_cast<int>(checkpoints.y + 0.5));
+
+        if(checkpoints.z<-1){
+                    virtualToRealCheckPoints_.insert(std::pair<int,int>(checkpoints.z,(*it)));
+                    it++;
+        }
+        if(checkpoints.z!=-1)
+            this->nextCheckpoints_.insert(static_cast<int>(checkpoints.z + 0.5));*/
+        nextCheckpointsVirtual_.clear();
+        if(checkpoints.x!=-1)
+            nextCheckpointsVirtual_.insert(checkpoints.x);
+        if(checkpoints.y!=-1)
+                nextCheckpointsVirtual_.insert(checkpoints.y);
+        if(checkpoints.z!=-1)
+                nextCheckpointsVirtual_.insert(checkpoints.z);
+    }
+
     void RaceCheckPoint::setNextCheckpointsAsVector3(const Vector3& checkpoints)
     {
@@ -107,17 +144,83 @@
 
         if (checkpoints.x > -1)
-            this->nextCheckpoints_.insert(static_cast<int>(checkpoints.x + 0.5));
+        this->nextCheckpoints_.insert(static_cast<int>(checkpoints.x + 0.5)); // the red number has the type double and for the cast (to int) is added 0.5 so that the cast works correctly
         if (checkpoints.y > -1)
-            this->nextCheckpoints_.insert(static_cast<int>(checkpoints.y + 0.5));
+        this->nextCheckpoints_.insert(static_cast<int>(checkpoints.y + 0.5));
         if (checkpoints.z > -1)
-            this->nextCheckpoints_.insert(static_cast<int>(checkpoints.z + 0.5));
-    }
-
-    Vector3 RaceCheckPoint::getNextCheckpointsAsVector3() const
+        this->nextCheckpoints_.insert(static_cast<int>(checkpoints.z + 0.5));
+
+        this->nextCheckpointsVirtual_=nextCheckpoints_;
+    }
+
+    PlayerInfo* RaceCheckPoint::getPlayer(unsigned int clientID) const
+    {
+        if (players_.size() > 0)
+        {
+            for (int i = 0; i < players_.size(); i++)
+            {
+                if (this->players_[i]->getClientID() == clientID)
+                {
+                    return players_[i];
+                }
+            }
+        }
+        return NULL;
+    }
+
+    bool RaceCheckPoint::playerWasHere(PlayerInfo* player) const
+    {
+        if (players_.size() > 0)
+        {
+            for (int i = 0; i < players_.size(); i++)
+            {
+                if (this->players_[i] == player)
+                {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    Vector3 RaceCheckPoint::getNextCheckpointsAsVector3()
+    {
+        Vector3 checkpoints(-1,-1,-1); int count=0;
+        for (std::set<int>::iterator it= nextCheckpoints_.begin();it!=nextCheckpoints_.end(); it++ ){
+            switch (count)
+                        {
+                            case 0: checkpoints.x = static_cast<Ogre::Real>(*it); break;
+                            case 1: checkpoints.y = static_cast<Ogre::Real>(*it); break;
+                            case 2: checkpoints.z = static_cast<Ogre::Real>(*it); break;
+                        }
+                        ++count;
+        }
+        return checkpoints;
+        //= getVirtualNextCheckpointsAsVector3();
+        int j[3];
+        j[0]=changeVirtualToRealCheckPoint(checkpoints.x);
+        j[1]=changeVirtualToRealCheckPoint(checkpoints.y);
+        j[2]=changeVirtualToRealCheckPoint(checkpoints.z);
+
+
+        return Vector3(j[0],j[1],j[2]);
+
+
+    }
+
+    int RaceCheckPoint::changeVirtualToRealCheckPoint(int checkpointID) {
+        int temp=checkpointID;
+        while(temp<-1){
+            temp = this->virtualToRealCheckPoints_[temp];
+        }
+        return temp;
+    }
+
+
+    Vector3 RaceCheckPoint::getVirtualNextCheckpointsAsVector3() const
     {
         Vector3 checkpoints = Vector3(-1, -1, -1);
 
         size_t count = 0;
-        for (std::set<int>::iterator it = this->nextCheckpoints_.begin(); it != this->nextCheckpoints_.end(); ++it)
+        for (std::set<int>::iterator it = this->nextCheckpointsVirtual_.begin(); it != this->nextCheckpointsVirtual_.end(); ++it)
         {
             switch (count)
Index: code/trunk/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.h	(revision 9525)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.h	(revision 9526)
@@ -37,9 +37,10 @@
 {
     /**
-    @brief
-        The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
-        Don't forget to control the indexes of your check points and to set one last check point
-    */
-    class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable
+     @brief
+     The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
+     Don't forget to control the indexes of your check points and to set one last check point
+     */
+    class _GametypesExport RaceCheckPoint: public DistanceMultiTrigger,
+            public RadarViewable
     {
         public:
@@ -50,39 +51,76 @@
 
             inline void setCheckpointIndex(int checkpointIndex)
-                { this->checkpointIndex_ = checkpointIndex; }
+            {
+                this->checkpointIndex_ = checkpointIndex;
+            }
             inline int getCheckpointIndex() const
-                { return this->checkpointIndex_; }
+            {
+                return this->checkpointIndex_;
+            }
 
             void setNextCheckpointsAsVector3(const Vector3& checkpoints);
-            Vector3 getNextCheckpointsAsVector3() const;
-            const std::set<int>& getNextCheckpoints() const
-                { return this->nextCheckpoints_; }
+            Vector3 getNextCheckpointsAsVector3();
+            Vector3 getVirtualNextCheckpointsAsVector3() const;
+            void setNextVirtualCheckpointsAsVector3(const Vector3& checkpoints);
+            int changeVirtualToRealCheckPoint(int);
 
+            const std::set<int>& getVirtualNextCheckpoints() const
+            {
+                return this->nextCheckpointsVirtual_;
+            }
+
+            const std::set<int>& getNextCheckpoints()
+            {
+                return nextCheckpoints_;
+                std::set<int> temp;
+                std::set<int> temp2=getVirtualNextCheckpoints();
+                for (std::set<int>::iterator it = temp2.begin(); it!=temp2.end(); ++it){
+                    temp.insert(changeVirtualToRealCheckPoint((*it)));
+                }
+                return temp;
+            }
             inline void setLast(bool isLast)
-                { this->bIsLast_ = isLast; }
+            {
+                this->bIsLast_ = isLast;
+            }
             inline bool isLast() const
-                { return this->bIsLast_; }
+            {
+                return this->bIsLast_;
+            }
 
             virtual void setTimelimit(float timeLimit);
             inline float getTimeLimit() const
-                { return this->timeLimit_; }
+            {
+                return this->timeLimit_;
+            }
 
-            inline PlayerInfo* getPlayer() const
-                { return this->player_; }
+            PlayerInfo* getPlayer(unsigned int clientID) const;
+
+            bool playerWasHere(PlayerInfo* ) const;
+
             inline void resetPlayer()
-                { this->player_ = NULL; }
+            {
+                this->players_.clear();
+            }
 
         protected:
+
             virtual void fire(bool bIsTriggered, BaseObject* originator);
 
             inline const WorldEntity* getWorldEntity() const
-                { return this; }
+            {
+                return this;
+            }
 
         private:
-            int checkpointIndex_;           ///< The index of this check point. The race starts with the check point with the index 0
+
+            int checkpointIndex_; ///< The index of this check point. The race starts with the check point with the index 0
             std::set<int> nextCheckpoints_; ///< the indexes of the next check points
-            bool bIsLast_;                  ///< True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
-            float timeLimit_;               ///< The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
-            PlayerInfo* player_;            ///< The player that reached the checkpoint
+            bool bIsLast_; ///< True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
+            float timeLimit_; ///< The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
+            std::vector<PlayerInfo*> players_; ///< The player that reached the checkpoint
+            Vector3 myPosition_;
+            std::set<int>  nextCheckpointsVirtual_;
+            std::map<int,int> virtualToRealCheckPoints_; // if virtualChepoint was inserted the original can be reconstructed
     };
 }
Index: code/trunk/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.cc	(revision 9525)
+++ code/trunk/src/modules/gametypes/SpaceRace.cc	(revision 9526)
@@ -35,5 +35,5 @@
 #include "util/Convert.h"
 #include "util/Math.h"
-
+#include "SpaceRaceBot.h"
 #include "items/Engine.h"
 
@@ -46,4 +46,5 @@
         RegisterObject(SpaceRace);
 
+        this->botclass_ = Class(SpaceRaceBot);//ClassByString("")
         this->cantMove_ = false;
         this->bTimeIsUp_ = false;
Index: code/trunk/src/modules/gametypes/SpaceRaceBot.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceBot.cc	(revision 9526)
+++ code/trunk/src/modules/gametypes/SpaceRaceBot.cc	(revision 9526)
@@ -0,0 +1,38 @@
+/*
+ *   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.
+ *
+ *  Created on: Oct 8, 2012
+ *      Author: purgham
+ */
+
+#include "SpaceRaceBot.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(SpaceRaceBot);
+
+    SpaceRaceBot::SpaceRaceBot(BaseObject* creator) : Bot(creator){
+        RegisterObject(SpaceRaceBot);
+        this->defaultController_ = Class(SpaceRaceController);// ClassByString("")
+        this->createController();
+    }
+}
Index: code/trunk/src/modules/gametypes/SpaceRaceBot.h
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceBot.h	(revision 9526)
+++ code/trunk/src/modules/gametypes/SpaceRaceBot.h	(revision 9526)
@@ -0,0 +1,49 @@
+/*
+ *   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.
+ *
+ *  Created on: Oct 8, 2012
+ *      Author: purgham
+ */
+
+#ifndef SPACERACEBOT_H_
+#define SPACERACEBOT_H_
+
+#include "infos/Bot.h"
+#include "gametypes/GametypesPrereqs.h"
+#include "gametypes/SpaceRaceController.h"
+
+
+namespace orxonox
+{
+
+    /**
+
+    */
+    class _GametypesExport SpaceRaceBot: public Bot
+    {
+        public:
+        SpaceRaceBot(BaseObject* creator);
+            virtual ~SpaceRaceBot() {}
+    };
+}
+
+
+#endif /* SPACERACEBOT_H_ */
Index: code/trunk/src/modules/gametypes/SpaceRaceController.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceController.cc	(revision 9526)
+++ code/trunk/src/modules/gametypes/SpaceRaceController.cc	(revision 9526)
@@ -0,0 +1,606 @@
+/*
+ *   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.
+ *
+ *  Created on: Oct 8, 2012
+ *      Author: purgham
+ */
+
+/**
+ * Conventions:
+ * -first Checkpoint has index 0
+ * -staticCheckPoint= static Point (see def over = constructor)
+ */
+
+/*TODO:
+ * tICK KORRIGIEREN
+ *
+ *
+ */
+#include <gametypes/SpaceRaceController.h>
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "gametypes/SpaceRaceManager.h"
+#include "collisionshapes/CollisionShape.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+
+
+namespace orxonox
+{
+    CreateFactory(SpaceRaceController);
+
+    const int ADJUSTDISTANCE = 500;
+    const int MINDISTANCE = 5;
+    /*
+     * Idea: Find static Point (checkpoints the spaceship has to reach)
+     */
+    SpaceRaceController::SpaceRaceController(BaseObject* creator) :
+        ArtificialController(creator)
+    {
+        RegisterObject(SpaceRaceController)
+;        std::vector<RaceCheckPoint*> checkpoints;
+
+        virtualCheckPointIndex = -2;
+        for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it != ObjectList<SpaceRaceManager>::end(); ++it)
+        {
+            checkpoints = it->getAllCheckpoints();
+            nextRaceCheckpoint_ = it->findCheckpoint(0);
+        }
+
+        OrxAssert(!checkpoints.empty(), "No Checkpoints in Level");
+        checkpoints_ = checkpoints;
+        /*orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;
+        for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++)
+        {
+            orxout()<<"Checkpoint "<<(*it)->getCheckpointIndex()<<"; NExtReal: ";
+            std::set<int> temp =(*it)->getNextCheckpoints();
+            for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
+            {
+                orxout()<<(*ii)<<", ";
+            }
+
+            orxout()<<" NextVirtual: ";
+            temp=(*it)->getVirtualNextCheckpoints();
+            for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
+            {
+                orxout()<<(*ii)<<", ";
+            }
+            orxout()<<endl<<endl;
+
+        }//ausgabe*/
+
+        for (std::vector<RaceCheckPoint*>::iterator it = checkpoints.begin(); it != checkpoints.end(); ++it)
+        {
+            std::set<int> nextCheckPoints = ((*it)->getNextCheckpoints());
+            if(!nextCheckPoints.empty())
+            {
+                for (std::set<int>::iterator numb = nextCheckPoints.begin(); numb!=nextCheckPoints.end(); numb++)
+                {
+                    RaceCheckPoint* point2 = findCheckpoint((*numb));
+
+                    //if(point2 != NULL)
+                    //placeVirtualCheckpoints((*it), point2);
+                }
+            }
+        }/*
+        for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++)
+        {
+            orxout()<<"Checkpoint "<<(*it)->getCheckpointIndex()<<"; NExtReal: ";
+            std::set<int> temp =(*it)->getNextCheckpoints();
+            for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
+            {
+                orxout()<<(*ii)<<", ";
+            }
+
+            orxout()<<" NextVirtual: ";
+            temp=(*it)->getVirtualNextCheckpoints();
+            for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
+            {
+                orxout()<<(*ii)<<", ";
+            }
+            orxout()<<endl;
+
+        }//ausgabe
+        orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;*/
+        staticRacePoints_ = findStaticCheckpoints(checkpoints);
+        // initialisation of currentRaceCheckpoint_
+        currentRaceCheckpoint_ = NULL;
+
+        int i;
+        for (i = -2; findCheckpoint(i) != NULL; i--)
+        {
+            continue;
+        }
+        //orxout()<<"Die ANzahl der virtuellen CP betraegt: "<< (-i)-2<<endl;
+
+    }
+
+    //------------------------------
+    // functions for initialisation
+
+    void SpaceRaceController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(SpaceRaceController, XMLPort, xmlelement, mode);
+        XMLPortParam(ArtificialController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
+        XMLPortObject(ArtificialController, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);
+    }
+
+    /*
+     * called from constructor 'SpaceRaceController'
+     * returns a vector of static Point (checkpoints the spaceship has to reach)
+     */
+    std::vector<RaceCheckPoint*> SpaceRaceController::findStaticCheckpoints(std::vector<RaceCheckPoint*> allCheckpoints)
+    {
+        std::map<RaceCheckPoint*, int> * zaehler = new std::map<RaceCheckPoint*, int>(); // counts how many times the checkpoint was reached (for simulation)
+        for (unsigned int i = 0; i < allCheckpoints.size(); i++)
+        {
+            zaehler->insert(std::pair<RaceCheckPoint*, int>(allCheckpoints[i],0));
+        }
+        int maxWays = rekSimulationCheckpointsReached(zaehler->begin()->first, zaehler);
+
+        std::vector<RaceCheckPoint*> returnVec;
+        returnVec.clear();
+        for (std::map<RaceCheckPoint*, int>::iterator iter = zaehler->begin(); iter != zaehler->end(); iter++)
+        {
+            if (iter->second == maxWays)
+            {
+                //returnVec.insert(allCheckpoints[1]);
+                returnVec.insert(returnVec.end(), iter->first);
+            }
+        }
+        delete zaehler;
+        return returnVec;
+    }
+
+    /*
+     * called from 'findStaticCheckpoints'
+     * return how many ways go from the given Checkpoint to the last Checkpoint (of the Game)
+     */
+    int SpaceRaceController::rekSimulationCheckpointsReached(RaceCheckPoint* currentCheckpoint, std::map<RaceCheckPoint*, int>* zaehler)
+    {
+
+        if (currentCheckpoint->isLast())
+        {// last point reached
+
+            (*zaehler)[currentCheckpoint] += 1;
+            return 1; // 1 Way form the last point to this one
+        }
+        else
+        {
+            int numberOfWays = 0; // counts number of ways from this Point to the last point
+            for (std::set<int>::iterator it = currentCheckpoint->getVirtualNextCheckpoints().begin(); it!= currentCheckpoint->getVirtualNextCheckpoints().end(); ++it)
+            {
+                if(currentCheckpoint == findCheckpoint(*it))
+                {
+                    //orxout() << currentCheckpoint->getCheckpointIndex()<<endl;
+                    continue;
+                }
+                if(findCheckpoint(*it) == NULL)
+                    {orxout()<<"Problematic Point: "<<(*it)<<endl;}
+                numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(*it), zaehler);
+            }
+            (*zaehler)[currentCheckpoint] += numberOfWays;
+            return numberOfWays; // returns the number of ways from this point to the last one
+        }
+    }
+
+    //-------------------------------------
+    // functions for dynamic Way-search
+
+    int SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint)
+    {
+        if (this->getControllableEntity() != NULL)
+        {
+            return (CheckPoint->getPosition()- this->getControllableEntity()->getPosition()).length();
+        }
+        return -1;
+    }
+
+    /*
+     * called by: 'tick' or  'adjustNextPoint'
+     * returns the next Checkpoint which the shortest way contains
+     */
+    RaceCheckPoint* SpaceRaceController::nextPointFind(RaceCheckPoint* raceCheckpoint)
+    {
+        int distances[] = {-1, -1, -1};
+        int temp_i = 0;
+        for (std::set<int>::iterator it =raceCheckpoint->getVirtualNextCheckpoints().begin(); it!= raceCheckpoint->getVirtualNextCheckpoints().end(); ++it)
+        {
+            distances[temp_i] = recCalculateDistance(findCheckpoint(*it), this->getControllableEntity()->getPosition());
+            temp_i++;
+        }
+        if (distances[0] > distances[1] && distances[1] != -1)
+        {
+            if (distances[2] < distances[1] && distances[2] != -1)
+            {
+                return findCheckpoint(*raceCheckpoint->getVirtualNextCheckpoints().end()); // return checkpoint with ID of raceCheckpoint->getNextCheckpoints() [2]
+            }
+            else
+            {
+                std::set<int>::iterator temp = raceCheckpoint->getVirtualNextCheckpoints().begin();
+                return findCheckpoint(*(++temp)); // return [1]
+            }
+        }
+        else
+        {
+            if (distances[2] < distances[0] && distances[2] != -1)
+            {
+                return findCheckpoint(*raceCheckpoint->getVirtualNextCheckpoints().end()); // return [2]
+            }
+            else
+            {
+                return findCheckpoint(*raceCheckpoint->getVirtualNextCheckpoints().begin()); // return [0]
+            }
+        }
+    }
+
+    /*
+     * called from 'nextPointFind'
+     * returns the distance between "currentPosition" and the next static checkpoint that can be reached from "currentCheckPoint"
+     */
+    int SpaceRaceController::recCalculateDistance(RaceCheckPoint* currentCheckPoint, Vector3 currentPosition)
+    {
+        // find: looks if the currentCheckPoint is a staticCheckPoint (staticCheckPoint is the same as: static Point)
+        if (std::find(staticRacePoints_.begin(), staticRacePoints_.end(), currentCheckPoint) != staticRacePoints_.end())
+        {
+            return (currentCheckPoint->getPosition() - currentPosition).length();
+        }
+        else
+        {
+            int minimum = std::numeric_limits<int>::max();
+            for (std::set<int>::iterator it = currentCheckPoint->getVirtualNextCheckpoints().begin(); it != currentCheckPoint->getVirtualNextCheckpoints().end(); ++it)
+            {
+                int dist_currentCheckPoint_currentPosition = static_cast<int> ((currentPosition- currentCheckPoint->getPosition()).length());
+
+                minimum = std::min(minimum, dist_currentCheckPoint_currentPosition + recCalculateDistance(findCheckpoint(*it), currentCheckPoint->getPosition()));
+                // minimum of distanz from 'currentPosition' to the next static Checkpoint
+            }
+            return minimum;
+        }
+    }
+
+    /*called by 'tick'
+     *adjust chosen way of the Spaceship every "AdjustDistance" because spaceship could be displaced through an other one
+     */
+    RaceCheckPoint* SpaceRaceController::adjustNextPoint()
+    {
+        if (currentRaceCheckpoint_ == NULL) // no Adjust possible
+
+        {
+            return nextRaceCheckpoint_;
+        }
+        if ((currentRaceCheckpoint_->getVirtualNextCheckpoints()).size() == 1) // no Adjust possible
+
+        {
+            return nextRaceCheckpoint_;
+        }
+
+        //Adjust possible
+
+        return nextPointFind(currentRaceCheckpoint_);
+    }
+
+    RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const
+    {
+        for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+        if (this->checkpoints_[i]->getCheckpointIndex() == index)
+        return this->checkpoints_[i];
+        return NULL;
+    }
+
+    /*RaceCheckPoint* SpaceRaceController::addVirtualCheckPoint( RaceCheckPoint* previousCheckpoint, int indexFollowingCheckPoint , Vector3 virtualCheckPointPosition )
+    {
+        orxout()<<"add VCP at"<<virtualCheckPointPosition.x<<", "<<virtualCheckPointPosition.y<<", "<<virtualCheckPointPosition.z<<endl;
+        RaceCheckPoint* newTempRaceCheckPoint;
+        for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it!= ObjectList<SpaceRaceManager>::end(); ++it)
+        {
+            newTempRaceCheckPoint = new RaceCheckPoint((*it));
+        }
+        newTempRaceCheckPoint->setVisible(false);
+        newTempRaceCheckPoint->setPosition(virtualCheckPointPosition);
+        newTempRaceCheckPoint->setCheckpointIndex(virtualCheckPointIndex);
+        newTempRaceCheckPoint->setLast(false);
+        newTempRaceCheckPoint->setNextVirtualCheckpointsAsVector3(Vector3(indexFollowingCheckPoint,-1,-1));
+
+        Vector3 temp = previousCheckpoint->getVirtualNextCheckpointsAsVector3();
+        //orxout()<<"temp bei 0: ="<< temp.x<< temp.y<< temp.z<<endl;
+        checkpoints_.insert(checkpoints_.end(), newTempRaceCheckPoint);
+        int positionInNextCheckPoint;
+        for (int i = 0; i <3; i++)
+        {
+            if(previousCheckpoint->getVirtualNextCheckpointsAsVector3()[i] == indexFollowingCheckPoint)
+            positionInNextCheckPoint=i;
+        }
+        switch(positionInNextCheckPoint)
+        {
+            case 0: temp.x=virtualCheckPointIndex; break;
+            case 1: temp.y=virtualCheckPointIndex; break;
+            case 2: temp.z=virtualCheckPointIndex; break;
+        }
+        previousCheckpoint->setNextVirtualCheckpointsAsVector3(temp); //Existiert internes Problem bei negativen index fueer next Checkpoint
+        virtualCheckPointIndex--;
+        //orxout()<<"temp bei 1: ="<< temp.x<< temp.y<< temp.z<<endl;
+        //orxout()<<"temp nach ausgabe: "<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().x<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().y<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().z<<endl;
+        //OrxAssert(virtualCheckPointIndex < -1, "TO much virtual cp");
+        /*orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<", following:"<<indexFollowingCheckPoint<<" :       "<<temp.x<<", "<<temp.y<<", "<<temp.z<<";       ";
+         temp=previousCheckpoint->getNextCheckpointsAsVector3();
+         orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<":       "<<temp.x<<", "<<temp.y<<", "<<temp.z<<";       ";
+         orxout()<<endl;*//*
+        return newTempRaceCheckPoint;
+    }*/
+
+    SpaceRaceController::~SpaceRaceController()
+    {
+        for (int i =-1; i>virtualCheckPointIndex; i--)
+        {
+            delete findCheckpoint(i);
+        }
+    }
+
+    void SpaceRaceController::tick(float dt)
+    {
+        if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL )
+        {
+            //orxout()<< this->getControllableEntity() << " in tick"<<endl;
+            return;
+        }
+        //FOR virtual Checkpoints
+        if(nextRaceCheckpoint_->getCheckpointIndex() < 0)
+        {
+            if( distanceSpaceshipToCheckPoint(nextRaceCheckpoint_) < 200)
+            {
+                currentRaceCheckpoint_=nextRaceCheckpoint_;
+                nextRaceCheckpoint_ = nextPointFind(nextRaceCheckpoint_);
+                lastPositionSpaceship=this->getControllableEntity()->getPosition();
+                //orxout()<< "CP "<< currentRaceCheckpoint_->getCheckpointIndex()<<" chanched to: "<< nextRaceCheckpoint_->getCheckpointIndex()<<endl;
+            }
+        }
+
+        if (nextRaceCheckpoint_->playerWasHere(this->getControllableEntity()->getPlayer()))
+        {//Checkpoint erreicht
+
+            currentRaceCheckpoint_ = nextRaceCheckpoint_;
+            OrxAssert(nextRaceCheckpoint_, "next race checkpoint undefined");
+            nextRaceCheckpoint_ = nextPointFind(nextRaceCheckpoint_);
+            lastPositionSpaceship = this->getControllableEntity()->getPosition();
+            //orxout()<< "CP "<< currentRaceCheckpoint_->getCheckpointIndex()<<" chanched to: "<< nextRaceCheckpoint_->getCheckpointIndex()<<endl;
+        }
+        else if ((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()/dt > ADJUSTDISTANCE)
+        {
+            nextRaceCheckpoint_ = adjustNextPoint();
+            lastPositionSpaceship = this->getControllableEntity()->getPosition();
+        }
+
+        // Abmessung fuer MINDISTANCE gut;
+
+        else if((lastPositionSpaceship - this->getControllableEntity()->getPosition()).length()/dt < MINDISTANCE )
+        {
+            this->moveToPosition(Vector3(rnd()*100, rnd()*100, rnd()*100));
+            this->spin();
+            //orxout(user_status) << "Mindistance reached" << std::endl;
+            return;
+        }
+        //orxout(user_status) << "dt= " << dt << ";  distance= " << (lastPositionSpaceship-this->getControllableEntity()->getPosition()).length() <<std::endl;
+        lastPositionSpaceship = this->getControllableEntity()->getPosition();
+        this->moveToPosition(nextRaceCheckpoint_->getPosition());
+    }
+
+    // True if a coordinate of 'pointToPoint' is smaller then the corresponding coordinate of 'groesse'
+    bool SpaceRaceController::vergleicheQuader(Vector3 pointToPoint, Vector3 groesse)
+    {
+        if(abs(pointToPoint.x) < groesse.x)
+            return true;
+        if(abs(pointToPoint.y) < groesse.y)
+            return true;
+        if(abs(pointToPoint.z) < groesse.z)
+            return true;
+        return false;
+
+    }
+
+    bool SpaceRaceController::directLinePossible(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2,std::vector<StaticEntity*> allObjects)
+    {
+
+        Vector3 cP1ToCP2 = (racepoint2->getPosition() - racepoint1->getPosition()) / (racepoint2->getPosition() - racepoint1->getPosition()).length(); //unit Vector
+        Vector3 centerCP1 = racepoint1->getPosition();
+        btVector3 positionObject;
+        btScalar radiusObject;
+
+        for (std::vector<StaticEntity*>::iterator it = allObjects.begin(); it != allObjects.end(); ++it)
+        {
+            for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape) != 0; everyShape++)
+            {
+                btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
+                if(currentShape == NULL)
+                continue;
+
+                currentShape->getBoundingSphere(positionObject,radiusObject);
+                Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
+                if((powf((cP1ToCP2.dotProduct(centerCP1-positionObjectNonBT)),2)-(centerCP1-positionObjectNonBT).dotProduct(centerCP1-positionObjectNonBT)+powf(radiusObject, 2))>0)
+                {
+                    return false;
+                }
+
+            }
+        }
+        return true;
+
+    }
+
+    /*void SpaceRaceController::computeVirtualCheckpoint(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2, std::vector<StaticEntity*> allObjects)
+    {
+        Vector3 cP1ToCP2=(racepoint2->getPosition()-racepoint1->getPosition()) / (racepoint2->getPosition()-racepoint1->getPosition()).length(); //unit Vector
+        Vector3 centerCP1=racepoint1->getPosition();
+        btVector3 positionObject;
+        btScalar radiusObject;
+
+        for (std::vector<StaticEntity*>::iterator it = allObjects.begin(); it != allObjects.end(); ++it)
+        {
+            for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape) != 0; everyShape++)
+            {
+                btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
+                if(currentShape == NULL)
+                continue;
+
+                currentShape->getBoundingSphere(positionObject,radiusObject);
+                Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
+				Vector3 norm_r_CP = cP1ToCP2.crossProduct(centerCP1-positionObjectNonBT);
+
+				if(norm_r_CP.length() == 0){
+					Vector3 zufall;
+                    do{
+                        zufall=Vector3(rnd(),rnd(),rnd());//random
+                    }while((zufall.crossProduct(cP1ToCP2)).length() == 0);
+					norm_r_CP=zufall.crossProduct(cP1ToCP2);
+				}
+				Vector3 VecToVCP = norm_r_CP.crossProduct(cP1ToCP2);
+				float distanzToCP1 = sqrt(powf(radiusObject,4)/(powf((centerCP1-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
+				float distanzToCP2 = sqrt(powf(radiusObject,4)/(powf((racepoint2->getPosition()-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
+                float distanz = std::max(distanzToCP1,distanzToCP2);
+				//float distanz = 0.0f; //TEMPORARY
+				Vector3 newCheckpointPositionPos = positionObjectNonBT+(distanz*VecToVCP)/VecToVCP.length();
+				Vector3 newCheckpointPositionNeg = positionObjectNonBT-(distanz*VecToVCP)/VecToVCP.length();
+				if((newCheckpointPositionPos - centerCP1).length() + (newCheckpointPositionPos - (centerCP1+cP1ToCP2)).length() < (newCheckpointPositionNeg - centerCP1).length() + (newCheckpointPositionNeg - (centerCP1+cP1ToCP2)).length() )
+				{
+					RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionPos);
+				}
+				else
+				{
+					RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionNeg);
+				}
+				return;
+            }
+        }
+
+    }*/
+
+    /*void SpaceRaceController::placeVirtualCheckpoints(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2)
+    {
+        Vector3 point1 = racepoint1->getPosition();
+        Vector3 point2 = racepoint2->getPosition();
+        std::vector<StaticEntity*> problematicObjects;
+
+        for (ObjectList<StaticEntity>::iterator it = ObjectList<StaticEntity>::begin(); it!= ObjectList<StaticEntity>::end(); ++it)
+        {
+
+            if (dynamic_cast<RaceCheckPoint*>(*it) != NULL)
+            {
+                continue;
+            } // does not work jet
+
+            problematicObjects.insert(problematicObjects.end(), *it);
+            //it->getScale3D();// vector fuer halbe wuerfellaenge
+        }
+
+        if(!directLinePossible(racepoint1, racepoint2, problematicObjects))
+        {
+            //orxout()<<"From "<<racepoint1->getCheckpointIndex()<<" to "<<racepoint2->getCheckpointIndex()<<"produces: "<< virtualCheckPointIndex<<endl;
+            computeVirtualCheckpoint(racepoint1, racepoint2, problematicObjects);
+        }
+
+        //
+        //        do{
+        //            zufall=Vector3(rnd(),rnd(),rnd());//random
+        //        }while((zufall.crossProduct(objectmiddle-racepoint1->getPosition())).length()==0);
+        //
+        //        Vector3 normalvec=zufall.crossProduct(objectmiddle-racepoint1->getPosition());
+        //        // a'/b'=a/b => a' =b'*a/b
+        //        float laengeNormalvec=(objectmiddle-racepoint1->getPosition()).length()/sqrt((objectmiddle-racepoint1->getPosition()).squaredLength()-radius*radius)*radius;
+        //        addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), objectmiddle+normalvec/normalvec.length()*laengeNormalvec);
+
+        //        Vector3 richtungen [6];
+        //        richtungen[0]= Vector3(1,0,0);
+        //        richtungen[1]= Vector3(-1,0,0);
+        //        richtungen[2]= Vector3(0,1,0);
+        //        richtungen[3]= Vector3(0,-1,0);
+        //        richtungen[4]= Vector3(0,0,1);
+        //        richtungen[5]= Vector3(0,0,-1);
+        //
+        //        for (int i = 0; i< 6; i++)
+        //        {
+        //            const int STEPS=100;
+        //            const float PHI=1.1;
+        //            bool collision=false;
+        //
+        //            for (int j =0; j<STEPS; j++)
+        //            {
+        //                Vector3 tempPosition=(point1 - (point2-point1+richtungen[i]*PHI)*(float)j/STEPS);
+        //                for (std::vector<StaticEntity*>::iterator it = problematicObjects.begin(); it!=problematicObjects.end(); ++it)
+        //                {
+        //                    btVector3 positionObject;
+        //                    btScalar radiusObject;
+        //                    if((*it)==NULL)
+        //                    {   orxout()<<"Problempoint 1.1"<<endl; continue;}
+        //                    //TODO: Probably it points on a wrong object
+        //                    for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
+        //                    {
+        //                        if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
+        //                        {    continue;}
+        //
+        //                        orxout()<<"Problempoint 2.1"<<endl;
+        //                        (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);
+        //                        Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
+        //                        if (((tempPosition - positionObjectNonBT).length()<radiusObject) && (vergleicheQuader((tempPosition-positionObjectNonBT),(*it)->getScale3D())))
+        //                        {
+        //                            collision=true; break;
+        //                        }
+        //                    }
+        //                    if(collision) break;
+        //                }
+        //                if(collision)break;
+        //            }
+        //            if(collision) continue;
+        //            // no collision => possible Way
+        //            for (float j =0; j<STEPS; j++)
+        //            {
+        //                Vector3 possiblePosition=(point1 - (point2-point1+richtungen[i]*PHI)*j/STEPS);
+        //                collision=false;
+        //                for(int ij=0; ij<STEPS; j++)
+        //                {
+        //                    Vector3 tempPosition=(possiblePosition - (point2-possiblePosition)*(float)ij/STEPS);
+        //                    for (std::vector<StaticEntity*>::iterator it = problematicObjects.begin(); it!=problematicObjects.end(); ++it)
+        //                    {
+        //                        btVector3 positionObject;
+        //                        btScalar radiusObject;
+        //                        if((*it)==NULL)
+        //                        {   orxout()<<"Problempoint 1"<<endl; continue;}
+        //                        for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
+        //                        {
+        //                            if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
+        //                            {   orxout()<<"Problempoint 2.2"<<endl; continue;}
+        //                            (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);
+        //                            Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
+        //                            if (((tempPosition-positionObjectNonBT).length()<radiusObject) && (vergleicheQuader((tempPosition-positionObjectNonBT),(*it)->getScale3D())))
+        //                            {
+        //                                collision=true; break;
+        //                            }
+        //                        }
+        //                        if(collision) break;
+        //                    }
+        //                    if(collision)break;
+        //                    //addVirtualCheckPoint(racepoint1, racepoint2->getCheckpointIndex(), possiblePosition);
+        //                    return;
+        //                }
+        //
+        //            }
+        //        }
+
+    }*/
+}
Index: code/trunk/src/modules/gametypes/SpaceRaceController.h
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceController.h	(revision 9526)
+++ code/trunk/src/modules/gametypes/SpaceRaceController.h	(revision 9526)
@@ -0,0 +1,75 @@
+/*
+ *   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.
+ *
+ *
+ *  Created on: Oct 8, 2012
+ *      Author: purgham
+ */
+
+#ifndef SPACERACECONTROLLER_H_
+#define SPACERACECONTROLLER_H_
+
+#include "gametypes/GametypesPrereqs.h"
+#include "controllers/ArtificialController.h"
+#include "gametypes/Gametype.h"
+#include "gametypes/RaceCheckPoint.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _GametypesExport SpaceRaceController: public ArtificialController,
+            public Tickable
+    {
+        private:
+            std::vector<RaceCheckPoint*> staticRacePoints_;
+            RaceCheckPoint* nextRaceCheckpoint_; // checkpoint that should be reached
+            RaceCheckPoint* currentRaceCheckpoint_; // last checkPoint (already reached)
+            std::vector<RaceCheckPoint*> checkpoints_;
+            Vector3 lastPositionSpaceship;
+            int virtualCheckPointIndex;
+
+            int recCalculateDistance(RaceCheckPoint*, Vector3 currentPosition);
+            int distanceSpaceshipToCheckPoint(RaceCheckPoint*);
+            RaceCheckPoint* nextPointFind(RaceCheckPoint*);
+            RaceCheckPoint* adjustNextPoint();
+            std::vector<RaceCheckPoint*> findStaticCheckpoints(std::vector<
+                    RaceCheckPoint*>);
+            std::vector<RaceCheckPoint*> staticCheckpoints();
+            int rekSimulationCheckpointsReached(RaceCheckPoint*, std::map<
+                    RaceCheckPoint*, int>*);
+            // same as SpaceRaceManager, but needed to add virtuell Checkpoints ( Checkpoints which don't exist but needed to avoid collisions with big Objects)
+            RaceCheckPoint* findCheckpoint(int index) const;
+            //RaceCheckPoint * addVirtualCheckPoint(RaceCheckPoint*, int , Vector3);
+            //void placeVirtualCheckpoints(RaceCheckPoint*, RaceCheckPoint*);
+            bool vergleicheQuader(Vector3, Vector3);
+            bool directLinePossible(RaceCheckPoint*, RaceCheckPoint*, std::vector<StaticEntity*>);
+            //void computeVirtualCheckpoint(RaceCheckPoint*, RaceCheckPoint*, std::vector<StaticEntity*>);
+
+        public:
+            SpaceRaceController(BaseObject* creator);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual ~SpaceRaceController();
+            virtual void tick(float dt);
+    };
+
+}
+
+#endif /* SPACERACECONTROLLER_H_ */
Index: code/trunk/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.cc	(revision 9525)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.cc	(revision 9526)
@@ -38,14 +38,15 @@
 #include "util/Math.h"
 
-
-
 namespace orxonox
 {
     CreateFactory(SpaceRaceManager);
 
-    SpaceRaceManager::SpaceRaceManager(BaseObject* creator) : BaseObject(creator)
+    SpaceRaceManager::SpaceRaceManager(BaseObject* creator) :
+        BaseObject(creator)
     {
         RegisterObject(SpaceRaceManager);
-
+        this->race_ = orxonox_cast<SpaceRace*>(this->getGametype().get());
+        assert(race_);
+        //amountOfPlayers=(race_->getPlayers()).size();
         this->firstcheckpointvisible_ = false;
     }
@@ -54,5 +55,5 @@
     {
         for (size_t i = 0; i < this->checkpoints_.size(); ++i)
-            this->checkpoints_[i]->destroy();
+        this->checkpoints_[i]->destroy();
     }
 
@@ -61,5 +62,5 @@
         SUPER(SpaceRaceManager, XMLPort, xmlelement, mode);
 
-        XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint,  xmlelement, mode);
+        XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint, xmlelement, mode);
     }
 
@@ -67,4 +68,6 @@
     {
         SUPER(SpaceRaceManager,tick,dt);
+
+        this->players_ = this->race_->getPlayers();
 
         if (this->checkpoints_[0] != NULL && !this->firstcheckpointvisible_)
@@ -74,9 +77,15 @@
         }
 
-        for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+        for ( std::map< PlayerInfo*, Player>::iterator it = players_.begin(); it != players_.end(); ++it)
         {
-            if (this->checkpoints_[i]->getPlayer() != NULL)
-                this->checkpointReached(this->checkpoints_[i], this->checkpoints_[i]->getPlayer());
+
+            for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+            {
+                if (this->checkpoints_[i]->playerWasHere(it->first)){
+                this->checkpointReached(this->checkpoints_[i], it->first /*this->checkpoints_[i]->getPlayer()*/);
+                }
+            }
         }
+
     }
 
@@ -89,17 +98,22 @@
     {
         if (index < this->checkpoints_.size())
-            return this->checkpoints_[index];
+        return this->checkpoints_[index];
         else
-            return 0;
+        return 0;
+    }
+
+    std::vector<RaceCheckPoint*> SpaceRaceManager::getAllCheckpoints()
+    {
+        return checkpoints_;
     }
 
     /**
-        @brief Returns the checkpoint with the given checkpoint-index (@see RaceCheckPoint::getCheckpointIndex).
-    */
+     @brief Returns the checkpoint with the given checkpoint-index (@see RaceCheckPoint::getCheckpointIndex).
+     */
     RaceCheckPoint* SpaceRaceManager::findCheckpoint(int index) const
     {
         for (size_t i = 0; i < this->checkpoints_.size(); ++i)
-            if (this->checkpoints_[i]->getCheckpointIndex() == index)
-                return this->checkpoints_[i];
+        if (this->checkpoints_[i]->getCheckpointIndex() == index)
+        return this->checkpoints_[i];
         return 0;
     }
@@ -107,11 +121,11 @@
     bool SpaceRaceManager::reachedValidCheckpoint(RaceCheckPoint* oldCheckpoint, RaceCheckPoint* newCheckpoint, PlayerInfo* player) const
     {
-        if (oldCheckpoint)
+        if (oldCheckpoint != NULL)
         {
             // the player already visited an old checkpoint; see which checkpoints are possible now
             const std::set<int>& possibleCheckpoints = oldCheckpoint->getNextCheckpoints();
             for (std::set<int>::const_iterator it = possibleCheckpoints.begin(); it != possibleCheckpoints.end(); ++it)
-                if (this->findCheckpoint(*it) == newCheckpoint)
-                    return true;
+            if (this->findCheckpoint(*it) == newCheckpoint)
+            return true;
             return false;
         }
@@ -128,7 +142,7 @@
         assert(gametype);
         if (!gametype)
-            return;
+        return;
 
-        RaceCheckPoint* oldCheckpoint = gametype->getCheckpointReached(player);
+        RaceCheckPoint* oldCheckpoint = gametype->getCheckpointReached(player); // returns the last from player reached checkpoint
 
         if (this->reachedValidCheckpoint(oldCheckpoint, newCheckpoint, player))
@@ -152,9 +166,10 @@
                 // adjust the radarvisibility
                 gametype->newCheckpointReached(newCheckpoint, player);
-                this->updateRadarVisibility(oldCheckpoint, newCheckpoint);
+                if(player->isHumanPlayer())
+                    this->updateRadarVisibility(oldCheckpoint, newCheckpoint);
             }
         }
 
-        newCheckpoint->resetPlayer();
+        // newCheckpoint->resetPlayer(); loescht playerpointer TODO: check if problems occur
     }
 
@@ -165,5 +180,5 @@
             const std::set<int>& oldVisible = oldCheckpoint->getNextCheckpoints();
             for (std::set<int>::const_iterator it = oldVisible.begin(); it != oldVisible.end(); ++it)
-                this->findCheckpoint(*it)->setRadarVisibility(false);
+            this->findCheckpoint(*it)->setRadarVisibility(false);
         }
 
@@ -174,5 +189,5 @@
             const std::set<int>& newVisible = newCheckpoint->getNextCheckpoints();
             for (std::set<int>::const_iterator it = newVisible.begin(); it != newVisible.end(); ++it)
-                this->findCheckpoint(*it)->setRadarVisibility(true);
+            this->findCheckpoint(*it)->setRadarVisibility(true);
         }
     }
Index: code/trunk/src/modules/gametypes/SpaceRaceManager.h
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.h	(revision 9525)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.h	(revision 9526)
@@ -67,4 +67,6 @@
             void checkpointReached(RaceCheckPoint* newCheckpoint, PlayerInfo* player);
 
+            std::vector<RaceCheckPoint*> getAllCheckpoints();
+
             void tick(float dt);
 
@@ -76,4 +78,7 @@
             std::vector<RaceCheckPoint*> checkpoints_;
             bool firstcheckpointvisible_; ///< true if the first check point is visible.
+            SpaceRace* race_; // needed to get the players
+            //int amountOfPlayers;
+            std::map<PlayerInfo*, Player> players_;
     };
 }
Index: code/trunk/src/modules/objects/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/objects/CMakeLists.txt	(revision 9525)
+++ code/trunk/src/modules/objects/CMakeLists.txt	(revision 9526)
@@ -5,4 +5,5 @@
   Script.cc
   SpaceBoundaries.cc
+  Turret.cc
 )
 
Index: code/trunk/src/modules/objects/ObjectsPrereqs.h
===================================================================
--- code/trunk/src/modules/objects/ObjectsPrereqs.h	(revision 9525)
+++ code/trunk/src/modules/objects/ObjectsPrereqs.h	(revision 9526)
@@ -73,4 +73,5 @@
     class Script;
     class SpaceBoundaries;
+    class Turret;
 
     // collisionshapes
Index: code/trunk/src/modules/objects/Turret.cc
===================================================================
--- code/trunk/src/modules/objects/Turret.cc	(revision 9526)
+++ code/trunk/src/modules/objects/Turret.cc	(revision 9526)
@@ -0,0 +1,85 @@
+/*
+ *   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:
+ *      Marian Runo
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Turret.h"
+#include "core/CoreIncludes.h"
+#include "OgreQuaternion.h"
+#include "core/XMLPort.h"
+#include "controllers/WaypointPatrolController.h"
+
+namespace orxonox
+{
+    CreateFactory(Turret);
+
+    /**
+     * @brief Constructor
+     */
+    Turret::Turret(BaseObject* creator) : SpaceShip(creator)
+    {
+        RegisterObject(Turret);
+        this->controller_ = new WaypointPatrolController(this);
+    }
+
+    /**
+     * @brief Destructor
+     */
+    Turret::~Turret()
+    {
+
+    }
+
+
+    void Turret::rotatePitch(const Vector2& value)
+    {
+    	orxout()<< "Turret rotate Pitch"<< endl;
+
+    	const Quaternion& orient = this->getOrientation();
+    	Radian pitch = orient.getPitch();
+
+    	if((value.x > 0 && pitch < Radian(180)) || (value.x < 0 && pitch > Radian(0)))
+    		SpaceShip::rotatePitch(value);
+    }
+
+
+    void Turret::setAlertnessRadius(float value)
+    {
+    	this->controller_->setAlertnessRadius(value);
+    }
+    float Turret::getAlertnessRadius()
+    {
+    	return this->controller_->getAlertnessRadius();
+    }
+
+    void Turret::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Turret, XMLPort, xmlelement, mode);
+        XMLPortParam(Turret, "alertnessRadius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues("400");
+    }
+
+
+}
Index: code/trunk/src/modules/objects/Turret.h
===================================================================
--- code/trunk/src/modules/objects/Turret.h	(revision 9526)
+++ code/trunk/src/modules/objects/Turret.h	(revision 9526)
@@ -0,0 +1,68 @@
+/*
+ *   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:
+ *      Marian Runo
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Turret.h
+    @brief Definition of the Turret class.
+    @ingroup Objects
+*/
+
+#ifndef _Turret_H__
+#define _Turret_H__
+
+#include "objects/ObjectsPrereqs.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+    class _ObjectsExport Turret : public SpaceShip
+    {
+        public:
+            Turret(BaseObject* creator);
+            virtual ~Turret();
+
+            //virtual void tick(float dt);
+
+            virtual void rotatePitch(const Vector2& value);
+
+            void setAlertnessRadius(float value);
+            float getAlertnessRadius();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+
+        protected:
+            WaypointPatrolController* controller_;
+        private:
+
+    };
+}
+
+#endif
+
Index: code/trunk/src/modules/overlays/OverlaysPrereqs.h
===================================================================
--- code/trunk/src/modules/overlays/OverlaysPrereqs.h	(revision 9525)
+++ code/trunk/src/modules/overlays/OverlaysPrereqs.h	(revision 9526)
@@ -91,4 +91,5 @@
     class HUDBoostBar;
     class HUDTimer;
+    class HUDAimAssistant;
     class KillMessage;
     class LastManStandingInfos;
Index: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 9525)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 9526)
@@ -37,6 +37,9 @@
 #include <OgrePanelOverlayElement.h>
 
+#include <typeinfo>
+
 #include "util/Math.h"
 #include "util/Convert.h"
+#include "core/command/ConsoleCommand.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -55,21 +58,35 @@
 namespace orxonox
 {
-    bool compareDistance(std::pair<RadarViewable*, unsigned int> a, std::pair<RadarViewable*, unsigned int> b)
+
+    SetConsoleCommand("HUDNavigation","selectClosest", &HUDNavigation::selectClosestTarget).addShortcut().keybindMode(KeybindMode::OnPress);
+    SetConsoleCommand("HUDNavigation","selectNext", &HUDNavigation::selectNextTarget).addShortcut().keybindMode(KeybindMode::OnPress);
+
+    static bool compareDistance(std::pair<RadarViewable*, unsigned int> a,
+            std::pair<RadarViewable*, unsigned int> b)
     {
         return a.second < b.second;
     }
-
     CreateFactory ( HUDNavigation );
 
-    HUDNavigation::HUDNavigation(BaseObject* creator) : OrxonoxOverlay(creator)
-    {
-        RegisterObject(HUDNavigation);
-        this->setConfigValues();
+    HUDNavigation* HUDNavigation::localHUD_s = 0;
+
+    HUDNavigation::HUDNavigation(BaseObject* creator) :
+        OrxonoxOverlay(creator)
+    {
+        RegisterObject(HUDNavigation)
+;        this->setConfigValues();
 
         // Set default values
         this->setFont("Monofur");
         this->setTextSize(0.05f);
-        this->setNavMarkerSize(0.05f);
+        this->setNavMarkerSize(0.03f);
+        this->setAimMarkerSize(0.02f);
+
         this->setDetectionLimit(10000.0f);
+        this->currentMunitionSpeed_ = 2500.0f;
+
+        this->closestTarget_ = true;
+        this->nextTarget_ = false;
+        HUDNavigation::localHUD_s = this;
     }
 
@@ -79,5 +96,5 @@
         {
             for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end();)
-                removeObject((it++)->first);
+            removeObject((it++)->first);
         }
         this->sortedObjectList_.clear();
@@ -94,8 +111,9 @@
         SUPER(HUDNavigation, XMLPort, xmlelement, mode);
 
-        XMLPortParam(HUDNavigation, "font",           setFont,           getFont,           xmlelement, mode);
-        XMLPortParam(HUDNavigation, "textSize",       setTextSize,       getTextSize,       xmlelement, mode);
-        XMLPortParam(HUDNavigation, "navMarkerSize",  setNavMarkerSize,  getNavMarkerSize,  xmlelement, mode);
+        XMLPortParam(HUDNavigation, "font", setFont, getFont, xmlelement, mode);
+        XMLPortParam(HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode);
+        XMLPortParam(HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode);
         XMLPortParam(HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode);
+        XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlelement, mode);
     }
 
@@ -112,5 +130,5 @@
         {
             if (it->second.text_ != NULL)
-                it->second.text_->setFontName(this->fontName_);
+            it->second.text_->setFontName(this->fontName_);
         }
     }
@@ -132,5 +150,5 @@
         {
             if (it->second.text_)
-                it->second.text_->setCharHeight(size);
+            it->second.text_->setCharHeight(size);
         }
     }
@@ -144,5 +162,5 @@
     {
         if (dist < 600)
-            dist = 600;
+        dist = 600;
         return this->getActualSize().x * 900 * this->navMarkerSize_ / dist;
     }
@@ -151,5 +169,5 @@
     {
         if (dist < 600)
-            dist = 600;
+        dist = 600;
         return this->getActualSize().y * 900 * this->navMarkerSize_ / dist;
     }
@@ -161,10 +179,9 @@
         Camera* cam = CameraManager::getInstance().getActiveCamera();
         if (cam == NULL)
-            return;
+        return;
         const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
 
-
         for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)
-            listIt->second = (int)((listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
+        listIt->second = (int)((listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
 
         this->sortedObjectList_.sort(compareDistance);
@@ -172,4 +189,18 @@
         unsigned int markerCount = 0;
         bool closeEnough = false; // only display objects that are close enough to be relevant for the player
+
+        // if the selected object doesn't exist any more or is now out of range select the closest object
+        std::map<RadarViewable*, ObjectInfo>::iterator selectedActiveObject = this->activeObjectList_.find(this->selectedTarget_);
+        if(selectedActiveObject == this->activeObjectList_.end())
+        {
+            this->closestTarget_ = true;
+        }
+        else if(this->detectionLimit_ < (this->selectedTarget_->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f)
+        {
+            this->closestTarget_ = true;
+            selectedActiveObject->second.selected_ = false;
+        }
+
+        bool nextHasToBeSelected = false;
 
         for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt)
@@ -178,5 +209,5 @@
             closeEnough = listIt->second < this->detectionLimit_;
             // display radarviewables on HUD if the marker limit and max-distance is not exceeded
-            if (markerCount < this->markerLimit_ && (closeEnough ||  this->detectionLimit_ < 0))
+            if (markerCount < this->markerLimit_ && (closeEnough || this->detectionLimit_ < 0))
             {
                 // Get Distance to HumanController and save it in the TextAreaOverlayElement.
@@ -196,4 +227,51 @@
                     textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f;
                 }
+
+                // select the object that aim-assistant indicates
+                if(this->closestTarget_)
+                // select the closest object
+                {
+                    if(listIt == this->sortedObjectList_.begin())
+                    {
+                        it->second.selected_ = true;
+                        this->selectedTarget_ = it->first;
+                    }
+                    else if(it->second.selected_)
+                    {
+                        it->second.selected_ = false;
+                    }
+
+                }
+                else if(this->nextTarget_)
+                // select the next object in sortedObjectList
+                {
+                    if(nextHasToBeSelected){
+                        it->second.selected_ = true;
+                        this->selectedTarget_ = it->first;
+                        nextHasToBeSelected = false;
+                    }
+                    else if(it->second.selected_)
+                    {
+                        nextHasToBeSelected = true;
+                        it->second.selected_ = false;
+
+                        // check if there's a next object
+                        listIt++;
+                        if(listIt != this->sortedObjectList_.end())
+                        {
+                            // and if the marker limit and max-distance are not exceeded for it
+                            if (markerCount + 1 >= this->markerLimit_ ||
+                                    (listIt->second > this->detectionLimit_ && detectionLimit_ >= 0))
+                            {
+                                // otherwise select the closest object
+                                this->activeObjectList_.find(this->sortedObjectList_.begin()->first)->second.selected_ = true;
+                                this->selectedTarget_ = it->first;
+                                nextHasToBeSelected = false;
+                            }
+                        }
+                        listIt--;
+                    }
+                }
+
 
                 // Transform to screen coordinates
@@ -222,4 +300,5 @@
                         it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("arrows.png", it->first->getRadarObjectColour()));
                         it->second.wasOutOfView_ = true;
+                        it->second.target_->hide();
                     }
 
@@ -284,4 +363,5 @@
                         it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("tdc.png", it->first->getRadarObjectColour()));
                         it->second.panel_->setDimensions(this->navMarkerSize_ * this->getActualSize().x, this->navMarkerSize_ * this->getActualSize().y);
+                        it->second.target_->setDimensions(this->aimMarkerSize_ * this->getActualSize().x, this->aimMarkerSize_ * this->getActualSize().y);
                         it->second.wasOutOfView_ = false;
                     }
@@ -295,23 +375,63 @@
                     it->second.text_->setLeft((pos.x + 1.0f + it->second.panel_->getWidth()) * 0.5f);
                     it->second.text_->setTop((-pos.y + 1.0f + it->second.panel_->getHeight()) * 0.5f);
-                }
-
-                // Make sure the overlays are shown
-                it->second.panel_->show();
-                it->second.text_->show();
+
+                    // Make sure the overlays are shown
+                    it->second.panel_->show();
+                    it->second.text_->show();
+
+                    // Target marker
+                    const Pawn* pawn = dynamic_cast<const Pawn*>(it->first->getWorldEntity());
+                    /* Pawn* humanPawn = HumanController::getLocalControllerEntityAsPawn();*/
+                    if(!it->second.selected_
+                            || it->first->getRVVelocity().squaredLength() == 0
+                            || pawn == NULL
+                            /* TODO : improve getTeam in such a way that it works
+                             * || humanPawn == NULL
+                             * || pawn->getTeam() == humanPawn->getTeam()*/)
+                    {
+                        // don't show marker for not selected enemies nor if the selected doesn't move
+                        it->second.target_->hide();
+                    }
+                    else // object is selected and moves
+                    {
+                        // get the aim position
+                        Vector3* targetPos = this->toAimPosition(it->first);
+                        // Transform to screen coordinates
+                        Vector3 screenPos = camTransform * (*targetPos);
+                        // Check if the target marker is in view too
+                        if(screenPos.z > 1 || screenPos.x < -1.0 || screenPos.x > 1.0
+                                || screenPos.y < -1.0 || screenPos.y > 1.0)
+                        {
+                            it->second.target_->hide();
+                        }
+                        else
+                        {
+                            it->second.target_->setLeft((screenPos.x + 1.0f - it->second.target_->getWidth()) * 0.5f);
+                            it->second.target_->setTop((-screenPos.y + 1.0f - it->second.target_->getHeight()) * 0.5f);
+                            it->second.target_->show();
+                        }
+                        delete targetPos;
+                    }
+
+                }
             }
             else // do not display on HUD
+
             {
                 it->second.panel_->hide();
                 it->second.text_->hide();
+                it->second.target_->hide();
             }
         }
+
+        this->closestTarget_ = false;
+        this->nextTarget_ = false;
     }
 
     /** Overridden method of OrxonoxOverlay.
-    @details
-        Usually the entire overlay scales with scale().
-        Here we obviously have to adjust this.
-    */
+     @details
+     Usually the entire overlay scales with scale().
+     Here we obviously have to adjust this.
+     */
     void HUDNavigation::sizeChanged()
     {
@@ -326,4 +446,6 @@
             if (it->second.text_ != NULL)
                 it->second.text_->setCharHeight(it->second.text_->getCharHeight() * yScale);
+            if (it->second.target_ != NULL)
+                it->second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
         }
     }
@@ -332,9 +454,9 @@
     {
         if (showObject(object) == false)
-            return;
+        return;
 
         if (this->activeObjectList_.size() >= this->markerLimit_)
-            if (object == NULL)
-                return;
+        if (object == NULL)
+        return;
 
         // Object hasn't been added yet (we know that)
@@ -349,5 +471,5 @@
         // Create arrow/marker
         Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton()
-                                           .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
+                .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
         //panel->setMaterialName("Orxonox/NavTDC");
         panel->setMaterialName(TextureGenerator::getMaterialName("tdc.png", object->getRadarObjectColour()));
@@ -355,6 +477,13 @@
         //panel->setColour(object->getRadarObjectColour());
 
+        // Create target marker
+        Ogre::PanelOverlayElement* target = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                    .createOverlayElement("Panel", "HUDNavigation_targetMarker_" + getUniqueNumberString()));
+        target->setMaterialName(TextureGenerator::getMaterialName("target.png", object->getRadarObjectColour()));
+        target->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
+
+        // Create text
         Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*>( Ogre::OverlayManager::getSingleton()
-                                             .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
+                .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
         text->setFontName(this->fontName_);
         text->setCharHeight(text->getCharHeight() * yScale);
@@ -362,10 +491,13 @@
 
         panel->hide();
+        target->hide();
         text->hide();
 
-        ObjectInfo tempStruct = {panel, text, false /*, TODO: initialize wasOutOfView_ */};
+        ObjectInfo tempStruct =
+        {   panel, target, text, false, false, false};
         this->activeObjectList_[object] = tempStruct;
 
         this->background_->addChild(panel);
+        this->background_->addChild(target);
         this->background_->addChild(text);
 
@@ -381,7 +513,9 @@
             // Detach overlays
             this->background_->removeChild(it->second.panel_->getName());
+            this->background_->removeChild(it->second.target_->getName());
             this->background_->removeChild(it->second.text_->getName());
             // Properly destroy the overlay elements (do not use delete!)
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.panel_);
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.target_);
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.text_);
             // Remove from the list
@@ -409,8 +543,8 @@
     {
         if (rv == orxonox_cast<RadarViewable*>(this->getOwner()))
-            return false;
+        return false;
         assert(rv->getWorldEntity());
         if (rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false)
-            return false;
+        return false;
         return true;
     }
@@ -422,5 +556,35 @@
         {
             if (!(*it)->isHumanShip_)
-                this->addObject(*it);
+            this->addObject(*it);
+        }
+    }
+
+    Vector3* HUDNavigation::toAimPosition(RadarViewable* target) const
+    {
+        Vector3 wePosition = HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition();
+        Vector3 targetPosition = target->getRVWorldPosition();
+        Vector3 targetSpeed = target->getRVVelocity();
+        Vector3 relativePosition = targetPosition - wePosition; //Vector from attacker to target
+
+        float p_half = relativePosition.dotProduct(targetSpeed)/(targetSpeed.squaredLength() - this->currentMunitionSpeed_ * this->currentMunitionSpeed_);
+        float time1 = -p_half + sqrt(p_half * p_half - relativePosition.squaredLength()/(targetSpeed.squaredLength() - this->currentMunitionSpeed_ * this->currentMunitionSpeed_));
+
+        Vector3* result = new Vector3(targetPosition + targetSpeed * time1);
+        return result;
+    }
+
+    void HUDNavigation::selectClosestTarget()
+    {
+        if(HUDNavigation::localHUD_s)
+        {
+            HUDNavigation::localHUD_s->closestTarget_ = true;
+        }
+    }
+
+    void HUDNavigation::selectNextTarget()
+    {
+        if(HUDNavigation::localHUD_s)
+        {
+            HUDNavigation::localHUD_s->nextTarget_ = true;
         }
     }
Index: code/trunk/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.h	(revision 9525)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.h	(revision 9526)
@@ -71,11 +71,16 @@
                 { return this->markerLimit_; }
 
+            static void selectClosestTarget();
+            static void selectNextTarget();
+
         private:
             struct ObjectInfo
             {
                 Ogre::PanelOverlayElement* panel_;
+                Ogre::PanelOverlayElement* target_;
                 Ogre::TextAreaOverlayElement* text_;
                 bool outOfView_;
                 bool wasOutOfView_;
+                bool selected_;
             };
 
@@ -85,9 +90,16 @@
             inline void setNavMarkerSize(float size)
             {
-                navMarkerSize_ = size;
+                this->navMarkerSize_ = size;
                 this->sizeChanged();
             }
             inline float getNavMarkerSize() const
                 { return navMarkerSize_; }
+            inline void setAimMarkerSize(float size)
+            {
+                this->aimMarkerSize_ = size;
+                this->sizeChanged();
+            }
+            inline float getAimMarkerSize() const
+                { return aimMarkerSize_; }
             inline void setDetectionLimit(float limit)
                 { this->detectionLimit_ = limit; }
@@ -104,11 +116,24 @@
             float getArrowSizeY(int dist) const;
 
+            Vector3* toAimPosition(RadarViewable* target) const;
+
             std::map<RadarViewable*, ObjectInfo> activeObjectList_;
             std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
 
             float navMarkerSize_;
+            float aimMarkerSize_;
             std::string fontName_;
             float textSize_;
             bool showDistance_;
+
+            RadarViewable* selectedTarget_;
+
+            bool closestTarget_;
+            bool nextTarget_;
+
+            static HUDNavigation* localHUD_s; //!< This is used as a filter. Only the local HUD should be influenced by the static Console Command functions.
+
+
+            float currentMunitionSpeed_;
 
             unsigned int markerLimit_;
Index: code/trunk/src/modules/portals/PortalEndPoint.cc
===================================================================
--- code/trunk/src/modules/portals/PortalEndPoint.cc	(revision 9525)
+++ code/trunk/src/modules/portals/PortalEndPoint.cc	(revision 9526)
@@ -28,4 +28,5 @@
 
 #include "PortalEndPoint.h"
+#include "portals/PortalLink.h"
 
 #include <ctime>
@@ -35,8 +36,7 @@
 
 #include "worldentities/MobileEntity.h"
-
 #include "objects/triggers/MultiTriggerContainer.h"
 
-#include "portals/PortalLink.h"
+#include "sound/WorldSound.h"
 
 namespace orxonox
@@ -59,4 +59,11 @@
         this->setRadarObjectShape(RadarViewable::Dot);
         this->setRadarVisibility(true);
+        if( GameMode::isMaster() )
+        {
+            this->portalSound_ = new WorldSound(this);
+            this->portalSound_->setLooping(false);
+            this->attach(this->portalSound_);
+            this->portalSound_->setSource("sounds/Weapon_HsW01.ogg"); //TODO: change sound file
+        }
     }
 
@@ -158,4 +165,9 @@
         entity->rotate(this->getWorldOrientation());
         entity->setVelocity(this->getWorldOrientation() * entity->getVelocity());
+        //play Sound
+        if( this->portalSound_ && !(this->portalSound_->isPlaying()))
+        {
+            this->portalSound_->play();
+        }
     }
 
Index: code/trunk/src/modules/portals/PortalEndPoint.h
===================================================================
--- code/trunk/src/modules/portals/PortalEndPoint.h	(revision 9525)
+++ code/trunk/src/modules/portals/PortalEndPoint.h	(revision 9526)
@@ -115,4 +115,6 @@
             std::map<MobileEntity *, time_t> jumpOutTimes_;   //!< Stores the time at which a certain MobileEntity @ref jumpOut "jumped out" of this PortalEndPoint
             std::set<MobileEntity *> recentlyJumpedOut_;   //!< Stores the entities witch recently jumped out of this PortalEndPoint and haven't left the activation radius yet. This is needed in order to prevent them from beeing pulled into the PortalEndPoint they have just come out of.
+
+            WorldSound* portalSound_;
     };
 
Index: code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/HsW01.cc	(revision 9525)
+++ code/trunk/src/modules/weapons/weaponmodes/HsW01.cc	(revision 9526)
@@ -61,9 +61,12 @@
         this->delay_ = 0.0f;
         this->setMunitionName("LaserMunition");
+        this->mesh_ = "laserbeam.mesh";
+        this->sound_ = "sounds/Weapon_HsW01.ogg";
+
 
         this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this)));
         this->delayTimer_.stopTimer();
 
-        this->setDefaultSound("sounds/Weapon_HsW01.ogg");
+        this->setDefaultSound(this->sound_);
     }
 
@@ -78,4 +81,6 @@
         XMLPortParam(HsW01, "delay", setDelay, getDelay, xmlelement, mode);
         XMLPortParam(HsW01, "material", setMaterial, getMaterial, xmlelement, mode);
+        XMLPortParam(HsW01, "projectileMesh", setMesh, getMesh, xmlelement, mode);
+	XMLPortParam(HsW01, "sound", setSound, getSound, xmlelement, mode);
     }
 
@@ -108,5 +113,5 @@
         Projectile* projectile = new Projectile(this);
         Model* model = new Model(projectile);
-        model->setMeshSource("laserbeam.mesh");
+        model->setMeshSource(mesh_);
         model->setCastShadows(false);
         projectile->attach(model);
Index: code/trunk/src/modules/weapons/weaponmodes/HsW01.h
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/HsW01.h	(revision 9525)
+++ code/trunk/src/modules/weapons/weaponmodes/HsW01.h	(revision 9526)
@@ -61,4 +61,32 @@
         private:
             /**
+            @brief Set the mesh.
+            @param mesh The mesh name.
+            */
+            void setMesh(const std::string& mesh)
+                { this->mesh_ = mesh; }
+
+            /**
+            @brief Get the mesh.
+            @return Returns the mesh name.
+            */
+            const std::string& getMesh() const
+                { return this->mesh_; }
+
+	    /**
+            @brief Set the sound.
+            @param mesh The Sound name.
+            */
+            void setSound(const std::string& sound)
+                { this->sound_ = sound; }
+
+	    /**
+            @brief Get the sound.
+            @return Returns the sound name.
+            */
+            const std::string& getSound() const
+                { return this->sound_; }
+
+            /**
             @brief Set the material.
             @param material The material name.
@@ -85,4 +113,9 @@
 
             std::string material_; //!< The material.
+            std::string mesh_; //!< The mesh.
+            std::string sound_; //!< The sound.
+
+
+
             float speed_; //!< The speed of the fired projectile.
             float delay_; //!< The firing delay.
Index: code/trunk/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.cc	(revision 9525)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.cc	(revision 9526)
@@ -102,4 +102,11 @@
     }
 
+    Vector3 RadarViewable::getRVVelocity() const
+    {
+        const WorldEntity* object = this->getWorldEntity();
+        validate(object);
+        return object->getVelocity();
+    }
+
     void RadarViewable::validate(const WorldEntity* object) const
     {
Index: code/trunk/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.h	(revision 9525)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.h	(revision 9526)
@@ -113,4 +113,5 @@
         const Vector3& getRVWorldPosition() const;
         Vector3 getRVOrientedVelocity() const;
+        Vector3 getRVVelocity() const;
 
         inline void setRadarObjectShape(Shape shape)
