Index: branches/network/src/defs/class_id.h
===================================================================
--- branches/network/src/defs/class_id.h	(revision 6377)
+++ branches/network/src/defs/class_id.h	(revision 6386)
@@ -147,7 +147,8 @@
   // StoryEntities (range from 0x00000100 to 0x000001ff)
   CL_CAMPAIGN                   =    0x00000101,
-  CL_GAME_WORLD                 =    0x00000102,
-  CL_SINGLE_PLAYER_WORLD        =    0x00000103,
-  CL_MULTI_PLAYER_WORLD         =    0x00000104,
+  CL_CAMPAIGN_DATA              =    0x00000102,
+  CL_GAME_WORLD                 =    0x00000103,
+  CL_SINGLE_PLAYER_WORLD        =    0x00000104,
+  CL_MULTI_PLAYER_WORLD         =    0x00000105,
 
   // WorldEntities (range from 0x00000200 to 0x000004ff)
Index: branches/network/src/story_entities/campaign.cc
===================================================================
--- branches/network/src/story_entities/campaign.cc	(revision 6377)
+++ branches/network/src/story_entities/campaign.cc	(revision 6386)
@@ -34,9 +34,9 @@
 {
   this->setClassID(CL_CAMPAIGN, "Campaign");
-  this->isInit = false;
 
   PRINTF(4)("Loading Campaign...\n");
   assert( root != NULL);
 
+  this->campaignData = new CampaignData();
   this->loadParams(root);
 }
