Index: code/trunk/src/libraries/util/CMakeLists.txt
===================================================================
--- code/trunk/src/libraries/util/CMakeLists.txt	(revision 7268)
+++ code/trunk/src/libraries/util/CMakeLists.txt	(revision 7284)
@@ -31,6 +31,9 @@
   CRC32.cc
   OutputHandler.cc
+  ScopedSingletonManager.cc
+  SharedPtr.cc
   SignalHandler.cc
   Sleep.cc
+  SmallObjectAllocator.cc
   SubString.cc
 COMPILATION_END
Index: code/trunk/src/libraries/util/Convert.h
===================================================================
--- code/trunk/src/libraries/util/Convert.h	(revision 7268)
+++ code/trunk/src/libraries/util/Convert.h	(revision 7284)
@@ -109,4 +109,32 @@
         }
     };
+
+    ////////////
+    // upcast //
+    ////////////
+    namespace detail
+    {
+        // perform a static cast if ToType is a base of FromType
+        template<class ToType, class FromType>
+        FORCEINLINE ToType upcast(FromType input, Loki::Int2Type<true>)
+        {
+            return static_cast<ToType>(input);
+        }
+
+        // return zero if ToType is not a base of FromType
+        template<class ToType, class FromType>
+        FORCEINLINE ToType upcast(FromType input, Loki::Int2Type<false>)
+        {
+            return 0;
+        }
+    }
+
+    // performs an upcast if ToType is a base of FromType, returns zero otherwise
+    template <class ToType, class FromType>
+    FORCEINLINE ToType upcast(FromType input)
+    {
+        enum { probe = ImplicitConversion<FromType, ToType>::exists };
+        return detail::upcast<ToType, FromType>(input, Loki::Int2Type<probe>());
+    }
 }
 
Index: code/trunk/src/libraries/util/Math.cc
===================================================================
--- code/trunk/src/libraries/util/Math.cc	(revision 7268)
+++ code/trunk/src/libraries/util/Math.cc	(revision 7284)
@@ -234,6 +234,6 @@
     bool ConverterFallback<std::string, orxonox::Vector2>::convert(orxonox::Vector2* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos)
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
             opening_parenthesis = 0;
         else
@@ -257,6 +257,6 @@
     bool ConverterFallback<std::string, orxonox::Vector3>::convert(orxonox::Vector3* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos)
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
             opening_parenthesis = 0;
         else
@@ -282,6 +282,6 @@
     bool ConverterFallback<std::string, orxonox::Vector4>::convert(orxonox::Vector4* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos)
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
             opening_parenthesis = 0;
         else
