Index: code/branches/FICN/bin/levels/sample.oxw
===================================================================
--- code/branches/FICN/bin/levels/sample.oxw	(revision 626)
+++ code/branches/FICN/bin/levels/sample.oxw	(revision 627)
@@ -32,4 +32,10 @@
 
     <SpaceShip camera="true" position="0,0,0" scale="10" yaw="-90" pitch="-90" mesh="assf3.mesh"  forward="500" rotateupdown="200" rotaterightleft="200" looprightleft="200" />
+
+    <NPC position="0,100,400" scale="1" mesh="razor.mesh"/>
+    <NPC position="0,100,400" scale="1" mesh="razor.mesh"/>
+    <NPC position="0,-100,500" scale="1" mesh="razor.mesh"/>
+    <NPC position="0,-200,450" scale="1" mesh="razor.mesh"/>
+    <NPC position="100,0,400" scale="1" mesh="razor.mesh"/>
 
     <Model position="200,0,500" scale="10" mesh="assf3.mesh" yaw="-90" pitch="-90" />
Index: code/branches/FICN/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/FICN/src/orxonox/Orxonox.cc	(revision 626)
+++ code/branches/FICN/src/orxonox/Orxonox.cc	(revision 627)
@@ -63,4 +63,5 @@
 #include "objects/Tickable.h"
 #include "objects/Timer.h"
+#include "objects/NPC.h"
 #include "core/ArgReader.h"
 #include "core/Factory.h"
@@ -90,4 +91,5 @@
       {
         auMan_->update();
+        updateAI();
 
         if(mode_==PRESENTATION)
@@ -100,4 +102,12 @@
         mKeyboard->capture();
         return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
+      }
+
+      void updateAI()
+      {
+        for(Iterator<NPC> it = ObjectList<NPC>::start(); it; ++it)
+        {
+          it->update();
+        }
       }
 
Index: code/branches/FICN/src/orxonox/objects/NPC.cc
===================================================================
--- code/branches/FICN/src/orxonox/objects/NPC.cc	(revision 626)
+++ code/branches/FICN/src/orxonox/objects/NPC.cc	(revision 627)
@@ -29,10 +29,12 @@
 #include "../core/Iterator.h"
 #include "../core/ObjectList.h"