@@ -51,13 +51,4 @@
 
 /**
- *  initializes the class
- */
-ErrorMessage Campaign::init()
-{
-  this->isInit = true;
-}
-
-
-/**
  *  loads the Parameters of a Campaign
  * @param root: The XML-element to load from
@@ -87,7 +78,5 @@
     StoryEntity* created = (StoryEntity*) Factory::fabricate(element);
     if( created != NULL)
-      this->addEntity( created);
-    PRINTF(3)("Campaign: Constructor: adding a world with name \"%s\" and id %i\n",
-              created->getName(), created->getStoryID());
+      this->campaignData->addStoryEntity(created);
   }
   LOAD_PARAM_END_CYCLE(element);
@@ -97,9 +86,9 @@
 
 /**
- *  starts the campaing
- */
-ErrorMessage Campaign::start()
-{
-  this->start(0);
+ *  initializes the class
+ */
+ErrorMessage Campaign::init()
+{
+  this->isInit = true;
 }
 
@@ -109,46 +98,21 @@
  * @param storyID the id of the StoryEntity
  */
-ErrorMessage Campaign::start(int storyID = 0)
-{
-  ErrorMessage errorCode;
-  if( !this->isInit) return errorCode;
-  if( storyID == WORLD_ID_GAMEEND) return errorCode;
-  this->running = true;
-  StoryEntity* se = this->getStoryEntity(storyID);
-  this->currentEntity = se;
-  while( se != NULL && this->running)
-  {
-    PRINTF(0)("Campaign is starting StoryEntity nr:%i\n", se->getStoryID());
-
-    se->init();
-    se->loadData();
-
-    se->preStart();
-    se->start();
-
-
-    int nextWorldID = se->getNextStoryID();
-
-    this->entities.remove(se);
-    delete se;
-
-    se = this->getStoryEntity(nextWorldID);
-    this->currentEntity = se;
-    if( ( nextWorldID == WORLD_ID_GAMEEND) || ( se == NULL) )
-    {
-      PRINTF(4)("Quitting campaing story loop\n");
-      if(se != NULL)
-        delete se;
-      return errorCode;
-    }
-  }
-
-  /* clean up all world that have not been loaded and therefore are still in the world list  -
-     this probably does not belong into the start function. remove this later
-  */
-  list<StoryEntity*>::iterator it;
-  for(it = this->entities.begin(); it != entities.end(); it++)
-  {
-    delete (*it);
+ErrorMessage Campaign::start()
+{
+  PRINTF(2)("Starting Campaign nr. %i\n", this->getStoryID());
+
+  ErrorMessage       errorCode;
+  int                storyID = WORLD_ID_0;
+
+  for( this->currentEntity = this->campaignData->getFirstLevel(), this->isRunning = true;
+       this->currentEntity != NULL && this->isRunning;
+       this->currentEntity = this->campaignData->getNextLevel())
+  {
+    PRINTF(0)("Campaign is starting StoryEntity nr:%i\n", this->currentEntity->getStoryID());
+
+    this->currentEntity->init();
+    this->currentEntity->loadData();
+    this->currentEntity->start();
+    this->currentEntity->unloadData();
   }
 
@@ -158,24 +122,30 @@
 
 /**
- *  pauses the campaing
+ *  pauses the campaign
  */
 ErrorMessage Campaign::pause()
 {
-  if(this->currentEntity != NULL)
+  if( this->currentEntity != NULL)
     this->isPaused = true;
 }
 
 
+/**
+ *  resumes the campaign after a pause
+ */
 ErrorMessage Campaign::resume()
 {
-  if(this->currentEntity != NULL)
+  if( this->currentEntity != NULL)
     this->isPaused = false;
 }
 
 
+/**
+ *  stops the campaign
+ */
 ErrorMessage Campaign::stop()
 {
-  this->running = false;
-  if(this->currentEntity != NULL)
+  this->isRunning = false;
+  if( this->currentEntity != NULL)
   {
     this->currentEntity->stop();
@@ -183,54 +153,9 @@
 }
 
-/*
-ErrorMessage Campaign::destroy()
-{
-  if(this->currentEntity != NULL)
-    {
-      this->currentEntity->destroy();
-      delete this->currentEntity;
-      this->currentEntity = NULL;
-    }
-}*/
-
-
-/**
-  *  adds an game stroy entity to the campaign
-
-  * @param se: The entity
-  * @param storyID: The number that identifies the entity in the campaign. Each ID only used once in a Campaign
-
-    An entity can be a world (playable), a cinematic, a shop, sounds, whatever you
-    want to queue up in the campaign.
-*/
-void Campaign::addEntity(StoryEntity* se, int storyID)
-{
-  se->setStoryID(storyID);
-  this->addEntity(se);
-}
-
-void Campaign::addEntity(StoryEntity* se)
-{
-  this->entities.push_back(se);
-}
-
-
-void Campaign::removeEntity(int storyID)
-{
-  this->removeEntity(this->getStoryEntity(storyID));
-
-}
-
-
-void Campaign::removeEntity(StoryEntity* se)
-{
-  this->entities.remove(se);
-}
-
-
-/*
-  \brief this changes to the next level
-*/
-void Campaign::nextLevel()
+
+/**
+ *  this changes to the next level
+ */
+void Campaign::switchToNextLevel()
 {
   PRINTF(4)("Campaign:nextLevel()\n");
@@ -238,32 +163,78 @@
 }
 
-/*
-  \brief change to the previous level - not implemented
-
-  this propably useless
-*/
-void Campaign::previousLevel()
+
+
+/* CampaignData */
+
+/**
+ * constructor for CampaignData
+ */
+CampaignData::CampaignData()
+{
+  this->setClassID(CL_CAMPAIGN_DATA, "CampaignData");
+  this->currentEntity = NULL;
+}
+
+
+/**
+ * destructor for CampaignData
+ */
+CampaignData::~ CampaignData()
 {}
 
 
-/*
-  \brief lookup a entity with a given id
-* @param story id to be lookuped
-  @returns the entity found or NULL if search ended without match
-*/
-StoryEntity* Campaign::getStoryEntity(int storyID)
-{
-  if( storyID == WORLD_ID_GAMEEND)
-    return NULL;
-
-  int id;
-  list<StoryEntity*>::iterator it;
-  for( it = this->entities.begin(); it != this->entities.end(); it++)
-  {
-    id = (*it)->getStoryID();
-    if( id == storyID)
-      return (*it);
-  }
-
-  return NULL;
-}
+/**
+ *  add the StoryEntity to the campaign data tank
+ * @param se the StoryEntity to add
+ */
+void CampaignData::addStoryEntity(StoryEntity* se)
+{
+  this->storyEntities.push_back(se);
+}
+
+
+/**
+ *  switch to the next level in the list and return it
+ */
+StoryEntity* CampaignData::getFirstLevel()
+{
+  int                            nextStoryID;
+  int                            storyID;
+  list<StoryEntity*>::iterator   it;
+
+  nextStoryID = 0;
+  this->currentEntity = NULL;
+  for( it = this->storyEntities.begin(); it != this->storyEntities.end(); it++)
+  {
+    storyID = (*it)->getStoryID();
+    if( storyID == nextStoryID)
+      this->currentEntity = (*it);
+  }
+  return this->currentEntity;
+}
+
+
+/**
+ *  switch to the next level in the list and return it
+ */
+StoryEntity* CampaignData::getNextLevel()
+{
+  int                            nextStoryID;
+  int                            storyID;
+  list<StoryEntity*>::iterator   it;
+
+  nextStoryID = this->currentEntity->getNextStoryID();
+  this->currentEntity = NULL;
+  for( it = this->storyEntities.begin(); it != this->storyEntities.end(); it++)
+  {
+    storyID = (*it)->getStoryID();
+    if( storyID == nextStoryID)
+      this->currentEntity = (*it);
+  }
+  return this->currentEntity;
+}
+
+
+
+
+
Index: branches/network/src/story_entities/campaign.h
===================================================================
--- branches/network/src/story_entities/campaign.h	(revision 6377)
+++ branches/network/src/story_entities/campaign.h	(revision 6386)
@@ -1,13 +1,20 @@
+/*!
+ * @file campaign.h
+ * definition of the campaign
+ */
 
 #ifndef _CAMPAIGN_H
 #define _CAMPAIGN_H
 
+
 #include "story_entity.h"
-
 #include <list>
 
-class World;
+
 class TiXmlElement;
+class CampaignData;
 
+
+//! A class that represents a game Campaign that contains other StoryEntities like GameWorlds, movies, etc.
 class Campaign : public StoryEntity
 {
@@ -22,31 +29,19 @@
     virtual ErrorMessage init();
     virtual ErrorMessage start();
-    virtual ErrorMessage start(int storyID);
     virtual ErrorMessage pause();
     virtual ErrorMessage resume();
     virtual ErrorMessage stop();
 
-    void addEntity(StoryEntity* se, int storyID);
-    void addEntity(StoryEntity* se);
-    void removeEntity(int storyID);
-    void removeEntity(StoryEntity* se);
-
-    void nextLevel();
-    void previousLevel();
+    void switchToNextLevel();
 
 
   private:
-    StoryEntity* getStoryEntity(int storyID);
-
-
-  private:
-    StoryEntity* currentEntity;
-    std::list<StoryEntity*> entities;
-    bool running;
-
+    StoryEntity*                        currentEntity;          //!< reference to the current StoryEntity
+    CampaignData*                       campaignData;           //!< reference to the CampaignData
 };
 
 
 
+//! A class that contains the data of the Campaign object
 class CampaignData : virtual public BaseObject
 {
@@ -56,7 +51,13 @@
     virtual ~CampaignData();
 
-    void addStoryEntity(StoryEntity* se, int storyID = -1);
+    void addStoryEntity(StoryEntity* se);
 
-    void getNextLevel();
+    StoryEntity* getFirstLevel();
+    StoryEntity* getNextLevel();
+
+
+  private:
+    StoryEntity*                  currentEntity;                //!< reference to the currently used StoryEntity
+    std::list<StoryEntity*>       storyEntities;                //!< list of story entities
 };
 
Index: branches/network/src/story_entities/debug_world.cc
===================================================================
--- branches/network/src/story_entities/debug_world.cc	(revision 6377)
+++ branches/network/src/story_entities/debug_world.cc	(revision 6386)
@@ -1,868 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   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, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer: Christian Meyer
-   co-programmer: Benjamin Grauer
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
-
-#include "world.h"
-
-#include "shell_command.h"
-
-#include "state.h"
-
-#include "p_node.h"
-#include "pilot_node.h"
-#include "world_entity.h"
-#include "player.h"
-#include "camera.h"
-#include "environment.h"
-#include "skysphere.h"
-#include "skybox.h"
-#include "satellite.h"
-#include "test_entity.h"
-#include "terrain.h"
-#include "light.h"
-#include "load_param.h"
-#include "shell.h"
-
-#include "fast_factory.h"
-#include "animation_player.h"
-#include "particle_engine.h"
-#include "graphics_engine.h"
-#include "physics_engine.h"
-#include "fields.h"
-
-#include "md2Model.h"
-
-#include "glmenu_imagescreen.h"
-#include "game_loader.h"
-
-#include "animation3d.h"
-
-#include "substring.h"
-
-#include "factory.h"
-
-#include "weapons/projectile.h"
-#include "event_handler.h"
-#include "sound_engine.h"
-#include "ogg_player.h"
-
-#include "class_list.h"
-
-#include "cd_engine.h"
-#include "npcs/npc_test1.h"
-#include "shader.h"
-
-#include "playable.h"
-#include "network_manager.h"
-#include "playable.h"
-
-
-SHELL_COMMAND(speed, World, setSpeed);
-SHELL_COMMAND(togglePNodeVisibility, World, togglePNodeVisibility);
-SHELL_COMMAND(toggleBVVisibility, World, toggleBVVisibility);
-
-using namespace std;
-
-//! This creates a Factory to fabricate a World
-CREATE_FACTORY(World, CL_WORLD);
-
-World::World(const TiXmlElement* root)
-{
-  this->constuctorInit("", -1);
-  this->path = NULL;
-
-  this->loadParams(root);
-}
-
-/**
-  *  create a new World
-
-    This creates a new empty world!
-*/
-World::World (const char* name)
-{
-  this->path = NULL;
-  this->constuctorInit(name, -1);
-}
-
-/**
- *  creates a new World...
- * @param worldID with this ID
-*/
-World::World (int worldID)
-{
-  this->path = NULL;
-  this->constuctorInit(NULL, worldID);
-}
-
-/**
- *  remove the World from memory
-
-    delete everything explicitly, that isn't contained in the parenting tree!
-    things contained in the tree are deleted automaticaly
- */
-World::~World ()
-{
-  delete this->shell;
-  PRINTF(3)("World::~World() - deleting current world\n");
-
-  delete this->localPlayer;
-
-  // delete all the initialized Engines.
-  FastFactory::flushAll(true);
-  delete LightManager::getInstance();
-  delete ParticleEngine::getInstance();
-  delete AnimationPlayer::getInstance();
-  delete PhysicsEngine::getInstance();
-
-  // external engines initialized by the orxonox-class get deleted
-  SoundEngine::getInstance()->flushAllBuffers();
-  SoundEngine::getInstance()->flushAllSources();
-
-  if (State::getObjectManager() == &this->objectManager)
-    State::setObjectManager(NULL);
-  // erease everything that is left.
-  delete PNode::getNullParent();
-
-  //secondary cleanup of PNodes;
-  const std::list<BaseObject*>* nodeList = ClassList::getList(CL_PARENT_NODE);
-  if (nodeList != NULL)
-    while (!nodeList->empty())
-      delete nodeList->front();
-
-  Shader::suspendShader();
-
-  // unload the resources !!
-  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
-
-  delete[] this->path;
-}
-
-/**
- * initializes the world.
- * @param name the name of the world
- * @param worldID the ID of this world
- *
- * set all stuff here that is world generic and does not use to much memory
- * because the real init() function StoryEntity::init() will be called
- * shortly before start of the game.
- * since all worlds are initiated/referenced before they will be started.
- * NO LEVEL LOADING HERE - NEVER!
-*/
-void World::constuctorInit(const char* name, int worldID)
-{
-  this->setClassID(CL_WORLD, "World");
-
-  this->setName(name);
-  this->debugWorldNr = worldID;
-  this->gameTime = 0.0f;
-  this->setSpeed(1.0);
-  this->music = NULL;
-  this->shell = NULL;
-  this->localPlayer = NULL;
-  this->localCamera = NULL;
-
-  this->showPNodes = false;
-  this->showBV = false;
-}
-
-/**
- * loads the parameters of a World from an XML-element
- * @param root the XML-element to load from
- */
-void World::loadParams(const TiXmlElement* root)
-{
-  PRINTF(4)("Creating a World\n");
-
-  LoadParam(root, "identifier", this, World, setStoryID)
-    .describe("Sets the StoryID of this world");
-
-  LoadParam(root, "nextid", this, World, setNextStoryID)
-    .describe("Sets the ID of the next world");
-
-  LoadParam(root, "path", this, World, setPath)
-    .describe("The Filename of this World (relative from the data-dir)");
-}
-
-/**
- * this is executed just before load
- *
- * since the load function sometimes needs data, that has been initialized
- * before the load and after the proceeding storyentity has finished
-*/
-ErrorMessage World::preLoad()
-{
-  State::setObjectManager(&this->objectManager);
-  this->cycle = 0;
-
-  /* init the world interface */
-  this->shell = new Shell();
-
-  LightManager::getInstance();
-  PNode::getNullParent();
-
-  AnimationPlayer::getInstance(); // initializes the animationPlayer
-  ParticleEngine::getInstance();
-  PhysicsEngine::getInstance();
-
-  this->localCamera = new Camera();
-  this->localCamera->setName ("World-Camera");
-
-  State::setCamera(this->localCamera, this->localCamera->getTarget());
-
-  GraphicsEngine::getInstance()->displayFPS(true);
-}
-
-
-/**
- *  loads the World by initializing all resources, and set their default values.
-*/
-ErrorMessage World::load()
-{
-  PRINTF(3)("> Loading world: '%s'\n", getPath());
-  TiXmlElement* element;
-  GameLoader* loader = GameLoader::getInstance();
-
-  if( getPath() == NULL)
-    {
-      PRINTF(1)("World has no path specified for loading");
-      this->loadDebugWorld(this->getStoryID());
-      return (ErrorMessage){213,"Path not specified","World::load()"};
-    }
-
-  TiXmlDocument* XMLDoc = new TiXmlDocument( getPath());
-  // load the campaign document
-  if( !XMLDoc->LoadFile())
-  {
-    // report an error
-    PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getPath(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
-    delete XMLDoc;
-    return (ErrorMessage){213,"XML File parsing error","World::load()"};
-  }
-
-  // check basic validity
-  TiXmlElement* root = XMLDoc->RootElement();
-  assert( root != NULL);
-
-  if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile"))
-    {
-      // report an error
-      PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
-      delete XMLDoc;
-      return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"};
-    }
-
-  // load the parameters
-  // name
-  const char* string = grabParameter( root, "name");
-  if( string == NULL)
-    {
-      PRINTF(2)("World is missing a proper 'name'\n");
-      this->setName("Unknown");
-    }
-  else
-    {
-      this->setName(string);
-    }
-
-  ////////////////
-  // LOADSCREEN //
-  ////////////////
-  element = root->FirstChildElement("LoadScreen");
-  if (element == NULL)
-    {
-      PRINTF(2)("no LoadScreen specified, loading default\n");
-
-      glmis->setBackgroundImage("pictures/load_screen.jpg");
-      this->glmis->setMaximum(8);
-      this->glmis->draw();
-    }
-  else
-    {
-      this->glmis->loadParams(element);
-      this->glmis->draw();
-    }
-  this->glmis->draw();
-
-  ////////////////////////
-  // find WorldEntities //
-  ////////////////////////
-
-  element = root->FirstChildElement("WorldEntities");
-
-  if( element == NULL)
-    {
-      PRINTF(1)("World is missing 'WorldEntities'\n");
-    }
-  else
-    {
-      element = element->FirstChildElement();
-      // load Players/Objects/Whatever
-      PRINTF(4)("Loading WorldEntities\n");
-      while( element != NULL)
-        {
-          BaseObject* created = Factory::fabricate(element);
-          if( created != NULL )
-          {
-            if(created->isA(CL_WORLD_ENTITY))
-              this->spawn(dynamic_cast<WorldEntity*>(created));
-            printf("Created a %s: %s\n", created->getClassName(), created->getName());
-          }
-
-          // if we load a 'Player' we use it as localPlayer
-
-
-          //todo do this more elegant
-          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
-            sky = dynamic_cast<SkyBox*>(created);
-          if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
-          {
-            terrain = dynamic_cast<Terrain*>(created);
-            CDEngine::getInstance()->setTerrain(terrain);
-          }
-          element = element->NextSiblingElement();
-          glmis->step(); //! @todo temporary
-        }
-      PRINTF(4)("Done loading WorldEntities\n");
-    }
-
-    //////////////////////////////
-    // LOADING ADDITIONAL STUFF //
-    //////////////////////////////
-
-    LoadParamXML(root, "LightManager", LightManager::getInstance(), LightManager, loadParams);
-
-   LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams);
-//   LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
-
-  // free the XML data
-
-  delete XMLDoc;
-  /* GENERIC LOADING PROCESS FINISHED */
-
-
-  // Create a Player
-  this->localPlayer = new Player();
-
-  Playable* playable;
-  const list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
-  if (playableList != NULL)
-  {
-    playable = dynamic_cast<Playable*>(playableList->front());
-    this->localPlayer->setControllable(playable);
-  }
-
-  // bind camera
-  playable->addChild (this->localCamera);
-
-//   //localCamera->setParent(TrackNode::getInstance());
-//  tn->addChild(this->localCamera);
-  localCamera->setClipRegion(1, 10000.0);
-  localCamera->lookAt(playable);
-//  this->localPlayer->setParentMode(PNODE_ALL);
-  if (sky != NULL)
-  {
-    this->sky->setParent(this->localCamera);
-    this->sky->setParentMode(PNODE_MOVEMENT);
-  }
-
-  // initialize debug coord system
-  objectList = glGenLists(1);
-  glNewList (objectList, GL_COMPILE);
-
-  glEndList();
-
-  SoundEngine::getInstance()->setListener(this->localCamera);
-
-
-
-  ////////////
-  // STATIC //
-  ////////////
-
-
-//   TestEntity* testEntity = new TestEntity();
-//   testEntity->setRelCoor(Vector(570, 10, -15));
-//   testEntity->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity);
-
-  for(int i = 0; i < 100; i++)
-  {
-    WorldEntity* tmp = new NPCTest1();
-    char npcChar[10];
-    sprintf (npcChar, "NPC_%d", i);
-        tmp->setName(npcChar);
-    tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);
-    this->spawn(tmp);
-  }
-
-  this->music = NULL;
-  //(OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL);
-  //music->playback();
-}
-
-
-
-/**
- * creates a debug world: only for experimental stuff
-*/
-void World::loadDebugWorld(int worldID)
-{
-  /*monitor progress*/
-  this->glmis->step();
-  // stuff beyond this point remains to be loaded properly
-
-  // LIGHT initialisation
-  LightManager::getInstance()->setAmbientColor(.1,.1,.1);
-//  LightManager::getInstance()->addLight();
-  LightManager::getInstance()->debug();
-
-  switch(this->debugWorldNr)
-    {
-      /*
-        this loads the hard-coded debug world. this only for simplicity and will be
-        removed by a reald world-loader, which interprets a world-file.
-        if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
-        make whatever you want...
-      */
-    case DEBUG_WORLD_0:
-      {
-        LightManager::getInstance()->getLight()->setAbsCoor(-5.0, 10.0, -40.0);
-        /*monitor progress*/
-        this->glmis->step();
-
-        // bind camera
-        this->localCamera = new Camera();
-        this->localCamera->setName ("camera");
-        /*monitor progress*/
-        this->glmis->step();
-
-
-        // Create SkySphere
-        this->sky = new Skysphere("pictures/sky-replace.jpg");
-        this->sky->setName("SkySphere");
-        this->spawn(this->sky);
-        this->localCamera->addChild(this->sky);
-        this->sky->setParentMode(PNODE_MOVEMENT);
-        /*monitor progress*/
-        this->glmis->step();
-
-
-        terrain = new Terrain("worlds/newGround.obj");
-        terrain->setRelCoor(Vector(0,-10,0));
-        this->spawn(terrain);
-        /*monitor progress*/
-        this->glmis->step();
-
-        this->glmis->step();
-        break;
-      }
-    case DEBUG_WORLD_1:
-      {
-
-        break;
-      }
-    case DEBUG_WORLD_2:
-      {
-
-        break;
-      }
-    default:
-      break;
-    }
-}
-
-/**
- *  initializes a new World shortly before start
- *
- * this is the function, that will be loaded shortly before the world is
- * started
-*/
-ErrorMessage World::init()
-{
-  this->bPause = false;
-
-  /* update the object position before game start - so there are no wrong coordinates used in the first processing */
-  PNode::getNullParent()->updateNode (0.001f);
-  PNode::getNullParent()->updateNode (0.001f);
-
-}
-
-
-/**
- *  starts the World
-*/
-ErrorMessage World::start()
-{
-  PRINTF(3)("World::start() - starting current World: nr %i\n", this->debugWorldNr);
-  this->bQuitOrxonox = false;
-  this->bQuitCurrentGame = false;
-  this->mainLoop();
-}
-
-/**
- *  stops the world.
-
-   This happens, when the player decides to end the Level.
-*/
-ErrorMessage World::stop()
-{
-  PRINTF(3)("World::stop() - got stop signal\n");
-  this->bQuitCurrentGame = true;
-}
-
-/**
- *  pauses the Game
-*/
-ErrorMessage World::pause()
-{
-  this->isPaused = true;
-}
-
-/**
- *  ends the pause Phase
-*/
-ErrorMessage World::resume()
-{
-  this->isPaused = false;
-}
-
-/**
- *  destroys the World
-*/
-ErrorMessage World::destroy()
-{
-
-}
-
-/**
- *  shows the loading screen
-*/
-void World::displayLoadScreen ()
-{
-  PRINTF(3)("World::displayLoadScreen - start\n");
-
-  //GLMenuImageScreen*
-  this->glmis = new GLMenuImageScreen();
-  this->glmis->setMaximum(8);
-
-  PRINTF(3)("World::displayLoadScreen - end\n");
-}
-
-/**
- *  removes the loadscreen, and changes over to the game
-
-   @todo take out the delay
-*/
-void World::releaseLoadScreen ()
-{
-  PRINTF(3)("World::releaseLoadScreen - start\n");
-  this->glmis->setValue(this->glmis->getMaximum());
-  PRINTF(3)("World::releaseLoadScreen - end\n");
-  delete this->glmis;
-}
-
-
-/**
- *  this returns the current game time
- * @returns elapsed game time
-*/
-double World::getGameTime()
-{
-  return this->gameTime;
-}
-
-/**
-  \brief main loop of the world: executing all world relevant function
-
-  in this loop we synchronize (if networked), handle input events, give the heart-beat to
-  all other member-entities of the world (tick to player, enemies etc.), checking for
-  collisions drawing everything to the screen.
-*/
-void World::mainLoop()
-{
-  this->lastFrame = SDL_GetTicks ();
-  PRINTF(3)("World::mainLoop() - Entering main loop\n");
-
-  while( !this->bQuitOrxonox && !this->bQuitCurrentGame) /* @todo implement pause */
-    {
-      ++this->cycle;
-      // Network
-      this->synchronize ();
-      // Process input
-      this->handleInput ();
-      if( this->bQuitCurrentGame || this->bQuitOrxonox)
-          break;
-      // Process time
-      this->tick ();
-      // Process collision
-      this->collide ();
-      // Update the state
-      this->update ();
-      // Draw
-      this->display ();
-    }
-
-  PRINTF(3)("World::mainLoop() - Exiting the main loop\n");
-}
-
-
-/**
- *  synchronize local data with remote data
-*/
-void World::synchronize ()
-{
-  // Get remote input
-  // Update synchronizables
-/*  NetworkManager::getInstance()->synchronize();*/
-}
-
-
-/**
- *  run all input processing
-
-   the command node is the central input event dispatcher. the node uses the even-queue from
-   sdl and has its own event-passing-queue.
-*/
-void World::handleInput ()
-{
-  EventHandler::getInstance()->process();
-
-  // remoteinput
-}
-
-void World::tick(std::list<WorldEntity*> entityList, float dt)
-{
-  std::list<WorldEntity*>::iterator entity;
-  for (entity = entityList.begin(); entity != entityList.end(); entity++)
-    (*entity)->tick(dt);
-
-}
-
-/**
- *  advance the timeline
-
-   this calculates the time used to process one frame (with all input handling, drawing, etc)
-   the time is mesured in ms and passed to all world-entities and other classes that need
-   a heart-beat.
-*/
-void World::tick ()
-{
-  Uint32 currentFrame = SDL_GetTicks();
-  if(!this->bPause)
-    {
-      this->dt = currentFrame - this->lastFrame;
-
-      if( this->dt > 10)
-        {
-          float fps = 1000/dt;
-
-          // temporary, only for showing how fast the text-engine is
-          char tmpChar[20];
-          sprintf(tmpChar, "fps: %4.0f", fps);
-        }
-      else
-        {
-          /* the frame-rate is limited to 100 frames per second, all other things are for
-             nothing.
-          */
-          PRINTF(3)("fps = 1000 - frame rate is adjusted\n");
-          SDL_Delay(10-dt);
-          this->dt = 10;
-        }
-
-      this->dtS = (float)this->dt / 1000.0 * this->speed;
-      this->gameTime += this->dtS;
-
-/*      this->tick(this->objectManager.getObjectList(OM_DEAD_TICK), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_COMMON), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_00), this->dtS);*/
-      this->tick(this->objectManager.getObjectList(OM_GROUP_01), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_01_PROJ), this->dtS);
-
-      /* update tick the rest */
-      this->localCamera->tick(this->dtS);
-      // tick the engines
-      AnimationPlayer::getInstance()->tick(this->dtS);
-//      if (this->cycle > 5)
-        PhysicsEngine::getInstance()->tick(this->dtS);
-
-      ParticleEngine::getInstance()->tick(this->dtS);
-
-
-      /** actualy the Graphics Engine should tick the world not the other way around...
-         but since we like the things not too complicated we got it this way around
-         until there is need or time to do it the other way around.
-         @todo: GraphicsEngine ticks world: separation of processes and data...
-
-        bensch: in my opinion the GraphicsEngine could draw the world, but not tick it,
-         beceause graphics have nothing(or at least not much) to do with Motion.
-      */
-      GraphicsEngine::getInstance()->tick(this->dtS);
-    }
-  this->lastFrame = currentFrame;
-}
-
-
-/**
- *  this function gives the world a consistant state
-
-   after ticking (updating the world state) this will give a constistant
-   state to the whole system.
-*/
-void World::update()
-{
-  GraphicsEngine::getInstance()->update(this->dtS);
-  PNode::getNullParent()->updateNode (this->dtS);
-
-  SoundEngine::getInstance()->update();
-  //music->update();
-}
-
-
-void World::collide()
-{
-  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_00),
-                                            this->objectManager.getObjectList(OM_GROUP_01_PROJ));
-  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_01),
-                                            this->objectManager.getObjectList(OM_COMMON));
-}
-
-/**
- *  render the current frame
-
-   clear all buffers and draw the world
-*/
-void World::display ()
-{
-  // clear buffer
-  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
-  // set camera
-  this->localCamera->apply ();
-  // draw world
-  this->draw();
-  // draw HUD
-  /** @todo draw HUD */
-  // flip buffers
-  GraphicsEngine::swapBuffers();
-  //SDL_Surface* screen = Orxonox::getInstance()->getScreen ();
-  //SDL_Flip (screen);
-}
-
-
-/**
- *  runs through all entities calling their draw() methods
- */
-void World::draw ()
-{
-  GraphicsEngine* engine = GraphicsEngine::getInstance();
-  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON_NOTICK));
-  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON));
-  engine->draw(State::getObjectManager()->getObjectList(OM_COMMON));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_00));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
-
-//   {
-//     if( entity->isVisible() ) entity->draw();
-  //FIXME
-//     if( unlikely( this->showBV)) entity->drawBVTree(3, 226);  // to draw the bounding boxes of the objects at level 2 for debug purp
-//     entity = iterator->nextElement();
-//   }
-
-  glCallList (objectList);
-
-  ParticleEngine::getInstance()->draw();
-
-  if (unlikely(this->showPNodes))
-    PNode::getNullParent()->debugDraw(0);
-
-  engine->draw();
-  //TextEngine::getInstance()->draw();
-}
-
-/**
- *  add and spawn a new entity to this world
- * @param entity to be added
-*/
-void World::spawn(WorldEntity* entity)
-{
-//   this->entities->add (entity);
-  entity->postSpawn ();
-}
-
-
-/**
- *  add and spawn a new entity to this world
- * @param entity to be added
- * @param absCoor At what coordinates to add this entity.
- * @param absDir In which direction should it look.
-*/
-void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir)
-{
-//   this->entities->add (entity);
-
-  entity->setAbsCoor (*absCoor);
-  entity->setAbsDir (*absDir);
-
-  entity->postSpawn ();
-}
-
-
-/**
- *  add and spawn a new entity to this world
- * @param entity to be added
- * @param entity to be added to (PNode)
- * @param At what relative  coordinates to add this entity.
- * @param In which relative direction should it look.
-*/
-void World::spawn(WorldEntity* entity, PNode* parentNode,
-                  Vector* relCoor, Quaternion* relDir)
-{
-  if( parentNode != NULL)
-    {
-      parentNode->addChild (entity);
-
-      entity->setRelCoor (*relCoor);
-      entity->setRelDir (*relDir);
-
-//       this->entities->add (entity);
-
-      entity->postSpawn ();
-    }
-}
-
-void World::setPath( const char* name)
-{
-  if (this->path)
-    delete this->path;
-  if (ResourceManager::isFile(name))
-  {
-    this->path = new char[strlen(name)+1];
-    strcpy(this->path, name);
-  }
-  else
-    {
-      this->path = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(name) +1];
-      sprintf(this->path, "%s%s", ResourceManager::getInstance()->getDataDir(), name);
-    }
-}
-
-const char* World::getPath( void)
-{
-  return path;
-}
Index: branches/network/src/story_entities/debug_world.h
===================================================================
--- branches/network/src/story_entities/debug_world.h	(revision 6377)
+++ branches/network/src/story_entities/debug_world.h	(revision 6386)
@@ -1,123 +1,0 @@
-/*!
- * @file world.h
-  *  Holds and manages all game data
-*/
-
-#ifndef _WORLD_H
-#define _WORLD_H
-
-#include "stdincl.h"
-#include "comincl.h"
-#include "story_entity.h"
-#include "p_node.h"
-#include "object_manager.h"
-
-
-class WorldEntity;
-class Camera;
-class Player;
-class GLMenuImageScreen;
-class Terrain;
-class TiXmlElement;
-
-class Shell;
-class OggPlayer;
-
-//! The game world
-/**
-   this class initializes everything that should be displayed inside of the current level.
-   it is the main driving factor during gameplay.
-*/
-class World : public StoryEntity {
-
- public:
-  World (const char* name);
-  World (int worldID);
-  World (const TiXmlElement* root = NULL);
-  virtual ~World ();
-
-  void loadParams(const TiXmlElement* root);
-
-  double getGameTime();
-
-  /* classes from story-entity */
-  virtual ErrorMessage preLoad();
-  virtual ErrorMessage load ();
-  virtual ErrorMessage init ();
-  virtual ErrorMessage start ();
-  virtual ErrorMessage stop ();
-  virtual ErrorMessage pause ();
-  virtual ErrorMessage resume ();
-  virtual ErrorMessage destroy ();
-
-  void loadDebugWorld(int worldID);
-
-  virtual void displayLoadScreen();
-  virtual void releaseLoadScreen();
-
-  /* command node functions */
-  bool command (Command* cmd);
-
-  /* interface to world */
-  void spawn (WorldEntity* entity);
-  void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
-  void spawn(WorldEntity* entity, PNode* parentNode, Vector* relCoor, Quaternion* relDir);
-
-  /** @param speed sets the speed of the Game */
-  inline void setSpeed(float speed) { this->speed = speed; };
-  const char* getPath();
-  void setPath( const char* name);
-
-  inline Camera* getLocalCamera() { return this->localCamera; };
-
-  void togglePNodeVisibility() { this->showPNodes = !this->showPNodes; };
-  void toggleBVVisibility() { this->showBV = !this->showBV; };
-
- private:
-  void constuctorInit(const char* name, int worldID);
-  /* function for main-loop */
-  void mainLoop ();
-  void synchronize ();
-  void handleInput ();
-  void tick (std::list<WorldEntity*> worldEntity, float dt);
-  void tick ();
-  void update ();
-  void collide ();
-  void draw ();
-  void display ();
-  void debug ();
-
-  private:
-    bool   showPNodes;                  //!< if the PNodes should be visible.
-    bool   showBV;                      //!< if the Bounding Volumes should be visible.
-    Uint32 lastFrame;                   //!< last time of frame
-    Uint32 cycle;                       //!< The cycle we are in (starts with 0 and rises with every frame)
-    Uint32 dt;                          //!< time needed to calculate this frame (in milliSeconds)
-    float dtS;                          //!< The time needed for caluculations in seconds
-    float speed;                        //!< how fast the game flows
-    double gameTime;                    //!< this is where the game time is saved
-    bool bQuitOrxonox;                  //!< quit this application
-    bool bQuitCurrentGame;              //!< quit only the current game and return to menu
-    bool bPause;                        //!< pause mode
-
-    ObjectManager      objectManager;   //!< The ObjectManager of this World.
-
-    GLMenuImageScreen* glmis;           //!< The Level-Loader Display
-
-    int debugWorldNr;                   //!< The Debug Nr. needed, if something goes wrong
-    char* path;                         //!< The file from which this world is loaded
-
-    Shell*     shell;
-    OggPlayer* music;
-
-  // IMPORTANT WORLD-ENTITIES
-    Camera* localCamera;                //!< The current Camera
-    WorldEntity* sky;                   //!< The Environmental Heaven of orxonox @todo insert this to environment insted
-    Terrain* terrain;                   //!< The Terrain of the World.
-
-    GLuint objectList;                  //!< temporary: @todo this will be ereased soon
-
-    Player* localPlayer;                //!< The Player, you fly through the level.
-};
-
-#endif /* _WORLD_H */
Index: branches/network/src/story_entities/dedicated_server_world.cc
===================================================================
--- branches/network/src/story_entities/dedicated_server_world.cc	(revision 6377)
+++ branches/network/src/story_entities/dedicated_server_world.cc	(revision 6386)
@@ -9,788 +9,61 @@
    any later version.
 