@@ -309,6 +309,9 @@
     bool ConverterFallback<std::string, orxonox::Quaternion>::convert(orxonox::Quaternion* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
+            opening_parenthesis = 0;
+        else
+            opening_parenthesis++;
 
         SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
@@ -332,6 +335,9 @@
     bool ConverterFallback<std::string, orxonox::ColourValue>::convert(orxonox::ColourValue* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
+            opening_parenthesis = 0;
+        else
+            opening_parenthesis++;
 
         SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
Index: code/trunk/src/libraries/util/MultiType.h
===================================================================
--- code/trunk/src/libraries/util/MultiType.h	(revision 7268)
+++ code/trunk/src/libraries/util/MultiType.h	(revision 7284)
@@ -77,4 +77,5 @@
 #include <OgreColourValue.h>
 #include <loki/TypeTraits.h>
+#include "mbool.h"
 
 namespace orxonox
@@ -265,4 +266,5 @@
             inline MultiType(const orxonox::Radian& value)      : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
             inline MultiType(const orxonox::Degree& value)      : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const orxonox::mbool& value)       : value_(0) { this->assignValue((bool)value); }     /** @brief Constructor: Assigns the given mbool and converts it to bool. */
             inline MultiType(const char* value)                 : value_(0) { this->setValue(std::string(value)); } /** @brief Constructor: Converts the char array to a std::string, assigns the value and sets the type. */
             inline MultiType(const MultiType& other)            : value_(0) { this->setValue(other); }              /** @brief Copyconstructor: Assigns value and type of the other MultiType. */
@@ -318,5 +320,5 @@
             inline void                       copy(const MultiType& other)    { if (this == &other) { return; } if (this->value_) { delete this->value_; } this->value_ = (other.value_) ? other.value_->clone() : 0; }
 
-            template <typename T> inline bool convert()                       { return this->setValue<T>((T)(*this));  } /** @brief Converts the current value to type T. */
+            template <typename T> inline bool convert()                       { return this->setValue<T>((typename Loki::TypeTraits<T>::UnqualifiedReferredType)(*this));  } /** @brief Converts the current value to type T. */
             inline bool                       convert(const MultiType& other) { return this->convert(other.getType()); } /** @brief Converts the current value to the type of the other MultiType. */
             bool                              convert(MT_Type::Value type);
@@ -350,5 +352,8 @@
 
             /** @brief Checks whether the value is a default one. */
-            bool                              hasDefaultValue()         const { return this->value_->hasDefaultValue(); }
+            bool                              hasDefaultValue() const { return this->value_->hasDefaultValue(); }
+
+            /** @brief Checks if the MT contains no value. */
+            bool                              null() const { return (!this->value_); }
 
             operator char()                  const;
@@ -487,4 +492,6 @@
     template <> inline bool MultiType::isType<orxonox::Degree>()      const { return (this->value_ && this->value_->type_ == MT_Type::Degree);           } /** @brief Returns true if the current type equals the given type. */
 
+    template <> inline bool MultiType::convert<void>()                 { this->reset(); return true; } /** @brief Deletes the content, type becomes MT_Type::Null. */
+
     // Specialization to avoid ambiguities with the conversion operator
     template <> inline bool MultiType::convert<std::string>()          { return this->setValue<std::string>         (this->operator std::string());          } /** @brief Converts the current value to the given type. */
Index: code/trunk/src/libraries/util/OutputHandler.h
===================================================================
--- code/trunk/src/libraries/util/OutputHandler.h	(revision 7268)
+++ code/trunk/src/libraries/util/OutputHandler.h	(revision 7284)
@@ -104,22 +104,22 @@
 
             //! Writes to all output devices
-            static inline const std::string& log(const std::string& text)
-                { OutputHandler::getOutStream(0).output(text) << std::endl; return text; }
+            static inline void log(const std::string& text)
+                { OutputHandler::getOutStream(0).output(text) << std::endl; }
 
             //! Writes an error message to the output
-            static inline const std::string& error(const std::string& text)
-                { OutputHandler::getOutStream(1).output(text) << std::endl; return text; }
+            static inline void error(const std::string& text)
+                { OutputHandler::getOutStream(1).output(text) << std::endl; }
 
             //! Writes a warning message to the output
-            static inline const std::string& warning(const std::string& text)
-                { OutputHandler::getOutStream(2).output(text) << std::endl; return text; }
+            static inline void warning(const std::string& text)
+                { OutputHandler::getOutStream(2).output(text) << std::endl; }
 
             //! Writes an informational message to the output
-            static inline const std::string& info(const std::string& text)
-                { OutputHandler::getOutStream(3).output(text) << std::endl; return text; }
+            static inline void info(const std::string& text)
+                { OutputHandler::getOutStream(3).output(text) << std::endl; }
 
             //! Writes a debug message to the output
-            static inline const std::string& debug(const std::string& text)
-                { OutputHandler::getOutStream(4).output(text) << std::endl; return text; }
+            static inline void debug(const std::string& text)
+                { OutputHandler::getOutStream(4).output(text) << std::endl; }
 
             //! Registers an object that receives output via a provided std::ostream
Index: code/trunk/src/libraries/util/ScopedSingletonManager.cc
===================================================================
--- code/trunk/src/libraries/util/ScopedSingletonManager.cc	(revision 7284)
+++ code/trunk/src/libraries/util/ScopedSingletonManager.cc	(revision 7284)
@@ -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.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "ScopedSingletonManager.h"
+
+namespace orxonox
+{
+    /*static*/ std::map<std::string, ScopedSingletonManager*>& ScopedSingletonManager::getManagers()
+    {
+        static std::map<std::string, ScopedSingletonManager*> managers;
+        return managers;
+    }
+    /*static*/ ScopedSingletonManager::ManagerMultiMap& ScopedSingletonManager::getManagersByScope()
+    {
+        static ManagerMultiMap managers;
+        return managers;
+    }
+
+    /*static*/ void ScopedSingletonManager::addManager(ScopedSingletonManager* manager)
+    {
+        getManagers()[manager->className_] = manager;
+        getManagersByScope().insert(std::make_pair(manager->scope_, manager));
+    }
+}
Index: code/trunk/src/libraries/util/ScopedSingletonManager.h
===================================================================
--- code/trunk/src/libraries/util/ScopedSingletonManager.h	(revision 7284)
+++ code/trunk/src/libraries/util/ScopedSingletonManager.h	(revision 7284)
@@ -0,0 +1,214 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef __ScopedSingletonManager_H__
+#define __ScopedSingletonManager_H__
+
+#include "UtilPrereqs.h"
+
+#include <cassert>
+#include <map>
+#include "util/Exception.h"
+#include "util/Scope.h"
+#include "util/Singleton.h"
+
+#define ManageScopedSingleton(className, scope, allowedToFail) \
+    className* className::singletonPtr_s = NULL; \
+    static ClassScopedSingletonManager<className, scope, allowedToFail> className##ScopedSingletonManager(#className)
+
+namespace orxonox
+{
+    class OrxonoxClass;
+
+    class _UtilExport ScopedSingletonManager
+    {
+        public:
+            ScopedSingletonManager(const std::string& className, ScopeID::Value scope)
+                : className_(className)
+                , scope_(scope)
+            { }
+            virtual ~ScopedSingletonManager() { }
+            static void addManager(ScopedSingletonManager* manager);
+
+            template<ScopeID::Value scope>
+            static void preUpdate(const Clock& time)
+            {
+                assert(Scope<scope>::isActive());
+                for (ManagerMultiMap::iterator it = getManagersByScope().lower_bound(scope); it != getManagersByScope().upper_bound(scope); ++it)
+                    it->second->preUpdate(time);
+            }
+            virtual void preUpdate(const Clock& time) = 0;
+            template<ScopeID::Value scope>
+            static void postUpdate(const Clock& time)
+            {
+                assert(Scope<scope>::isActive());
+                for (ManagerMultiMap::iterator it = getManagersByScope().lower_bound(scope); it != getManagersByScope().upper_bound(scope); ++it)
+                    it->second->postUpdate(time);
+            }
+            virtual void postUpdate(const Clock& time) = 0;
+
+            static std::map<std::string, ScopedSingletonManager*>& getManagers();
+            typedef std::multimap<ScopeID::Value, ScopedSingletonManager*> ManagerMultiMap;
+            static ManagerMultiMap& getManagersByScope();
+
+        protected:
+            const std::string className_;
+            const ScopeID::Value scope_;
+    };
+
+    template <class T, ScopeID::Value scope, bool allowedToFail>
+    class ClassScopedSingletonManager : public ScopedSingletonManager, public ScopeListener
+    {
+    public:
+        ClassScopedSingletonManager(const std::string& className)
+            : ScopedSingletonManager(className, scope)
+            , ScopeListener(scope)
+            , singletonPtr_(NULL)
+        {
+            ScopedSingletonManager::addManager(this);
+        }
+
+        ~ClassScopedSingletonManager()
+        {
+        }
+
+        //! Called if the Scope of the Singleton gets active (creates the instance)
+        void activated()
+        {
+            assert(singletonPtr_ == NULL);
+            singletonPtr_ = new T();
+        }
+
+        //! Called if the Scope of this Singleton gets deactivated (destroys the instance)
+        void deactivated()
+        {
+            assert(singletonPtr_ != NULL);
+            this->destroy(singletonPtr_);
+            singletonPtr_ = NULL;
+        }
+
+        void destroy(OrxonoxClass*)
+        {
+            singletonPtr_->destroy();
+        }
+        void destroy(void*)
+        {
+            delete singletonPtr_;
+        }
+
+        //! Called every frame by the ScopedSingletonManager
+        void preUpdate(const Clock& time)
+        {
+            assert(Scope<scope>::isActive());
+            // assuming T inherits Singleton<T>
+            singletonPtr_->preUpdateSingleton(time);
+        }
+
+        //! Called every frame by the ScopedSingletonManager
+        void postUpdate(const Clock& time)
+        {
+            assert(Scope<scope>::isActive());
+            // assuming T inherits Singleton<T>
+            singletonPtr_->postUpdateSingleton(time);
+        }
+
+    private:
+        T* singletonPtr_;
+    };
+
+    template <class T, ScopeID::Value scope>
+    class ClassScopedSingletonManager<T, scope, true> : public ScopedSingletonManager, public ScopeListener
+    {
+    public:
+        ClassScopedSingletonManager(const std::string& className)
+            : ScopedSingletonManager(className, scope)
+            , ScopeListener(scope)
+            , singletonPtr_(NULL)
+        {
+            ScopedSingletonManager::addManager(this);
+        }
+
+        ~ClassScopedSingletonManager()
+        {
+        }
+
+        //! Called if the Scope of the Singleton gets active (creates the instance)
+        void activated()
+        {
+            assert(singletonPtr_ == NULL);
+            try
+                { singletonPtr_ = new T(); }
+            catch (const InitialisationAbortedException& ex)
+                { COUT(3) << ex.getDescription() << std::endl; }
+            catch (...)
+                { COUT(1) << "Singleton creation failed: " << Exception::handleMessage() << std::endl; }
+        }
+
+        //! Called if the Scope of this Singleton gets deactivated (destroys the instance)
+        void deactivated()
+        {
+            if (singletonPtr_ != NULL)
+            {
+                this->destroy(singletonPtr_);
+                singletonPtr_ = NULL;
+            }
+        }
+
+        void destroy(OrxonoxClass* ptr)
+        {
+            singletonPtr_->destroy();
+        }
+        void destroy(void* ptr)
+        {
+            delete singletonPtr_;
+        }
+
+        //! Called every frame by the ScopedSingletonManager
+        void preUpdate(const Clock& time)
+        {
+            assert(Scope<scope>::isActive());
+            // assuming T inherits Singleton<T>
+            if (singletonPtr_ != NULL)
+                singletonPtr_->preUpdateSingleton(time);
+        }
+
+        //! Called every frame by the ScopedSingletonManager
+        void postUpdate(const Clock& time)
+        {
+            assert(Scope<scope>::isActive());
+            // assuming T inherits Singleton<T>
+            if (singletonPtr_ != NULL)
+                singletonPtr_->postUpdateSingleton(time);
+        }
+
+    private:
+        T* singletonPtr_;
+    };
+}
+
+#endif /* __ScopedSingletonManager_H__ */
Index: code/trunk/src/libraries/util/SharedPtr.cc
===================================================================
--- code/trunk/src/libraries/util/SharedPtr.cc	(revision 7284)
+++ code/trunk/src/libraries/util/SharedPtr.cc	(revision 7284)
@@ -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.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SharedPtr.h"
+
+namespace orxonox
+{
+    SmallObjectAllocator& createSharedCounterPool()
+    {
+        static SmallObjectAllocator instance(sizeof(SharedCounterImpl<void>));
+        return instance;
+    }
+}
Index: code/trunk/src/libraries/util/SharedPtr.h
===================================================================
--- code/trunk/src/libraries/util/SharedPtr.h	(revision 7284)
+++ code/trunk/src/libraries/util/SharedPtr.h	(revision 7284)
@@ -0,0 +1,193 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _SharedPtr_H__
+#define _SharedPtr_H__
+
+#include "UtilPrereqs.h"
+
+#include <algorithm>
+#include <cassert>
+
+#include "SmallObjectAllocator.h"
+
+namespace orxonox
+{
+    class SharedCounter
+    {
+        public:
+            SharedCounter() : count_(1) {}
+            virtual void destroy() = 0;
+
+            int count_;
+    };
+
+    template <class T>
+    class SharedCounterImpl : public SharedCounter
+    {
+        public:
+            SharedCounterImpl(T* pointer) : pointer_(pointer) {}
+
+            void destroy()
+            {
+                delete this->pointer_;
+            }
+
+        private:
+            T* pointer_;
+    };
+
+    _UtilExport SmallObjectAllocator& createSharedCounterPool();
+
+    FORCEINLINE SmallObjectAllocator& getSharedCounterPool()
+    {
+        static SmallObjectAllocator& instance = createSharedCounterPool();
+        return instance;
+    }
+
+    template <class T>
+    class SharedPtr
+    {
+        template <class O>
+        friend class SharedPtr;
+
+        public:
+            inline SharedPtr() : pointer_(0), counter_(0)
+            {
+            }
+
+            inline SharedPtr(T* pointer) : pointer_(pointer), counter_(0)
+            {
+                if (this->pointer_)
+                {
+                    void* chunk = getSharedCounterPool().alloc();
+                    this->counter_ = new (chunk) SharedCounterImpl<T>(this->pointer_);
+                }
+            }
+
+            inline SharedPtr(const SharedPtr& other) : pointer_(other.pointer_), counter_(other.counter_)
+            {
+                if (this->pointer_)
+                    ++this->counter_->count_;
+            }
+
+            template <class O>
+            inline SharedPtr(const SharedPtr<O>& other) : pointer_(other.pointer_), counter_(other.counter_)
+            {
+                if (this->pointer_)
+                    ++this->counter_->count_;
+            }
+
+            inline ~SharedPtr()
+            {
+                if (this->pointer_)
+                {
+                    --this->counter_->count_;
+
+                    if (this->counter_->count_ == 0)
+                    {
+                        this->counter_->destroy();
+                        getSharedCounterPool().free(this->counter_);
+                    }
+                }
+            }
+
+            inline SharedPtr& operator=(const SharedPtr& other)
+            {
+                SharedPtr(other).swap(*this);
+                return *this;
+            }
+
+            template <class O>
+            inline SharedPtr& operator=(const SharedPtr<O>& other)
+            {
+                SharedPtr(other).swap(*this);
+                return *this;
+            }
+
+            template <class O>
+            inline SharedPtr<O> cast() const
+            {
+                O* temp = static_cast<O*>(this->pointer_); // temp value for prettier compiler error in case of an invalid static_cast
+                return SharedPtr<O>(temp, this->counter_);
+            }
+
+            inline T* operator->() const
+            {
+                assert(this->pointer_ != 0);
+                return this->pointer_;
+            }
+
+            inline T& operator*() const
+            {
+                assert(this->pointer_ != 0);
+                return *this->pointer_;
+            }
+
+            inline T* get() const
+            {
+                return this->pointer_;
+            }
+
+            inline operator bool() const
+            {
+                return (this->pointer_ != 0);
+            }
+
+            inline void swap(SharedPtr& other)
+            {
+                std::swap(this->pointer_, other.pointer_);
+                std::swap(this->counter_, other.counter_);
+            }
+
+        private:
+            inline SharedPtr(T* pointer, SharedCounter* counter) : pointer_(pointer), counter_(counter)
+            {
+                if (this->pointer_)
+                    ++this->counter_->count_;
+            }
+
+            T* pointer_;
+            SharedCounter* counter_;
+    };
+
+    template <class T, class Parent>
+    class SharedChildPtr : public Parent
+    {
+        public:
+            inline SharedChildPtr() : Parent() {}
+            inline SharedChildPtr(T* pointer) : Parent(pointer) {}
+            inline SharedChildPtr(const SharedPtr<T>& other) : Parent(other) {}
+
+            inline T* operator->() const { return static_cast<T*>(Parent::operator->()); }
+            inline T& operator*() const { return *static_cast<T*>(Parent::operator->()); }
+    };
+
+}
+
+#endif /* _SharedPtr_H__ */
Index: code/trunk/src/libraries/util/SmallObjectAllocator.cc
===================================================================
--- code/trunk/src/libraries/util/SmallObjectAllocator.cc	(revision 7284)
+++ code/trunk/src/libraries/util/SmallObjectAllocator.cc	(revision 7284)
@@ -0,0 +1,87 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SmallObjectAllocator.h"
+
+namespace orxonox
+{
+    SmallObjectAllocator::SmallObjectAllocator(size_t objectSize, size_t numObjects)
+    {
+        this->objectSize_ = std::max(objectSize, sizeof(Chunk));
+        this->numObjects_ = numObjects;
+        this->first_ = 0;
+    }
+
+    SmallObjectAllocator::~SmallObjectAllocator()
+    {
+        for (std::vector<char*>::iterator it = this->blocks_.begin(); it != this->blocks_.end(); ++it)
+            delete[] *it;
+    }
+
+    /* static */ void SmallObjectAllocator::setNext(void* chunk, void* next)
+    {
+        static_cast<Chunk*>(chunk)->next_ = static_cast<Chunk*>(next);
+    }
+
+    /* static */ void* SmallObjectAllocator::getNext(void* chunk)
+    {
+        return static_cast<Chunk*>(chunk)->next_;
+    }
+
+    void* SmallObjectAllocator::alloc()
+    {
+        void* chunk = this->first_;
+
+        if (chunk)
+        {
+            this->first_ = getNext(chunk);
+        }
+        else
+        {
+            char* block = new char[this->objectSize_ * this->numObjects_];
+            this->blocks_.push_back(block);
+
+            for (size_t i = 1; i < this->numObjects_ - 1; ++i)
+                setNext(block + i * this->objectSize_, block + (i + 1) * this->objectSize_);
+
+            setNext(block + (this->numObjects_ - 1) * this->objectSize_, 0);
+
+            this->first_ = block + this->objectSize_;
+
+            chunk = block;
+        }
+
+        return chunk;
+    }
+
+    void SmallObjectAllocator::free(void* chunk)
+    {
+        setNext(chunk, this->first_);
+        this->first_ = chunk;
+    }
+}
Index: code/trunk/src/libraries/util/SmallObjectAllocator.h
===================================================================
--- code/trunk/src/libraries/util/SmallObjectAllocator.h	(revision 7284)
+++ code/trunk/src/libraries/util/SmallObjectAllocator.h	(revision 7284)
@@ -0,0 +1,63 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _SmallObjectAllocator_H__
+#define _SmallObjectAllocator_H__
+
+#include "UtilPrereqs.h"
+#include <vector>
+
+namespace orxonox
+{
+    class _UtilExport SmallObjectAllocator
+    {
+        struct Chunk
+        {
+            Chunk* next_;
+        };
+
+        public:
+            SmallObjectAllocator(size_t objectSize, size_t numObjects = 64);
+            ~SmallObjectAllocator();
+
+            void* alloc();
+            void free(void* chunk);
+
+        private:
+            static void setNext(void* chunk, void* next);
+            static void* getNext(void* chunk);
+
+            void* first_;
+            size_t objectSize_;
+            size_t numObjects_;
+
+            std::vector<char*> blocks_;
+    };
+}
+
+#endif /* _SmallObjectAllocator_H__ */
Index: code/trunk/src/libraries/util/StringUtils.cc
===================================================================
--- code/trunk/src/libraries/util/StringUtils.cc	(revision 7268)
+++ code/trunk/src/libraries/util/StringUtils.cc	(revision 7284)
@@ -35,4 +35,5 @@
 
 #include <cctype>
+#include <boost/scoped_array.hpp>
 #include "Convert.h"
 #include "Math.h"
@@ -514,5 +515,5 @@
         @return Number of replacements
     */
-    _UtilExport size_t replaceCharacters(std::string& str, char target, char replacement)
+    size_t replaceCharacters(std::string& str, char target, char replacement)
     {
         size_t j = 0;
@@ -527,3 +528,37 @@
         return j;
     }
+
+    /**
+        @brief Calculates the Levenshtein distance between two strings.
+
+        The Levenshtein distance is defined by the number of transformations needed to convert str1
+        into str2. Possible transformations are substituted, added, or removed characters.
+    */
+    unsigned int getLevenshteinDistance(const std::string& str1, const std::string& str2)
+    {
+        size_t cols = str1.size() + 1;
+        size_t rows = str2.size() + 1;
+        boost::scoped_array<int> matrix(new int[rows * cols]);
+
+        for (size_t r = 0; r < rows; ++r)
+            for (size_t c = 0; c < cols; ++c)
+                matrix[r*cols + c] = 0;
+
+        for (size_t i = 1; i < cols; ++i)
+            matrix[0*cols + i] = i;
+        for (size_t i = 1; i < rows; ++i)
+            matrix[i*cols + 0] = i;
+
+        for (size_t r = 1; r < rows; ++r)
+            for (size_t c = 1; c < cols; ++c)
+                matrix[r*cols + c] = (str1[c-1] != str2[r-1]);
+
+        for (size_t r = 1; r < rows; ++r)
+            for (size_t c = 1; c < cols; ++c)
+                matrix[r*cols + c] = std::min(std::min(matrix[(r-1)*cols + c] + 1,
+                                                       matrix[r*cols + c-1] + 1),
+                                              matrix[(r-1)*cols + c-1] + (str1[c-1] != str2[r-1]));
+
+        return matrix[(rows-1)*cols + cols-1];
+    }
 }