-//#include "../Flocking.h"
 
 namespace orxonox {
 
+  CreateFactory(NPC);
+
   NPC::NPC()
   {
+    RegisterObject(NPC);
     movable_ = true;
   }
@@ -40,4 +42,9 @@
   NPC::~NPC()
   {
+  }
+
+  void NPC::loadParams(TiXmlElement* xmlElem)
+  {
+    Model::loadParams(xmlElem);
   }
 
@@ -55,5 +62,5 @@
    * calculates the distance between the element and an other point given by temp
    */
-  float NPC::getDistance(NPC* temp)
+  float NPC::getDistance(WorldEntity* temp)
   {
     Vector3 distance = temp->getPosition() - this->getPosition();
@@ -67,9 +74,6 @@
   {
 
-    // find out about this arrayOfElements
-    NPC* arrayOfElements[ANZELEMENTS];
-
     //if element is movable, calculate acceleration
-    if (this->movable_ == true) calculateAcceleration(arrayOfElements);
+    if (this->movable_ == true) calculateAcceleration();
 
   }
@@ -81,5 +85,7 @@
   {
 
-
+    this->setVelocity(0.995*this->getVelocity() + this->getAcceleration()*dt);
+    this->translate(this->getVelocity()*dt);
+    this->setAcceleration(Vector3(0,0,0));
   }
 
@@ -87,8 +93,8 @@
    * calculates the new acceleration of an element
    */
-  void NPC::calculateAcceleration(NPC** arrayOfElements)
+  void NPC::calculateAcceleration()
   {
     //acceleration consisting of flocking-functions
-    this->setAcceleration(separation(arrayOfElements) + alignment(arrayOfElements) + cohesion(arrayOfElements));
+    this->setAcceleration(separation() + alignment() + cohesion());
   }
 
@@ -96,5 +102,5 @@
    * separation-function (keep elements separated, avoid crashs)
    */
-  Vector3 NPC::separation(NPC** arrayOfElements)
+  Vector3 NPC::separation()
   {
     Vector3 steering = Vector3(0,0,0); //steeringvector
@@ -102,10 +108,9 @@
     int numberOfNeighbour = 0;  //number of observed neighbours
     float distance = 0;  // distance to the actual element
-    for(int i=0; i<ANZELEMENTS; i++) {  //go through all elements
-      NPC* actual = arrayOfElements[i];  //get the actual element
-      distance = getDistance(actual);  //get distance between this and actual
+    for(Iterator<WorldEntity> it = ObjectList<WorldEntity>::start(); it; ++it) {  //go through all elements
+      distance = getDistance(*it);  //get distance between this and actual
       if ((distance > 0) && (distance < SEPERATIONDISTANCE)) {  //do only if actual is inside detectionradius
         inverseDistance = Vector3(0,0,0);
-        inverseDistance = this->getPosition() - actual->getPosition();  //calculate the distancevector heading towards this
+        inverseDistance = this->getPosition() - it->getPosition();  //calculate the distancevector heading towards this
         //adaptation of the inverseDistance to the distance
         if ((distance < 200) && (distance >= 120)) {inverseDistance = 2*inverseDistance;}
@@ -124,5 +129,5 @@
    * alignment-function (lead elements to the same heading)
    */
-  Vector3 NPC::alignment(NPC** arrayOfElements)
+  Vector3 NPC::alignment()
   {
     Vector3 steering = Vector3(0,0,0); //steeringvector
@@ -130,9 +135,8 @@
     //float distance = 0;
     //go through all elements
-    for(int i=0; i<ANZELEMENTS; i++) {  //just working with 3 elements at the moment
-      NPC* actual = arrayOfElements[i];  //get the actual element
-      float distance = getDistance(actual);  //get distance between this and actual
+    for(Iterator<NPC> it = ObjectList<NPC>::start(); it; ++it) {  //just working with 3 elements at the moment
+      float distance = getDistance(*it);  //get distance between this and actual
       if ((distance > 0) && (distance < ALIGNMENTDISTANCE)) {  //check if actual element is inside detectionradius
-        steering = steering + actual->getVelocity();  //add up all speedvectors inside the detectionradius
+        steering = steering + it->getVelocity();  //add up all speedvectors inside the detectionradius
         numberOfNeighbour++;  //counts the elements inside the detectionradius
       }
@@ -145,5 +149,5 @@
    * cohseion-function (keep elements close to each other)
    */
-  Vector3 NPC::cohesion(NPC** arrayOfElements)
+  Vector3 NPC::cohesion()
   {
     Vector3 steering = Vector3(0,0,0); //steeringvector
@@ -151,9 +155,8 @@
     //float distance = 0;
     //go through all elements
-    for(int i=0; i<ANZELEMENTS; i++) {  //just working with 3 elements at the moment
-      NPC* actual = arrayOfElements[i];  //get the actual element
-      float distance = getDistance(actual);  //get distance between this and actual
+    for(Iterator<NPC> it = ObjectList<NPC>::start(); it; ++it) {  //just working with 3 elements at the moment
+      float distance = getDistance(*it);  //get distance between this and actual
       if ((distance > 0) && (distance < COHESIONDISTANCE)) {  //check if actual element is inside detectionradius
-        steering = steering + actual->getPosition();  //add up all locations of elements inside the detectionradius
+        steering = steering + it->getPosition();  //add up all locations of elements inside the detectionradius
         numberOfNeighbour++;  //counts the elements inside the detectionradius
       }
Index: code/branches/FICN/src/orxonox/objects/NPC.h
===================================================================
--- code/branches/FICN/src/orxonox/objects/NPC.h	(revision 626)
+++ code/branches/FICN/src/orxonox/objects/NPC.h	(revision 627)
@@ -9,5 +9,4 @@
 
 // includes
-#include "WorldEntity.h"
 #include "Model.h"
 
@@ -20,4 +19,5 @@
       NPC();
       virtual ~NPC();
+      virtual void loadParams(TiXmlElement* xmlElem);
       void tick(float dt);
       void update();
@@ -25,9 +25,9 @@
 
     private:
-      float getDistance(NPC* temp);
-      void calculateAcceleration(NPC** arrayOfElements);
-      Vector3 separation(NPC** arrayOfElements);
-      Vector3 alignment(NPC** arrayOfElements);
-      Vector3 cohesion(NPC** arrayOfElements);
+      float getDistance(WorldEntity* temp);
+      void calculateAcceleration();
+      Vector3 separation();
+      Vector3 alignment();
+      Vector3 cohesion();
 
 