-   ### File Specific:
+### File Specific:
    main-programmer: Patrick Boenzli
-   co-programmer: Christian Meyer
-   co-programmer: Benjamin Grauer
 */
 
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
 
-#include "network_world.h"
+#include "dedicated_server_world.h"
 
-#include "shell_command.h"
-#include "resource_manager.h"
 #include "state.h"
+#include "class_list.h"
 
-#include "p_node.h"
-#include "world_entity.h"
-#include "player.h"
-#include "camera.h"
-#include "environment.h"
-#include "terrain.h"
-
-#include "test_entity.h"
-#include "terrain.h"
-#include "light.h"
 #include "load_param.h"
-#include "shell.h"
-
 #include "fast_factory.h"
-#include "animation_player.h"
-#include "particle_engine.h"
-#include "graphics_engine.h"
-#include "physics_engine.h"
-#include "fields.h"
-
-#include "md2Model.h"
-
-#include "glmenu_imagescreen.h"
-#include "game_loader.h"
-
-#include "animation3d.h"
-
-#include "substring.h"
-
 #include "factory.h"
 
-#include "weapons/projectile.h"
-#include "event_handler.h"
-#include "sound_engine.h"
-#include "ogg_player.h"
+#include "world_entity.h"
+#include "npcs/npc_test1.h"
 