Index: code/trunk/src/libraries/util/StringUtils.h
===================================================================
--- code/trunk/src/libraries/util/StringUtils.h	(revision 7268)
+++ code/trunk/src/libraries/util/StringUtils.h	(revision 7284)
@@ -43,40 +43,42 @@
     _UtilExport std::string getUniqueNumberString();
 
-    _UtilExport void        strip(std::string* str);
-    _UtilExport std::string getStripped(const std::string& str);
+    _UtilExport void         strip(std::string* str);
+    _UtilExport std::string  getStripped(const std::string& str);
 
-    _UtilExport std::string removeTrailingWhitespaces(const std::string& str);
+    _UtilExport std::string  removeTrailingWhitespaces(const std::string& str);
 
-    _UtilExport size_t      getNextQuote(const std::string& str, size_t start);
-    _UtilExport bool        isBetweenQuotes(const std::string& str, size_t pos);
+    _UtilExport size_t       getNextQuote(const std::string& str, size_t start);
+    _UtilExport bool         isBetweenQuotes(const std::string& str, size_t pos);
 
-    _UtilExport bool        hasStringBetweenQuotes(const std::string& str);
-    _UtilExport std::string getStringBetweenQuotes(const std::string& str);
+    _UtilExport bool         hasStringBetweenQuotes(const std::string& str);
+    _UtilExport std::string  getStringBetweenQuotes(const std::string& str);
 