-#include "class_list.h"
-
-#include "cd_engine.h"
-#include "npcs/npc_test1.h"
-#include "shader.h"
-
-#include "playable.h"
-#include "network_manager.h"
-#include "network_game_manager.h"
-#include "playable.h"
-
-
-SHELL_COMMAND(speed, NetworkWorld, setSpeed);
-SHELL_COMMAND(togglePNodeVisibility, NetworkWorld, togglePNodeVisibility);
-SHELL_COMMAND(toggleBVVisibility, NetworkWorld, toggleBVVisibility);
 
 using namespace std;
 
-//! This creates a Factory to fabricate a NetworkWorld
-CREATE_FACTORY(NetworkWorld, CL_WORLD);
+//! This creates a Factory to fabricate a DedicatedServerWorld
+CREATE_FACTORY(DedicatedServerWorld, CL_DEDICATED_SERVER_WORLD);
 
-NetworkWorld::NetworkWorld(const TiXmlElement* root)
+
+
+DedicatedServerWorld::DedicatedServerWorld(const TiXmlElement* root)
+  : GameWorld(root)
 {
-  this->constuctorInit("", -1);
-  this->path = NULL;
+  this->setClassID(CL_DEDICATED_SERVER_WORLD, "DedicatedServerWorld");
+  this->setName("DedicatedServerWorld uninitialized");
 
   this->loadParams(root);
 }
 