-    _UtilExport std::string stripEnclosingQuotes(const std::string& str);
-    _UtilExport std::string stripEnclosingBraces(const std::string& str);
+    _UtilExport std::string  stripEnclosingQuotes(const std::string& str);
+    _UtilExport std::string  stripEnclosingBraces(const std::string& str);
 
-    _UtilExport bool        isEmpty(const std::string& str);
-    _UtilExport bool        isComment(const std::string& str);
-    _UtilExport bool        isNumeric(const std::string& str);
+    _UtilExport bool         isEmpty(const std::string& str);
+    _UtilExport bool         isComment(const std::string& str);
+    _UtilExport bool         isNumeric(const std::string& str);
 
-    _UtilExport std::string addSlashes(const std::string& str);
-    _UtilExport std::string removeSlashes(const std::string& str);
+    _UtilExport std::string  addSlashes(const std::string& str);
+    _UtilExport std::string  removeSlashes(const std::string& str);
 
-    _UtilExport void        lowercase(std::string* str);
-    _UtilExport std::string getLowercase(const std::string& str);
+    _UtilExport void         lowercase(std::string* str);
+    _UtilExport std::string  getLowercase(const std::string& str);
 
-    _UtilExport void        uppercase(std::string* str);
-    _UtilExport std::string getUppercase(const std::string& str);
+    _UtilExport void         uppercase(std::string* str);
+    _UtilExport std::string  getUppercase(const std::string& str);
 
-    _UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2);
-    _UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2, size_t len);
+    _UtilExport int          nocaseCmp(const std::string& s1, const std::string& s2);
+    _UtilExport int          nocaseCmp(const std::string& s1, const std::string& s2, size_t len);
 
-    _UtilExport bool        hasComment(const std::string& str);
-    _UtilExport std::string getComment(const std::string& str);
-    _UtilExport size_t      getCommentPosition(const std::string& str);
-    _UtilExport size_t      getNextCommentPosition(const std::string& str, size_t start = 0);
+    _UtilExport bool         hasComment(const std::string& str);
+    _UtilExport std::string  getComment(const std::string& str);
+    _UtilExport size_t       getCommentPosition(const std::string& str);
+    _UtilExport size_t       getNextCommentPosition(const std::string& str, size_t start = 0);
 
-    _UtilExport size_t      replaceCharacters(std::string& str, char target, char replacement);
+    _UtilExport size_t       replaceCharacters(std::string& str, char target, char replacement);
+
+    _UtilExport unsigned int getLevenshteinDistance(const std::string& str1, const std::string& str2);
 }
 
Index: code/trunk/src/libraries/util/SubString.cc
===================================================================
--- code/trunk/src/libraries/util/SubString.cc	(revision 7268)
+++ code/trunk/src/libraries/util/SubString.cc	(revision 7284)
@@ -309,5 +309,5 @@
      * @param line the inputLine to split
      * @param delimiters a String of Delimiters (here the input will be splitted)