+
 /**
- *  remove the NetworkWorld from memory
+ *  remove the DedicatedServerWorld from memory
  *
  *  delete everything explicitly, that isn't contained in the parenting tree!
  *  things contained in the tree are deleted automaticaly
  */
-NetworkWorld::~NetworkWorld ()
+DedicatedServerWorld::~DedicatedServerWorld ()
 {
-  delete this->shell;
-  PRINTF(3)("NetworkWorld::~NetworkWorld() - deleting current world\n");
-
-  delete this->localPlayer;
-
-  // delete all the initialized Engines.
-  FastFactory::flushAll(true);
-  delete LightManager::getInstance();
-  delete ParticleEngine::getInstance();
-  delete AnimationPlayer::getInstance();
-  delete PhysicsEngine::getInstance();
-
-  // external engines initialized by the orxonox-class get deleted
-  SoundEngine::getInstance()->flushAllBuffers();
-  SoundEngine::getInstance()->flushAllSources();
-
-  if (State::getObjectManager() == &this->objectManager)
-    State::setObjectManager(NULL);
-  // erease everything that is left.
-  delete PNode::getNullParent();
-
-  //secondary cleanup of PNodes;
-  const std::list<BaseObject*>* nodeList = ClassList::getList(CL_PARENT_NODE);
-  if (nodeList != NULL)
-    while (!nodeList->empty())
-      delete nodeList->front();
-
-  Shader::suspendShader();
-
-  // unload the resources !!
-  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
-}
-
-/**
- * initializes the world.
- * @param name the name of the world
- * @param worldID the ID of this world
- *
- * set all stuff here that is world generic and does not use to much memory
- * because the real init() function StoryEntity::init() will be called
- * shortly before start of the game.
- * since all worlds are initiated/referenced before they will be started.
- * NO LEVEL LOADING HERE - NEVER!
-*/
-void NetworkWorld::constuctorInit(const char* name, int worldID)
-{
-  this->setClassID(CL_WORLD, "NetworkWorld");
-  PRINTF(0)("START\n");
-
-  this->setName(name);
-  this->gameTime = 0.0f;
-  this->setSpeed(1.0);
-  this->music = NULL;
-  this->shell = NULL;
-  this->localPlayer = NULL;
-  this->localCamera = NULL;
-
-  this->showPNodes = false;
-  this->showBV = false;
-}
-
-/**
- * loads the parameters of a NetworkWorld from an XML-element
- * @param root the XML-element to load from
- */
-void NetworkWorld::loadParams(const TiXmlElement* root)
-{
-  PRINTF(4)("Creating a NetworkWorld\n");
-
-  LoadParam(root, "identifier", this, NetworkWorld, setStoryID)
-    .describe("Sets the StoryID of this world");
-
-  LoadParam(root, "nextid", this, NetworkWorld, setNextStoryID)
-    .describe("Sets the ID of the next world");
-
-  LoadParam(root, "path", this, NetworkWorld, setPath)
-    .describe("The Filename of this NetworkWorld (relative from the data-dir)");
-}
-
-/**
- * this is executed just before load
- *
- * since the load function sometimes needs data, that has been initialized
- * before the load and after the proceeding storyentity has finished
-*/
-ErrorMessage NetworkWorld::preLoad()
-{
-  State::setObjectManager(&this->objectManager);
-  this->cycle = 0;
-
-  /* init the world interface */
-  this->shell = new Shell();
-
-  LightManager::getInstance();
-  PNode::getNullParent();
-
-  AnimationPlayer::getInstance(); // initializes the animationPlayer
-  ParticleEngine::getInstance();
-  PhysicsEngine::getInstance();
-
-  this->localCamera = new Camera();
-  this->localCamera->setName ("NetworkWorld-Camera");
-
-  State::setCamera(this->localCamera, this->localCamera->getTarget());
-
-  GraphicsEngine::getInstance()->displayFPS(true);
-  this->displayLoadScreen();
+  PRINTF(3)("DedicatedServerWorld::~DedicatedServerWorld() - deleting current world\n");
 }
 
 
 /**
- *  loads the NetworkWorld by initializing all resources, and set their default values.
+ * loads the parameters of a DedicatedServerWorld from an XML-element
+ * @param root the XML-element to load from
  */
-ErrorMessage NetworkWorld::load()
+void DedicatedServerWorld::loadParams(const TiXmlElement* root)
 {
-  PRINTF(3)("> Loading world: '%s'\n", getPath());
-  TiXmlElement* element;
-  GameLoader* loader = GameLoader::getInstance();
+  static_cast<GameWorld*>(this)->loadParams(root);
 
-  if( getPath() == NULL)
-    {
-      PRINTF(1)("World has no path specified for loading");
-      return (ErrorMessage){213,"Path not specified","World::load()"};
-    }
-
-  TiXmlDocument* XMLDoc = new TiXmlDocument( getPath());
-  // load the campaign document
-  if( !XMLDoc->LoadFile())
-  {
-    // report an error
-    PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getPath(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
-    delete XMLDoc;
-    return (ErrorMessage){213,"XML File parsing error","NetworkWorld::load()"};
-  }
-
-  // check basic validity
-  TiXmlElement* root = XMLDoc->RootElement();
-  assert( root != NULL);
-
-  if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile"))
-    {
-      // report an error
-      PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
-      delete XMLDoc;
-      return (ErrorMessage){213,"Path not a WorldDataFile","NetworkWorld::load()"};
-    }
-
-
-  // load the parameters
-  // name
-  const char* string = grabParameter( root, "name");
-  if( string == NULL)
-    {
-      PRINTF(2)("World is missing a proper 'name'\n");
-      this->setName("Unknown");
-    }
-  else
-    {
-      this->setName(string);
-    }
-
-
-  ////////////////
-  // LOADSCREEN //
-  ////////////////
-  element = root->FirstChildElement("LoadScreen");
-  if (element == NULL)
-    {
-      PRINTF(2)("no LoadScreen specified, loading default\n");
-
-      glmis->setBackgroundImage("pictures/load_screen.jpg");
-      this->glmis->setMaximum(8);
-      this->glmis->draw();
-    }
-  else
-    {
-      this->glmis->loadParams(element);
-      this->glmis->draw();
-    }
-  this->glmis->draw();
-
-
-
-  ////////////////////////////
-  // Loading Spawning Point //
-  ////////////////////////////
-  element = root->FirstChildElement("SpawningPoints");
-  if( element == NULL)
-  {
-    PRINTF(1)("NetworkWorld is missing 'SpawningPoints'\n");
-  }
-  else
-  {
-    element = element->FirstChildElement();
-      // load Players/Objects/Whatever
-    PRINTF(4)("Loading Spawning Points\n");
-    while( element != NULL)
-    {
-      BaseObject* created = Factory::fabricate(element);
-      if( created != NULL )
-      {
-//        if(created->isA(CL_SPAWNING_POINT))
-//          this->spawn(dynamic_cast<WorldEntity*>(created));
-        printf("Created a Spawning Point %s: %s\n", created->getClassName(), created->getName());
-      }
-
-
-      element = element->NextSiblingElement();
-      glmis->step(); //! @todo temporary
-    }
-    PRINTF(4)("Done loading NetworkWorldEntities\n");
-  }
-
-
-  ////////////////////////
-  // find WorldEntities //
-  ////////////////////////
-  element = root->FirstChildElement("WorldEntities");
-  if( element == NULL)
-  {
-    PRINTF(1)("NetworkWorld is missing 'WorldEntities'\n");
-  }
-  else
-  {
-    element = element->FirstChildElement();
-      // load Players/Objects/Whatever
-    PRINTF(4)("Loading NetworkWorldEntities\n");
-    while( element != NULL)
-    {
-      if( NetworkManager::getInstance()->isGameServer())
-      {
-
-        BaseObject* created = NetworkGameManager::getInstance()->createEntity(element);
-        if( created != NULL )
-        {
-//          if(created->isA(CL_WORLD_ENTITY))
-//            this->spawn(dynamic_cast<WorldEntity*>(created));
-          printf("Created a %s: %s\n", created->getClassName(), created->getName());
-        }
-        else
-          PRINTF(1)("NetworkWorld: could not create this entity\n");
-
-          // if we load a 'Player' we use it as localPlayer
-
-
-          //todo do this more elegant
-        if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
-          sky = dynamic_cast<WorldEntity*>(created);
-        if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
-        {
-          terrain = dynamic_cast<Terrain*>(created);
-          CDEngine::getInstance()->setTerrain(terrain);
-
-        }
-
-      }
-      else if( /* !strcmp( element->Value(), "SkyBox") || */ /* !strcmp( element->Value(), "Terrain") || */ !strcmp( element->Value(), "SpaceShip"))
-      {
-        BaseObject* created = Factory::fabricate(element);
-        if( created != NULL )
-        {
-//          if(created->isA(CL_WORLD_ENTITY))
-//            this->spawn(dynamic_cast<WorldEntity*>(created));
-          printf("Created a %s: %s\n", created->getClassName(), created->getName());
-        }
-        else
-          PRINTF(1)("NetworkWorld: could not create this entity\n");
-
-          // if we load a 'Player' we use it as localPlayer
-
-
-          //todo do this more elegant
-        if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
-          sky = dynamic_cast<WorldEntity*>(created);
-        if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
-        {
-          terrain = dynamic_cast<Terrain*>(created);
-          CDEngine::getInstance()->setTerrain(terrain);
-        }
-      }
-      element = element->NextSiblingElement();
-      glmis->step(); //! @todo temporary
-      PRINTF(4)("Done loading NetworkWorldEntities\n");
-    }
-  }
-
-
-    //////////////////////////////
-    // LOADING ADDITIONAL STUFF //
-    //////////////////////////////
-
-    LoadParamXML(root, "LightManager", LightManager::getInstance(), LightManager, loadParams);
-
-   LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams);
-//   LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
-
-  // free the XML data
-
-  delete XMLDoc;
-  /* GENERIC LOADING PROCESS FINISHED */
-
-
-  // Create a Player
-  this->localPlayer = new Player();
-
-  Playable* playable;
-  const list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
-  if (playableList != NULL)
-  {
-    playable = dynamic_cast<Playable*>(playableList->front());
-    this->localPlayer->setControllable(playable);
-  }
-
-
-//   //localCamera->setParent(TrackNode::getInstance());
-//  tn->addChild(this->localCamera);
-  localCamera->setClipRegion(1, 10000.0);
-//  localCamera->lookAt(playable);
-//  this->localPlayer->setParentMode(PNODE_ALL);
-  if (this->sky != NULL)
-  {
-    this->localCamera->addChild(sky);
-  }
-  SoundEngine::getInstance()->setListener(this->localCamera);
-
-
-
-  ////////////
-  // STATIC //
-  ////////////
-
-
-//   TestEntity* testEntity = new TestEntity();
-//   testEntity->setRelCoor(Vector(570, 10, -15));
-//   testEntity->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity);
-
-//   for(int i = 0; i < 100; i++)
-//   {
-//     WorldEntity* tmp = NetworkGameManager::;
-//     char npcChar[10];
-//     sprintf (npcChar, "NPC_%d", i);
-//         tmp->setName(npcChar);
-//     tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);
-//     this->spawn(tmp);
-//   }
-
-  this->music = NULL;
-  //(OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL);
-  //music->playback();
+  PRINTF(4)("Loaded DedicatedServerWorld specific stuff\n");
 }
 