-     * @param delimiterNeighbours Naighbours to the Delimitter, that will be removed if they are to the left or the right of a Delimiter.
+     * @param delimiterNeighbours Neighbours to the Delimiter, that will be removed if they are to the left or the right of a Delimiter.
      * @param emptyEntries: if empty Strings are added to the List of Strings.
      * @param escape_char: Escape carater (escapes splitters)
Index: code/trunk/src/libraries/util/SubString.h
===================================================================
--- code/trunk/src/libraries/util/SubString.h	(revision 7268)
+++ code/trunk/src/libraries/util/SubString.h	(revision 7284)
@@ -81,5 +81,5 @@
             SL_SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
             SL_COMMENT,           //!< In Comment mode.
-            SL_PARENTHESES,       //!< Between parentheses (usually '(' and ')')
+            SL_PARENTHESES,       //!< Between parentheses (usually '{' and '}')
             SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing paranthesis character.
         } SPLIT_LINE_STATE;
@@ -92,5 +92,5 @@
                   const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
                   char escapeChar ='\\', bool removeEscapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
-                  char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
+                  char openparenthesis_char = '{', char closeparenthesis_char = '}',  bool removeParenthesisChars = true, char comment_char = '\0');
         SubString(unsigned int argc, const char** argv);
         /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
@@ -116,5 +116,5 @@
                            const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
                            char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
-                           char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
+                           char openparenthesis_char = '{', char closeparenthesis_char = '}',  bool removeParenthesisChars = true, char comment_char = '\0');
         std::string join(const std::string& delimiter = " ") const;
         ////////////////////////////////////////
@@ -155,6 +155,6 @@
                                           char safemode_char = '"',
                                           bool removeSafemodeChar = true,
-                                          char openparenthesis_char = '(',
-                                          char closeparenthesis_char = ')',
+                                          char openparenthesis_char = '{',
+                                          char closeparenthesis_char = '}',
                                           bool removeParenthesisChars = true,
                                           char comment_char = '\0',
Index: code/trunk/src/libraries/util/VA_NARGS.h
===================================================================
--- code/trunk/src/libraries/util/VA_NARGS.h	(revision 7284)
+++ code/trunk/src/libraries/util/VA_NARGS.h	(revision 7284)
@@ -0,0 +1,61 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Declaration of the ORXONOX_VA_NARGS macro which returns the number of arguments passed to a variadic macro.
+*/
+
+#include <boost/preprocessor/facilities/expand.hpp>
+
+/**
+    @brief Returns the number of arguments passed to a variadic macro. Important: The number of arguments must be greater than zero (ORXONOX_VA_NARGS() returns 1).
+*/
+#define ORXONOX_VA_NARGS(...) \
+    ORXONOX_VA_NARGS_CONCAT(__VA_ARGS__, ORXONOX_VA_NARGS_NUMBERS)
+
+
+// some helper macros //
+
+#define ORXONOX_VA_NARGS_CONCAT(...) \
+    BOOST_PP_EXPAND(ORXONOX_VA_NARGS_INTERN(__VA_ARGS__))
+
+#define ORXONOX_VA_NARGS_INTERN( \
+    arg1,  arg2,  arg3,  arg4,  arg5,  arg6,  arg7,  arg8,  arg9,  arg10, \
+    arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, \
+    arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30, \
+    arg31, arg32, arg33, arg34, arg35, arg36, arg37, arg38, arg39, arg40, \
+    arg41, arg42, arg43, arg44, arg45, arg46, arg47, arg48, arg49, arg50, \
+    arg51, arg52, arg53, arg54, arg55, arg56, arg57, arg58, arg59, arg60, \
+    arg61, arg62, arg63, argn, ...) argn
+
+#define ORXONOX_VA_NARGS_NUMBERS \
+    63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, \
+    47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, \
+    31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, \
+    15, 14, 13, 12, 11, 10,  9,  8,  7,  6,  5,  4,  3,  2,  1,  0