-ErrorMessage NetworkWorld::postLoad()
-{
-  /*monitor progress*/
-  this->glmis->step();
-  // stuff beyond this point remains to be loaded properly
-
-  // LIGHT initialisation
-  LightManager::getInstance()->setAmbientColor(.1,.1,.1);
-//  LightManager::getInstance()->addLight();
-  LightManager::getInstance()->debug();
-
-  this->releaseLoadScreen();
-}
-
-
-/**
- *  initializes a new NetworkWorld shortly before start
- *
- * this is the function, that will be loaded shortly before the world is
- * started
-*/
-ErrorMessage NetworkWorld::preStart()
-{
-  this->bPause = false;
-
-  /* update the object position before game start - so there are no wrong coordinates used in the first processing */
-  PNode::getNullParent()->updateNode (0.001f);
-  PNode::getNullParent()->updateNode (0.001f);
-}
-
-
-/**
- *  starts the NetworkWorld
- */
-ErrorMessage NetworkWorld::start()
-{
-  this->bQuitWorld = false;
-  this->mainLoop();
-}
-
-/**
- *  stops the world.
-
-   This happens, when the player decides to end the Level.
-*/
-ErrorMessage NetworkWorld::stop()
-{
-  PRINTF(3)("NetworkWorld::stop() - got stop signal\n");
-  this->bQuitWorld= true;
-}
-
-/**
- *  pauses the Game
-*/
-ErrorMessage NetworkWorld::pause()
-{
-  this->isPaused = true;
-}
-
-/**
- *  ends the pause Phase
-*/
-ErrorMessage NetworkWorld::resume()
-{
-  this->isPaused = false;
-}
-
-/**
- *  destroys the NetworkWorld
-*/
-ErrorMessage NetworkWorld::destroy()
-{
-
-}
-
-/**
- *  shows the loading screen
-*/
-void NetworkWorld::displayLoadScreen ()
-{
-  PRINTF(3)("NetworkWorld::displayLoadScreen - start\n");
-
-  //GLMenuImageScreen*
-  this->glmis = new GLMenuImageScreen();
-  this->glmis->setMaximum(8);
-
-  PRINTF(3)("NetworkWorld::displayLoadScreen - end\n");
-}
-
-/**
- * @brief removes the loadscreen, and changes over to the game
- *
- * @todo take out the delay
-*/
-void NetworkWorld::releaseLoadScreen ()
-{
-  PRINTF(3)("NetworkWorld::releaseLoadScreen - start\n");
-  this->glmis->setValue(this->glmis->getMaximum());
-  PRINTF(3)("NetworkWorld::releaseLoadScreen - end\n");
-  delete this->glmis;
-}
-
-
-/**
- *  this returns the current game time
- * @returns elapsed game time
-*/
-double NetworkWorld::getGameTime()
-{
-  return this->gameTime;
-}
-
-/**
-  \brief main loop of the world: executing all world relevant function
-  in this loop we synchronize (if networked), handle input events, give the heart-beat to
-  all other member-entities of the world (tick to player, enemies etc.), checking for
-  collisions drawing everything to the screen.
-*/
-void NetworkWorld::mainLoop()
-{
-  this->lastFrame = SDL_GetTicks ();
-  PRINTF(3)("World::mainLoop() - Entering main loop\n");
-
-  while(!this->bQuitWorld) /* @todo implement pause */
-  {
-    ++this->cycle;
-      // Network
-    this->synchronize ();
-      // Process input
-    this->handleInput ();
-    if( this->bQuitWorld)
-      break;
-      // Process time
-    this->tick ();
-      // Process collision
-    this->collide ();
-      // Update the state
-    this->update ();
-      // Draw
-    this->display ();
-  }
-
-  PRINTF(3)("NetworkWorld::mainLoop() - Exiting the main loop\n");
-}
-
-
-/**
- *  synchronize local data with remote data
-*/
-void NetworkWorld::synchronize ()
-{
-  // Get remote input
-  // Update synchronizables
-  NetworkManager::getInstance()->synchronize();
-}
-
-
-/**
- *  run all input processing
-
-   the command node is the central input event dispatcher. the node uses the even-queue from
-   sdl and has its own event-passing-queue.
-*/
-void NetworkWorld::handleInput ()
-{
-  EventHandler::getInstance()->process();
-
-  // remoteinput
-}
-
-void NetworkWorld::tick(std::list<WorldEntity*> entityList, float dt)
-{
-  std::list<WorldEntity*>::iterator entity;
-  for (entity = entityList.begin(); entity != entityList.end(); entity++)
-    (*entity)->tick(dt);
-
-}
-
-/**
- *  advance the timeline
-
-   this calculates the time used to process one frame (with all input handling, drawing, etc)
-   the time is mesured in ms and passed to all world-entities and other classes that need
-   a heart-beat.
-*/
-void NetworkWorld::tick ()
-{
-  Uint32 currentFrame = SDL_GetTicks();
-  if(!this->bPause)
-    {
-      this->dt = currentFrame - this->lastFrame;
-
-      if( this->dt > 10)
-        {
-          float fps = 1000/dt;
-
-          // temporary, only for showing how fast the text-engine is
-          char tmpChar[20];
-          sprintf(tmpChar, "fps: %4.0f", fps);
-        }
-      else
-        {
-          /* the frame-rate is limited to 100 frames per second, all other things are for
-             nothing.
-          */
-          PRINTF(3)("fps = 1000 - frame rate is adjusted\n");
-          SDL_Delay(10-dt);
-          this->dt = 10;
-        }
-
-      this->dtS = (float)this->dt / 1000.0 * this->speed;
-      this->gameTime += this->dtS;
-
-      this->tick(this->objectManager.getObjectList(OM_DEAD_TICK), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_COMMON), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_00), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_01), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_01_PROJ), this->dtS);
-
-      /* update tick the rest */
-      this->localCamera->tick(this->dtS);
-      // tick the engines
-      AnimationPlayer::getInstance()->tick(this->dtS);
-//      if (this->cycle > 5)
-        PhysicsEngine::getInstance()->tick(this->dtS);
-
-      ParticleEngine::getInstance()->tick(this->dtS);
-
-
-      /** actualy the Graphics Engine should tick the world not the other way around...
-         but since we like the things not too complicated we got it this way around
-         until there is need or time to do it the other way around.
-         @todo: GraphicsEngine ticks world: separation of processes and data...
-
-        bensch: in my opinion the GraphicsEngine could draw the world, but not tick it,
-         beceause graphics have nothing(or at least not much) to do with Motion.
-      */
-      GraphicsEngine::getInstance()->tick(this->dtS);
-    }
-  this->lastFrame = currentFrame;
-}
-
-
-/**
- *  this function gives the world a consistant state
-
-   after ticking (updating the world state) this will give a constistant
-   state to the whole system.
-*/
-void NetworkWorld::update()
-{
-  GraphicsEngine::getInstance()->update(this->dtS);
-  PNode::getNullParent()->updateNode (this->dtS);
-  SoundEngine::getInstance()->update();
-  //music->update();
-}
-
-
-void NetworkWorld::collide()
-{
-  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_00),
-                                            this->objectManager.getObjectList(OM_GROUP_01_PROJ));
-  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_01),
-                                            this->objectManager.getObjectList(OM_COMMON));
-}
-
-/**
- *  render the current frame
-
-   clear all buffers and draw the world
-*/
-void NetworkWorld::display ()
-{
-  // clear buffer
-  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
-  // set camera
-  this->localCamera->apply ();
-  // draw world
-  this->draw();
-  // draw HUD
-  /** @todo draw HUD */
-  // flip buffers
-  GraphicsEngine::swapBuffers();
-  //SDL_Surface* screen = Orxonox::getInstance()->getScreen ();
-  //SDL_Flip (screen);
-}
-
-
-/**
- *  runs through all entities calling their draw() methods
- */
-void NetworkWorld::draw ()
-{
-  GraphicsEngine* engine = GraphicsEngine::getInstance();
-  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON_NOTICK));
-  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON));
-  engine->draw(State::getObjectManager()->getObjectList(OM_COMMON));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_00));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
-
-   if( unlikely( this->showBV))  // to draw the bounding boxes of the objects at level 2 for debug purp
-   {
-     CDEngine* engine = CDEngine::getInstance();
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_ENVIRON_NOTICK));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_ENVIRON));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_COMMON));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_GROUP_00));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_GROUP_01));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
-   }
-
-//   {
-//     if( entity->isVisible() ) entity->draw();
-  //FIXME
-//     entity = iterator->nextElement();
-//   }
-
-  ParticleEngine::getInstance()->draw();
-
-  if (unlikely(this->showPNodes))
-    PNode::getNullParent()->debugDraw(0);
-
-  engine->draw();
-  //TextEngine::getInstance()->draw();
-}
-
-void NetworkWorld::setPath( const char* name)
-{
-  if (this->path)
-    delete this->path;
-  if (ResourceManager::isFile(name))
-  {
-    this->path = new char[strlen(name)+1];
-    strcpy(this->path, name);
-  }
-  else
-    {
-      this->path = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(name) +1];
-      sprintf(this->path, "%s%s", ResourceManager::getInstance()->getDataDir(), name);
-    }
-}
-
-const char* NetworkWorld::getPath( void)
-{
-  return path;
-}
Index: branches/network/src/story_entities/dedicated_server_world.h
===================================================================
--- branches/network/src/story_entities/dedicated_server_world.h	(revision 6377)
+++ branches/network/src/story_entities/dedicated_server_world.h	(revision 6386)
@@ -1,115 +1,33 @@
 /*!
- * @file world.h
-  *  Holds and manages all game data
-*/
+ * @file dedicated_server_world.h
+ *  Holds and manages all dedicated server data
+ */
 
-#ifndef _WORLD_H
-#define _WORLD_H
+#ifndef _DEDICATED_SERVER_WORLD_H
+#define _DEDICATED_SERVER_WORLD_H
 
-#include "sdlincl.h"
-#include "story_entity.h"
-#include "object_manager.h"
+#include "game_world.h"
 
-class NetworkWorld;
 
-class WorldEntity;
-class Camera;
-class Player;
-class GLMenuImageScreen;
-class Terrain;
 class TiXmlElement;
 
-class Shell;
-class OggPlayer;
 
 //! The game world
 /**
-   this class initializes everything that should be displayed inside of the current level.
-   it is the main driving factor during gameplay.
-*/
-class NetworkWorld : public StoryEntity {
+ *  this class initializes everything that should be displayed inside of the current level.
+ *  it is the main driving factor during gameplay.
+ */
+class DedicatedServerWorld : public GameWorld
+{
 
- public:
-  NetworkWorld (const TiXmlElement* root = NULL);
-  virtual ~NetworkWorld ();
+  public:
+    DedicatedServerWorld (const TiXmlElement* root = NULL);
+    virtual ~DedicatedServerWorld ();
 
-  void loadParams(const TiXmlElement* root);
-
-  double getGameTime();
-
-  /* classes from story-entity */
-  virtual ErrorMessage preLoad();
-  virtual ErrorMessage load ();
-  virtual ErrorMessage postLoad();
-
-  virtual ErrorMessage preStart();
-  virtual ErrorMessage start ();
-  virtual ErrorMessage stop ();
-  virtual ErrorMessage pause ();
-  virtual ErrorMessage resume ();
-  virtual ErrorMessage destroy ();
-
-  void displayLoadScreen();
-  void releaseLoadScreen();
-
-  /* interface to world */
-//  void spawn (WorldEntity* entity);
-
-  /** @param speed sets the speed of the Game */
-  inline void setSpeed(float speed) { this->speed = speed; };
-  const char* getPath();
-  void setPath( const char* name);
-
-  void togglePNodeVisibility() { this->showPNodes = !this->showPNodes; };
-  void toggleBVVisibility() { this->showBV = !this->showBV; };
-
- private:
-  void constuctorInit(const char* name, int worldID);
-  /* function for main-loop */
-  void synchronize ();
-  void handleInput ();
-  void tick (std::list<WorldEntity*> worldEntity, float dt);
-  void tick ();
-  void update ();
-  void collide ();
-  void draw ();
-  void mainLoop ();
-
-  void display ();
-  void debug ();
+    void loadParams(const TiXmlElement* root);
 
   private:
-    char* path;                         //!< The file from which this world is loaded
 
-    // FLAGS //
-    bool bQuitWorld;                    //!< quit only the current game and return to menu
-    bool bPause;                        //!< pause mode
-
-    bool showPNodes;                    //!< if the PNodes should be visible.
-    bool showBV;                        //!< if the Bounding Volumes should be visible.
-
-    // TIMING //
-    Uint32 lastFrame;                   //!< last time of frame
-    Uint32 cycle;                       //!< The cycle we are in (starts with 0 and rises with every frame)
-    Uint32 dt;                          //!< time needed to calculate this frame (in milliSeconds)
-    float dtS;                          //!< The time needed for caluculations in seconds
-    float speed;                        //!< how fast the game flows
-    double gameTime;                    //!< this is where the game time is saved
-
-    // INTERNAL ENGINES
-    ObjectManager objectManager;        //!< The ObjectManager of this World.
-    Shell*     shell;
-    OggPlayer* music;
-
-    GLMenuImageScreen* glmis;           //!< The Level-Loader Display
-
-
-    // IMPORTANT ENTITIES
-    Camera* localCamera;                //!< The current Camera
-    Player* localPlayer;                //!< The Player, you fly through the level.
-
-    WorldEntity* sky;                   //!< The Environmental Heaven of orxonox @todo insert this to environment insted
-    Terrain* terrain;                   //!< The Terrain of the NetworkWorld.
 };
 
-#endif /* _WORLD_H */
+#endif /* _DEDICATED_SERVER_WORLD_H */
Index: branches/network/src/story_entities/game_world.cc
===================================================================
--- branches/network/src/story_entities/game_world.cc	(revision 6377)
+++ branches/network/src/story_entities/game_world.cc	(revision 6386)
@@ -278,11 +278,5 @@
           BaseObject* created = Factory::fabricate(element);
           if( created != NULL )
-          {
-            if(created->isA(CL_WORLD_ENTITY))
-              this->spawn(dynamic_cast<WorldEntity*>(created));
             printf("Created a %s: %s\n", created->getClassName(), created->getName());
-          }
-
-          // if we load a 'Player' we use it as localPlayer
 
 
@@ -345,21 +339,9 @@
   //music->playback();
 
-  this->releaseLoadScreen();
-}
-
-
-/**
- *  initializes a new GameWorld shortly before start
- *
- * this is the function, that will be loaded shortly before the world is
- * started
-*/
-ErrorMessage GameWorld::preStart()
-{
-  this->bPause = false;
-
   /* update the object position before game start - so there are no wrong coordinates used in the first processing */
   PNode::getNullParent()->updateNode (0.001f);
   PNode::getNullParent()->updateNode (0.001f);
+
+  this->releaseLoadScreen();
 }
 
@@ -370,5 +352,6 @@
 ErrorMessage GameWorld::start()
 {
-  this->bQuitWorld = false;
+  this->isPaused = false;
+  this->isRunning = true;
   this->mainLoop();
 }
@@ -382,5 +365,5 @@
 {
   PRINTF(3)("GameWorld::stop() - got stop signal\n");
-  this->bQuitWorld= true;
+  this->isRunning = false;
 }
 
@@ -408,11 +391,9 @@
 {
   PRINTF(3)("GameWorld::displayLoadScreen - start\n");
-
-  //GLMenuImageScreen*
   this->glmis = new GLMenuImageScreen();
   this->glmis->setMaximum(8);
-
   PRINTF(3)("GameWorld::displayLoadScreen - end\n");
 }
+
 
 /**
@@ -472,5 +453,5 @@
 {
   Uint32 currentFrame = SDL_GetTicks();
-  if(!this->bPause)
+  if( !this->isPaused)
     {
       this->dt = currentFrame - this->lastFrame;
@@ -624,5 +605,5 @@
   PRINTF(3)("GameWorld::mainLoop() - Entering main loop\n");
 
-  while(!this->bQuitWorld) /* @todo implement pause */
+  while( this->isRunning) /* @todo implement pause */
   {
     ++this->cycle;
@@ -631,5 +612,5 @@
       // Process input
     this->handleInput ();
-    if( this->bQuitWorld)
+    if( !this->isRunning)
       break;
       // Process time
@@ -652,9 +633,9 @@
  * @param entity to be added
 */
-void GameWorld::spawn(WorldEntity* entity)
-{
-//   this->entities->add (entity);
-  entity->postSpawn ();
-}
+// void GameWorld::spawn(WorldEntity* entity)
+// {
+// //   this->entities->add (entity);
+//   entity->postSpawn ();
+// }
 
 /**
Index: branches/network/src/story_entities/game_world.h
===================================================================
--- branches/network/src/story_entities/game_world.h	(revision 6377)
+++ branches/network/src/story_entities/game_world.h	(revision 6386)
@@ -38,16 +38,10 @@
     virtual ErrorMessage init();
     virtual ErrorMessage loadData();
+    virtual ErrorMessage unloadData() {}
 
-    virtual ErrorMessage preStart();
     virtual ErrorMessage start();
     virtual ErrorMessage stop();
     virtual ErrorMessage pause();
     virtual ErrorMessage resume();
-
-    virtual void displayLoadScreen();
-    virtual void releaseLoadScreen();
-
-    /* interface to the game world */
-    virtual void spawn (WorldEntity* entity);
 
 
@@ -57,5 +51,5 @@
     inline void setSpeed(float speed) { this->speed = speed; };
     /**  returns the track path of this world @returns the track path */
-    const char* getPath() {   return path; }
+    const char* getPath() { return this->path; }
     void setPath( const char* name);
 
@@ -67,23 +61,29 @@
 
   protected:
+    /* world loading functions */
+    virtual ErrorMessage loadGUI(TiXmlElement* root) {}
+    virtual ErrorMessage loadWorldEntities(TiXmlElement* root) {}
+    virtual ErrorMessage loadScene(TiXmlElement* root) {}
+
     /* world - running functions */
     virtual void mainLoop ();
 
-    virtual void synchronize ();
-    virtual void handleInput ();
-    virtual void tick (std::list<WorldEntity*> worldEntity, float dt);
-    virtual void tick ();
-    virtual void update ();
-    virtual void collide ();
-    virtual void draw ();
-    virtual void display ();
+    virtual void synchronize();
+    virtual void handleInput();
+    virtual void tick(std::list<WorldEntity*> worldEntity, float dt);
+    virtual void tick();
+    virtual void update();
+    virtual void collide();
+    virtual void draw();
+    virtual void display();
+
+
+  private:
+    void displayLoadScreen();
+    void releaseLoadScreen();
 
 
   protected:
     char* path;                         //!< The file from which this world is loaded
-
-    /* state flags */
-    bool bQuitWorld;                    //!< quit only the current game and return to menu
-    bool bPause;                        //!< pause mode
 
     bool showPNodes;                    //!< if the PNodes should be visible.
Index: branches/network/src/story_entities/story_entity.cc
===================================================================
--- branches/network/src/story_entities/story_entity.cc	(revision 6377)
+++ branches/network/src/story_entities/story_entity.cc	(revision 6386)
@@ -32,7 +32,6 @@
 
   this->isInit = false;
-  this->readyToRun = false;
   this->isPaused = false;
-  this->isSuspended = false;
+  this->isRunning = false;
 
   this->storyID = -1;
Index: branches/network/src/story_entities/story_entity.h
===================================================================
--- branches/network/src/story_entities/story_entity.h	(revision 6377)
+++ branches/network/src/story_entities/story_entity.h	(revision 6386)
@@ -1,6 +1,6 @@
 /*!
  * @file story_entity.h
-  *  holds the base class of everything that is playable - that is part of the story
-*/
+ *  holds the base class of everything that is playable - that is part of the story
+ */
 
 
@@ -24,10 +24,9 @@
   /** initializes a Story Entity to the needed values */
   virtual ErrorMessage init() {};
-  /** called to load the data into the story entity */
+  /** called to load the data into the StoryEntity*/
   virtual ErrorMessage loadData() {};
-
+  /** function that unloads the data from the StoryEntity */
+  virtual ErrorMessage unloadData() {};
   /* running, stopping and pausing */
-  /** called shortly before starting the Entity */
-  virtual ErrorMessage preStart() {};
   /** starts the Entity. Starts the main cycle */
   virtual ErrorMessage start() = 0;
@@ -36,10 +35,4 @@
   /** resumes the Entity after a stop/pause or suspend. */
   virtual ErrorMessage resume() = 0;
-  /** suspends the Entity detaches all mayor functions  (optional) */
-  virtual ErrorMessage suspend() {};
-  /** rewinds to the beginning/last checkpoint */
-  virtual ErrorMessage rewind() {};
-  /** leaves the Entity. Ends it */
-  virtual ErrorMessage preStop() {};
   /**  Stops the entity. */
   virtual ErrorMessage stop() = 0;
@@ -62,7 +55,6 @@
   protected:
     bool isInit;         //!< if the entity is initialized, this has to be true.
-    bool readyToRun;     //!< If the entity is ready to run -> post-check.
+    bool isRunning;      //!< is true if the entity is running
     bool isPaused;       //!< is true if the entity is paused
-    bool isSuspended;    //!< if the Entity is suspended.
 
 
Index: branches/network/src/util/loading/game_loader.cc
===================================================================
--- branches/network/src/util/loading/game_loader.cc	(revision 6377)
+++ branches/network/src/util/loading/game_loader.cc	(revision 6386)
@@ -61,17 +61,4 @@
 }
 
-
-/**
- *  this class is a singleton class
- * @returns an instance of itself
- *
- * if you are unsure about singleton classes, check the theory out on the internet :)
- */
-GameLoader* GameLoader::getInstance()
-{
-  if(singletonRef == NULL)
-    singletonRef = new GameLoader();
-  return singletonRef;
-}
 
 /**
@@ -124,5 +111,5 @@
   if (campaignName)
   {
-    this->currentCampaign = this->fileToNetworkCampaign(campaignName);
+    this->currentCampaign = this->fileToCampaign(campaignName);
     delete[] campaignName;
   }
@@ -225,13 +212,4 @@
 
 /**
- *  release the mem ATTENTION: not implemented
- */
-ErrorMessage GameLoader::destroy()
-{
-
-}
-
-
-/**
  *  reads a campaign definition file into a campaign class
  * @param fileName to be loaded
@@ -285,55 +263,4 @@
 
 
-/**
- *  reads a campaign definition file into a campaign class
- * @param fileName to be loaded
- * @returns the loaded campaign
- *
- *  this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
- */
-Campaign* GameLoader::fileToNetworkCampaign(const char* fileName)
-{
-  /* do not entirely load the campaign. just the current world
-  before start of each world, it has to be initialized so it
-  can load everything it needs into memory then.
-  */
-
-  if( fileName == NULL)
-  {
-    PRINTF(2)("No filename specified for loading");
-    return NULL;
-  }
-
-  TiXmlDocument* XMLDoc = new TiXmlDocument( fileName);
-  // load the campaign document
-  if( !XMLDoc->LoadFile())
-  {
-      // report an error
-    PRINTF(1)("Could not load XML File %s: %s @ %d:%d\n", fileName, XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
-    delete XMLDoc;
-    return NULL;
-  }
-
-  // check basic validity
-  TiXmlElement* root = XMLDoc->RootElement();
-  assert( root != NULL);
-
-  if( strcmp( root->Value(), "Campaign"))
-  {
-      // report an error
-    PRINTF(2)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
-    delete XMLDoc;
-    return NULL;
-  }
-
-  // construct campaign
-  Campaign* c = new Campaign( root);
-
-  // free the XML data
-  delete XMLDoc;
-
-  return c;
-}
-
 
 /**
@@ -347,12 +274,5 @@
     if( likely(event.bPressed))
     {
-      this->nextLevel();
-    }
-  }
-  else if( event.type == KeyMapper::PEV_PREVIOUS_WORLD)
-  {
-    if( likely(event.bPressed))
-    {
-      this->previousLevel();
+      this->switchToNextLevel();
     }
   }
@@ -377,21 +297,11 @@
 
 /**
- *  \brief this changes to the next level
- */
-void GameLoader::nextLevel()
-{
-  if(this->currentCampaign != NULL)
-    this->currentCampaign->nextLevel();
-}
-
-
-/**
- *  change to the previous level - not implemented
- *
- * this propably useless
- */
-void GameLoader::previousLevel()
-{
-  if(this->currentCampaign != NULL)
-    this->currentCampaign->previousLevel();
-}
+ *  this changes to the next level
+ */
+void GameLoader::switchToNextLevel()
+{
+  if(this->currentCampaign != NULL)
+    this->currentCampaign->switchToNextLevel();
+}
+
+
Index: branches/network/src/util/loading/game_loader.h
===================================================================
--- branches/network/src/util/loading/game_loader.h	(revision 6377)
+++ branches/network/src/util/loading/game_loader.h	(revision 6386)
@@ -41,6 +41,10 @@
  public:
   ~GameLoader ();
+  /**  this class is a singleton class @returns an instance of itself  */
+  static GameLoader* getInstance() { if(singletonRef == NULL) singletonRef = new GameLoader(); return singletonRef; }
 
-  static GameLoader* getInstance();
+  ErrorMessage loadCampaign(const char* name);
+  ErrorMessage loadDebugCampaign(Uint32 campaignID);
+  ErrorMessage loadNetworkCampaign(const char* fileName);
 
   ErrorMessage init();
@@ -49,12 +53,6 @@
   ErrorMessage pause();
   ErrorMessage resume();
-  ErrorMessage destroy();
 
-  ErrorMessage loadCampaign(const char* name);
-  ErrorMessage loadDebugCampaign(Uint32 campaignID);
-  ErrorMessage loadNetworkCampaign(const char* fileName);
-
-  void nextLevel();
-  void previousLevel();
+  void switchToNextLevel();
 
   void process(const Event &event);
@@ -65,5 +63,4 @@
 
   Campaign* fileToCampaign(const char* name);
-  Campaign* fileToNetworkCampaign(const char* fileName);
 
 
