Index: java/Framclipse/com.framsticks.framclipse.ui/src/com/framsticks/framclipse/ui/labeling/FramScriptLabelProvider.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse.ui/src/com/framsticks/framclipse/ui/labeling/FramScriptLabelProvider.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse.ui/src/com/framsticks/framclipse/ui/labeling/FramScriptLabelProvider.java	(revision 440)
@@ -112,3 +112,7 @@
 		return "class.gif";
 	}
+
+	public String text(EObject obj) {
+		return obj.eClass().getName();
+	}
 }
Index: java/Framclipse/com.framsticks.framclipse/res/framscontext.dtd
===================================================================
--- java/Framclipse/com.framsticks.framclipse/res/framscontext.dtd	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/res/framscontext.dtd	(revision 440)
@@ -6,14 +6,13 @@
 
 <!--
- framsticks files can reference scripting objects in 3 ways
- as described by the 3 tags of the framscontext.xml file:
+ Framsticks files can reference scripting objects in 3 ways
+ as described by 3 tags of the framscontext.xml file:
 
- - <objects> framsticks objects are stored in the file in the framsticks format
- - <code> a field in the file (using the framsticks format) contains a script
-         that uses some objects
+ - <objects> Framsticks objects are stored in the file in the Framsticks format
+ - <code> a field in the file (using the Framsticks format) contains a script that uses some objects
  - <script> plain text file containing a script
 
 <script> excludes the two following tags.
-<code> implies that the framsticks format is used for the file so the <objects> tags will be also used to declare which objects can be present in the file.
+<code> implies that the Framsticks format is used for the file so the <objects> tags will be also used to declare which objects can be present in the file.
 -->
 
Index: java/Framclipse/com.framsticks.framclipse/res/framscontext.xml
===================================================================
--- java/Framclipse/com.framsticks.framclipse/res/framscontext.xml	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/res/framscontext.xml	(revision 440)
@@ -43,4 +43,5 @@
     <objects context="properties file"/>
     <code object="show" member="code">
+      <context name="Framsticks Theater"/>
       <context name="Command line interface"/>
       <context name="Experiment definition"/>
@@ -59,13 +60,8 @@
 
   <file pattern="*.ini" label="Framsticks startup scripts">
+    <script context="Framsticks Theater"/>
     <script context="Command line interface"/>
     <script context="Global context"/>
   </file>
-  
-  <file pattern="*.inc" label="Framsticks Theater show">
-    <code object="include" member="code">
-      <context name="Global context"/>
-    </code>
-  </file>
 
 </framscontext>
Index: java/Framclipse/com.framsticks.framclipse/res/framscontext.xsl
===================================================================
--- java/Framclipse/com.framsticks.framclipse/res/framscontext.xsl	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/res/framscontext.xsl	(revision 440)
@@ -9,11 +9,19 @@
 
 <xsl:template match="framscontext">
+<style>
+.file {color:red;}
+.context-code {color: #00ee00;} 
+.context-file {color: #007700;} 
+.objects {color: #0000ff;} 
+</style>
+
   <h1>Framscript Context Configuration</h1>
-<i>Note:
+
+<b>Each <span class="file">file type</span> may contain <span class="objects">objects</span> from many <span class="context-file">contexts</span>, as specified below.<br/>Each <span class="context-file">context</span> may contain many <span class="objects">objects</span>, as specified below.<br/>Note:
   <xsl:choose><xsl:when test="count(document('framscript.xml')/framscript)=0">
-	This formatting sheet would also use <a href="framscript.xml">framscript.xml</a> to show object names if that file was available</xsl:when>
-<xsl:otherwise>This formatting sheet also includes object names extracted from <a href="framscript.xml">framscript.xml</a></xsl:otherwise>
+	This formatting sheet (xsl) would use <a href="framscript.xml">framscript.xml</a> to show object names if that file was available!</xsl:when>
+<xsl:otherwise>This formatting sheet (xsl) includes object names extracted from <a href="framscript.xml">framscript.xml</a>.</xsl:otherwise>
 	</xsl:choose>
-</i>
+</b><br/><br/><br/>
 
   <table border="1">
@@ -25,9 +33,9 @@
 <xsl:template match="file">
   <tr valign="top">
-   <td><b><xsl:value-of select="@label"/></b><br/><xsl:value-of select="@pattern"/></td>
+   <td class="file"><b><xsl:value-of select="@label"/></b><br/><xsl:value-of select="@pattern"/></td>
    <td>
 	<xsl:if test="count(code)!=0">
 	<p title="Defined by &lt;objects&gt;">
-	Objects defined in the following contexts can be stored directly in the file: (using the standard framsticks format)<ul><xsl:apply-templates select="objects"/></ul>
+	Objects defined in the following contexts can be stored directly in the file (using the standard Framsticks <a href="http://www.framsticks.com/common/formatspec.html">format</a>):<ul><xsl:apply-templates select="objects"/></ul>
 	</p>
 	<xsl:apply-templates select="code"/>
@@ -86,6 +94,21 @@
 </xsl:template>
 
+
+
+
+<xsl:template name="extobjects">
+  <xsl:param name="objs"/>
+  <xsl:if test="count($objs)!=0">
+  (
+  <xsl:for-each select="$objs">
+	<font class="objects"><xsl:value-of select="@name"/></font>,
+  </xsl:for-each>
+  )
+  </xsl:if>
+</xsl:template>
+
+
 <xsl:template match="objects">
-  <li><b><xsl:value-of select="@context"/></b>
+  <li><b><span class="context-file"><xsl:value-of select="@context"/></span></b>
 	<xsl:variable name="context" select="@context"/>
       	<xsl:call-template name="extobjects"><xsl:with-param name="objs" select="document('framscript.xml')/framscript/type[@context=$context]"/></xsl:call-template>
@@ -94,5 +117,5 @@
 
 <xsl:template match="script">
-  <li><b><xsl:value-of select="@context"/></b>
+  <li><b><span class="context-code"><xsl:value-of select="@context"/></span></b>
 	<xsl:variable name="context" select="@context"/>
       	<xsl:call-template name="extobjects"><xsl:with-param name="objs" select="document('framscript.xml')/framscript/type[@context=$context]"/></xsl:call-template>
@@ -100,21 +123,12 @@
 </xsl:template>
 
-<xsl:template name="extobjects">
-  <xsl:param name="objs"/>
-  <xsl:if test="count($objs)!=0">
-  (
-  <xsl:for-each select="$objs">
-	<xsl:value-of select="@name"/>,
-  </xsl:for-each>
-  )
-  </xsl:if>
-</xsl:template>
-
 <xsl:template match="context">
-  <li><b><xsl:value-of select="@name"/></b>
+  <li><b><span class="context-code"><xsl:value-of select="@name"/></span></b>
 	<xsl:variable name="context" select="@name"/>
       	<xsl:call-template name="extobjects"><xsl:with-param name="objs" select="document('framscript.xml')/framscript/type[@context=$context]"/></xsl:call-template>
   </li>
 </xsl:template>
+
+
 
 <xsl:template match="code">
@@ -126,5 +140,5 @@
 <xsl:template match="properties">
   <li>
-  <b><xsl:value-of select="@to"/></b> is defined by "<xsl:value-of select="@from"/>" objects
+  <span class="objects"><b><xsl:value-of select="@to"/></b></span> is defined by <span class="objects"><xsl:value-of select="@from"/></span> objects
   </li>
 </xsl:template>
Index: java/Framclipse/com.framsticks.framclipse/res/framscript.dtd
===================================================================
--- java/Framclipse/com.framsticks.framclipse/res/framscript.dtd	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/res/framscript.dtd	(revision 440)
@@ -11,5 +11,5 @@
 
 <!-- "type" attribute in element:
-     - framscript scalar datatypes: "integer", "float", "string"
+     - Framscript scalar datatypes: "integer", "float", "string"
      - object of unknown type: "Object"
      - value of unknown type: "untyped" (this can be object or not)
@@ -22,7 +22,13 @@
 <!ATTLIST element max CDATA #IMPLIED>
 <!ATTLIST element function (false|true) "false">
+<!ATTLIST element deprecated (false|true) "false">
 <!ATTLIST element default CDATA #IMPLIED>
 
-<!-- important difference: no <arguments> tag means the argument number is not known
+<!-- The full list of possible values for flags is defined and explained in param.h in Framsticks SDK:
+     https://www.framsticks.com/svn/framsticks/cpp/frams/param/param.h
+     Other related information can be found at http://www.framsticks.com/common/formatspec.html -->
+<!ATTLIST element flags CDATA #IMPLIED>
+
+<!-- Important difference: no <arguments> tag means the argument number is not known
                            empty <arguments> means the function does not accept arguments -->
 <!ELEMENT arguments (argument*)>
Index: java/Framclipse/com.framsticks.framclipse/res/framscript.xml
===================================================================
--- java/Framclipse/com.framsticks.framclipse/res/framscript.xml	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/res/framscript.xml	(revision 440)
@@ -4,95 +4,140 @@
 <framscript>
 	<type name="expdef" context="expdef file">
-		<element name="code" type="string"/>
+		<element name="name" type="string"/>
 		<element name="info" type="string"/>
-		<element name="name" type="string"/>
+		<element name="code" type="string" flags="16384"/>
 		<element name="neurons" type="string"/>
 	</type>
 	<type name="prop" context="properties file">
-		<element name="flags" type="integer"/>
-		<element name="group" type="string"/>
-		<element name="help" type="string"/>
 		<element name="id" type="string"/>
 		<element name="name" type="string"/>
 		<element name="type" type="string"/>
+		<element name="flags" type="integer"/>
+		<element name="help" type="string"/>
+		<element name="group" type="string"/>
 	</type>
 	<type name="stat" context="state file">
-		<element name="flags" type="integer"/>
-		<element name="group" type="string"/>
-		<element name="help" type="string"/>
 		<element name="id" type="string"/>
 		<element name="name" type="string"/>
 		<element name="type" type="string"/>
+		<element name="flags" type="integer"/>
+		<element name="help" type="string"/>
+		<element name="group" type="string"/>
 	</type>
 	<type name="style" context="style file">
 <description><![CDATA[General visual style properties.]]></description>
-		<element name="code" type="string"/>
-		<element name="info" type="string"/>
+		<element name="style" type="string" default="standard"/>
+		<element name="name" type="string" flags="19"/>
+		<element name="info" type="string" flags="19"/>
+		<element name="code" type="string" flags="16419"/>
+		<element name="streload" function="true" flags="2"/>
+		<element name="rebuild" function="true" flags="34"/>
+		<element name="tex" type="integer" min="0" max="2" default="1"/>
+		<element name="smooth" type="integer" min="0" max="1" default="1"/>
+		<element name="neurons" type="integer" min="0" max="1" default="1"/>
+	</type>
+	<type name="show" context="show file">
+<description><![CDATA[Properties of a show for the Framsticks Theater (from the *.show file).]]></description>
+		<element name="show" type="string"/>
+		<element name="name" type="string" flags="50"/>
+		<element name="info" type="string" flags="50"/>
+		<element name="dispinfo" type="integer" min="0" max="2" flags="2"/>
+		<element name="userspeed" type="integer" min="0" max="5" default="3" flags="2"/>
+		<element name="showlog" type="integer" min="0" max="1" flags="2"/>
+		<element name="code" type="string" flags="16418"/>
+		<element name="expdef" type="string" flags="34"/>
+		<element name="reload" function="true" flags="2"/>
+		<element name="dummy" function="true" flags="2">
+			<description><![CDATA[This is the empty item in the Theater's menu]]></description>
+		</element>
+		<element name="about" function="true" flags="34"/>
+		<element name="regname" type="string" flags="35"/>
+		<element name="prev_show" type="string" flags="35"/>
+		<element name="mode" type="integer" min="0" max="2" flags="35"/>
+		<element name="switchmode" type="integer" min="0" max="3" flags="32"/>
+		<element name="switchtime" type="integer" min="0" max="9999" flags="32">
+			<description><![CDATA[time between switching (seconds)]]></description>
+		</element>
+		<element name="switchshows" type="string" flags="32">
+			<description><![CDATA[names of the shows participating in automatic switching (comma separated). Use * as a wildcard.]]></description>
+		</element>
+		<element name="includeshows" type="string" flags="32">
+			<description><![CDATA[names of shows included in the show menu. Use * as a wildcard.]]></description>
+		</element>
+		<element name="excludeshows" type="string" flags="32">
+			<description><![CDATA[names of shows excluded from the show menu. Use * as a wildcard.]]></description>
+		</element>
+		<element name="openfilename" type="string" flags="33">
+			<description><![CDATA[Filename to be opened in onAppOpenFile()]]></description>
+		</element>
+	</type>
+	<type name="class" context="neuro file">
 		<element name="name" type="string"/>
-		<element name="neurons" type="integer" min="0" max="1"/>
-		<element name="smooth" type="integer" min="0" max="1"/>
-		<element name="style" type="string"/>
-		<element name="tex" type="integer" min="0" max="2"/>
-		<element name="rebuild" function="true"/>
-		<element name="streload" function="true"/>
-	</type>
-	<type name="show" context="show file">
-<description><![CDATA[Show properties for the Framsticks Theater (from the *.show file).]]></description>
-		<element name="code" type="string"/>
-		<element name="dispinfo" type="integer" min="0" max="2"/>
-		<element name="expdef" type="string"/>
-		<element name="info" type="string"/>
-		<element name="mode" type="integer" min="0" max="2"/>
+		<element name="longname" type="string"/>
+		<element name="description" type="string"/>
+		<element name="code" type="string" flags="16384"/>
+		<element name="prefinputs" type="integer"/>
+		<element name="prefoutput" type="integer" min="0" max="1"/>
+		<element name="preflocation" type="integer" min="0" max="2"/>
+		<element name="icon" type="string"/>
+		<element name="vhints" type="integer"/>
+	</type>
+	<type name="script" context="script file">
 		<element name="name" type="string"/>
-		<element name="regname" type="string"/>
-		<element name="show" type="string"/>
-		<element name="showlog" type="integer" min="0" max="1"/>
-		<element name="switchmode" type="integer" min="0" max="2"/>
-		<element name="switchshows" type="string">
-			<description><![CDATA[names of the shows participating in automatic switching (comma separated). Use * as a wildcard.]]></description>
-		</element>
-		<element name="switchtime" type="integer" min="0" max="9999">
-			<description><![CDATA[time between switching (seconds)]]></description>
-		</element>
-		<element name="userspeed" type="integer" min="0" max="5" default="3"/>
-		<element name="about" function="true"/>
-		<element name="dummy" function="true">
-			<description><![CDATA[This is the empty item in the Theater's menu]]></description>
-		</element>
-		<element name="reload" function="true"/>
-	</type>
-	<type name="class" context="neuro file">
-		<element name="code" type="string"/>
-		<element name="description" type="string"/>
-		<element name="icon" type="string"/>
-		<element name="longname" type="string"/>
-		<element name="name" type="string"/>
-		<element name="prefinputs" type="integer"/>
-		<element name="preflocation" type="integer" min="0" max="2"/>
-		<element name="prefoutput" type="integer" min="0" max="1"/>
-		<element name="vhints" type="integer"/>
-	</type>
-	<type name="script" context="script file">
-		<element name="code" type="string"/>
+		<element name="code" type="string" flags="16384"/>
+		<element name="help" type="string"/>
 		<element name="group" type="string"/>
-		<element name="help" type="string"/>
-		<element name="name" type="string"/>
+	</type>
+	<type name="CheckpointEvent" context="Global context">
+<description><![CDATA[Used in onSlaveCheckpoint() which is called when a Slave Simulator checkpoint is reached.]]></description>
+		<element name="index" type="integer" flags="1"/>
+		<element name="slave" type="Simulator" flags="1"/>
+		<element name="ticks" type="integer" flags="1"/>
+		<element name="data" type="untyped" flags="1"/>
 	</type>
 	<type name="Collision" context="Global context">
 <description><![CDATA[Used in collision handlers (On___Collision). Contains the detailed information about the colliding parts (Part1,Part2 and their associated MechParts and Creatures). See the onFoodCollision() function in standard.expdef]]></description>
-		<element name="Creature1" type="Object"/>
-		<element name="Creature2" type="Object"/>
-		<element name="MechPart1" type="Object"/>
-		<element name="MechPart2" type="Object"/>
-		<element name="Part1" type="Object"/>
-		<element name="Part2" type="Object"/>
+		<element name="Part1" type="Object" flags="1"/>
+		<element name="Part2" type="Object" flags="1"/>
+		<element name="MechPart1" type="Object" flags="1"/>
+		<element name="MechPart2" type="Object" flags="1"/>
+		<element name="Creature1" type="Object" flags="1"/>
+		<element name="Creature2" type="Object" flags="1"/>
 	</type>
 	<type name="CrCollision" context="Global context">
 <description><![CDATA[Used in creature collision handlers (On___CrCollision).]]></description>
-		<element name="Creature1" type="Object"/>
-		<element name="Creature2" type="Object"/>
+		<element name="Creature1" type="Object" flags="1"/>
+		<element name="Creature2" type="Object" flags="1"/>
 	</type>
 	<type name="Creature" context="Global context">
-<description><![CDATA[The object inside the simulated world, including its physical structure, neural network and performance data. Food pieces, obstacles and other movable objects can be implemented as Creatures even though the are not "alive". See also: Population.]]></description>
+<description><![CDATA[The object inside the simulated world, including its physical structure, neural network and performance data. Food pieces, obstacles and other movable objects can be implemented as Creatures even though the are not "alive".
+Before version 4.0rc4 the static Creature object was used in event handlers and in functions operating on the "selected" creature. This is now deprecated as all operations can be performed using the more convenient direct access (see GenePools). For event handlers, the creature object will be passed as argument, like this:
+function onDied(cr) {Simulator.print("Creature "+cr.name+" has died");}
+See also: Population.]]></description>
+		<element name="name" type="string" max="30"/>
+		<element name="genotype" type="string" flags="1"/>
+		<element name="info" type="string">
+			<description><![CDATA[Additional info or comments]]></description>
+		</element>
+		<element name="group" type="untyped" deprecated="true" flags="8227">
+			<description><![CDATA[Deprecated. Use population instead.]]></description>
+		</element>
+		<element name="population" type="untyped" flags="35"/>
+		<element name="index" type="integer" flags="35">
+			<description><![CDATA[Note that the index changes depending on the current creature position in the population. Use Creature.uid if you need a permanent identifier that persists through the entire object lifetime.]]></description>
+		</element>
+		<element name="gnum" type="integer"/>
+		<element name="buildproblems" type="integer" flags="34"/>
+		<element name="energ0" type="float" deprecated="true" flags="8226"/>
+		<element name="energy0" type="float"/>
+		<element name="idleen" type="float"/>
+		<element name="energy" type="float"/>
+		<element name="energy_p" type="float"/>
+		<element name="energy_m" type="float"/>
+		<element name="energy_b" type="float"/>
+		<element name="perf" type="integer" min="0" max="2">
+			<description><![CDATA[Initial value of this property is taken from Population.enableperf]]></description>
+		</element>
+		<element name="nnenabled" type="integer" min="0" max="1"/>
 		<element name="bodysim" type="integer" min="0" max="1" default="1">
 			<description><![CDATA[(Physical) body simulation can be disabled for individual objects which makes them immovable. Disabled objects can still participate in collisions depending on their collisions masks.
@@ -100,440 +145,354 @@
 Bugs: the standard collision handler does not work for disabled objects when ODE simulation is used. It means that these objects won't physically interact with other objects. The custom (scripting) handlers work as expected.]]></description>
 		</element>
-		<element name="buildproblems" type="integer"/>
-		<element name="c_velocity" type="float"/>
-		<element name="c_vertpos" type="float"/>
-		<element name="c_vertvelocity" type="float"/>
-		<element name="center_x" type="float">
-			<description><![CDATA[Center of gravity]]></description>
-		</element>
-		<element name="center_y" type="float">
-			<description><![CDATA[Center of gravity]]></description>
-		</element>
-		<element name="center_z" type="float">
-			<description><![CDATA[Center of gravity]]></description>
-		</element>
-		<element name="distance" type="float"/>
-		<element name="drive" type="XYZ">
-			<description><![CDATA[Measured in global coordinates]]></description>
-		</element>
-		<element name="energ0" type="float"/>
-		<element name="energy" type="float"/>
-		<element name="energy_b" type="float"/>
-		<element name="energy_m" type="float"/>
-		<element name="energy_p" type="float"/>
-		<element name="geno" type="Geno">
-			<description><![CDATA[Source genotype for this creature]]></description>
-		</element>
-		<element name="genotype" type="string"/>
-		<element name="gnum" type="integer"/>
-		<element name="group" type="untyped"/>
-		<element name="idleen" type="float"/>
-		<element name="index" type="integer">
-			<description><![CDATA[Index of this Creature in its Population.]]></description>
-		</element>
-		<element name="info" type="string">
-			<description><![CDATA[Additional info or comments]]></description>
-		</element>
-		<element name="lifespan" type="integer"/>
-		<element name="liveModel" type="Model">
-			<description><![CDATA[A Model object that is a copy of the current (temporary) geometry of this creature]]></description>
-		</element>
-		<element name="localDrive" type="XYZ">
-			<description><![CDATA[Measured in local coordinates, that is, with respect to the current orientation of the creature.
-See also: Creature.orient]]></description>
-		</element>
-		<element name="model" type="Model">
-			<description><![CDATA[Source Model for this creature]]></description>
-		</element>
-		<element name="name" type="string"/>
-		<element name="nnenabled" type="integer" min="0" max="1"/>
-		<element name="numjoints" type="integer"/>
-		<element name="numneurons" type="integer"/>
-		<element name="numparts" type="integer"/>
-		<element name="orient" type="Orient">
-			<description><![CDATA[By convention, the orientation of the creature is equal to the orientation of its first Part]]></description>
-		</element>
-		<element name="othermask" type="integer" min="0" max="2147483647" default="0"/>
-		<element name="perf" type="integer" min="0" max="2">
-			<description><![CDATA[Initial value of this property is taken from Population.enableperf]]></description>
-		</element>
-		<element name="pos_x" type="float">
-			<description><![CDATA[(pos_x,pos_y,pos_z) is the point of minimal coordinates ("bottom left corner") of the creature, including imaginary Part sizes (Part.s, usually 1.0). See also: Creature.moveAbs]]></description>
-		</element>
-		<element name="pos_y" type="float">
-			<description><![CDATA[See Creature.pos_x]]></description>
-		</element>
-		<element name="pos_z" type="float">
-			<description><![CDATA[See Creature.pos_x]]></description>
-		</element>
 		<element name="selfcol" type="integer" min="0" max="1">
 			<description><![CDATA[Enable/disable detection of self-collisions (within a creature body). They can only occur when using the ODE simulation engine. If enabled, the creature will have its sticks collide during lifespan.]]></description>
 		</element>
-		<element name="selfcolstate" type="integer" min="0" max="1">
-			<description><![CDATA[Current self-collision state]]></description>
-		</element>
-		<element name="selfmask" type="integer" min="0" max="2147483647" default="0"/>
-		<element name="signals" type="CreatureSignals"/>
-		<element name="size_x" type="float">
+		<element name="selfcolstate" function="true" type="integer" flags="32">
+			<description><![CDATA[Current self-collision state. In old versions this was a field, not a function.]]></description>
+<arguments/></element>
+		<element name="lifespan" type="integer"/>
+		<element name="distance" type="float"/>
+		<element name="c_velocity" type="float"/>
+		<element name="c_vertvelocity" type="float"/>
+		<element name="c_vertpos" type="float"/>
+		<element name="velocity" type="float"/>
+		<element name="vertpos" type="float"/>
+		<element name="vertvel" type="float"/>
+		<element name="pos_x" type="float" flags="3">
+			<description><![CDATA[(pos_x,pos_y,pos_z) is the point of minimal coordinates ("bottom left corner") of the creature, including imaginary Part sizes (Part.s, usually 1.0). See also: Creature.moveAbs]]></description>
+		</element>
+		<element name="pos_y" type="float" flags="3">
+			<description><![CDATA[See Creature.pos_x]]></description>
+		</element>
+		<element name="pos_z" type="float" flags="3">
+			<description><![CDATA[See Creature.pos_x]]></description>
+		</element>
+		<element name="size_x" type="float" flags="3">
 			<description><![CDATA[(size_x,size_y,size_z) are dimensions of the axis-aligned bounding box of the creature, including the imaginary part sizes (Part.s, usually 1.0). A creature consisting of a single default Part has the size of (2.0,2.0,2.0) - twice the Part.s value (like a sphere diameter is twice its radius).
 See also: Creature.moveAbs]]></description>
 		</element>
-		<element name="size_y" type="float">
+		<element name="size_y" type="float" flags="3">
 			<description><![CDATA[See Creature.size_x]]></description>
 		</element>
-		<element name="size_z" type="float">
+		<element name="size_z" type="float" flags="3">
 			<description><![CDATA[See Creature.size_x]]></description>
 		</element>
-		<element name="uid" type="string"/>
+		<element name="center_x" type="float" flags="1">
+			<description><![CDATA[Center of gravity]]></description>
+		</element>
+		<element name="center_y" type="float" flags="1">
+			<description><![CDATA[Center of gravity]]></description>
+		</element>
+		<element name="center_z" type="float" flags="1">
+			<description><![CDATA[Center of gravity]]></description>
+		</element>
+		<element name="numparts" type="integer" flags="3"/>
+		<element name="numjoints" type="integer" flags="3"/>
+		<element name="numneurons" type="integer" flags="3"/>
 		<element name="user1" type="untyped"/>
 		<element name="user2" type="untyped"/>
 		<element name="user3" type="untyped"/>
+		<element name="move" function="true" type="void" flags="32">
+			<description><![CDATA[Shift the creature by a given vector.]]></description>
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="z" type="float"/>
+			</arguments>
+		</element>
+		<element name="moveAbs" function="true" type="void" flags="32">
+			<description><![CDATA[Moves the creature so that its origin (pos_x,pos_y,pos_z) is placed at the given location. The origin is the point of minimal coordinates ("bottom left corner"), including imaginary part sizes (Part.s, usually 1.0).
+Assuming a simple single-stick creature "X" having parts at (0,0,0) and (1,0,0),
+
+origin (pos_x,pos_y,pos_z) = (-1,-1,-1)
+size (size_x,size_y,size_z) = (3,2,2)
+
+The following example places the bottom of a creature at a given location (x,y,z):
+Creature.moveAbs(x-(Creature.size_x/2),y-(Creature.size_y/2),z-1.0)
+(assuming that the part size is 1.0)]]></description>
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="z" type="float"/>
+			</arguments>
+		</element>
+		<element name="moveLocal" function="true" type="void" flags="32">
+			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="z" type="float"/>
+			</arguments>
+		</element>
+		<element name="localToWorld" function="true" type="XYZ" flags="32">
+			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="z" type="float"/>
+			</arguments>
+		</element>
+		<element name="worldToLocal" function="true" type="XYZ" flags="32">
+			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="z" type="float"/>
+			</arguments>
+		</element>
+		<element name="orient" type="Orient" flags="33">
+			<description><![CDATA[By convention, the orientation of the creature is equal to the orientation of its first Part]]></description>
+		</element>
+		<element name="rotate" function="true" type="void" flags="32">
+			<description><![CDATA[Rotate the creature around X, Y and Z axes. Should only be used immediately after creating a new creature (before the first simulation step is performed for this creature), otherwise further simulation can be disturbed.]]></description>
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="z" type="float"/>
+			</arguments>
+		</element>
+		<element name="rotateLocal" function="true" type="void" flags="32">
+			<description><![CDATA[Rotate the creature around (local) X, Y and Z axes. Should only be used immediately after creating a new creature (before the first simulation step is performed for this creature), otherwise further simulation can be disturbed.]]></description>
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="z" type="float"/>
+			</arguments>
+		</element>
+		<element name="drive" type="XYZ" flags="34">
+			<description><![CDATA[Measured in global coordinates]]></description>
+		</element>
+		<element name="localDrive" type="XYZ" flags="34">
+			<description><![CDATA[Measured in local coordinates, that is, with respect to the current orientation of the creature.
+See also: Creature.orient]]></description>
+		</element>
+		<element name="getPart" function="true" type="Part" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getJoint" function="true" type="Joint" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getNeuroDef" function="true" type="NeuroDef" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getMechPart" function="true" type="MechPart" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getMechJoint" function="true" type="MechJoint" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getNeuro" function="true" type="Neuro" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="selfmask" type="integer" min="0" max="2147483647" default="0" flags="32">
+			<description><![CDATA[Creature's selfmask is set according to the Creature's Population.selfmask. See Population.selfmask for detailed information about collision handling.]]></description>
+		</element>
+		<element name="othermask" type="integer" min="0" max="2147483647" default="0" flags="32">
+			<description><![CDATA[Creature's othermask is set according to the Creature's Population.othermask. See Population.selfmask for detailed information about collision handling.]]></description>
+		</element>
+		<element name="geno" type="Geno" flags="35">
+			<description><![CDATA[Source genotype for this creature]]></description>
+		</element>
+		<element name="model" type="Model" flags="35">
+			<description><![CDATA[Source Model for this creature]]></description>
+		</element>
+		<element name="liveModel" type="Model" flags="35">
+			<description><![CDATA[A Model object that is a copy of the current (temporary) geometry of this creature]]></description>
+		</element>
+		<element name="uid" type="string" flags="33"/>
+		<element name="signals" type="CreatureSignals" flags="35"/>
+		<element name="boundingBoxCollisions" function="true" type="integer" flags="34">
+			<description><![CDATA[Checks approximate collisions for the selected creature.
+Returns the collision mask calculated as ( creature.selfmask & other_creatures.othermask ).
+Passing non-zero argument is equivalent to setting a temporary selfmask for the current creature.]]></description>
+			<arguments>
+				<argument name="mask" type="integer"/>
+			</arguments>
+		</element>
+	</type>
+	<type name="CreatureSettings" context="Global context">
+<description><![CDATA[Creature building parameters]]></description>
+		<element name="minjoint" type="float" min="0" max="100" default="0.0"/>
+		<element name="maxjoint" type="float" min="0" max="100" default="2.0"/>
+		<element name="randinit" type="float" min="0" max="10" default="0.01">
+			<description><![CDATA[Allowed range for initializing all neuron states with uniform distribution random numbers and zero mean. Set to 0 for deterministic initialization.]]></description>
+		</element>
+		<element name="nnoise" type="float" min="0" max="1" default="0.0">
+			<description><![CDATA[Gaussian neural noise: a random value is added to each neural output in each simulation step. Set standard deviation here to add random noise, or 0 for deterministic simulation.]]></description>
+		</element>
+		<element name="touchrange" type="float" min="0" max="100" default="1.0"/>
+		<element name="bnoise_struct" type="float" min="0" max="10" default="0.0">
+			<description><![CDATA[When >0, body constructs of creatures (position of Parts) will be randomly disturbed when they are created.]]></description>
+		</element>
+		<element name="bnoise_vel" type="float" min="0" max="10" default="0.0">
+			<description><![CDATA[Random velocities will be applied to all body Parts (in MechaStick) or rigid segments (in ODE) of newly created creatures.]]></description>
+		</element>
+	</type>
+	<type name="CreatureSignals" context="Global context">
+<description><![CDATA[Signal sources associated with a creature. See also: Signal, WorldSignals, NeuroSignals.]]></description>
+		<element name="add" function="true" type="Signal">
+			<arguments>
+				<argument name="channel" type="string"/>
+			</arguments>
+		</element>
+		<element name="addProperty" function="true" type="Signal" flags="256">
+			<description><![CDATA[Create a signal that automatically reflects one of the creature's properties (i.e. its power is equal to the property value).
+Example:
+Creature.signals.addProperty("energy","energy"); //then, Neuro.signals.receive("energy") in a custom neuron would work similarly to a built-in smell sensor.]]></description>
+			<arguments>
+				<argument name="channel" type="string"/>
+				<argument name="property" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="receive" function="true" type="float">
+			<description><![CDATA[Receive the aggregated signal power in a given channel.]]></description>
+			<arguments>
+				<argument name="channel" type="string"/>
+			</arguments>
+		</element>
+		<element name="receiveSet" function="true" type="Vector">
+			<description><![CDATA[Get all signals in the specified range. Returns a read-only vector object containing Signal objects - individual signals can be accessed as result[0], .., result[result.size-1].]]></description>
+			<arguments>
+				<argument name="channel" type="string"/>
+				<argument name="max distance" type="float"/>
+			</arguments>
+		</element>
+		<element name="receiveFilter" function="true" type="float">
+			<description><![CDATA[Receive the aggregated signal power in a given channel.
+
+Additional filtering options:
+- Max distance only receives the neighbor signals (based on their physical location)
+- Flavor filtering: only signals having the flavor similar to the specified value will be received. The flavorfilter value is the difference of flavor that reduces the received signal to 0. The "flavor attenuation" is linear, i.e., signals differing by (filter/2) in flavor will be reduced to 50%.]]></description>
+			<arguments>
+				<argument name="channel" type="string"/>
+				<argument name="max distance" type="float"/>
+				<argument name="flavor" type="float"/>
+				<argument name="flavorfilter" type="float"/>
+			</arguments>
+		</element>
+		<element name="receiveSingle" function="true" type="Signal">
+			<description><![CDATA[Find the signal source that has the highest signal power (taking into account distance).]]></description>
+			<arguments>
+				<argument name="channel" type="string"/>
+				<argument name="max distance" type="float"/>
+			</arguments>
+		</element>
+		<element name="get" function="true" type="Signal">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="size" type="integer" flags="1"/>
+		<element name="clear" function="true" type="void" flags="1"><arguments/></element>
+	</type>
+	<type name="CreatureSnapshot" context="Global context">
+<description><![CDATA[A data object consisting of the same fields as the serialized Creature. Typically used for reading a Creature back from a file, then Population.add(snapshot_object) creates the Creature object from the snapshot.]]></description>
+		<element name="new" function="true" type="Creature"><arguments/></element>
+		<element name="name" type="string" max="30"/>
+		<element name="genotype" type="string"/>
+		<element name="info" type="string">
+			<description><![CDATA[Additional info or comments]]></description>
+		</element>
+		<element name="gnum" type="integer"/>
+		<element name="energy0" type="float"/>
+		<element name="idleen" type="float"/>
+		<element name="energy" type="float"/>
+		<element name="energy_p" type="float"/>
+		<element name="energy_m" type="float"/>
+		<element name="energy_b" type="float"/>
+		<element name="perf" type="integer" min="0" max="2">
+			<description><![CDATA[Initial value of this property is taken from Population.enableperf]]></description>
+		</element>
+		<element name="nnenabled" type="integer" min="0" max="1"/>
+		<element name="bodysim" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[(Physical) body simulation can be disabled for individual objects which makes them immovable. Disabled objects can still participate in collisions depending on their collisions masks.
+
+Bugs: the standard collision handler does not work for disabled objects when ODE simulation is used. It means that these objects won't physically interact with other objects. The custom (scripting) handlers work as expected.]]></description>
+		</element>
+		<element name="selfcol" type="integer" min="0" max="1">
+			<description><![CDATA[Enable/disable detection of self-collisions (within a creature body). They can only occur when using the ODE simulation engine. If enabled, the creature will have its sticks collide during lifespan.]]></description>
+		</element>
+		<element name="lifespan" type="integer"/>
+		<element name="distance" type="float"/>
+		<element name="c_velocity" type="float"/>
+		<element name="c_vertvelocity" type="float"/>
+		<element name="c_vertpos" type="float"/>
 		<element name="velocity" type="float"/>
 		<element name="vertpos" type="float"/>
 		<element name="vertvel" type="float"/>
-		<element name="currentGeometryAsF0" function="true" type="string"><arguments/></element>
-		<element name="getJoint" function="true" type="Joint">
+		<element name="center_x" type="float">
+			<description><![CDATA[Center of gravity]]></description>
+		</element>
+		<element name="center_y" type="float">
+			<description><![CDATA[Center of gravity]]></description>
+		</element>
+		<element name="center_z" type="float">
+			<description><![CDATA[Center of gravity]]></description>
+		</element>
+		<element name="user1" type="untyped"/>
+		<element name="user2" type="untyped"/>
+		<element name="user3" type="untyped"/>
+		<element name="orient" type="Orient" flags="32">
+			<description><![CDATA[By convention, the orientation of the creature is equal to the orientation of its first Part]]></description>
+		</element>
+		<element name="selfmask" type="integer" min="0" max="2147483647" default="0" flags="32">
+			<description><![CDATA[Creature's selfmask is set according to the Creature's Population.selfmask. See Population.selfmask for detailed information about collision handling.]]></description>
+		</element>
+		<element name="othermask" type="integer" min="0" max="2147483647" default="0" flags="32">
+			<description><![CDATA[Creature's othermask is set according to the Creature's Population.othermask. See Population.selfmask for detailed information about collision handling.]]></description>
+		</element>
+		<element name="uid" type="string" flags="32"/>
+	</type>
+	<type name="Dictionary" context="Global context">
+<description><![CDATA[Dictionary associates stored values with string keys ("key" is the first argument in get/set/remove functions). Integer key can be used to enumerate all elements (note that while iterating, the elements are returned in no particular order).
+Examples:
+	var d;
+	d=Dictionary.new();
+	d.set("name","John");
+	d.set("age",44);
+Another way of doing the same:
+	d={};
+	d["name"]="John";
+	d["age"]=44;
+And the most concise way:
+	d={ "name":"John", "age":44 };
+Iterating:
+	for(var i=0;i<d.size;i++) Simulator.print(d.getKey(i)+" is "+d.get(i));]]></description>
+		<element name="clear" function="true" type="void" flags="256"><arguments/></element>
+		<element name="size" type="integer" flags="257"/>
+		<element name="remove" function="true" type="void" flags="256">
+			<description><![CDATA[Removes the named or indexed element (depending on the argument type: string or int).]]></description>
+			<arguments>
+				<argument name="key" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="get" function="true" type="untyped" flags="256">
+			<description><![CDATA[Retrieves the named or indexed element (depending on the argument type: string or int). null is returned for nonexistent keys.
+object.get(key) can be shortened to 'object[key]']]></description>
+			<arguments>
+				<argument name="key" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="getKey" function="true" type="string" flags="256">
+			<description><![CDATA[Returns the key of the indexed element (0 <= index < size)]]></description>
 			<arguments>
 				<argument name="index" type="integer"/>
 			</arguments>
 		</element>
-		<element name="getMechJoint" function="true" type="MechJoint">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getMechPart" function="true" type="MechPart">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getNeuro" function="true" type="Neuro">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getNeuroDef" function="true" type="NeuroDef">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getPart" function="true" type="Part">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="localToWorld" function="true" type="XYZ">
-			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-		<element name="move" function="true" type="void">
-			<description><![CDATA[Shift the creature by a given vector.]]></description>
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-		<element name="moveAbs" function="true" type="void">
-			<description><![CDATA[Moves the creature so that its origin (pos_x,pos_y,pos_z) is placed at the given location. The origin is the point of minimal coordinates ("bottom left corner"), including imaginary part sizes (Part.s, usually 1.0).
-Assuming a simple single-stick creature "X" having parts at (0,0,0) and (1,0,0),
-
-origin (pos_x,pos_y,pos_z) = (-1,-1,-1)
-size (size_x,size_y,size_z) = (3,2,2)
-
-The following example places the bottom of a creature at a given location (x,y,z):
-Creature.moveAbs(x-(Creature.size_x/2),y-(Creature.size_y/2),z-1.0)
-(assuming that the part size is 1.0)]]></description>
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-		<element name="moveLocal" function="true" type="void">
-			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-		<element name="rotate" function="true" type="void">
-			<description><![CDATA[Rotate the creature around X, Y and Z axes. Should only be used immediately after creating a new creature (before the first simulation step is performed for this creature), otherwise further simulation can be disturbed.]]></description>
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-		<element name="rotateLocal" function="true" type="void">
-			<description><![CDATA[Rotate the creature around (local) X, Y and Z axes. Should only be used immediately after creating a new creature (before the first simulation step is performed for this creature), otherwise further simulation can be disturbed.]]></description>
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-		<element name="worldToLocal" function="true" type="XYZ">
-			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="CreatureSettings" context="Global context">
-<description><![CDATA[Creature building parameters]]></description>
-		<element name="bnoise_struct" type="float" min="0" max="10" default="0">
-			<description><![CDATA[When >0, body constructs of creatures (position of Parts) will be randomly disturbed when they are created.]]></description>
-		</element>
-		<element name="bnoise_vel" type="float" min="0" max="10" default="0">
-			<description><![CDATA[Random velocities will be applied to all body Parts (in MechaStick) or rigid segments (in ODE) of newly created creatures.]]></description>
-		</element>
-		<element name="maxjoint" type="float" min="0" max="100" default="2"/>
-		<element name="minjoint" type="float" min="0" max="100" default="0"/>
-		<element name="randinit" type="float" min="0" max="10" default="0.01">
-			<description><![CDATA[Allowed range for initializing all neuron states with uniform distribution random numbers and zero mean. Set 0 for deterministic initialization.]]></description>
-		</element>
-		<element name="touchrange" type="float" min="0" max="100" default="1"/>
-	</type>
-	<type name="CreaturesGroup" context="Global context">
-<description><![CDATA[A set of Creature objects, sharing some high level simulation properties (performance calculation, NN simulation, collision detection, event handling). The groups usually have different roles in the experiment (Creatures groups and Food group in standard.expdef).]]></description>
-		<element name="bodysim" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[Enable/disable physical body simulation. This is the initial value of Creature.bodysim for all objects created in this group. For details, see the documentation of Creature.bodysim.]]></description>
-		</element>
-		<element name="colmask" type="integer" min="0" max="65535" default="0">
-			<description><![CDATA[DEPRECATED. You should use selfmask and othermask (these masks are also much easier to understand than the old colmask field).]]></description>
-		</element>
-		<element name="death" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[Do creatures die when no energy?]]></description>
-		</element>
-		<element name="em_dyn" type="float" min="0" max="1" default="0">
-			<description><![CDATA[Energy requirements for a muscle
-moving a stick]]></description>
-		</element>
-		<element name="em_stat" type="float" min="0" max="1" default="0">
-			<description><![CDATA[Energy requirements for a muscle
-resisting an external force]]></description>
-		</element>
-		<element name="en_assim" type="float" min="0" max="1" default="0">
-			<description><![CDATA[Maximal energy gain produced by a vertical specialized stick.
-Horizontal specialized sticks get half of this value.]]></description>
-		</element>
-		<element name="enableperf" type="integer" min="0" max="2" default="1">
-			<description><![CDATA[Stabilization means no significant movement during a specified period of time.]]></description>
-		</element>
-		<element name="energy" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[If turned off, creature's energy will be constant.]]></description>
-		</element>
-		<element name="index" type="integer"/>
-		<element name="killnostable" type="integer" min="0" max="10000000" default="1000000">
-			<description><![CDATA[Creatures that fail to stabilize after the specified waiting period (e.g. because they are continuously rolling) will be killed. 0 disables this feature.]]></description>
-		</element>
-		<element name="name" type="string"/>
-		<element name="nnsim" type="integer" min="0" max="2" default="1">
-			<description><![CDATA[Stabilization means no significant movement during a specified period of time.]]></description>
-		</element>
-		<element name="othermask" type="integer" min="0" max="2147483647" default="0">
-			<description><![CDATA[See selfmask.]]></description>
-		</element>
-		<element name="perfperiod" type="integer" min="0" max="1000000" default="100">
-			<description><![CDATA[Defines how often onUpdate() events are called. Also used to compute partial performance of creatures (distance, speed, etc.) and to determine stabilization.]]></description>
-		</element>
-		<element name="selfcol" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[Detect collisions within creature bodies (only applicable for the ODE simulation engine). This is the initial value of Creature.selfcol for all objects created in this group. If enabled, creatures with self-colliding genotypes are not born, and others will have their sticks collide during lifespan.]]></description>
-		</element>
-		<element name="selfmask" type="integer" min="0" max="2147483647" default="0">
-			<description><![CDATA[Collisions between objects can be handled in two ways:
- - standard 'mechanical' collision (simple 'rebound' effect)
- - special script handler (On[GROUPNAME]Collision function)
-
-In the script handler function, use the Collision object to access the two colliding parts of two creatures.
-The first part in the Collision object (i.e. Collision.Creature1) always concerns the creature that belongs to [GROUPNAME].
-The handler is called once for each creature that collides with the creature from [GROUPNAME].
-
-Collision masks determine which one will be used (none and both are also possible). On each collision, selfmask and othermask of the colliding objects are logically ANDed. 16 lower bits (0xffff) enable the standard handler. 16 higher bits (0xffff0000) enable the custom handler. 
-Examples:
-
-1.With one group, all possible combinations of the collision handlers are as follows:
-  - ignore collisions (e.g. selfmask=othermask=0)
-  - use standard handling (e.g. selfmask=othermask=1)
-  - use custom handling (e.g. selfmask=othermask=0x10000)
-  - use standard and custom handling (e.g. selfmask=othermask=0x10001)
-
-2.Two groups yield more interesting cases. Let us consider the 'standard.expdef' setting:
-  Creatures: selfmask=0x10001, othermask=0x20001
-  Food colmask = selfmask=0x20002, othermask=0x10002
-There are three possible scenarios:
-- creature and creature: collision value = 0x10001 & 0x20001 = 1 -> Standard handling will be used (1 is one of the lower 16 bits)
-- food and food: collision value = 0x20002 & 0x10002 = 2 -> As above.
-- creature and food: collision value = (0x10001 & 0x10002) or (0x20002 & 0x20001) = 0x10000 or 0x20000 -> Custom handling will be used (higher 16 bits).
-]]></description>
-		</element>
-		<element name="size" type="integer"/>
-		<element name="stabilperiod" type="integer" min="0" max="1000000" default="100">
-			<description><![CDATA["Performance sampling period" for the stabilization phase.]]></description>
-		</element>
-		<element name="stabledist" type="float" min="0" max="1" default="0.01">
-			<description><![CDATA[A creature is considered stabilized when its center of gravity stays within the specified distance after the "Sampling period while waiting" has elapsed.]]></description>
-		</element>
-		<element name="createFromGeno" function="true" type="Creature">
-			<description><![CDATA[Uses the supplied Geno object]]></description>
-			<arguments>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="createFromGenotype" function="true" type="Creature">
-			<description><![CDATA[Uses the selected Genotype object]]></description>
-<arguments/></element>
-		<element name="createFromString" function="true" type="Creature">
-			<description><![CDATA[Uses the supplied string argument]]></description>
-			<arguments>
-				<argument name="genotype" type="string"/>
-			</arguments>
-		</element>
-		<element name="delete" function="true" type="void">
-			<description><![CDATA[delete creature]]></description>
-			<arguments>
-				<argument name="creature index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="findCreatureAt" function="true" type="Creature">
-			<arguments>
-				<argument name="point" type="Vector"/>
-				<argument name="vector" type="Vector"/>
-			</arguments>
-		</element>
-		<element name="findUID" function="true" type="integer">
-			<arguments>
-				<argument name="uid" type="string"/>
-			</arguments>
-		</element>
-		<element name="get" function="true" type="Creature">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="kill" function="true" type="void">
-			<description><![CDATA[kill creature]]></description>
-			<arguments>
-				<argument name="creature index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="senseCreaturesProperty" function="true" type="float">
-			<description><![CDATA[arguments:
- - x,y,z (sensor position)
- - property (name, name[index] or Class:id). name[index] can be used for Vector objects inside the user fields, eg "user2[10]"
- - exclude (creature object)
-works like a smell sensor for a given property (for all creatures in this group except "exclude").
-The following function reproduces the "classic" framsticks "S" sensor:
-function smellReceptorValue(x,y,z,exclude)
-{
-var i,s=0; for(i=0;i<Populations.size;i++)
-	s+=Populations[0].senseCreaturesProperty(x,y,z,"energy",exclude);
-return s;
-}]]></description>
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-				<argument name="propertyname" type="string"/>
-				<argument name="exclude" type="Creature"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="CreatureSignals" context="Global context">
-<description><![CDATA[Signal sources associated with the creature. See also: Signal, WorldSignals, NeuroSignals]]></description>
-		<element name="size" type="integer">
-			<description><![CDATA[Number of signals in this set]]></description>
-		</element>
-		<element name="add" function="true" type="Signal">
-			<description><![CDATA[Create a new signal]]></description>
-			<arguments>
-				<argument name="channel" type="string"/>
-			</arguments>
-		</element>
-		<element name="addProperty" function="true" type="Signal">
-			<description><![CDATA[Create a signal that automatically reflects one of the creature's properties (i.e. its power is equal to the property value).
-Example:
-Creature.signals.addProperty("energy","energy"); //then, Neuro.signals.receive("energy") in custom neuron would work similarly to the built-in smell sensor]]></description>
-			<arguments>
-				<argument name="channel" type="string"/>
-				<argument name="property" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="clear" function="true" type="void">
-			<description><![CDATA[Delete all signals]]></description>
-<arguments/></element>
-		<element name="get" function="true" type="Signal">
-			<description><![CDATA[Access individual signals (index=0 .. size-1)]]></description>
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="receive" function="true" type="float">
-			<description><![CDATA[Receive the aggregated signal power in a given channel.]]></description>
-			<arguments>
-				<argument name="channel" type="string"/>
-			</arguments>
-		</element>
-		<element name="receiveFilter" function="true" type="float">
-			<description><![CDATA[Receive the aggregated signal power in a given channel.
-
-Additional filtering options:
-- Max distance only receives the neighbor signals (based on their physical location)
-- Flavor filtering: only signals having the flavor close to the specified one will be received. The filter value is the maximum allowed difference.]]></description>
-			<arguments>
-				<argument name="channel" type="string"/>
-				<argument name="max distance" type="float"/>
-				<argument name="flavor" type="float"/>
-				<argument name="filter" type="float"/>
-			</arguments>
-		</element>
-		<element name="receiveSet" function="true" type="Vector">
-			<description><![CDATA[Get all signals in the specified range. Returns a readonly vector object containing Signal objects (individual signals can be accessed as result[0], .., result[result.size-1]).]]></description>
-			<arguments>
-				<argument name="channel" type="string"/>
-				<argument name="max distance" type="float"/>
-			</arguments>
-		</element>
-		<element name="receiveSingle" function="true" type="Signal">
-			<description><![CDATA[Find the signal source having the highest signal power (including the distance)]]></description>
-			<arguments>
-				<argument name="channel" type="string"/>
-				<argument name="max distance" type="float"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="Dictionary" context="Global context">
-<description><![CDATA[Dictionary associates stored values with string keys ("key" is the first argument in get/set/remove functions). Integer "key" can be used to enumerate all elements.
-Example: var d=Dictionary.new(); d.set("name","John"); d.set("age",44);
-var i,element; for(i=0;i<d.size;i++) element=d.get(i);]]></description>
-		<element name="size" type="integer"/>
-		<element name="toString" type="string"/>
-		<element name="clear" function="true" type="void"><arguments/></element>
-		<element name="find" function="true" type="string">
-			<description><![CDATA[returns the element key or null if not found]]></description>
-			<arguments>
-				<argument name="value" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="get" function="true" type="untyped">
-			<arguments>
-				<argument name="key" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="new" function="true" type="Dictionary"><arguments/></element>
-		<element name="remove" function="true" type="void">
-			<arguments>
-				<argument name="key" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="set" function="true" type="void">
+		<element name="set" function="true" type="void" flags="256">
+			<description><![CDATA[Set element value for the specified key or index (depending on the argument type: string or int).
+object.set(key,value) can be shortened to object[key]=value]]></description>
 			<arguments>
 				<argument name="key" type="untyped"/>
@@ -541,13 +500,87 @@
 			</arguments>
 		</element>
+		<element name="find" function="true" type="untyped" flags="256">
+			<description><![CDATA[Returns the element key or null if not found.]]></description>
+			<arguments>
+				<argument name="value" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="new" function="true" type="Dictionary">
+			<description><![CDATA[Empty directory can be also created using the {} expression.]]></description>
+<arguments/></element>
+		<element name="toString" type="string" flags="257"/>
+		<element name="clone" function="true" type="Dictionary" flags="256">
+			<description><![CDATA[The resulting clone is a shallow copy (contains the same object references as the original). A deep copy can be obtained through serialization: String.deserialize(String.serialize(object));]]></description>
+<arguments/></element>
 	</type>
 	<type name="File" context="Global context">
-<description><![CDATA[Provides read/write access to the filesystem. Can be used in the experiment definition to save the experiment state (onExpSave). Files are created in the "scripts_output" subdirectory of the directory where the Framsticks executable is located.]]></description>
-		<element name="EOF" type="integer" min="0" max="1"/>
+<description><![CDATA[Provides read/write access to the filesystem. Can be used in the experiment definition to save the experiment state (onExpSave) or any other information. Files are created in the "data/scripts_output" subdirectory, which is either near the Framsticks executable (if this subdirectory is writable) or in your user Documents directory.]]></description>
+		<element name="name" type="string" flags="1"/>
+		<element name="path" type="string" flags="1"/>
 		<element name="info" type="string"/>
-		<element name="name" type="string"/>
-		<element name="path" type="string"/>
-		<element name="pathseparator" type="string"/>
-		<element name="append" function="true" type="File ">
+		<element name="writeNameObject" function="true" type="void" flags="32">
+			<arguments>
+				<argument name="name" type="string"/>
+				<argument type="Object"/>
+			</arguments>
+		</element>
+		<element name="writeObject" function="true" type="void" flags="32">
+			<arguments>
+				<argument type="Object"/>
+			</arguments>
+		</element>
+		<element name="writeObjectBegin" function="true" type="void" flags="32">
+			<arguments>
+				<argument type="Object"/>
+			</arguments>
+		</element>
+		<element name="writeObjectField" function="true" type="void" flags="32">
+			<arguments>
+				<argument type="Object"/>
+				<argument name="field index or name" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="writeObjectFields" function="true" type="void" flags="32">
+			<arguments>
+				<argument type="Object"/>
+			</arguments>
+		</element>
+		<element name="writeObjectFieldForce" function="true" type="void" flags="32">
+			<arguments>
+				<argument type="Object"/>
+				<argument name="field index or name" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="writeObjectFieldsForce" function="true" type="void" flags="32">
+			<arguments>
+				<argument type="Object"/>
+			</arguments>
+		</element>
+		<element name="writeObjectEnd" function="true" type="void" flags="32"><arguments/></element>
+		<element name="writeString" function="true" type="void" flags="32">
+			<arguments>
+				<argument name="anything" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="writeComment" function="true" type="void" flags="32">
+			<arguments>
+				<argument name="anything" type="string"/>
+			</arguments>
+		</element>
+		<element name="readLine" function="true" type="string" flags="32"><arguments/></element>
+		<element name="readObject" function="true" type="void" flags="32">
+			<arguments>
+				<argument type="Object"/>
+			</arguments>
+		</element>
+		<element name="EOF" type="integer" min="0" max="1" flags="33"/>
+		<element name="readUntilEOF" function="true" type="string" flags="32"><arguments/></element>
+		<element name="getContents" function="true" type="string" flags="32">
+			<description><![CDATA[Shortcut to: var f=File.open(filename); c=f.readUntilEOF(); f.close(); return c;]]></description>
+			<arguments>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="create" function="true" type="File" flags="32">
 			<arguments>
 				<argument name="filename" type="string"/>
@@ -555,5 +588,5 @@
 			</arguments>
 		</element>
-		<element name="appendDirect" function="true" type="File ">
+		<element name="createDirect" function="true" type="File" flags="32">
 			<arguments>
 				<argument name="filename" type="string"/>
@@ -561,8 +594,5 @@
 			</arguments>
 		</element>
-		<element name="close" function="true" type="string">
-			<description><![CDATA[returns file contents if it has been buffered]]></description>
-<arguments/></element>
-		<element name="create" function="true" type="File">
+		<element name="append" function="true" type="File " flags="32">
 			<arguments>
 				<argument name="filename" type="string"/>
@@ -570,5 +600,5 @@
 			</arguments>
 		</element>
-		<element name="createDirect" function="true" type="File">
+		<element name="appendDirect" function="true" type="File " flags="32">
 			<arguments>
 				<argument name="filename" type="string"/>
@@ -576,30 +606,29 @@
 			</arguments>
 		</element>
-		<element name="exists" function="true" type="integer" min="0" max="1">
+		<element name="flush" function="true" type="void" flags="32">
+			<description><![CDATA[Useful for unbuffered disk files only (openDirect, appendDirect)]]></description>
+<arguments/></element>
+		<element name="open" function="true" type="File " flags="32">
+			<arguments>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="stdin" type="File" flags="1"/>
+		<element name="stdout" type="File" flags="1"/>
+		<element name="new" function="true" type="File " flags="32"><arguments/></element>
+		<element name="newFromString" function="true" type="File " flags="32">
+			<arguments>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="close" function="true" type="string" flags="32">
+			<description><![CDATA[Returns file contents if it has been buffered.]]></description>
+<arguments/></element>
+		<element name="exists" function="true" type="integer" min="0" max="1" flags="32">
 			<description><![CDATA[Sample:
-File.exists("default.sim") -> return 0 or 1]]></description>
+File.exists("walking.gen") -> returns 0 or 1.]]></description>
 <arguments/></element>
-		<element name="flush" function="true" type="void">
-			<description><![CDATA[useful for unbuffered disk files only (openDirect, appendDirect)]]></description>
-<arguments/></element>
-		<element name="new" function="true" type="File "><arguments/></element>
-		<element name="newFromString" function="true" type="File ">
-			<arguments>
-				<argument name="text" type="string"/>
-			</arguments>
-		</element>
-		<element name="open" function="true" type="File ">
-			<arguments>
-				<argument name="filename" type="string"/>
-			</arguments>
-		</element>
-		<element name="readLine" function="true" type="string"><arguments/></element>
-		<element name="readObject" function="true" type="void">
-			<arguments>
-				<argument type="Object"/>
-			</arguments>
-		</element>
-		<element name="readUntilEOF" function="true" type="string"><arguments/></element>
-		<element name="system" function="true" type="integer">
+		<element name="pathseparator" type="string" flags="33"/>
+		<element name="system" function="true" type="integer" flags="32">
 			<description><![CDATA[Invokes a system command and returns its exit code (0 usually means the command was completed successfully).
 
@@ -611,408 +640,319 @@
 			</arguments>
 		</element>
-		<element name="writeComment" function="true" type="void">
-			<arguments>
-				<argument name="anything" type="string"/>
-			</arguments>
-		</element>
-		<element name="writeNameObject" function="true" type="void">
-			<arguments>
-				<argument name="name" type="string"/>
-				<argument type="Object"/>
-			</arguments>
-		</element>
-		<element name="writeObject" function="true" type="void">
-			<arguments>
-				<argument type="Object"/>
-			</arguments>
-		</element>
-		<element name="writeObjectBegin" function="true" type="void">
-			<arguments>
-				<argument type="Object"/>
-			</arguments>
-		</element>
-		<element name="writeObjectEnd" function="true" type="void"><arguments/></element>
-		<element name="writeObjectField" function="true" type="void">
-			<arguments>
-				<argument type="Object"/>
-				<argument name="field index or name" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="writeObjectFieldForce" function="true" type="void">
-			<arguments>
-				<argument type="Object"/>
-				<argument name="field index or name" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="writeObjectFields" function="true" type="void">
-			<arguments>
-				<argument type="Object"/>
-			</arguments>
-		</element>
-		<element name="writeObjectFieldsForce" function="true" type="void">
-			<arguments>
-				<argument type="Object"/>
-			</arguments>
-		</element>
-		<element name="writeString" function="true" type="void">
-			<arguments>
-				<argument name="anything" type="untyped"/>
-			</arguments>
-		</element>
+	</type>
+	<type name="FunctionReference" context="Global context">
+<description><![CDATA[Function reference objects are created using the 'function' operator, the referenced function can be called using the 'call' operator:
+
+	function abc(a,b)
+	{ return a+b; }
+
+	var f=function abc;
+	Simulator.print(typeof(f)); //"FunctionReference"
+	Simulator.print(call(f)(123,321)); //444]]></description>
 	</type>
 	<type name="GenePool" context="Global context">
-<description><![CDATA[The static GenePool object refers to the "selected group" as described in GenePools.]]></description>
+<description><![CDATA[GenePool objects are accessed by GenePools[index], or Genotype.genepool and created by GenePools.addGroup(). Usage of the static GenePool object is not recommended.
+You can iterate directly over Genotypes in the GenePool using for(...in...) loops:
+	for(var genotype in GenePools[0]) Simulator.print(genotype.name);
+
+See also: GenePools]]></description>
+		<element name="name" type="string"/>
+		<element name="index" type="integer" flags="35"/>
+		<element name="size" type="integer" flags="3">
+			<description><![CDATA[In standard.expdef, this is equivalent to the number of unique genotypes. Standard experiment definition uses the Genotype.instances field to indicate that some genotypes exist in multiple instances despite having only one item in the group. Other experiment definitions may create multiple copies of the same genotype.]]></description>
+		</element>
+		<element name="genotype_instances" type="integer" flags="3">
+			<description><![CDATA[A sum of Genotype.instances values of all Genotypes in this gene pool.]]></description>
+		</element>
+		<element name="totalpop" type="integer" deprecated="true" flags="8195">
+			<description><![CDATA[Please use 'genotype_instances' instead of this field.]]></description>
+		</element>
+		<element name="fitness" type="string">
+			<description><![CDATA[(intended for advanced users)]]></description>
+		</element>
 		<element name="fitfun" type="integer" min="0" max="1" default="0">
 			<description><![CDATA[Enables fitness scaling.]]></description>
 		</element>
-		<element name="fitm" type="float" min="0" max="10" default="2">
+		<element name="fitm" type="float" min="0" max="10" default="2.0">
 			<description><![CDATA[Lower threshold: how many standard deviations below average?
 (avg - n * stddev) - used for fitness shifting]]></description>
 		</element>
-		<element name="fitma" type="float" min="1" max="10" default="2">
+		<element name="fitma" type="float" min="1" max="10" default="2.0">
 			<description><![CDATA[The best genotype is as many times
 better than the average one.]]></description>
 		</element>
-		<element name="fitness" type="string">
-			<description><![CDATA[(intended for advanced users)]]></description>
-		</element>
-		<element name="index" type="integer"/>
-		<element name="name" type="string"/>
-		<element name="size" type="integer">
-			<description><![CDATA[In standard.expdef, this is equivalent to the number of unique genotypes. Standard experiment definition uses the Genotype.instances field to indicate that some genotypes exist in multiple instances despite having only one item in the group. Other experiment definitions may create multiple copies of the same genotype.]]></description>
-		</element>
-		<element name="totalpop" type="integer">
-			<description><![CDATA[Takes into account the Genotype.instances field (which may give the total number of instances depending on the experiment definition).]]></description>
-		</element>
-		<element name="addGeno" function="true" type="Genotype">
+		<element name="get" function="true" type="Genotype" flags="34">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="findGeno" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Finds the Genotype whose genes are identical to the supplied Geno object.
+Returns the Genotype index or -1 if not found.
+Deprecated. Use the more versatile GenePool.findGenotype() instead of this function.]]></description>
+			<arguments>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="findGenotype" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Finds the Genotype whose genes are identical to the supplied Genotype object, Geno object, or genotype string.
+Returns the Genotype object or null if not found.]]></description>
+			<arguments>
+				<argument name="genotype object or geno object or string genotype" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="findUID" function="true" type="integer" flags="34">
+			<arguments>
+				<argument name="uid" type="string"/>
+			</arguments>
+		</element>
+		<element name="addGeno" function="true" type="Genotype" deprecated="true" flags="8226">
 			<description><![CDATA[Creates a new Genotype from the supplied Geno object.
+Returns the created Genotype.
+Deprecated. Use the more versatile GenePool.add() instead of this function.]]></description>
+			<arguments>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="createFromGeno" function="true" type="Genotype" deprecated="true" flags="8226">
+			<description><![CDATA[same as addGeno (to comply with createFrom... convention)
+Deprecated. Use the more versatile GenePool.add() instead of this function.]]></description>
+			<arguments>
+				<argument name="genotype" type="Geno"/>
+			</arguments>
+		</element>
+		<element name="createFromString" function="true" type="Genotype" deprecated="true" flags="8226">
+			<description><![CDATA[Uses the supplied string argument.
+Deprecated. Use the more versatile GenePool.add() instead of this function.]]></description>
+			<arguments>
+				<argument name="genotype" type="string"/>
+			</arguments>
+		</element>
+		<element name="add" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Creates a new Genotype from the supplied Genotype, Geno or string.
 Returns the created Genotype.]]></description>
 			<arguments>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="delete" function="true" type="void">
+				<argument name="genotype object or geno object or string genotype" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="worst" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Returns the genotype object having the lowest fitness. Unrated genotypes (instances==0) are ranked lower than those having at least one instance.]]></description>
+<arguments/></element>
+		<element name="best" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Returns the genotype object having the highest fitness. Unrated genotypes (instances==0) are ranked lower than those having at least one instance.]]></description>
+<arguments/></element>
+		<element name="random" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Returns a random genotype object]]></description>
+<arguments/></element>
+		<element name="roulette" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Returns a fitness-proportional genotype object]]></description>
+<arguments/></element>
+		<element name="revroulette" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Returns a reverse fitness-proportional genotype object]]></description>
+<arguments/></element>
+		<element name="tournament" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Returns a tournament winner genotype object]]></description>
+			<arguments>
+				<argument name="genotypes in tournament" type="integer"/>
+			</arguments>
+		</element>
+		<element name="randomLikeGeno" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Returns a random genotype index similar to the target genotype. Read about details:
+http://www.framsticks.com/node/795
+http://www.framsticks.com/node/890]]></description>
+			<arguments>
+				<argument name="minimum similarity" type="float"/>
+				<argument name="target geno" type="Geno"/>
+			</arguments>
+		</element>
+		<element name="rouletteLikeGeno" function="true" type="Genotype" flags="34">
+			<description><![CDATA[Returns a random genotype similar to the target genotype, fitness-proportional. Read about details:
+http://www.framsticks.com/node/795
+http://www.framsticks.com/node/890]]></description>
+			<arguments>
+				<argument name="minimum similarity" type="float"/>
+				<argument name="target geno" type="Geno"/>
+			</arguments>
+		</element>
+		<element name="delete" function="true" type="void" flags="34">
 			<description><![CDATA[Deletes a genotype.]]></description>
 			<arguments>
+				<argument name="genotype object or index" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="deleteOne" function="true" type="void" flags="34">
+			<description><![CDATA[Deletes one individual, i.e. decreases its 'instances' and deletes the genotype if the 'instances' goes to 0.]]></description>
+			<arguments>
+				<argument name="genotype object or index" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="clear" function="true" type="void" flags="34">
+			<description><![CDATA[Delete all genotypes. GenePools[group].clear() is equivalent to GenePools.clearGroup(group)]]></description>
+<arguments/></element>
+		<element name="mergeInstances" function="true" type="void" flags="34">
+			<description><![CDATA[Merges instances of the same genotype.]]></description>
+<arguments/></element>
+		<element name="splitInstances" function="true" type="void" flags="34">
+			<description><![CDATA[Splits genotype instances.]]></description>
+<arguments/></element>
+		<element name="iterator" type="Object" flags="291"/>
+		<element name="getStatsMin" function="true" type="float" flags="32">
+			<description><![CDATA[Retrieves data from stats.* object. Can only be used for fields covered by stats.* (subset of Genotype fields).]]></description>
+			<arguments>
+				<argument name="field name" type="string"/>
+			</arguments>
+		</element>
+		<element name="getStatsAvg" function="true" type="float" flags="32">
+			<description><![CDATA[Retrieves data from stats.* object. Can only be used for fields covered by stats.* (subset of Genotype fields).]]></description>
+			<arguments>
+				<argument name="field name" type="string"/>
+			</arguments>
+		</element>
+		<element name="getStatsMax" function="true" type="float" flags="32">
+			<description><![CDATA[Retrieves data from stats.* object. Can only be used for fields covered by stats.* (subset of Genotype fields).]]></description>
+			<arguments>
+				<argument name="field name" type="string"/>
+			</arguments>
+		</element>
+		<element name="refreshGUI" function="true" type="void" flags="32">
+			<description><![CDATA[Notify list content changed]]></description>
+<arguments/></element>
+	</type>
+	<type name="GenePools" context="Global context">
+<description><![CDATA[Manages all genotypes in the experiment, organized in one or more groups.
+You can iterate directly over GenePool objects in the GenePools collection using for(...in...) loops:
+	for(var pool in GenePools) Simulator.print(pool.name);
+
+Before version 4.0rc4, some operations could only be performed on the "selected" genotype (the one pointed to by group/genotype fields in GenePools). Currently, the more convenient and recommended way is to call Genotype's or GenePool's functions that operate directly on the passed objects.
+
+The old way:
+	GenePools.newGenotype("X");
+	GenePools.mutateSelected();
+	Genotype.info="my favorite genotype";
+	GenePools.copySelected(0);
+
+Doing the same the new way:
+	var g=Genotype.newFromGeno(GenMan.mutate(Geno.newFromString("X")));
+	g.info="my favorite genotype";
+	g.moveTo(GenePools[0]);]]></description>
+		<element name="group" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Index of the currently selected group (GenePool).]]></description>
+		</element>
+		<element name="size" type="integer" flags="3"/>
+		<element name="genotype" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Index of the currently selected genotype or -1 if no genotype is selected.]]></description>
+		</element>
+		<element name="newGenotype" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Makes a new genotype from the supplied string and select the genotype. The resulting genotype is stored in the static Genotype object detached from the genotype group. After calling this function GenePools.genotype is -1 indicating that no genotype from the group is selected. (call "copySelected" if you want to add this gentype to the genotype group).]]></description>
+			<arguments>
+				<argument name="genotype" type="string"/>
+			</arguments>
+		</element>
+		<element name="deleteSelected" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Deletes selected genotype from the gene pool (uses the selected genotype object).]]></description>
+<arguments/></element>
+		<element name="deleteOne" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Deletes one individual from the gene pool = decreases 'instances' and deletes the genotype if the 'instances' goes to 0.]]></description>
+			<arguments>
 				<argument name="genotype index" type="integer"/>
 			</arguments>
 		</element>
-		<element name="findGeno" function="true" type="integer">
-			<description><![CDATA[Finds the Genotype matching the supplied Geno object.
-returns genotype index or -1 if not found.]]></description>
-			<arguments>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="findUID" function="true" type="integer">
-			<arguments>
-				<argument name="uid" type="string"/>
-			</arguments>
-		</element>
-		<element name="get" function="true" type="Genotype">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="GenePools" context="Global context">
-<description><![CDATA[Manages all genotypes in the experiment, organized in one or more groups. Some functions refer to the "selected genotype" i.e. the genotype number "GenePools.genotype" in the pool number "GenePools.group". For example to access the first genoype in the first group you could do:
-GenePools.group=0; GenePools.genotype=0; var name=Genotype.name;
-However, the preferred way doesn't refer to the static Genotype object:
- var name=GenePools[0][0].name;
-
-Apart from the Genotypes in the group, there is also one temporary Genotype object used by genetic operators and some functions from GenePools. Genotype points to that object when "GenePools.genotype"=-1. The following code accesses that object before adding it to the genotype group:
-GenePools.newGenotype("X");
- //makes the temporary object from the "X" genotype, GenePools.genotype is now -1
-GenePools.mutateSelected();
- //the temporary object is mutated
-Genotype.info="my favorite genotype";
- //modify the temporary object
-GenePools.copySelected(0);
- //copy the current, i.e. temporary genotype to the genotype group #0]]></description>
-		<element name="genotype" type="integer">
-			<description><![CDATA[Index of the currently selected genotype or -1 if no genotype is selected.]]></description>
-		</element>
-		<element name="group" type="integer">
-			<description><![CDATA[Index of the currently selected group (GenePool).]]></description>
-		</element>
-		<element name="size" type="integer"/>
-		<element name="addGroup" function="true" type="void">
-			<description><![CDATA[Adds a new gene pool.]]></description>
-			<arguments>
-				<argument name="name" type="string"/>
-			</arguments>
-		</element>
-		<element name="addPerformanceFromCreature" function="true" type="void">
+		<element name="copySelected" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Copies the selected genotype to another group.]]></description>
+			<arguments>
+				<argument name="groupindex" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getFromCreature" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Copies a genotype from the selected creature. The resulting genotype is stored in the static Genotype object detached from the genotype group.]]></description>
+<arguments/></element>
+		<element name="getFromCreatureObject" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Copies a genotype from the creature object passed in argument. The resulting genotype is stored in the static Genotype object detached from the genotype group.]]></description>
+			<arguments>
+				<argument type="Creature"/>
+			</arguments>
+		</element>
+		<element name="addPerformanceFromCreature" function="true" type="void" deprecated="true" flags="8226">
 			<description><![CDATA[Updates the current Genotype's performance values merging them with the current Creture's performance. It assumes the Genotype.instances has a reasonable value and performs the proper weighting. Use your own function instead if these conditions are not met in your experiment.]]></description>
 <arguments/></element>
-		<element name="clear" function="true" type="void">
+		<element name="mutateSelected" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Mutates the selected genotype. The resulting genotype is stored in the static Genotype object detached from the genotype group. After calling this function GenePools.genotype is -1 indicating that no genotype from the group is selected.]]></description>
+<arguments/></element>
+		<element name="crossoverSelected" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Crossovers the selected genotype with another one (from the genotype group). The resulting genotype is stored in the static Genotype object detached from the genotype group. After calling this function GenePools.genotype is -1 indicating that no genotype from the group is selected.]]></description>
+			<arguments>
+				<argument name="other index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="worst" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Gets worst genotype index.]]></description>
+<arguments/></element>
+		<element name="random" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Gets random genotype index.]]></description>
+<arguments/></element>
+		<element name="roulette" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Gets fitness-proportional genotype index.]]></description>
+<arguments/></element>
+		<element name="revroulette" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Get reverse fitness-proportional genotype index.]]></description>
+<arguments/></element>
+		<element name="tournament" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Gets tournament winner genotype.]]></description>
+			<arguments>
+				<argument name="genotypes in tournament" type="integer"/>
+			</arguments>
+		</element>
+		<element name="randomLikeThis" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Gets a random genotype index similar to the selected one.]]></description>
+			<arguments>
+				<argument name="minimum similarity" type="float"/>
+			</arguments>
+		</element>
+		<element name="likeThisRoulette" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Gets a random genotype similar to the selected one, fitness-proportional.]]></description>
+			<arguments>
+				<argument name="minimum similarity" type="float"/>
+			</arguments>
+		</element>
+		<element name="findGenotype" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Finds a genotype identical to the currently selected genotype. It is only useful when the currently selected genotype is not on the list of genotypes (for example it is a result of a genetic operator)
+Deprecated. Use the more versatile GenePool.findGenotype() instead of this function.]]></description>
+<arguments/></element>
+		<element name="findGenotypeForCreature" function="true" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Finds a genotype identical to the genotype of the selected Creature.
+Deprecated. Use the more versatile GenePool.findGenotype() instead of this function.]]></description>
+<arguments/></element>
+		<element name="addGroup" function="true" type="GenePool" flags="34">
+			<description><![CDATA[Adds a new gene pool.]]></description>
+			<arguments>
+				<argument name="name" type="string"/>
+			</arguments>
+		</element>
+		<element name="deleteGroup" function="true" type="void" flags="34">
+			<description><![CDATA[Removes a gene pool.]]></description>
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="clear" function="true" type="void" flags="34">
 			<description><![CDATA[Removes all gene pools except the first one.]]></description>
 <arguments/></element>
-		<element name="clearGroup" function="true" type="void">
+		<element name="clearGroup" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[GenePools[group].clear() is more "object oriented" than GenePools.clearGroup(group)]]></description>
 			<arguments>
 				<argument name="index" type="integer"/>
 			</arguments>
 		</element>
-		<element name="copySelected" function="true" type="void">
-			<description><![CDATA[Copies the selected genotype to another group.]]></description>
-			<arguments>
-				<argument name="groupindex" type="integer"/>
-			</arguments>
-		</element>
-		<element name="crossoverSelected" function="true" type="void">
-			<description><![CDATA[Crossovers the selected genotype with another one (from the genotype group). The resulting genotype is stored in the static Genotype object detached from the genotype group. After calling this function GenePools.genotype is -1 indicating that no genotype from the group is selected.]]></description>
-			<arguments>
-				<argument name="other index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="deleteGroup" function="true" type="void">
-			<description><![CDATA[Removes a gene pool.]]></description>
+		<element name="get" function="true" type="GenePool" flags="34">
 			<arguments>
 				<argument name="index" type="integer"/>
 			</arguments>
 		</element>
-		<element name="deleteOne" function="true" type="void">
-			<description><![CDATA[Deletes one individual from the gene pool = decreases 'instances' and deletes the genotype if the 'instances' goes to 0.]]></description>
-			<arguments>
-				<argument name="genotype index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="deleteSelected" function="true" type="void">
-			<description><![CDATA[Deletes selected genotype from the gene pool (uses the selected genotype object).]]></description>
-<arguments/></element>
-		<element name="findGenotype" function="true" type="integer">
-			<description><![CDATA[Finds a genotype matching the current genotype. It only makes sense when the current genotype is a result of the genetic operator.]]></description>
-<arguments/></element>
-		<element name="findGenotypeForCreature" function="true" type="integer">
-			<description><![CDATA[Finds a genotype matching the selected creature.]]></description>
-<arguments/></element>
-		<element name="get" function="true" type="GenePool">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getFromCreature" function="true" type="void">
-			<description><![CDATA[Copies a genotype from the selected creature. The resulting genotype is stored in the static Genotype object detached from the genotype group.]]></description>
-<arguments/></element>
-		<element name="getFromCreatureObject" function="true" type="void">
-			<description><![CDATA[Copies a genotype from the creature object passed in argument. The resulting genotype is stored in the static Genotype object detached from the genotype group.]]></description>
-			<arguments>
-				<argument type="Creature"/>
-			</arguments>
-		</element>
-		<element name="likeThisRoulette" function="true" type="integer">
-			<description><![CDATA[Gets a random genotype similar to the selected one, fitness-proportional.]]></description>
-			<arguments>
-				<argument name="minimum similarity" type="float"/>
-			</arguments>
-		</element>
-		<element name="mutateSelected" function="true" type="void">
-			<description><![CDATA[Mutates the selected genotype. The resulting genotype is stored in the static Genotype object detached from the genotype group. After calling this function GenePools.genotype is -1 indicating that no genotype from the group is selected.]]></description>
-<arguments/></element>
-		<element name="newGenotype" function="true" type="void">
-			<description><![CDATA[Makes a new genotype from the supplied string and select the genotype. The resulting genotype is stored in the static Genotype object detached from the genotype group. After calling this function GenePools.genotype is -1 indicating that no genotype from the group is selected. (call "copySelected" if you want to add this gentype to the genotype group).]]></description>
-			<arguments>
-				<argument name="genotype" type="string"/>
-			</arguments>
-		</element>
-		<element name="random" function="true" type="integer">
-			<description><![CDATA[Gets random genotype.]]></description>
-<arguments/></element>
-		<element name="randomLikeThis" function="true" type="integer">
-			<description><![CDATA[Gets a random genotype similar to the selected one.]]></description>
-			<arguments>
-				<argument name="minimum similarity" type="float"/>
-			</arguments>
-		</element>
-		<element name="revroulette" function="true" type="integer">
-			<description><![CDATA[Get reverse fitness-proportional genotype.]]></description>
-<arguments/></element>
-		<element name="roulette" function="true" type="integer">
-			<description><![CDATA[Gets fitness-proportional genotype.]]></description>
-<arguments/></element>
-		<element name="tournament" function="true" type="integer">
-			<description><![CDATA[Gets tournament winner genotype.]]></description>
-			<arguments>
-				<argument name="genotypes in tournament" type="integer"/>
-			</arguments>
-		</element>
-		<element name="worst" function="true" type="integer">
-			<description><![CDATA[Gets worst genotype.]]></description>
-<arguments/></element>
+		<element name="iterator" type="Object" flags="289"/>
 	</type>
 	<type name="GenMan" context="Global context">
 <description><![CDATA[Manages various genetic operations, using appropriate operators for the argument genotype format.]]></description>
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="f0_c_del" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_c_new" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_c_wei" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_del" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_new" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_rsf" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_stf" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_stm" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_n_del" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_n_new" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_n_prp" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_nodel_tag" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[You can tag elements using their 'i' field and the i="mi=d" tag.
-Mutations will not delete such elements.
-The i="mi=dm" combination is allowed.]]></description>
-		</element>
-		<element name="f0_nomod_tag" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[You can tag elements using their 'i' field and the i="mi=m" tag.
-Mutations will not modify properties of such elements.
-The i="mi=md" combination is allowed.]]></description>
-		</element>
-		<element name="f0_p_asm" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_del" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_frc" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_ing" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_mas" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_new" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_pos" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_swp" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f1_mut_exmod" type="string">
-			<description><![CDATA[Modifiers that will not be added nor deleted during mutation
-(all: RrLlAaCcFfMmSsIiQqWwEe)]]></description>
-		</element>
-		<element name="f1_nmConn" type="float" min="0" max="100" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f1_nmNeu" type="float" min="0" max="100" default="0.05">
-			<description><![CDATA[Adds a (connected) neuron or removes a neuron]]></description>
-		</element>
-		<element name="f1_nmProp" type="float" min="0" max="100" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f1_nmVal" type="float" min="0" max="100" default="0.05"/>
-		<element name="f1_nmWei" type="float" min="0" max="100" default="1"/>
-		<element name="f1_smComma" type="float" min="0" max="100" default="0.02"/>
-		<element name="f1_smJunct" type="float" min="0" max="100" default="0.02"/>
-		<element name="f1_smModif" type="float" min="0" max="100" default="0.1">
-			<description><![CDATA[Modifiers: RrLlAaCcFfMmSsIiQqWwEe]]></description>
-		</element>
-		<element name="f1_smX" type="float" min="0" max="100" default="0.05"/>
-		<element name="f1_xo_propor" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[Cross over (exchange) corresponding segments of the two parent genotypes?
-
-f1 uses a two-point crossing over.
-If this option is turned on, cut points will be selected proportionally to neural genes.
-Thus, if both parents have the same number of neurons, then this will be preserved in their children.]]></description>
-		</element>
-		<element name="f2_mutAddOper" type="float" min="0" max="1" default="0.4">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutConnElem" type="float" min="0" max="1" default="0.33">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutDelOper" type="float" min="0" max="1" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutHandleOper" type="float" min="0" max="1" default="0.3">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutJointElem" type="float" min="0" max="1" default="0.33">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutNeuroElem" type="float" min="0" max="1" default="0.33">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutPropOper" type="float" min="0" max="1" default="0.2">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutDelIns" type="float" min="0" max="1" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutDelInsLength" type="integer" min="1" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutDelInsPerChar" type="float" min="0" max="1" default="0.05">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutDuplication" type="float" min="0" max="1" default="0.05">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutSubstitution" type="float" min="0" max="1" default="0.6">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutSubstPerChar" type="float" min="0" max="1" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutTranslocation" type="float" min="0" max="1" default="0.15">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_xovCrossingOver" type="float" min="0" max="1" default="0.2">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_xovGeneTransfer" type="float" min="0" max="1" default="0.8">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f4_mut_add" type="float" min="0" max="100" default="50">
-			<description><![CDATA[mutation: probability of adding a node]]></description>
-		</element>
-		<element name="f4_mut_add_conn" type="float" min="0" max="100" default="15">
-			<description><![CDATA[add node mutation: probability of adding a neural connection]]></description>
-		</element>
-		<element name="f4_mut_add_div" type="float" min="0" max="100" default="20">
-			<description><![CDATA[add node mutation: probability of adding a division]]></description>
-		</element>
-		<element name="f4_mut_add_neupar" type="float" min="0" max="100" default="5">
-			<description><![CDATA[add node mutation: probability of adding a neuron property/modifier]]></description>
-		</element>
-		<element name="f4_mut_add_rep" type="float" min="0" max="100" default="10">
-			<description><![CDATA[add node mutation: probability of adding a repetition]]></description>
-		</element>
-		<element name="f4_mut_add_simp" type="float" min="0" max="100" default="50">
-			<description><![CDATA[add node mutation: probability of adding a random, simple gene]]></description>
-		</element>
-		<element name="f4_mut_del" type="float" min="0" max="100" default="20">
-			<description><![CDATA[mutation: probability of deleting a node]]></description>
-		</element>
-		<element name="f4_mut_mod" type="float" min="0" max="100" default="30">
-			<description><![CDATA[mutation: probability of changing a node]]></description>
-		</element>
-		<element name="gen_extmutinfo" type="integer" min="0" max="2" default="0">
-			<description><![CDATA[If active, information about employed mutation method will be stored in the 'info' field of each mutated genotype.]]></description>
+		<element name="gen_hist" type="integer" min="0" max="1" default="0" flags="2">
+			<description><![CDATA[Required for phylogenetic analysis]]></description>
 		</element>
 		<element name="gen_hilite" type="integer" min="0" max="1" default="1">
@@ -1020,20 +960,73 @@
 (slows down viewing/editing of huge genotypes)]]></description>
 		</element>
-		<element name="gen_hist" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[Required for phylogenetic analysis]]></description>
-		</element>
-		<element name="genoper_f0" type="integer" min="0" max="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genoper_f1" type="integer" min="0" max="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genoper_f2" type="integer" min="0" max="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genoper_f3" type="integer" min="0" max="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genoper_f4" type="integer" min="0" max="0">
+		<element name="gen_extmutinfo" type="integer" min="0" max="2" default="0">
+			<description><![CDATA[If active, information about employed mutation method will be stored in the 'info' field of each mutated genotype.]]></description>
+		</element>
+		<element name="operReport" function="true" type="void" flags="2">
+			<description><![CDATA[Show available genetic operators]]></description>
+<arguments/></element>
+		<element name="toHTML" function="true" type="string" flags="2">
+			<description><![CDATA[returns genotype expressed as colored HTML]]></description>
+			<arguments>
+				<argument type="string"/>
+			</arguments>
+		</element>
+		<element name="toHTMLshort" function="true" type="string" flags="2">
+			<description><![CDATA[returns genotype (abbreviated if needed) expressed as colored HTML]]></description>
+			<arguments>
+				<argument type="string"/>
+			</arguments>
+		</element>
+		<element name="validate" function="true" type="Geno" flags="34">
+			<description><![CDATA[returns validated (if possible) Geno object from supplied Geno]]></description>
+			<arguments>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="mutate" function="true" type="Geno" flags="34">
+			<description><![CDATA[returns mutated Geno object from supplied Geno]]></description>
+			<arguments>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="crossOver" function="true" type="Geno" flags="34">
+			<description><![CDATA[returns crossed over genotype]]></description>
+			<arguments>
+				<argument type="Geno"/>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="getSimplest" function="true" type="Geno" flags="34">
+			<description><![CDATA[returns the simplest genotype for a given encoding (format). 0 means f0, 4 means f4, etc.]]></description>
+			<arguments>
+				<argument name="format" type="integer"/>
+			</arguments>
+		</element>
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
+		<element name="genoper_f0" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f1" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f2" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f3" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f4" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f9" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_fF" type="integer" min="0" max="0" flags="65">
 			<description><![CDATA[]]></description>
 		</element>
@@ -1105,5 +1098,5 @@
 ]]></description>
 		</element>
-		<element name="neuadd_*" type="integer" min="0" max="1">
+		<element name="neuadd_Constant" type="integer" min="0" max="1">
 			<description><![CDATA[Constant value
 
@@ -1114,5 +1107,5 @@
 ]]></description>
 		</element>
-		<element name="neuadd_|" type="integer" min="0" max="1">
+		<element name="neuadd_Bend_muscle" type="integer" min="0" max="1">
 			<description><![CDATA[Characteristics:
    uses single input
@@ -1125,5 +1118,5 @@
    bending range (r) float 0..1]]></description>
 		</element>
-		<element name="neuadd_@" type="integer" min="0" max="1">
+		<element name="neuadd_Rotation_muscle" type="integer" min="0" max="1">
 			<description><![CDATA[Characteristics:
    uses single input
@@ -1284,86 +1277,228 @@
    time (t) float 0..6.28319]]></description>
 		</element>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="crossOver" function="true" type="Geno">
-			<description><![CDATA[returns crossed over genotype]]></description>
-			<arguments>
-				<argument type="Geno"/>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="getSimplest" function="true" type="Geno">
-			<description><![CDATA[returns the simplest genotype for a given encoding (format). 0 means f0, 4 means f4, etc.]]></description>
-			<arguments>
-				<argument name="format" type="integer"/>
-			</arguments>
-		</element>
-		<element name="mutate" function="true" type="Geno">
-			<description><![CDATA[returns mutated Geno object from supplied Geno]]></description>
-			<arguments>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="operReport" function="true" type="void">
-			<description><![CDATA[Show available genetic operators]]></description>
-<arguments/></element>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
-		<element name="toHTML" function="true" type="string">
-			<description><![CDATA[returns genotype expressed as colored HTML]]></description>
-			<arguments>
-				<argument type="string"/>
-			</arguments>
-		</element>
-		<element name="toHTMLshort" function="true" type="string">
-			<description><![CDATA[returns genotype (abbreviated if needed) expressed as colored HTML]]></description>
-			<arguments>
-				<argument type="string"/>
-			</arguments>
-		</element>
-		<element name="validate" function="true" type="Geno">
-			<description><![CDATA[returns validated (if possible) Geno object from supplied Geno]]></description>
-			<arguments>
-				<argument type="Geno"/>
-			</arguments>
+		<element name="f0_nodel_tag" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[You can tag elements using their 'i' field and the i="mi=d" tag.
+Mutations will not delete such elements.
+The i="mi=dm" combination is allowed.]]></description>
+		</element>
+		<element name="f0_nomod_tag" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[You can tag elements using their 'i' field and the i="mi=m" tag.
+Mutations will not modify properties of such elements.
+The i="mi=md" combination is allowed.]]></description>
+		</element>
+		<element name="f0_p_new" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_del" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_swp" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_pos" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_mas" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_frc" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_ing" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_asm" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_vsiz" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_new" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_del" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_stm" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_stf" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_rsf" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_vred" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_vgrn" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_vblu" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_n_new" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_n_del" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_n_prp" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_c_new" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_c_del" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_c_wei" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f1_xo_propor" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[Cross over (exchange) corresponding segments of the two parent genotypes?
+
+f1 uses a two-point crossing over.
+If this option is turned on, cut points will be selected proportionally to neural genes.
+Thus, if both parents have the same number of neurons, then this will be preserved in their children.]]></description>
+		</element>
+		<element name="f1_smX" type="float" min="0" max="100" default="0.05"/>
+		<element name="f1_smJunct" type="float" min="0" max="100" default="0.02"/>
+		<element name="f1_smComma" type="float" min="0" max="100" default="0.02"/>
+		<element name="f1_smModif" type="float" min="0" max="100" default="0.1">
+			<description><![CDATA[Modifiers: LlRrCcQqFfMmIiWwEeAaSsDdGgBbHh]]></description>
+		</element>
+		<element name="f1_mut_exmod" type="string" max="30">
+			<description><![CDATA[Modifiers that will not be added nor deleted during mutation
+(all: LlRrCcQqFfMmIiWwEeAaSsDdGgBbHh)]]></description>
+		</element>
+		<element name="f1_nmNeu" type="float" min="0" max="100" default="0.05">
+			<description><![CDATA[Adds a (connected) neuron or removes a neuron]]></description>
+		</element>
+		<element name="f1_nmConn" type="float" min="0" max="100" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f1_nmProp" type="float" min="0" max="100" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f1_nmWei" type="float" min="0" max="100" default="1.0"/>
+		<element name="f1_nmVal" type="float" min="0" max="100" default="0.05"/>
+		<element name="f2_mutAddOper" type="float" min="0" max="1" default="0.4">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutJointElem" type="float" min="0" max="1" default="0.33">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutNeuroElem" type="float" min="0" max="1" default="0.33">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutConnElem" type="float" min="0" max="1" default="0.33">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutDelOper" type="float" min="0" max="1" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutHandleOper" type="float" min="0" max="1" default="0.3">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutPropOper" type="float" min="0" max="1" default="0.2">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutSubstitution" type="float" min="0" max="1" default="0.6">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutSubstPerChar" type="float" min="0" max="1" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutDelIns" type="float" min="0" max="1" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutDelInsPerChar" type="float" min="0" max="1" default="0.05">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutDelInsLength" type="integer" min="1" max="100" default="5">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutDuplication" type="float" min="0" max="1" default="0.05">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutTranslocation" type="float" min="0" max="1" default="0.15">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_xovGeneTransfer" type="float" min="0" max="1" default="0.8">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_xovCrossingOver" type="float" min="0" max="1" default="0.2">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f4_mut_add" type="float" min="0" max="100" default="50.0">
+			<description><![CDATA[mutation: probability of adding a node]]></description>
+		</element>
+		<element name="f4_mut_add_div" type="float" min="0" max="100" default="20.0">
+			<description><![CDATA[add node mutation: probability of adding a division]]></description>
+		</element>
+		<element name="f4_mut_add_conn" type="float" min="0" max="100" default="15.0">
+			<description><![CDATA[add node mutation: probability of adding a neural connection]]></description>
+		</element>
+		<element name="f4_mut_add_neupar" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[add node mutation: probability of adding a neuron property/modifier]]></description>
+		</element>
+		<element name="f4_mut_add_rep" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[add node mutation: probability of adding a repetition]]></description>
+		</element>
+		<element name="f4_mut_add_simp" type="float" min="0" max="100" default="50.0">
+			<description><![CDATA[add node mutation: probability of adding a random, simple gene]]></description>
+		</element>
+		<element name="f4_mut_del" type="float" min="0" max="100" default="20.0">
+			<description><![CDATA[mutation: probability of deleting a node]]></description>
+		</element>
+		<element name="f4_mut_mod" type="float" min="0" max="100" default="30.0">
+			<description><![CDATA[mutation: probability of changing a node]]></description>
+		</element>
+		<element name="f9_mut" type="float" min="0" max="1" default="0.1">
+			<description><![CDATA[How many genes should be mutated during single mutation (1=all genes, 0.1=ten percent)]]></description>
+		</element>
+		<element name="fF_xover" type="float" min="0" max="0.5" default="0.5">
+			<description><![CDATA[0.5 => children are averaged parents.
+0.2 => children are only 20% different from parents.
+0 => each child is identical to one parent (no crossover).]]></description>
 		</element>
 	</type>
 	<type name="GenManStats" context="Global context">
 <description><![CDATA[Statistics for genetic operations.]]></description>
-		<element name="gen_count" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="gen_mfailed" type="integer">
+		<element name="gen_count" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_mvalid" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_mvalidated" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_minvalid" type="integer" flags="1">
+			<description><![CDATA[couldn't be repaired]]></description>
+		</element>
+		<element name="gen_mfailed" type="integer" flags="1">
 			<description><![CDATA[couldn't be performed]]></description>
 		</element>
-		<element name="gen_minvalid" type="integer">
+		<element name="gen_xovalid" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_xovalidated" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_xoinvalid" type="integer" flags="1">
 			<description><![CDATA[couldn't be repaired]]></description>
 		</element>
-		<element name="gen_mutimpr" type="float">
+		<element name="gen_xofailed" type="integer" flags="1">
+			<description><![CDATA[couldn't be performed]]></description>
+		</element>
+		<element name="gen_mutimpr" type="float" flags="1">
 			<description><![CDATA[total cumulative mutation change]]></description>
 		</element>
-		<element name="gen_mvalid" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="gen_mvalidated" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="gen_xofailed" type="integer">
-			<description><![CDATA[couldn't be performed]]></description>
-		</element>
-		<element name="gen_xoimpr" type="float">
+		<element name="gen_xoimpr" type="float" flags="1">
 			<description><![CDATA[total cumulative crossover change]]></description>
 		</element>
-		<element name="gen_xoinvalid" type="integer">
-			<description><![CDATA[couldn't be repaired]]></description>
-		</element>
-		<element name="gen_xovalid" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="gen_xovalidated" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="clrstats" function="true" type="void">
+		<element name="clrstats" function="true" type="void" flags="2">
 			<description><![CDATA[]]></description>
 <arguments/></element>
@@ -1372,26 +1507,39 @@
 <description><![CDATA[All information about a single genotype.
 This is a genetics-only object which does not contain any performance data. See also: Genotype class]]></description>
-		<element name="autoname" type="string"/>
-		<element name="f0genotype" type="string">
+		<element name="name" type="string" max="40" flags="256"/>
+		<element name="rawgenotype" type="string" flags="257">
+			<description><![CDATA[Genotype, excluding the format specifier]]></description>
+		</element>
+		<element name="info" type="string" flags="256">
+			<description><![CDATA[Additional information or comments]]></description>
+		</element>
+		<element name="format" type="integer" flags="257">
+			<description><![CDATA[Genotype format]]></description>
+		</element>
+		<element name="genotype" type="string" flags="257">
+			<description><![CDATA[Genes as a string of characters]]></description>
+		</element>
+		<element name="isValid" type="integer" min="0" max="1" deprecated="true" flags="8449">
+			<description><![CDATA[Use 'is_valid' instead of 'isValid'.]]></description>
+		</element>
+		<element name="is_valid" type="integer" min="-1" max="1" default="-1" flags="256">
+			<description><![CDATA[0 = invalid genotype
+1 = valid genotype
+-1 = validity is not known. This is a transient state. The value of "is_valid" will never be -1 when read. It is safe to treat is_valid as boolean in statements like "if (g.is_valid) ...". Setting "is_valid=-1" will make it 0 or 1 again. This third state (-1) is only needed for loading Genotype objects from files where the "is_valid" field might not be present.]]></description>
+		</element>
+		<element name="getConverted" function="true" type="Geno" flags="256">
+			<arguments>
+				<argument name="format" type="integer"/>
+			</arguments>
+		</element>
+		<element name="f0genotype" type="string" flags="257">
 			<description><![CDATA[converted to f0 genotype]]></description>
 		</element>
-		<element name="format" type="integer">
-			<description><![CDATA[Genotype format]]></description>
-		</element>
-		<element name="genotype" type="string"/>
-		<element name="info" type="string">
-			<description><![CDATA[Additional information or comments]]></description>
-		</element>
-		<element name="isValid" type="integer" min="0" max="1"/>
-		<element name="name" type="string"/>
-		<element name="rawgenotype" type="string">
-			<description><![CDATA[Genotype, excluding the format specifier]]></description>
-		</element>
-		<element name="getConverted" function="true" type="Geno">
-			<arguments>
-				<argument name="format" type="integer"/>
-			</arguments>
-		</element>
 		<element name="new" function="true" type="Geno"><arguments/></element>
+		<element name="newFromString" function="true" type="Geno">
+			<arguments>
+				<argument name="genotype" type="string"/>
+			</arguments>
+		</element>
 		<element name="newFrom" function="true" type="Geno">
 			<arguments>
@@ -1402,140 +1550,191 @@
 			</arguments>
 		</element>
-		<element name="newFromString" function="true" type="Geno">
-			<arguments>
-				<argument name="genotype" type="string"/>
+		<element name="autoname" type="string" flags="257"/>
+		<element name="toVector" type="Vector" flags="257"/>
+		<element name="newFromVector" function="true" type="Geno">
+			<arguments>
+				<argument type="Vector"/>
 			</arguments>
 		</element>
 	</type>
 	<type name="Genotype" context="Global context">
-<description><![CDATA[A Genotype with the associated performance information. All but one Genotype objects are placed in Genotype Groups. There is also a single static Genotype object not associated with a group, which is used as a temporary storage by genetic operators and some functions from GenePools.]]></description>
-		<element name="convtrace1" type="string"/>
-		<element name="distance" type="float"/>
-		<element name="energ0" type="float"/>
-		<element name="f0genotype" type="string">
-			<description><![CDATA[converted to f0 genotype]]></description>
-		</element>
-		<element name="fit" type="float"/>
-		<element name="fit2" type="float">
-			<description><![CDATA[Fitness shifted by (avg-n*stddev)]]></description>
-		</element>
-		<element name="geno" type="Geno">
-			<description><![CDATA[Geno object for this Genotype]]></description>
-		</element>
-		<element name="genotype" type="string"/>
-		<element name="gnum" type="integer"/>
+<description><![CDATA[A Genotype with the associated performance information. Adding genotypes to GenePool makes them accessible in Framsticks GUI and enables the use of GenePool selection methods.
+Before version 4.0rc4 the static Genotype object was used in functions operating on the "selected" genotype. This is now deprecated as all operations can be performed using the more convenient direct access (see GenePools).]]></description>
+		<element name="name" type="string" max="40"/>
+		<element name="genotype" type="string">
+			<description><![CDATA[Genes as a string of characters]]></description>
+		</element>
 		<element name="info" type="string">
 			<description><![CDATA[Additional information or comments]]></description>
 		</element>
+		<element name="simi" type="float" flags="3">
+			<description><![CDATA[Read about details:
+http://www.framsticks.com/node/795
+http://www.framsticks.com/node/890]]></description>
+		</element>
+		<element name="energ0" type="float" deprecated="true" flags="8227"/>
+		<element name="energy0" type="float" min="0" max="-1" default="0.0" flags="16"/>
+		<element name="strsiz" type="integer" deprecated="true" flags="8227"/>
+		<element name="strjoints" type="integer" deprecated="true" flags="8227"/>
+		<element name="nnsiz" type="integer" deprecated="true" flags="8227"/>
+		<element name="nncon" type="integer" deprecated="true" flags="8227"/>
+		<element name="numparts" type="integer" flags="16"/>
+		<element name="numjoints" type="integer" flags="16"/>
+		<element name="numneurons" type="integer" flags="16"/>
+		<element name="numconnections" type="integer" flags="16"/>
+		<element name="num" type="integer"/>
+		<element name="gnum" type="integer"/>
+		<element name="popsiz" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Please use 'instances' instead of 'popsiz'.]]></description>
+		</element>
 		<element name="instances" type="integer">
 			<description><![CDATA[Copies of this genotype]]></description>
 		</element>
-		<element name="isValid" type="integer" min="0" max="1"/>
 		<element name="lifespan" type="float">
 			<description><![CDATA[Average life span]]></description>
 		</element>
-		<element name="name" type="string"/>
-		<element name="nncon" type="float"/>
-		<element name="nnsiz" type="float"/>
-		<element name="num" type="integer"/>
-		<element name="numconnections" type="float"/>
-		<element name="numjoints" type="float"/>
-		<element name="numneurons" type="float"/>
-		<element name="numparts" type="float"/>
-		<element name="popsiz" type="integer"/>
-		<element name="simi" type="float"/>
-		<element name="strjoints" type="float"/>
-		<element name="strsiz" type="float"/>
-		<element name="uid" type="string">
-			<description><![CDATA[Unique identifier]]></description>
-		</element>
+		<element name="velocity" type="float">
+			<description><![CDATA[Average velocity]]></description>
+		</element>
+		<element name="distance" type="float"/>
+		<element name="vertvel" type="float"/>
+		<element name="vertpos" type="float"/>
+		<element name="fit" type="float" flags="3"/>
+		<element name="fit2" type="float" flags="3">
+			<description><![CDATA[Fitness shifted by (avg-n*stddev)]]></description>
+		</element>
+		<element name="f0genotype" type="string" flags="3">
+			<description><![CDATA[converted to f0 genotype]]></description>
+		</element>
+		<element name="convtrace1" type="string" flags="3"/>
 		<element name="user1" type="untyped"/>
 		<element name="user2" type="untyped"/>
 		<element name="user3" type="untyped"/>
-		<element name="velocity" type="float">
-			<description><![CDATA[Average velocity]]></description>
-		</element>
-		<element name="vertpos" type="float"/>
-		<element name="vertvel" type="float"/>
-		<element name="getModel" function="true" type="Model"><arguments/></element>
-		<element name="getNormalized" function="true" type="float">
+		<element name="mutate" function="true" type="void"><arguments/></element>
+		<element name="isValid" type="integer" min="0" max="1" deprecated="true" flags="8227">
+			<description><![CDATA[Use 'is_valid' instead of 'isValid'.]]></description>
+		</element>
+		<element name="is_valid" type="integer" min="-1" max="1" default="-1" flags="32">
+			<description><![CDATA[0 = invalid genotype
+1 = valid genotype
+-1 = validity is not known. This is a transient state. The value of "is_valid" will never be -1 when read. It is safe to treat is_valid as boolean in statements like "if (g.is_valid) ...". Setting "is_valid=-1" will make it 0 or 1 again. This third state (-1) is only needed for loading Genotype objects from files where the "is_valid" field might not be present.]]></description>
+		</element>
+		<element name="getNormalized" function="true" type="float" flags="35">
 			<arguments>
 				<argument name="property name or index" type="untyped"/>
 			</arguments>
 		</element>
-		<element name="mutate" function="true" type="void"><arguments/></element>
-	</type>
-	<type name="GenotypeGroup" context="Global context">
-<description><![CDATA[The static GenePool object refers to the "selected group" as described in GenePools.]]></description>
-		<element name="fitfun" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[Enables fitness scaling.]]></description>
-		</element>
-		<element name="fitm" type="float" min="0" max="10" default="2">
-			<description><![CDATA[Lower threshold: how many standard deviations below average?
-(avg - n * stddev) - used for fitness shifting]]></description>
-		</element>
-		<element name="fitma" type="float" min="1" max="10" default="2">
-			<description><![CDATA[The best genotype is as many times
-better than the average one.]]></description>
-		</element>
-		<element name="fitness" type="string">
-			<description><![CDATA[(intended for advanced users)]]></description>
-		</element>
-		<element name="index" type="integer"/>
-		<element name="name" type="string"/>
-		<element name="size" type="integer">
-			<description><![CDATA[In standard.expdef, this is equivalent to the number of unique genotypes. Standard experiment definition uses the Genotype.instances field to indicate that some genotypes exist in multiple instances despite having only one item in the group. Other experiment definitions may create multiple copies of the same genotype.]]></description>
-		</element>
-		<element name="totalpop" type="integer">
-			<description><![CDATA[Takes into account the Genotype.instances field (which may give the total number of instances depending on the experiment definition).]]></description>
-		</element>
-		<element name="addGeno" function="true" type="Genotype">
-			<description><![CDATA[Creates a new Genotype from the supplied Geno object.
-Returns the created Genotype.]]></description>
-			<arguments>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="delete" function="true" type="void">
-			<description><![CDATA[Deletes a genotype.]]></description>
-			<arguments>
-				<argument name="genotype index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="findGeno" function="true" type="integer">
-			<description><![CDATA[Finds the Genotype matching the supplied Geno object.
-returns genotype index or -1 if not found.]]></description>
-			<arguments>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="findUID" function="true" type="integer">
-			<arguments>
-				<argument name="uid" type="string"/>
-			</arguments>
-		</element>
-		<element name="get" function="true" type="Genotype">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
+		<element name="geno" type="Geno" flags="35">
+			<description><![CDATA[A Geno object for this Genotype]]></description>
+		</element>
+		<element name="uid" type="string" flags="33">
+			<description><![CDATA[Unique identifier]]></description>
+		</element>
+		<element name="getModel" function="true" type="Model" flags="35"><arguments/></element>
+		<element name="splitInstances" function="true" type="void" flags="32"><arguments/></element>
+		<element name="newFromString" function="true" type="Genotype" flags="32">
+			<arguments>
+				<argument name="genotype" type="string"/>
+			</arguments>
+		</element>
+		<element name="newFromGeno" function="true" type="Genotype" flags="32">
+			<arguments>
+				<argument name="geno" type="Geno"/>
+			</arguments>
+		</element>
+		<element name="newFromCreature" function="true" type="Genotype" flags="32">
+			<arguments>
+				<argument name="creature" type="Creature"/>
+			</arguments>
+		</element>
+		<element name="addPerformanceFromCreature" function="true" type="void" flags="34">
+			<description><![CDATA[Updates the Genotype's performance values merging them with the supplied Creture's performance. It assumes the Genotype.instances has a reasonable value and performs the proper weighting. Use your own function instead if these conditions are not met in your experiment.]]></description>
+			<arguments>
+				<argument type="Creature"/>
+			</arguments>
+		</element>
+		<element name="moveTo" function="true" type="void" flags="32">
+			<description><![CDATA[the genotype is removed from its current pool when pool=null]]></description>
+			<arguments>
+				<argument name="pool" type="GenePool"/>
+			</arguments>
+		</element>
+		<element name="copyTo" function="true" type="Genotype" flags="32">
+			<description><![CDATA[returns the duplicate genotype, created in the target pool]]></description>
+			<arguments>
+				<argument name="pool" type="GenePool"/>
+			</arguments>
+		</element>
+		<element name="delete" function="true" type="void" flags="32"><arguments/></element>
+		<element name="deleteOne" function="true" type="void" flags="32">
+			<description><![CDATA[]]></description>
+<arguments/></element>
+		<element name="genepool" type="untyped" flags="35">
+			<description><![CDATA[GenePool object or null when not in pool]]></description>
+		</element>
+		<element name="index" type="integer" flags="35">
+			<description><![CDATA[-1 when not in pool.
+Note that the index changes depending on the current genotype position in the pool. Use Genotype.uid if you need a permanent identifier that persists through the entire object lifetime.]]></description>
+		</element>
+		<element name="beforeLoad" function="true" type="void" flags="32"><arguments/></element>
+		<element name="afterLoad" function="true" type="void" flags="32"><arguments/></element>
 	</type>
 	<type name="Interface" context="Global context">
 <description><![CDATA[Used to query for object member descriptions. Example:
 var iface=Interface.makeFrom(someobject); var description="this object has "+iface.properties+" properties, first property is "+iface.getId(0);]]></description>
-		<element name="groups" type="integer"/>
-		<element name="name" type="string"/>
-		<element name="properties" type="integer"/>
-		<element name="findGroupId" function="true" type="integer">
+		<element name="name" type="string" flags="257"/>
+		<element name="properties" type="integer" flags="257"/>
+		<element name="groups" type="integer" flags="257"/>
+		<element name="get" function="true" type="untyped" flags="256">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getId" function="true" type="string" flags="256">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getName" function="true" type="string" flags="256">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getGroup" function="true" type="integer" flags="256">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getGroupName" function="true" type="string" flags="256">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getType" function="true" type="string" flags="256">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getFlags" function="true" type="integer" flags="256">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getHelp" function="true" type="string" flags="256">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="findId" function="true" type="integer" flags="256">
 			<arguments>
 				<argument name="name" type="string"/>
 			</arguments>
 		</element>
-		<element name="findId" function="true" type="integer">
+		<element name="findGroupId" function="true" type="integer" flags="256">
 			<arguments>
 				<argument name="name" type="string"/>
 			</arguments>
 		</element>
-		<element name="findIdInGroup" function="true" type="integer">
+		<element name="findIdInGroup" function="true" type="integer" flags="256">
 			<arguments>
 				<argument name="name" type="string"/>
@@ -1543,45 +1742,22 @@
 			</arguments>
 		</element>
-		<element name="get" function="true" type="untyped">
+		<element name="makeFrom" function="true" type="Interface" flags="2">
+			<arguments>
+				<argument type="Object"/>
+			</arguments>
+		</element>
+		<element name="set" function="true" type="void" flags="256">
 			<arguments>
 				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getFlags" function="true" type="integer">
+				<argument name="value" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="setDefault" function="true" type="void" flags="256">
 			<arguments>
 				<argument name="index" type="integer"/>
 			</arguments>
 		</element>
-		<element name="getGroup" function="true" type="integer">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getGroupName" function="true" type="string">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getHelp" function="true" type="string">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getId" function="true" type="string">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getName" function="true" type="string">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getType" function="true" type="string">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="invoke" function="true" type="void">
+		<element name="setAllDefault" function="true" type="void" flags="256"><arguments/></element>
+		<element name="invoke" function="true" type="void" flags="256">
 			<arguments>
 				<argument name="function name or index" type="untyped"/>
@@ -1589,216 +1765,217 @@
 			</arguments>
 		</element>
-		<element name="makeFrom" function="true" type="Interface">
+	</type>
+	<type name="Joint" context="Global context">
+		<element name="p1" type="integer" min="-1" max="999999" default="-1" flags="1024"/>
+		<element name="p2" type="integer" min="-1" max="999999" default="-1" flags="1024"/>
+		<element name="rx" type="float"/>
+		<element name="ry" type="float" flags="1024"/>
+		<element name="rz" type="float" flags="1024"/>
+		<element name="dx" type="float" min="-2" max="2" default="0.0"/>
+		<element name="dy" type="float" min="-2" max="2" default="0.0" flags="1024"/>
+		<element name="dz" type="float" min="-2" max="2" default="0.0" flags="1024"/>
+		<element name="sh" type="integer" min="0" max="1" default="0"/>
+		<element name="stif" type="float" min="0" max="1" default="1.0"/>
+		<element name="rotstif" type="float" min="0" max="1" default="1.0"/>
+		<element name="stam" type="float" min="0" max="1" default="0.25"/>
+		<element name="i" type="string"/>
+		<element name="Vstyle" type="string" max="-1" default="joint"/>
+		<element name="vr" type="float" min="0" max="1" default="0.5"/>
+		<element name="vg" type="float" min="0" max="1" default="0.5" flags="1024"/>
+		<element name="vb" type="float" min="0" max="1" default="0.5" flags="1024"/>
+	</type>
+	<type name="Loader" context="Global context">
+<description><![CDATA[Support for loading files in the Framsticks format. Used in the experiment definition to retrieve experiment state (see OnExpLoad function in standard.expdef). Registered objects (addClass) are handled automaticaly. Loader can call user functions defined by setBreakLabel.]]></description>
+		<element name="addClass" function="true" type="void" flags="32">
 			<arguments>
 				<argument type="Object"/>
 			</arguments>
 		</element>
-		<element name="set" function="true" type="void">
-			<arguments>
-				<argument name="index" type="integer"/>
-				<argument name="value" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="setAllDefault" function="true" type="void"><arguments/></element>
-		<element name="setDefault" function="true" type="void">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="Joint" context="Global context">
-		<element name="dx" type="float" min="-2" max="2" default="0"/>
-		<element name="dy" type="float" min="-2" max="2" default="0"/>
-		<element name="dz" type="float" min="-2" max="2" default="0"/>
-		<element name="i" type="string"/>
-		<element name="p1" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="p2" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="rotstif" type="float" min="0" max="1" default="1"/>
+		<element name="removeClass" function="true" type="void" flags="32">
+			<arguments>
+				<argument type="Object"/>
+			</arguments>
+		</element>
+		<element name="clearClasses" function="true" type="void" flags="32"><arguments/></element>
+		<element name="go" function="true" type="integer" flags="32"><arguments/></element>
+		<element name="run" function="true" type="integer" flags="32"><arguments/></element>
+		<element name="status" type="integer" flags="1"/>
+		<element name="comment" type="string" flags="1"/>
+		<element name="setBreak" function="true" type="void" flags="32">
+			<arguments>
+				<argument name="break conditions" type="integer"/>
+			</arguments>
+		</element>
+		<element name="setBreakLabel" function="true" type="void" flags="32">
+			<arguments>
+				<argument name="break condition" type="integer"/>
+				<argument name="label" type="string"/>
+			</arguments>
+		</element>
+		<element name="abort" function="true" type="void" flags="32"><arguments/></element>
+		<element name="currentObject" type="Object" flags="32"/>
+		<element name="objectName" type="string" flags="32"/>
+		<element name="loadObject" function="true" type="void" flags="32"><arguments/></element>
+		<element name="skipObject" function="true" type="void" flags="32"><arguments/></element>
+		<element name="firstComment" type="integer" min="0" max="1" flags="1"/>
+		<element name="BeforeObject" type="integer" flags="1"/>
+		<element name="AfterObject" type="integer" flags="1"/>
+		<element name="BeforeUnknown" type="integer" flags="1"/>
+		<element name="OnComment" type="integer" flags="1"/>
+		<element name="OnError" type="integer" flags="1"/>
+	</type>
+	<type name="Math" context="Global context">
+<description><![CDATA[Mathematical functions library.]]></description>
+		<element name="pi" type="float" flags="1"/>
+		<element name="twopi" type="float" flags="1"/>
+		<element name="pi2" type="float" flags="1"/>
+		<element name="pi4" type="float" flags="1"/>
+		<element name="random" function="true" type="integer" flags="1">
+			<description><![CDATA[0..num-1]]></description>
+			<arguments>
+				<argument name="num" type="integer"/>
+			</arguments>
+		</element>
+		<element name="rnd01" type="float" flags="1"/>
+		<element name="rndUni" function="true" type="float" flags="1">
+			<description><![CDATA[[begin..end)]]></description>
+			<arguments>
+				<argument name="begin" type="float"/>
+				<argument name="end" type="float"/>
+			</arguments>
+		</element>
+		<element name="rndGaussStd" type="float" flags="1"/>
+		<element name="rndGauss" function="true" type="float" flags="1">
+			<description><![CDATA[rndGaussStd is rndGauss(0,1)]]></description>
+			<arguments>
+				<argument name="mean" type="float"/>
+				<argument name="standard deviation" type="float"/>
+			</arguments>
+		</element>
+		<element name="rndCustom" function="true" type="float" flags="1">
+			<description><![CDATA[the parameter describes the desired random distribution, being a sum of uniform distributions, eg. rndCustom([-10,-1, -1,1, 1,10]) defines 3 uniform distribution intervals [-1,10) [-1,1), [1,10)]]></description>
+			<arguments>
+				<argument type="Vector"/>
+			</arguments>
+		</element>
+		<element name="seed" type="integer">
+			<description><![CDATA[Random number generator seed.
+Note: Math.seed influences all further random activity in the simulator, not just the results of functions in this class.
+Note #2: When read, the value behaves just like a regular variable that stores the previously assigned value. It does NOT reflect the internal random generator seed that changes every time a random number has been generated.]]></description>
+		</element>
+		<element name="randomize" function="true">
+			<description><![CDATA[Set random seed for the random number generator.]]></description>
+		</element>
+		<element name="time" type="float" flags="1">
+			<description><![CDATA[Number of seconds since the Epoch (00:00:00 UTC/GMT, January 1, 1970)]]></description>
+		</element>
+		<element name="abs" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="sign" function="true" type="integer">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="sin" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="cos" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="asin" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="acos" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="atan" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="atan2" function="true" type="float">
+			<arguments>
+				<argument name="y" type="float"/>
+				<argument name="x" type="float"/>
+			</arguments>
+		</element>
+		<element name="pow" function="true" type="float">
+			<arguments>
+				<argument name="a" type="float"/>
+				<argument name="b" type="float"/>
+			</arguments>
+		</element>
+		<element name="exp" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="log" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="sqrt" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="sigmoid" function="true" type="float">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="min" function="true" type="untyped">
+			<arguments>
+				<argument type="untyped"/>
+				<argument type="untyped"/>
+			</arguments>
+		</element>
+		<element name="max" function="true" type="untyped">
+			<arguments>
+				<argument type="untyped"/>
+				<argument type="untyped"/>
+			</arguments>
+		</element>
+	</type>
+	<type name="MechJoint" context="Global context">
 		<element name="rx" type="float"/>
 		<element name="ry" type="float"/>
 		<element name="rz" type="float"/>
-		<element name="stam" type="float" min="0" max="1" default="0.25"/>
-		<element name="stif" type="float" min="0" max="1" default="1"/>
-		<element name="Vstyle" type="string"/>
-	</type>
-	<type name="Loader" context="Global context">
-<description><![CDATA[Support for loading files in the Framsticks format. Used in the experiment definition to retrieve experiment state (see OnExpLoad function in standard.expdef). Registered objects (addClass) are handled automaticaly. Loader can call user functions defined by setBreakLabel.]]></description>
-		<element name="AfterObject" type="integer"/>
-		<element name="BeforeObject" type="integer"/>
-		<element name="BeforeUnknown" type="integer"/>
-		<element name="comment" type="string"/>
-		<element name="currentObject" type="Object"/>
-		<element name="firstComment" type="integer" min="0" max="1"/>
-		<element name="objectName" type="string"/>
-		<element name="OnComment" type="integer"/>
-		<element name="OnError" type="integer"/>
-		<element name="status" type="integer"/>
-		<element name="abort" function="true" type="void"><arguments/></element>
-		<element name="addClass" function="true" type="void">
-			<arguments>
-				<argument type="Object"/>
-			</arguments>
-		</element>
-		<element name="clearClasses" function="true" type="void"><arguments/></element>
-		<element name="go" function="true" type="integer"><arguments/></element>
-		<element name="loadObject" function="true" type="void"><arguments/></element>
-		<element name="removeClass" function="true" type="void">
-			<arguments>
-				<argument type="Object"/>
-			</arguments>
-		</element>
-		<element name="run" function="true" type="integer"><arguments/></element>
-		<element name="setBreak" function="true" type="void">
-			<arguments>
-				<argument name="break conditions" type="integer"/>
-			</arguments>
-		</element>
-		<element name="setBreakLabel" function="true" type="void">
-			<arguments>
-				<argument name="break condition" type="integer"/>
-				<argument name="label" type="string"/>
-			</arguments>
-		</element>
-		<element name="skipObject" function="true" type="void"><arguments/></element>
-	</type>
-	<type name="Math" context="Global context">
-<description><![CDATA[Mathematical functions library.]]></description>
-		<element name="pi" type="float"/>
-		<element name="pi2" type="float"/>
-		<element name="pi4" type="float"/>
-		<element name="rnd01" type="float"/>
-		<element name="rndGaussStd" type="float"/>
-		<element name="seed" type="integer">
-			<description><![CDATA[Random number generator seed.
-Note: Math.seed influences all future random activity in the simulator, not only Math.rnd01 results.]]></description>
-		</element>
-		<element name="time" type="float">
-			<description><![CDATA[Number of seconds since the Epoch (00:00:00 UTC/GMT, January 1, 1970)]]></description>
-		</element>
-		<element name="twopi" type="float"/>
-		<element name="abs" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="acos" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="asin" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="atan" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="atan2" function="true" type="float">
-			<arguments>
-				<argument name="y" type="float"/>
-				<argument name="x" type="float"/>
-			</arguments>
-		</element>
-		<element name="cos" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="exp" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="log" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="max" function="true" type="untyped">
-			<arguments>
-				<argument type="untyped"/>
-				<argument type="untyped"/>
-			</arguments>
-		</element>
-		<element name="min" function="true" type="untyped">
-			<arguments>
-				<argument type="untyped"/>
-				<argument type="untyped"/>
-			</arguments>
-		</element>
-		<element name="pow" function="true" type="float">
-			<arguments>
-				<argument name="a" type="float"/>
-				<argument name="b" type="float"/>
-			</arguments>
-		</element>
-		<element name="random" function="true" type="integer">
-			<description><![CDATA[0..num-1]]></description>
-			<arguments>
-				<argument name="num" type="integer"/>
-			</arguments>
-		</element>
-		<element name="rndCustom" function="true" type="float">
-			<description><![CDATA[the parameter describes the desired random distribution, being a sum of uniform distributions, eg. rndCustom([-10,-1, -1,1, 1,10]) defines 3 uniform distribution intervals [-1,10) [-1,1), [1,10)]]></description>
-			<arguments>
-				<argument type="Vector"/>
-			</arguments>
-		</element>
-		<element name="rndGauss" function="true" type="float">
-			<description><![CDATA[rndGaussStd is rndGauss(0,1)]]></description>
-			<arguments>
-				<argument name="center" type="float"/>
-				<argument name="stdandard deviation" type="float"/>
-			</arguments>
-		</element>
-		<element name="rndUni" function="true" type="float">
-			<description><![CDATA[[begin..end)]]></description>
-			<arguments>
-				<argument name="begin" type="float"/>
-				<argument name="end" type="float"/>
-			</arguments>
-		</element>
-		<element name="sigmoid" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="sign" function="true" type="integer">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="sin" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="sqrt" function="true" type="float">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="MechJoint" context="Global context">
 		<element name="dx" type="float"/>
 		<element name="dy" type="float"/>
 		<element name="dz" type="float"/>
-		<element name="part1" type="MechPart"/>
-		<element name="part2" type="MechPart"/>
+		<element name="stif" type="float"/>
 		<element name="rotstif" type="float"/>
-		<element name="rotstress" type="float"/>
-		<element name="rx" type="float"/>
-		<element name="ry" type="float"/>
-		<element name="rz" type="float"/>
-		<element name="stif" type="float"/>
-		<element name="stress" type="float"/>
+		<element name="part1" type="MechPart" flags="1"/>
+		<element name="part2" type="MechPart" flags="1"/>
+		<element name="stress" type="float" flags="1"/>
+		<element name="rotstress" type="float" flags="1"/>
 	</type>
 	<type name="MechPart" context="Global context">
+		<element name="x" type="float"/>
+		<element name="y" type="float"/>
+		<element name="z" type="float"/>
+		<element name="pos" type="XYZ" flags="1"/>
+		<element name="m" type="float"/>
+		<element name="s" type="float"/>
+		<element name="vol" type="float"/>
 		<element name="fr" type="float"/>
-		<element name="m" type="float"/>
-		<element name="orient" type="Orient"/>
+		<element name="vx" type="float"/>
+		<element name="vy" type="float"/>
+		<element name="vz" type="float"/>
+		<element name="v" type="XYZ" flags="1"/>
+		<element name="orient" type="Orient" flags="1"/>
 		<element name="oxx" type="float"/>
 		<element name="oxy" type="float"/>
@@ -1810,14 +1987,4 @@
 		<element name="ozy" type="float"/>
 		<element name="ozz" type="float"/>
-		<element name="pos" type="XYZ"/>
-		<element name="s" type="float"/>
-		<element name="v" type="XYZ"/>
-		<element name="vol" type="float"/>
-		<element name="vx" type="float"/>
-		<element name="vy" type="float"/>
-		<element name="vz" type="float"/>
-		<element name="x" type="float"/>
-		<element name="y" type="float"/>
-		<element name="z" type="float"/>
 		<element name="applyForce" function="true" type="void">
 			<arguments>
@@ -1829,56 +1996,224 @@
 	</type>
 	<type name="Model" context="Global context">
-		<element name="geno" type="Geno"/>
-		<element name="numconnections" type="integer"/>
-		<element name="numjoints" type="integer"/>
-		<element name="numneurons" type="integer"/>
-		<element name="numparts" type="integer"/>
-		<element name="se" type="float"/>
-		<element name="size_x" type="float">
+		<element name="se" type="float" flags="256"/>
+		<element name="Vstyle" type="string" flags="256"/>
+		<element name="geno" type="Geno" flags="257"/>
+		<element name="newFromString" function="true" type="Model">
+			<arguments>
+				<argument name="genotype" type="string"/>
+			</arguments>
+		</element>
+		<element name="newFromGeno" function="true" type="Model">
+			<arguments>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="numparts" type="integer" flags="259"/>
+		<element name="numjoints" type="integer" flags="259"/>
+		<element name="numneurons" type="integer" flags="259"/>
+		<element name="numconnections" type="integer" flags="259"/>
+		<element name="getPart" function="true" type="Part" flags="288">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getJoint" function="true" type="Joint" flags="288">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getNeuroDef" function="true" type="NeuroDef" flags="288">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="size_x" type="float" flags="257">
 			<description><![CDATA[(size_x,size_y,size_z) are dimensions of the axis-aligned bounding box of the creature, including imaginary Part sizes (Part.s, usually 1.0). A creature consisting of a single default part has the size of (2.0,2.0,2.0) - twice the Part.s value (like a sphere diameter is twice its radius).
 See also: Creature.moveAbs]]></description>
 		</element>
-		<element name="size_y" type="float">
+		<element name="size_y" type="float" flags="257">
 			<description><![CDATA[See Model.size_x]]></description>
 		</element>
-		<element name="size_z" type="float">
+		<element name="size_z" type="float" flags="257">
 			<description><![CDATA[See Model.size_x]]></description>
 		</element>
-		<element name="Vstyle" type="string"/>
-		<element name="getJoint" function="true" type="Joint">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getNeuroDef" function="true" type="NeuroDef">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getPart" function="true" type="Part">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="newFromGeno" function="true" type="Model">
+	</type>
+	<type name="ModelGeometry" context="Global context">
+<description><![CDATA[Example usage:
+Simulator.print(ModelGeometry.forModel(Model.newFromString("//0\np:sh=1\n")).area());
+
+ModelGeometry.geom_density refers to the global simulator parameter (also available in GUI).
+To set geom_density for individual ModelGeometry objects:
+var mg=ModelGeometry.forModel(GenePools[0][0].getModel()); mg.geom_density=2; GenePools[0][0].user1=mg.area();
+]]></description>
+		<element name="geom_density" type="float" min="0.01" max="100" default="1.0">
+			<description><![CDATA[Affects the geometry calculation precision]]></description>
+		</element>
+		<element name="forModel" function="true" type="ModelGeometry" flags="32">
+			<description><![CDATA[The returned ModelGeometry object can be used to calculate geometric properties (volume, area, sizes) of the associated model. The density is copied from the current global ModelGeometry.geom_density on object creation.]]></description>
+			<arguments>
+				<argument type="Model"/>
+			</arguments>
+		</element>
+		<element name="volume" function="true" type="float" flags="288"><arguments/></element>
+		<element name="area" function="true" type="float" flags="288"><arguments/></element>
+		<element name="sizesAndAxes" function="true" type="Vector" flags="288">
+			<description><![CDATA[The returned vector contains XYZ (sizes) and Orient (axes) objects.]]></description>
+<arguments/></element>
+	</type>
+	<type name="ModelSimilarity" context="Global context">
+<description><![CDATA[Evaluates morphological dissimilarity. More information:
+http://www.framsticks.com/node/795
+http://www.framsticks.com/node/890]]></description>
+		<element name="simil_parts" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[Differing number of parts is also handled by the 'part degree' similarity component.]]></description>
+		</element>
+		<element name="simil_partdeg" type="float" min="0" max="100" default="1.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="simil_neuro" type="float" min="0" max="100" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="simil_partgeom" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="evaluateDistance" function="true" type="float" flags="34">
+			<description><![CDATA[Calculates dissimilarity between two models created from Geno objects.]]></description>
 			<arguments>
 				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="newFromString" function="true" type="Model">
-			<arguments>
-				<argument name="genotype" type="string"/>
-			</arguments>
-		</element>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+	</type>
+	<type name="ModelSymmetry" context="Global context">
+<description><![CDATA[Calculates bilateral symmetry. Details are described in http://www.framsticks.com/node/808]]></description>
+		<element name="calculateSymmetry" function="true" type="float" flags="32">
+			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model using default precision parameters (symPosSteps,symAlphaSteps,symBetaSteps). Returns the symmetry plane, too (sets symResultA,B,C,D).
+Note: may take a long time for large creatures.]]></description>
+			<arguments>
+				<argument name="model" type="Model"/>
+			</arguments>
+		</element>
+		<element name="calculateSymmetry2" function="true" type="float" flags="32">
+			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model using specified precision parameters. Returns the symmetry plane, too (sets symResultA,B,C,D).
+Note: may take a long time for large creatures.]]></description>
+			<arguments>
+				<argument name="model" type="Model"/>
+				<argument name="posSteps" type="integer"/>
+				<argument name="alphaSteps" type="integer"/>
+				<argument name="betaSteps" type="integer"/>
+			</arguments>
+		</element>
+		<element name="calculateSymmetryForPlane" function="true" type="float" flags="32">
+			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model and given a specific plane defined by coefficients A, B, C, D.]]></description>
+			<arguments>
+				<argument name="model" type="Model"/>
+				<argument name="A" type="float"/>
+				<argument name="B" type="float"/>
+				<argument name="C" type="float"/>
+				<argument name="D" type="float"/>
+			</arguments>
+		</element>
+		<element name="symPosSteps" type="integer" min="2" max="50" default="10">
+			<description><![CDATA[Default number of samples per stick length]]></description>
+		</element>
+		<element name="symAlphaSteps" type="integer" min="2" max="50" default="20">
+			<description><![CDATA[Default number of samples per full angle (#1)]]></description>
+		</element>
+		<element name="symBetaSteps" type="integer" min="2" max="50" default="20">
+			<description><![CDATA[Default number of samples per full angle (#2)]]></description>
+		</element>
+		<element name="symResultA" type="float" flags="35"/>
+		<element name="symResultB" type="float" flags="35"/>
+		<element name="symResultC" type="float" flags="35"/>
+		<element name="symResultD" type="float" flags="35"/>
 	</type>
 	<type name="Neuro" context="Global context">
 <description><![CDATA[Live Neuron object.]]></description>
+		<element name="getInputState" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputWeight" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getWeightedInputState" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputSum" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getWeightedInputSum" function="true" type="float">
+			<description><![CDATA[Uses any number of inputs starting with the specified input. getWeightedInputSum(0)=weightedInputSum]]></description>
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputCount" type="integer" flags="1"/>
+		<element name="inputSum" type="float" flags="1"/>
+		<element name="weightedInputSum" type="float" flags="1"/>
+		<element name="getInputChannelCount" function="true" type="integer">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputStateChannel" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+				<argument name="channel" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getWeightedInputStateChannel" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+				<argument name="channel" type="integer"/>
+			</arguments>
+		</element>
+		<element name="state" type="float">
+			<description><![CDATA[When read, returns the current neuron state.
+When written, sets the 'internal' neuron state that will become current in the next step.
+Typically you should use this field, and not currState.]]></description>
+		</element>
 		<element name="channelCount" type="integer"/>
-		<element name="creature" type="Creature"/>
+		<element name="getStateChannel" function="true" type="float">
+			<arguments>
+				<argument name="channel" type="integer"/>
+			</arguments>
+		</element>
+		<element name="setStateChannel" function="true" type="void">
+			<arguments>
+				<argument name="channel" type="integer"/>
+				<argument name="value" type="float"/>
+			</arguments>
+		</element>
+		<element name="hold" type="integer" min="0" max="1">
+			<description><![CDATA["Holding" means keeping the neuron state as is, blocking the regular neuron operation. This is useful when your script needs to inject some control signals into the NN. Without "holding", live neurons would be constantly overwriting your changes, and the rest of the NN could see inconsistent states, depending on the connections. Setting hold=1 ensures the neuron state will be only set by you, and not by the neuron. The enforced signal value can be set using Neuro.currState before or after setting hold=1. Set hold=0 to resume normal operation.]]></description>
+		</element>
 		<element name="currState" type="float">
-			<description><![CDATA[The only difference from the "state" field is that currState, when written, changes the internal neuron state immediately (which disturbs the regular synchronous NN operation). This feature should only be used while controlling the neuron 'from outside' (like a neuro probe) and not in the neuron definition. See also: Neuro.hold]]></description>
-		</element>
-		<element name="def" type="NeuroDef"/>
-		<element name="fields" type="Fields">
+			<description><![CDATA[When read, it behaves just like the 'state' field.
+When written, changes the current neuron state immediately, which disturbs the regular synchronous NN operation.
+This feature should only be used while controlling the neuron 'from outside' (like a neuro probe) and not in the neuron definition. See also: Neuro.hold]]></description>
+		</element>
+		<element name="setCurrStateChannel" function="true" type="void">
+			<description><![CDATA[Analogous to "currState".]]></description>
+			<arguments>
+				<argument name="channel" type="integer"/>
+				<argument name="value" type="float"/>
+			</arguments>
+		</element>
+		<element name="position_x" type="float" flags="1"/>
+		<element name="position_y" type="float" flags="1"/>
+		<element name="position_z" type="float" flags="1"/>
+		<element name="creature" type="Creature" flags="1"/>
+		<element name="part" type="MechPart" flags="1"/>
+		<element name="joint" type="MechJoint" flags="1"/>
+		<element name="fields" type="Fields" flags="1">
 			<description><![CDATA[Neurons can have different fields depending on their class. Script neurons have their fields defined using the "prop:" syntax. If you develop a custom neuron script you should use the Fields object for accessing your own neuron fields. The Neuro.fields property is meant for accessing the neuron fields from the outside script.
 Examples:
@@ -1895,103 +2230,66 @@
  Simulator.print(iobj.getId(i)+" ("+iobj.getName(i)+")");]]></description>
 		</element>
-		<element name="getInputCount" type="integer"/>
-		<element name="hold" type="integer" min="0" max="1">
-			<description><![CDATA["Holding" means keeping the neuron state as is, blocking the regular neuron operation. This is useful when your script needs to inject some control signals into the NN. Without "holding", live neurons would be constantly overwriting your changes, and the rest of the NN could see inconsistent states, depending on the connections. Setting hold=1 ensures the neuron state will be only set by you, and not by the neuron. The enforced signal value can be set using Neuro.currState before or after setting hold=1. Set hold=0 to resume normal operation.]]></description>
-		</element>
-		<element name="inputSum" type="float"/>
-		<element name="joint" type="MechJoint"/>
-		<element name="part" type="MechPart"/>
-		<element name="position_x" type="float"/>
-		<element name="position_y" type="float"/>
-		<element name="position_z" type="float"/>
-		<element name="signals" type="NeuroSignals"/>
-		<element name="state" type="float">
-			<description><![CDATA[When read, returns the current neuron state.
-When written, sets the next neuron state (for use in the neuron definition)]]></description>
-		</element>
-		<element name="weightedInputSum" type="float"/>
-		<element name="getInputChannelCount" function="true" type="integer">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputState" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputStateChannel" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-				<argument name="channel" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputSum" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputWeight" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getStateChannel" function="true" type="float">
-			<arguments>
-				<argument name="channel" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getWeightedInputState" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getWeightedInputStateChannel" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-				<argument name="channel" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getWeightedInputSum" function="true" type="float">
-			<description><![CDATA[Uses any number of inputs starting with the specified input. getWeightedInputSum(0)=weightedInputSum]]></description>
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="setCurrStateChannel" function="true" type="void">
-			<description><![CDATA[Analogous to "currState".]]></description>
-			<arguments>
-				<argument name="channel" type="integer"/>
-				<argument name="value" type="float"/>
-			</arguments>
-		</element>
-		<element name="setStateChannel" function="true" type="void">
-			<arguments>
-				<argument name="channel" type="integer"/>
-				<argument name="value" type="float"/>
-			</arguments>
-		</element>
+		<element name="def" type="NeuroDef" flags="1"/>
+		<element name="classObject" type="NeuroClass" flags="1"/>
+		<element name="signals" type="NeuroSignals" flags="1"/>
 	</type>
 	<type name="NeuroClass" context="Global context">
-<description><![CDATA[The static NeuroClass object refers to class selected in the NeuroClassLibrary.]]></description>
+<description><![CDATA[The static NeuroClass object refers to the class selected in the NeuroClassLibrary. Most, but not all, properties have direct counterparts in *.neuro files that define custom neuron classes.]]></description>
+		<element name="name" type="string">
+			<description><![CDATA[Used in genotypes]]></description>
+		</element>
+		<element name="longname" type="string">
+			<description><![CDATA[Used in hints]]></description>
+		</element>
 		<element name="description" type="string"/>
-		<element name="glyph" type="string"/>
-		<element name="longname" type="string"/>
-		<element name="name" type="string"/>
-		<element name="prefinputs" type="integer"/>
+		<element name="prefinputs" type="integer">
+			<description><![CDATA[-1 means "any number of inputs is OK"]]></description>
+		</element>
+		<element name="prefoutput" type="integer" min="0" max="1">
+			<description><![CDATA[Should be 1 if the neuron provides meaningful output value, 0 otherwise]]></description>
+		</element>
 		<element name="preflocation" type="integer" min="0" max="2"/>
-		<element name="prefoutput" type="integer" min="0" max="1"/>
-		<element name="properties" type="Interface"/>
-		<element name="summary" type="string">
-			<description><![CDATA[Textual summary of all features]]></description>
-		</element>
-		<element name="visualhints" type="integer"/>
+		<element name="visualhints" type="integer">
+			<description><![CDATA[This is a bitfield. Compute the value by adding the following bits:
+1 = Invisible - don't draw neurons of this class
+2 = No label - don't draw classname label (below the neuron symbol) for this neuron class
+4 = First Part - draw the neuron at the first part when attached to a joint (default is in the middle)
+8 = Second Part - draw the neuron at the second part when attached to a joint (default is in the middle)
+16 = Effector - use muscle color when drawing this neuron
+32 = Sensor - use receptor color when drawing this neuron
+Compatiblity: visualhints is called "vhints" in *.neuro files.]]></description>
+		</element>
+		<element name="glyph" type="string">
+			<description><![CDATA[<html>The neuron icon for use in NN diagrams, encoded as a comma-separated sequence of integer numbers.<ul>
+<li>N = the total number of all numbers following this one
+<li>NS = the number of line sequences<br>
+<ul>repeated NS times:
+<li>NL = number of line segments (creating a polyline)
+<li><span style="background-color:#fcc;">X,Y</span> (repeated NL+1 times) - subsequent line segment coordinates, each line should fit in a 100x100 square<br>
+- neuron input connections will be drawn at X=25 (varying Y for multiple inputs, Y=50 for a single input)<br>
+- neuron output connection will be drawn at (X=75,Y=50)
+</ul></ul>
+<p>Example:
+<table border=1>
+<tr><th>16,</th><th>2,</th><th>3,</th><th><span style="background-color:#fcc;">25,50</span>, <span style="background-color:#fcc;">40,30</span>, <span style="background-color:#fcc;">60,30</span>, <span style="background-color:#fcc;">75,50</span>,</th><th>1,</th><th><span style="background-color:#fcc;">40,50</span>, <span style="background-color:#fcc;">60,50</span></th></tr>
+<tr><td>N = 16 numbers following this one</td><td>NS = 2 line sequences</td><td>NL = the first sequence has 3 segments</td><td>coordinates for 3 line segments = 4 endpoints = 8 numbers</td><td>NL = the second sequence has 1 segment</td><td>coordinates for 1 line segment</td></tr>
+</table>
+<p>See also: <a href="http://www.framsticks.com/files/dev/files/inkscape-to-icon.html">a script for creating *.neuro icon from SVG</a><br>
+Compatibility: this field is called "icon" in *.neuro files.]]></description>
+		</element>
+		<element name="properties" type="Interface" flags="1">
+			<description><![CDATA[Compatibility: not preset in *.neuro files.]]></description>
+		</element>
+		<element name="summary" type="string" flags="1">
+			<description><![CDATA[Textual summary of all features.
+Compatibility: not preset in *.neuro files.]]></description>
+		</element>
 	</type>
 	<type name="NeuroClassLibrary" context="Global context">
 <description><![CDATA[Set of Neuron classes. You can access the selected class in the static NeuroClass object.]]></description>
+		<element name="count" type="integer" flags="1"/>
 		<element name="class" type="integer">
 			<description><![CDATA[0 ... count-1]]></description>
 		</element>
-		<element name="count" type="integer"/>
 		<element name="findClass" function="true" type="void">
 			<arguments>
@@ -1999,27 +2297,33 @@
 			</arguments>
 		</element>
+		<element name="getClass" function="true" type="NeuroClass">
+			<arguments>
+				<argument name="class name" type="string"/>
+			</arguments>
+		</element>
 	</type>
 	<type name="NeuroDef" context="Global context">
+		<element name="p" type="integer" min="-1" max="999999" default="-1"/>
+		<element name="j" type="integer" min="-1" max="999999" default="-1"/>
 		<element name="d" type="string"/>
-		<element name="getInputCount" type="integer"/>
 		<element name="i" type="string"/>
-		<element name="j" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="p" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="Vstyle" type="string"/>
-		<element name="getInputNeuroDef" function="true" type="NeuroDef">
+		<element name="Vstyle" type="string" max="-1" default="neuro"/>
+		<element name="getInputCount" type="integer" flags="3"/>
+		<element name="getInputNeuroDef" function="true" type="NeuroDef" flags="3">
 			<arguments>
 				<argument type="integer"/>
 			</arguments>
 		</element>
-		<element name="getInputNeuroIndex" function="true" type="integer">
+		<element name="getInputNeuroIndex" function="true" type="integer" flags="3">
 			<arguments>
 				<argument type="integer"/>
 			</arguments>
 		</element>
-		<element name="getInputWeight" function="true" type="float">
+		<element name="getInputWeight" function="true" type="float" flags="3">
 			<arguments>
 				<argument type="integer"/>
 			</arguments>
 		</element>
+		<element name="classObject" type="NeuroClass" flags="3"/>
 	</type>
 	<type name="NeuronsSimEnabled" context="Global context">
@@ -2091,5 +2395,5 @@
 ]]></description>
 		</element>
-		<element name="ncl_*" type="integer" min="0" max="1">
+		<element name="ncl_Constant" type="integer" min="0" max="1">
 			<description><![CDATA[Constant value
 
@@ -2100,5 +2404,5 @@
 ]]></description>
 		</element>
-		<element name="ncl_|" type="integer" min="0" max="1">
+		<element name="ncl_Bend_muscle" type="integer" min="0" max="1">
 			<description><![CDATA[Characteristics:
    uses single input
@@ -2111,5 +2415,5 @@
    bending range (r) float 0..1]]></description>
 		</element>
-		<element name="ncl_@" type="integer" min="0" max="1">
+		<element name="ncl_Rotation_muscle" type="integer" min="0" max="1">
 			<description><![CDATA[Characteristics:
    uses single input
@@ -2272,18 +2576,10 @@
 	</type>
 	<type name="NeuroSignals" context="Global context">
-<description><![CDATA[Signals attached to the neuron.
+<description><![CDATA[Signals attached to a neuron.
 See also: Signal, WorldSignals, CreatureSignals.
 scripts/light.neuro and scripts/seelight.neuro are simple custom neuron examples demonstrating how to send/receive signals between creatures.]]></description>
-		<element name="size" type="integer"/>
-		<element name="add" function="true" type="void">
-			<description><![CDATA[Create a new signal]]></description>
+		<element name="add" function="true" type="Signal">
 			<arguments>
 				<argument name="channel" type="string"/>
-			</arguments>
-		</element>
-		<element name="clear" function="true" type="void"><arguments/></element>
-		<element name="get" function="true" type="Signal">
-			<arguments>
-				<argument name="index" type="integer"/>
 			</arguments>
 		</element>
@@ -2294,4 +2590,11 @@
 			</arguments>
 		</element>
+		<element name="receiveSet" function="true" type="Vector">
+			<description><![CDATA[Get all signals in the specified range. Returns a read-only vector object containing Signal objects - individual signals can be accessed as result[0], .., result[result.size-1].]]></description>
+			<arguments>
+				<argument name="channel" type="string"/>
+				<argument name="max distance" type="float"/>
+			</arguments>
+		</element>
 		<element name="receiveFilter" function="true" type="float">
 			<description><![CDATA[Receive the aggregated signal power in a given channel.
@@ -2299,14 +2602,14 @@
 Additional filtering options:
 - Max distance only receives the neighbor signals (based on their physical location)
-- Flavor filtering: only signals having the flavor close to the specified one will be received. The filter value is the maximum allowed difference.]]></description>
+- Flavor filtering: only signals having the flavor similar to the specified value will be received. The flavorfilter value is the difference of flavor that reduces the received signal to 0. The "flavor attenuation" is linear, i.e., signals differing by (filter/2) in flavor will be reduced to 50%.]]></description>
 			<arguments>
 				<argument name="channel" type="string"/>
 				<argument name="max distance" type="float"/>
 				<argument name="flavor" type="float"/>
-				<argument name="filter" type="float"/>
-			</arguments>
-		</element>
-		<element name="receiveSet" function="true" type="Vector">
-			<description><![CDATA[Get all signals in the specified range. Returns a readonly vector object containing Signal objects (individual signals can be accessed as result[0] throught result[result.size-1]).]]></description>
+				<argument name="flavorfilter" type="float"/>
+			</arguments>
+		</element>
+		<element name="receiveSingle" function="true" type="Signal">
+			<description><![CDATA[Find the signal source that has the highest signal power (taking into account distance).]]></description>
 			<arguments>
 				<argument name="channel" type="string"/>
@@ -2314,56 +2617,67 @@
 			</arguments>
 		</element>
-		<element name="receiveSingle" function="true" type="Signal">
-			<description><![CDATA[Find the signal source having the highest signal power (including the distance)]]></description>
-			<arguments>
-				<argument name="channel" type="string"/>
-				<argument name="range" type="float"/>
-			</arguments>
-		</element>
+		<element name="get" function="true" type="Signal">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="size" type="integer" flags="1"/>
+		<element name="clear" function="true" type="void" flags="1"><arguments/></element>
 	</type>
 	<type name="ODE" context="Global context">
 <description><![CDATA[ODE Parameters.]]></description>
+		<element name="odeshape" type="integer" min="0" max="1"/>
+		<element name="odestep" type="float" min="0.001" max="1" default="0.05"/>
+		<element name="odemusclemin" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[i.e. "mmmmm" in f1]]></description>
+		</element>
+		<element name="odemusclemax" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[i.e. "MMMMM" if f1]]></description>
+		</element>
+		<element name="odemusclespeed" type="float" min="0" max="10" default="1.0">
+			<description><![CDATA[Muscle state cannot change faster than the supplied value]]></description>
+		</element>
 		<element name="odeairdrag" type="float" min="0" max="0.5" default="0.01">
 			<description><![CDATA[A drag force ("air drag") proportional to the velocity of mass centers of moving parts]]></description>
 		</element>
+		<element name="odewaterdrag" type="float" min="0.001" max="1" default="0.5"/>
+		<element name="odewaterbuoy" type="float" min="0" max="2" default="1.0"/>
+		<element name="odeseed" type="integer" min="0" max="2">
+			<description><![CDATA[Affects collisions.
+- 'Truly random' is closest to the standard ODE operation. Use Math.seed to influence randomness in ODE collisions.
+- 'Deterministic' automatically calculates random seed in each step based on the current simulation (world) state, which makes the simulation repeatable but more random than 'Fixed'.
+- 'Fixed' is completely deterministic and does not depend on Math.seed - the same seed value is set before each step. This might negatively affect ODE accuracy.
+]]></description>
+		</element>
+		<element name="odesepsticks" type="integer" min="0" max="1" default="0">
+			<description><![CDATA[Each stick gets a separate ODE body (like in MechaStick)]]></description>
+		</element>
+		<element name="odeworlderp" type="float" min="0" max="1" default="0.2">
+			<description><![CDATA[World ERP (error reduction parameter)]]></description>
+		</element>
+		<element name="odeworldcfm" type="float" min="0" max="1" default="1e-05">
+			<description><![CDATA[World CFM (constraint force mixing)]]></description>
+		</element>
+		<element name="odecolmumin" type="float" min="0" max="10" default="0.1">
+			<description><![CDATA[Mu coefficient for Parts with minimal friction (i.e. "fffff" in f1)]]></description>
+		</element>
+		<element name="odecolmumax" type="float" min="0" max="10" default="5.0">
+			<description><![CDATA[Mu coefficient for Parts with maximal friction (i.e. "FFFFF" in f1)]]></description>
+		</element>
+		<element name="odecolbounce" type="float" min="0" max="1" default="0.1"/>
+		<element name="odecolbouncevel" type="float" min="0" max="1" default="0.01"/>
+		<element name="odecolsoftcfm" type="float" min="0" max="1" default="0.0"/>
+		<element name="odecolsofterp" type="float" min="0" max="1" default="0.0"/>
+		<element name="odecol2mumin" type="float" min="0" max="10" default="0.1">
+			<description><![CDATA[Mu coefficient for Parts with minimal friction (i.e. "fffff" in f1)]]></description>
+		</element>
+		<element name="odecol2mumax" type="float" min="0" max="10" default="1.0">
+			<description><![CDATA[Mu coefficient for Parts with maximal friction (i.e. "FFFFF" in f1)]]></description>
+		</element>
 		<element name="odecol2bounce" type="float" min="0" max="1" default="0.1"/>
 		<element name="odecol2bouncevel" type="float" min="0" max="1" default="0.01"/>
-		<element name="odecol2mumax" type="float" min="0" max="10" default="1">
-			<description><![CDATA[Mu coefficient for Parts with maximal friction (i.e. "FFFFF" in f1)]]></description>
-		</element>
-		<element name="odecol2mumin" type="float" min="0" max="10" default="0.1">
-			<description><![CDATA[Mu coefficient for Parts with minimal friction (i.e. "fffff" in f1)]]></description>
-		</element>
-		<element name="odecol2softcfm" type="float" min="0" max="1" default="0"/>
-		<element name="odecolbounce" type="float" min="0" max="1" default="0.1"/>
-		<element name="odecolbouncevel" type="float" min="0" max="1" default="0.01"/>
-		<element name="odecolmumax" type="float" min="0" max="10" default="5">
-			<description><![CDATA[Mu coefficient for Parts with maximal friction (i.e. "FFFFF" in f1)]]></description>
-		</element>
-		<element name="odecolmumin" type="float" min="0" max="10" default="0.1">
-			<description><![CDATA[Mu coefficient for Parts with minimal friction (i.e. "fffff" in f1)]]></description>
-		</element>
-		<element name="odecolsoftcfm" type="float" min="0" max="1" default="0"/>
-		<element name="odemusclemax" type="float" min="0" max="100" default="10">
-			<description><![CDATA[i.e. "MMMMM" if f1]]></description>
-		</element>
-		<element name="odemusclemin" type="float" min="0" max="100" default="0">
-			<description><![CDATA[i.e. "mmmmm" in f1]]></description>
-		</element>
-		<element name="odemusclespeed" type="float" min="0" max="10" default="1">
-			<description><![CDATA[Muscle state cannot change faster than the supplied value]]></description>
-		</element>
-		<element name="odeseed" type="integer" min="0" max="2">
-			<description><![CDATA[Affects collisions.
-- 'Truly random' is closest to the standard ODE operation. Use Math.seed to influence randomness in ODE collisions
-- 'Deterministic' automatically calculates random seed in each step based on the current simulation (world) state, which makes the simulation repeatable but more random than 'Fixed'
-- 'Fixed' is completely deterministic and does not depend on Math.seed. This might negatively affect ODE accuracy
-]]></description>
-		</element>
-		<element name="odeshape" type="integer" min="0" max="1"/>
-		<element name="odestep" type="float" min="0.001" max="1" default="0.05"/>
-		<element name="odewaterbuoy" type="float" min="0" max="2" default="1"/>
-		<element name="odewaterdrag" type="float" min="0.001" max="1" default="0.5"/>
-		<element name="rayIntersection" function="true" type="float">
+		<element name="odecol2softcfm" type="float" min="0" max="1" default="0.0"/>
+		<element name="odecol2softerp" type="float" min="0" max="1" default="0.0"/>
+		<element name="rayIntersection" function="true" type="float" flags="32">
 			<arguments>
 				<argument name="position x" type="float"/>
@@ -2379,17 +2693,65 @@
 	<type name="Orient" context="Global context">
 <description><![CDATA[3D orientation, stored as 3x3 matrix.]]></description>
-		<element name="x" type="XYZ"/>
-		<element name="xx" type="float"/>
-		<element name="xy" type="float"/>
-		<element name="xz" type="float"/>
-		<element name="y" type="XYZ"/>
-		<element name="yx" type="float"/>
-		<element name="yy" type="float"/>
-		<element name="yz" type="float"/>
-		<element name="z" type="XYZ"/>
-		<element name="zx" type="float"/>
-		<element name="zy" type="float"/>
-		<element name="zz" type="float"/>
-		<element name="between2" function="true" type="void">
+		<element name="xx" type="float" flags="256"/>
+		<element name="xy" type="float" flags="256"/>
+		<element name="xz" type="float" flags="256"/>
+		<element name="yx" type="float" flags="256"/>
+		<element name="yy" type="float" flags="256"/>
+		<element name="yz" type="float" flags="256"/>
+		<element name="zx" type="float" flags="256"/>
+		<element name="zy" type="float" flags="256"/>
+		<element name="zz" type="float" flags="256"/>
+		<element name="x" type="XYZ" flags="257"/>
+		<element name="y" type="XYZ" flags="257"/>
+		<element name="z" type="XYZ" flags="257"/>
+		<element name="new" function="true" type="Orient"><arguments/></element>
+		<element name="newFromVector" function="true" type="Orient">
+			<arguments>
+				<argument type="Vector"/>
+			</arguments>
+		</element>
+		<element name="toVector" type="Vector" flags="257">
+			<description><![CDATA[for serialization]]></description>
+		</element>
+		<element name="clone" function="true" type="Orient" flags="256"><arguments/></element>
+		<element name="set" function="true" type="void" flags="256">
+			<arguments>
+				<argument type="Orient"/>
+			</arguments>
+		</element>
+		<element name="reset" function="true" type="void" flags="256"><arguments/></element>
+		<element name="rotate3" function="true" type="void" flags="256">
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="z" type="float"/>
+			</arguments>
+		</element>
+		<element name="rotate" function="true" type="void" flags="256">
+			<arguments>
+				<argument type="Orient"/>
+			</arguments>
+		</element>
+		<element name="revRotate" function="true" type="void" flags="256">
+			<arguments>
+				<argument type="Orient"/>
+			</arguments>
+		</element>
+		<element name="lookAt" function="true" type="void" flags="256">
+			<arguments>
+				<argument name="direction" type="XYZ"/>
+				<argument name="up" type="XYZ"/>
+			</arguments>
+		</element>
+		<element name="normalize" function="true" type="void" flags="256"><arguments/></element>
+		<element name="between2" function="true" type="void" flags="256">
+			<description><![CDATA[The calling Orient receives the orientation interpolated from 2 input orientations.
+Example:
+var o1=Orient.new(), o2=Orient.new(), o3=Orient.new();
+o2.rotate3(0,Math.pi/2,0);
+o3.between2(o1,o2,0); // o3 equals o2
+o3.between2(o1,o2,1); // o3 equals o1
+o3.between2(o1,o2,0.5); // o3 is halfway between o1 and o2
+]]></description>
 			<arguments>
 				<argument type="Orient"/>
@@ -2398,5 +2760,12 @@
 			</arguments>
 		</element>
-		<element name="betweenOV" function="true" type="void">
+		<element name="betweenOV" function="true" type="void" flags="256">
+			<description><![CDATA[Like between2(), but the second Orient is composed of the supplied XYZ vector (X component) and Y Z vectors from the calling object.
+Example:
+var o=Orient.new();
+o.betweenOV(o,(0,1,0),1); //no change, o remains 100 010 001
+o.betweenOV(o,(0,1,0),0.9); //o is slightly rotated towards (0,1,0)
+o.betweenOV(o,(0,1,0),0); //o is completely transformed, o.x=(0,1,0)
+]]></description>
 			<arguments>
 				<argument type="Orient"/>
@@ -2405,6 +2774,5 @@
 			</arguments>
 		</element>
-		<element name="clone" function="true" type="Orient"><arguments/></element>
-		<element name="localToWorld" function="true">
+		<element name="localToWorld" function="true" type="XYZ" flags="256">
 			<arguments>
 				<argument name="point" type="XYZ"/>
@@ -2412,42 +2780,5 @@
 			</arguments>
 		</element>
-		<element name="lookAt" function="true" type="void">
-			<arguments>
-				<argument name="direction" type="XYZ"/>
-				<argument name="up" type="XYZ"/>
-			</arguments>
-		</element>
-		<element name="new" function="true" type="Orient">
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-		<element name="normalize" function="true" type="void"><arguments/></element>
-		<element name="reset" function="true" type="void"><arguments/></element>
-		<element name="revRotate" function="true" type="void">
-			<arguments>
-				<argument type="Orient"/>
-			</arguments>
-		</element>
-		<element name="rotate" function="true" type="void">
-			<arguments>
-				<argument type="Orient"/>
-			</arguments>
-		</element>
-		<element name="rotate3" function="true" type="void">
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-		<element name="set" function="true" type="void">
-			<arguments>
-				<argument type="Orient"/>
-			</arguments>
-		</element>
-		<element name="worldToLocal" function="true">
+		<element name="worldToLocal" function="true" type="XYZ" flags="256">
 			<arguments>
 				<argument name="point" type="XYZ"/>
@@ -2455,70 +2786,69 @@
 			</arguments>
 		</element>
+		<element name="angles" type="XYZ" flags="257"/>
+		<element name="toString" type="string" flags="257"/>
 	</type>
 	<type name="Part" context="Global context">
+		<element name="x" type="float" flags="1024"/>
+		<element name="y" type="float" flags="1024"/>
+		<element name="z" type="float" flags="1024"/>
+		<element name="m" type="float" min="0.1" max="999" default="1.0"/>
+		<element name="sh" type="integer" min="0" max="3" default="0"/>
+		<element name="s" type="float" min="0.1" max="10" default="1.0"/>
+		<element name="sx" type="float" min="0.001" max="1000" default="1.0"/>
+		<element name="sy" type="float" min="0.001" max="1000" default="1.0"/>
+		<element name="sz" type="float" min="0.001" max="1000" default="1.0"/>
+		<element name="h" type="float" min="0" max="1" default="0.0"/>
+		<element name="dn" type="float" min="0.2" max="5" default="1.0"/>
+		<element name="fr" type="float" min="0" max="4" default="0.4"/>
+		<element name="ing" type="float" min="0" max="1" default="0.25"/>
 		<element name="as" type="float" min="0" max="1" default="0.25"/>
-		<element name="dn" type="float" min="0.2" max="5" default="1"/>
-		<element name="fr" type="float" min="0" max="4" default="0.4"/>
+		<element name="rx" type="float"/>
+		<element name="ry" type="float" flags="1024"/>
+		<element name="rz" type="float" flags="1024"/>
 		<element name="i" type="string"/>
-		<element name="ing" type="float" min="0" max="1" default="0.25"/>
-		<element name="m" type="float" min="0.1" max="999" default="1"/>
-		<element name="rx" type="float"/>
-		<element name="ry" type="float"/>
-		<element name="rz" type="float"/>
-		<element name="s" type="float" min="0.1" max="10" default="1"/>
-		<element name="Vstyle" type="string"/>
-		<element name="x" type="float"/>
-		<element name="y" type="float"/>
-		<element name="z" type="float"/>
+		<element name="Vstyle" type="string" max="-1" default="part"/>
+		<element name="vs" type="float" min="0.05" max="0.7" default="0.2"/>
+		<element name="vr" type="float" min="0" max="1" default="0.5"/>
+		<element name="vg" type="float" min="0" max="1" default="0.5" flags="1024"/>
+		<element name="vb" type="float" min="0" max="1" default="0.5" flags="1024"/>
 	</type>
 	<type name="Population" context="Global context">
-<description><![CDATA[A set of Creature objects, sharing some high level simulation properties (performance calculation, NN simulation, collision detection, event handling). The groups usually have different roles in the experiment (Creatures groups and Food group in standard.expdef).]]></description>
-		<element name="bodysim" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[Enable/disable physical body simulation. This is the initial value of Creature.bodysim for all objects created in this group. For details, see the documentation of Creature.bodysim.]]></description>
-		</element>
-		<element name="colmask" type="integer" min="0" max="65535" default="0">
-			<description><![CDATA[DEPRECATED. You should use selfmask and othermask (these masks are also much easier to understand than the old colmask field).]]></description>
+<description><![CDATA[A set of Creature objects, sharing some high level simulation properties (performance calculation, NN simulation, collision detection, event handling). The groups usually have different roles in the experiment (Creatures groups and Food group in standard.expdef).
+You can iterate directly over Creatures in a Population using for(...in...) loops:
+	for(var c in Populations[0]) Simulator.print(c.name);]]></description>
+		<element name="index" type="integer" flags="35"/>
+		<element name="name" type="string"/>
+		<element name="size" type="integer" flags="3"/>
+		<element name="energy" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[If turned off, creature's energy will be constant.]]></description>
 		</element>
 		<element name="death" type="integer" min="0" max="1" default="1">
 			<description><![CDATA[Do creatures die when no energy?]]></description>
 		</element>
-		<element name="em_dyn" type="float" min="0" max="1" default="0">
-			<description><![CDATA[Energy requirements for a muscle
-moving a stick]]></description>
-		</element>
-		<element name="em_stat" type="float" min="0" max="1" default="0">
-			<description><![CDATA[Energy requirements for a muscle
-resisting an external force]]></description>
-		</element>
-		<element name="en_assim" type="float" min="0" max="1" default="0">
-			<description><![CDATA[Maximal energy gain produced by a vertical specialized stick.
-Horizontal specialized sticks get half of this value.]]></description>
+		<element name="nnsim" type="integer" min="0" max="2" default="1">
+			<description><![CDATA[Stabilization means no significant movement during a specified period of time.]]></description>
+		</element>
+		<element name="perfperiod" type="integer" min="0" max="1000000" default="100">
+			<description><![CDATA[Defines how often onUpdate() events are called and how often the built-in performance counters (distance, speed, etc.) are calculated.]]></description>
+		</element>
+		<element name="stabilperiod" type="integer" min="0" max="1000000" default="100">
+			<description><![CDATA["Performance sampling period" for the stabilization phase.]]></description>
+		</element>
+		<element name="killnostable" type="integer" min="0" max="10000000" default="1000000">
+			<description><![CDATA[Creatures that fail to stabilize after the specified waiting period (e.g. because they are continuously rolling) will be killed. 0 disables this feature.]]></description>
+		</element>
+		<element name="stabledist" type="float" min="0" max="1" default="0.01">
+			<description><![CDATA[A creature is considered stabilized when its center of gravity stays within the specified distance after the "Sampling period while waiting" has elapsed.]]></description>
 		</element>
 		<element name="enableperf" type="integer" min="0" max="2" default="1">
 			<description><![CDATA[Stabilization means no significant movement during a specified period of time.]]></description>
 		</element>
-		<element name="energy" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[If turned off, creature's energy will be constant.]]></description>
-		</element>
-		<element name="index" type="integer"/>
-		<element name="killnostable" type="integer" min="0" max="10000000" default="1000000">
-			<description><![CDATA[Creatures that fail to stabilize after the specified waiting period (e.g. because they are continuously rolling) will be killed. 0 disables this feature.]]></description>
-		</element>
-		<element name="name" type="string"/>
-		<element name="nnsim" type="integer" min="0" max="2" default="1">
-			<description><![CDATA[Stabilization means no significant movement during a specified period of time.]]></description>
-		</element>
-		<element name="othermask" type="integer" min="0" max="2147483647" default="0">
-			<description><![CDATA[See selfmask.]]></description>
-		</element>
-		<element name="perfperiod" type="integer" min="0" max="1000000" default="100">
-			<description><![CDATA[Defines how often onUpdate() events are called. Also used to compute partial performance of creatures (distance, speed, etc.) and to determine stabilization.]]></description>
-		</element>
-		<element name="selfcol" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[Detect collisions within creature bodies (only applicable for the ODE simulation engine). This is the initial value of Creature.selfcol for all objects created in this group. If enabled, creatures with self-colliding genotypes are not born, and others will have their sticks collide during lifespan.]]></description>
-		</element>
-		<element name="selfmask" type="integer" min="0" max="2147483647" default="0">
+		<element name="colmask" type="integer" min="0" max="65535" default="0" deprecated="true" flags="8224">
+			<description><![CDATA[You should use selfmask and othermask instead of colmask (these masks are also much easier to understand than the old colmask field).]]></description>
+		</element>
+		<element name="selfmask" type="integer" min="0" max="2147483647" default="0" flags="32">
 			<description><![CDATA[Collisions between objects can be handled in two ways:
- - standard 'mechanical' collision (simple 'rebound' effect)
+ - standard 'mechanical' collision handler (simple 'rebound' effect)
  - special script handler (On[GROUPNAME]Collision function)
 
@@ -2527,73 +2857,80 @@
 The handler is called once for each creature that collides with the creature from [GROUPNAME].
 
-Collision masks determine which one will be used (none and both are also possible). On each collision, selfmask and othermask of the colliding objects are logically ANDed. 16 lower bits (0xffff) enable the standard handler. 16 higher bits (0xffff0000) enable the custom handler. 
+Collision masks that you set determine which handler will be used (none and both are also possible). On each collision, selfmask and othermask of the colliding objects are logically ANDed.
+If the resulting non-zero value falls into 16 lower bits (0x0000ffff), the standard handler is enabled.
+If the resulting non-zero value falls into 16 higher bits (0xffff0000), the custom handler is enabled.
+
 Examples:
 
 1.With one group, all possible combinations of the collision handlers are as follows:
-  - ignore collisions (e.g. selfmask=othermask=0)
-  - use standard handling (e.g. selfmask=othermask=1)
-  - use custom handling (e.g. selfmask=othermask=0x10000)
-  - use standard and custom handling (e.g. selfmask=othermask=0x10001)
+	- ignore collisions (e.g. selfmask=othermask=0)
+	- use standard handling (e.g. selfmask=othermask=1)
+	- use custom handling (e.g. selfmask=othermask=0x10000)
+	- use standard and custom handling (e.g. selfmask=othermask=0x10001)
 
 2.Two groups yield more interesting cases. Let us consider the 'standard.expdef' setting:
-  Creatures: selfmask=0x10001, othermask=0x20001
-  Food colmask = selfmask=0x20002, othermask=0x10002
+	Creatures: selfmask=0x10001, othermask=0x20001
+	Food: selfmask=0x20002, othermask=0x10002
 There are three possible scenarios:
-- creature and creature: collision value = 0x10001 & 0x20001 = 1 -> Standard handling will be used (1 is one of the lower 16 bits)
-- food and food: collision value = 0x20002 & 0x10002 = 2 -> As above.
-- creature and food: collision value = (0x10001 & 0x10002) or (0x20002 & 0x20001) = 0x10000 or 0x20000 -> Custom handling will be used (higher 16 bits).
+	- creature and creature: collision value = 0x10001 & 0x20001 = 1 -> Standard handling will be used (1 is one of the lower 16 bits)
+	- food and food: collision value = 0x20002 & 0x10002 = 2 -> As above.
+	- creature and food: collision value = (0x10001 & 0x10002) or (0x20002 & 0x20001) = 0x10000 or 0x20000 -> Custom handling will be used (the result falls into higher 16 bits).
 ]]></description>
 		</element>
-		<element name="size" type="integer"/>
-		<element name="stabilperiod" type="integer" min="0" max="1000000" default="100">
-			<description><![CDATA["Performance sampling period" for the stabilization phase.]]></description>
-		</element>
-		<element name="stabledist" type="float" min="0" max="1" default="0.01">
-			<description><![CDATA[A creature is considered stabilized when its center of gravity stays within the specified distance after the "Sampling period while waiting" has elapsed.]]></description>
-		</element>
-		<element name="createFromGeno" function="true" type="Creature">
-			<description><![CDATA[Uses the supplied Geno object]]></description>
+		<element name="othermask" type="integer" min="0" max="2147483647" default="0" flags="32">
+			<description><![CDATA[See selfmask.]]></description>
+		</element>
+		<element name="bodysim" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[Enable/disable physical body simulation. This is the initial value of Creature.bodysim for all objects created in this group. For details, see the documentation of Creature.bodysim.]]></description>
+		</element>
+		<element name="selfcol" type="integer" min="0" max="1" default="0">
+			<description><![CDATA[Detect collisions within creature bodies (only applicable for the ODE simulation engine). This is the initial value of Creature.selfcol for all objects created in this group. If enabled, creatures with self-colliding genotypes are not born, and others will have their sticks collide during lifespan.]]></description>
+		</element>
+		<element name="em_stat" type="float" min="0" max="1" default="0.0">
+			<description><![CDATA[Energy requirements for a muscle
+resisting an external force]]></description>
+		</element>
+		<element name="em_dyn" type="float" min="0" max="1" default="0.0">
+			<description><![CDATA[Energy requirements for a muscle
+moving a stick]]></description>
+		</element>
+		<element name="en_assim" type="float" min="0" max="1" default="0.0">
+			<description><![CDATA[Maximal energy gain produced by a vertical specialized stick.
+Horizontal specialized sticks get half of this value.]]></description>
+		</element>
+		<element name="createFromGenotype" function="true" type="Creature" deprecated="true" flags="8226">
+			<description><![CDATA[Uses the selected Genotype object.
+Deprecated. Use the more universal add() function.]]></description>
+<arguments/></element>
+		<element name="createFromString" function="true" type="Creature" deprecated="true" flags="8226">
+			<description><![CDATA[Uses the supplied string argument.
+Deprecated. Use the more universal add() function.]]></description>
+			<arguments>
+				<argument name="genotype" type="string"/>
+			</arguments>
+		</element>
+		<element name="createFromGeno" function="true" type="Creature" deprecated="true" flags="8226">
+			<description><![CDATA[Uses the supplied Geno object.
+Deprecated. Use the more universal add() function.]]></description>
 			<arguments>
 				<argument type="Geno"/>
 			</arguments>
 		</element>
-		<element name="createFromGenotype" function="true" type="Creature">
-			<description><![CDATA[Uses the selected Genotype object]]></description>
-<arguments/></element>
-		<element name="createFromString" function="true" type="Creature">
-			<description><![CDATA[Uses the supplied string argument]]></description>
-			<arguments>
-				<argument name="genotype" type="string"/>
-			</arguments>
-		</element>
-		<element name="delete" function="true" type="void">
-			<description><![CDATA[delete creature]]></description>
-			<arguments>
-				<argument name="creature index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="findCreatureAt" function="true" type="Creature">
-			<arguments>
-				<argument name="point" type="Vector"/>
-				<argument name="vector" type="Vector"/>
-			</arguments>
-		</element>
-		<element name="findUID" function="true" type="integer">
+		<element name="add" function="true" type="Creature" flags="34">
+			<arguments>
+				<argument name="genotype object or geno object or string genotype" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="findUID" function="true" type="integer" flags="34">
 			<arguments>
 				<argument name="uid" type="string"/>
 			</arguments>
 		</element>
-		<element name="get" function="true" type="Creature">
+		<element name="get" function="true" type="Creature" flags="34">
 			<arguments>
 				<argument name="index" type="integer"/>
 			</arguments>
 		</element>
-		<element name="kill" function="true" type="void">
-			<description><![CDATA[kill creature]]></description>
-			<arguments>
-				<argument name="creature index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="senseCreaturesProperty" function="true" type="float">
+		<element name="senseCreaturesProperty" function="true" type="float" flags="34">
 			<description><![CDATA[arguments:
  - x,y,z (sensor position)
@@ -2601,11 +2938,12 @@
  - exclude (creature object)
 works like a smell sensor for a given property (for all creatures in this group except "exclude").
-The following function reproduces the "classic" framsticks "S" sensor:
-function smellReceptorValue(x,y,z,exclude)
-{
-var i,s=0; for(i=0;i<Populations.size;i++)
-	s+=Populations[0].senseCreaturesProperty(x,y,z,"energy",exclude);
-return s;
-}]]></description>
+The following function reproduces the "classic" Framsticks "S" sensor:
+	function smellReceptorValue(x, y, z, exclude)
+	{
+	var i,s=0;
+	for(i=0; i<Populations.size; i++)
+		s += Populations[0].senseCreaturesProperty(x, y, z, "energy", exclude);
+	return s;
+	}]]></description>
 			<arguments>
 				<argument name="x" type="float"/>
@@ -2616,13 +2954,89 @@
 			</arguments>
 		</element>
+		<element name="findCreatureAt" function="true" type="Creature" flags="34">
+			<arguments>
+				<argument name="point" type="Vector"/>
+				<argument name="vector" type="Vector"/>
+			</arguments>
+		</element>
+		<element name="delete" function="true" type="void" flags="34">
+			<description><![CDATA[Delete the creature (remove it without executing the onKill event). Removing creatures inside some event handlers (e.g. onCollision) might be unsafe.]]></description>
+			<arguments>
+				<argument name="creature object or index" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="kill" function="true" type="void" flags="34">
+			<description><![CDATA[Kill the creature (remove it and execute its onKill handler). Killing creatures inside some event handlers (e.g. onCollision) might be unsafe. The recommended and safe way of killing a creature is by setting its energy to 0.]]></description>
+			<arguments>
+				<argument name="creature object or index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="clear" function="true" type="void" flags="34">
+			<description><![CDATA[Delete all creatures]]></description>
+<arguments/></element>
+		<element name="iterator" type="Object" flags="291"/>
+		<element name="getStatsMin" function="true" type="float" flags="32">
+			<description><![CDATA[Retrieves data from stats.* object. Can only be used for fields covered by stats.* (subset of Creature fields).]]></description>
+			<arguments>
+				<argument name="field name" type="string"/>
+			</arguments>
+		</element>
+		<element name="getStatsAvg" function="true" type="float" flags="32">
+			<description><![CDATA[Retrieves data from stats.* object. Can only be used for fields covered by stats.* (subset of Creature fields).]]></description>
+			<arguments>
+				<argument name="field name" type="string"/>
+			</arguments>
+		</element>
+		<element name="getStatsMax" function="true" type="float" flags="32">
+			<description><![CDATA[Retrieves data from stats.* object. Can only be used for fields covered by stats.* (subset of Creature fields).]]></description>
+			<arguments>
+				<argument name="field name" type="string"/>
+			</arguments>
+		</element>
+		<element name="refreshGUI" function="true" type="void" flags="32">
+			<description><![CDATA[Notify list content changed]]></description>
+<arguments/></element>
 	</type>
 	<type name="Populations" context="Global context">
-<description><![CDATA[Manages all Creature objects in the experiment, organized in one or more groups. See also: Creature, Population.]]></description>
-		<element name="creature" type="integer"/>
-		<element name="group" type="integer">
-			<description><![CDATA[Index of the currently selected group (Population).]]></description>
-		</element>
-		<element name="size" type="integer"/>
-		<element name="addGroup" function="true" type="void">
+<description><![CDATA[Manages all Creature objects in the experiment, organized in one or more groups.
+You can iterate directly over Population objects in the Populations collection using for(...in...) loops:
+	for(var pop in Populations) Simulator.print(pop.name);
+
+Before version 4.0rc4 some operations could only be performed on the "selected" creature (the one pointed to by group/creature fields in Populations). Currently, the more convenient and recommended way is to call Creatures's functions that operate directly on the passed objects.
+
+The old way:
+	Populations.group=0;
+	Populations.creature=0;
+	GenePools.getFromCreature();
+	GenePools.copyTo(0);
+
+Doing the same the new way:
+	Genotype.newFromCreature(Populations[0][0]).moveTo(GenePools[0]);
+
+See also: Creature, Population.]]></description>
+		<element name="group" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Index of the currently selected group (Population).
+Deprecated. Pass creature object to functions needing it, instead of the old "first select, then call" approach.]]></description>
+		</element>
+		<element name="size" type="integer" flags="3"/>
+		<element name="creature" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Deprecated. Pass creature object to functions needing it, instead of the old "first select, then call" approach.]]></description>
+		</element>
+		<element name="createFromGenotype" function="true" type="Creature" deprecated="true" flags="8226">
+			<description><![CDATA[Uses the selected Genotype object.]]></description>
+<arguments/></element>
+		<element name="createFromString" function="true" type="Creature" deprecated="true" flags="8226">
+			<description><![CDATA[Uses the supplied string argument.]]></description>
+			<arguments>
+				<argument name="genotype" type="string"/>
+			</arguments>
+		</element>
+		<element name="killSelected" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Applies to the selected Creature.]]></description>
+<arguments/></element>
+		<element name="deleteSelected" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Applies to the selected Creature.]]></description>
+<arguments/></element>
+		<element name="addGroup" function="true" type="Population" flags="34">
 			<description><![CDATA[Adds a new population.]]></description>
 			<arguments>
@@ -2630,38 +3044,36 @@
 			</arguments>
 		</element>
-		<element name="clear" function="true" type="void">
+		<element name="deleteGroup" function="true" type="void" flags="34">
+			<description><![CDATA[Removes a population.]]></description>
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="clear" function="true" type="void" flags="34">
 			<description><![CDATA[Removes all populations except the first one.]]></description>
 <arguments/></element>
-		<element name="clearGroup" function="true" type="void">
+		<element name="clearGroup" function="true" type="void" deprecated="true" flags="8226">
+			<description><![CDATA[Deprecated.
+Use Populations[pop_index].clear() instead of Populations.clearGroup(pop_index); ]]></description>
 			<arguments>
 				<argument name="index" type="integer"/>
 			</arguments>
 		</element>
-		<element name="creatBBCollisions" function="true" type="integer">
+		<element name="creatBBCollisions" function="true" type="integer" deprecated="true" flags="8226">
 			<description><![CDATA[Checks approximate collisions for the selected creature.
-Returns the collision mask calculated as in the regular simulation. The argument is the collision mask substituted for the selected creature (defaults to group colmask for 0).]]></description>
+Returns the collision mask calculated as ( creature.selfmask & other_creatures.othermask ).
+Passing non-zero argument is equivalent to setting a temporary selfmask for the current creature.
+
+Deprecated. Use Creature.boundingBoxCollisions()]]></description>
 			<arguments>
 				<argument name="mask" type="integer"/>
 			</arguments>
 		</element>
-		<element name="createFromGenotype" function="true" type="Creature">
-			<description><![CDATA[Uses the selected Genotype object.]]></description>
-<arguments/></element>
-		<element name="createFromString" function="true" type="Creature">
-			<description><![CDATA[Uses the supplied string argument.]]></description>
-			<arguments>
-				<argument name="genotype" type="string"/>
-			</arguments>
-		</element>
-		<element name="deleteGroup" function="true" type="void">
-			<description><![CDATA[Removes a population.]]></description>
+		<element name="get" function="true" type="Population" flags="34">
 			<arguments>
 				<argument name="index" type="integer"/>
 			</arguments>
 		</element>
-		<element name="deleteSelected" function="true" type="void">
-			<description><![CDATA[Applies to the selected Creature.]]></description>
-<arguments/></element>
-		<element name="findCreatureAt" function="true" type="Creature">
+		<element name="findCreatureAt" function="true" type="Creature" flags="34">
 			<arguments>
 				<argument name="point" type="Vector"/>
@@ -2669,12 +3081,5 @@
 			</arguments>
 		</element>
-		<element name="get" function="true" type="Population">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="killSelected" function="true" type="void">
-			<description><![CDATA[Applies to the selected Creature.]]></description>
-<arguments/></element>
+		<element name="iterator" type="Object" flags="291"/>
 	</type>
 	<type name="Ref" context="Global context">
@@ -2688,7 +3093,9 @@
 function square(r)
 {r.value=r.value*r.value;}
-//square receives the Reference objects and changes its 'value' field]]></description>
-		<element name="toString" type="string"/>
-		<element name="value" type="untyped"/>
+//square receives the Reference object and changes its 'value' field]]></description>
+		<element name="value" type="untyped" flags="256"/>
+		<element name="newO" function="true">
+			<description><![CDATA[(for internal use only) use &variablename to create Ref objects.]]></description>
+		</element>
 		<element name="copyFrom" function="true" type="void">
 			<description><![CDATA[make the reference point to the same target,]]></description>
@@ -2697,14 +3104,8 @@
 			</arguments>
 		</element>
-		<element name="newO" function="true">
-			<description><![CDATA[(for internal use only) use &variablename to create Ref objects.]]></description>
-		</element>
-		<element name="newS" function="true">
-			<description><![CDATA[(for internal use only) use &variablename to create Ref objects.]]></description>
-		</element>
+		<element name="toString" type="string" flags="257"/>
 	</type>
 	<type name="Shapes" context="Global context">
 <description><![CDATA[This object defines appearance of the elements of creatures (applies to the 'wireframe' display mode). Default shape definitions make food's "p:" look like a sphere, and manipulator's "p:" look like a robot hand. The model's Vstyle property is the name of the shape. Developers of experiment definitions can introduce new Vstyle(s) for their expdef and provide appropriate shape definitions by calling Shapes.set(...) in the onExpDefLoad() function.]]></description>
-		<element name="clear" function="true" type="void"><arguments/></element>
 		<element name="set" function="true" type="void">
 			<description><![CDATA[Arguments:
@@ -2730,4 +3131,5 @@
 			</arguments>
 		</element>
+		<element name="clear" function="true" type="void"><arguments/></element>
 	</type>
 	<type name="Signal" context="Global context">
@@ -2740,24 +3142,31 @@
 
 Creating: Use "add" in Creature.signals, Neuro.signals, or World.signals.]]></description>
-		<element name="channel" type="string">
-			<description><![CDATA[Channel name, readonly.]]></description>
-		</element>
-		<element name="flavor" type="float">
-			<description><![CDATA[Signal flavor is can be used to differentiate between signals in a single channel. ]]></description>
-		</element>
-		<element name="pos" type="XYZ">
-			<description><![CDATA[Signal position, readonly.]]></description>
-		</element>
-		<element name="power" type="float">
+		<element name="value" type="untyped" flags="256">
+			<description><![CDATA[Signal value can be any type. On the receiver side it is only available by accessing the individual Signal objects, i.e. after calling receiveSet() or receiveSingle(). The aggregating functions receive() and receiveFilter() ignore this attribute.]]></description>
+		</element>
+		<element name="power" type="float" flags="256">
 			<description><![CDATA[Signal power affects the aggregated signal value returned from receive() and receiveFilter().]]></description>
 		</element>
-		<element name="value" type="untyped">
-			<description><![CDATA[Signal value can be any type. On the receiver side it is only available by accessing the individual Signal objects, i.e. after calling receiveSet() or receiveSingle(). The aggregating function receive() and receiveFilter() ignore this attribute.]]></description>
-		</element>
-		<element name="remove" function="true">
-			<description><![CDATA[Deletes the signal]]></description>
+		<element name="flavor" type="float" flags="256">
+			<description><![CDATA[Signal flavor can be used to differentiate between signals in a single channel.]]></description>
+		</element>
+		<element name="channel" type="string" flags="257">
+			<description><![CDATA[Channel name, read-only.]]></description>
+		</element>
+		<element name="pos" type="XYZ" flags="257">
+			<description><![CDATA[Signal position, read-only.]]></description>
+		</element>
+		<element name="remove" function="true" flags="256">
+			<description><![CDATA[Deletes the signal.]]></description>
 		</element>
 	</type>
 	<type name="SignalView" context="Global context">
+<description><![CDATA[This object can be used by an Experiment Definition or a Framsticks Theater show script to configure the preferred Signal visualization in the experiment. SignalView.mode and SignalView.label can also be adjusted in the Framsticks GUI (overriding the script-configured state).]]></description>
+		<element name="clear" function="true">
+			<description><![CDATA[Removes custom display settings that might have been defined by various scripts (expdef or show).]]></description>
+		</element>
+		<element name="mode" type="integer" min="0" max="2">
+			<description><![CDATA["Automatic" labels all signal sources in all channels and shows the intensity map of the first channel. This is sufficient for many simple setups, but as the number of signals and channels grows, the display becomes cluttered. In such cases, the experiment definition can define "Custom" signal visualization tailored for the particular experiment.]]></description>
+		</element>
 		<element name="labels" type="string">
 			<description><![CDATA[The label formula should return text to be displayed over the signal source, presumably by reading some values from the supplied Signal object. It is especially useful for more sophisticated signal usage scenarios, when Signal.value keeps a reference to an object (the default signal label only shows <XXX Object at xxxxx> in such cases).
@@ -2769,8 +3178,5 @@
 return "power="+Signal.power;]]></description>
 		</element>
-		<element name="mode" type="integer" min="0" max="2">
-			<description><![CDATA["Automatic" labels all signal sources in all channels and shows the intensity map of the first channel. This is sufficient for many simple setups, but as the number of signals and channels grows, the display becomes cluttered. In such cases, the experiment definition can define "Custom" signal visualization tailored for the particular experiment.]]></description>
-		</element>
-		<element name="addMap" function="true" type="void">
+		<element name="addMap" function="true" type="void" flags="32">
 			<arguments>
 				<argument name="channel" type="string"/>
@@ -2778,5 +3184,5 @@
 			</arguments>
 		</element>
-		<element name="addSignals" function="true" type="void">
+		<element name="addSignals" function="true" type="void" flags="32">
 			<arguments>
 				<argument name="channel" type="string"/>
@@ -2787,5 +3193,5 @@
 			</arguments>
 		</element>
-		<element name="addSignalsFilter" function="true" type="void">
+		<element name="addSignalsFilter" function="true" type="void" flags="32">
 			<arguments>
 				<argument name="channel" type="string"/>
@@ -2798,917 +3204,89 @@
 			</arguments>
 		</element>
-		<element name="clear" function="true">
-			<description><![CDATA[Removes custom display settings that might have been defined by various scripts (expdef or show).]]></description>
-		</element>
 	</type>
 	<type name="sim_params" context="Global context">
 <description><![CDATA[This object groups all simulator parameters so they can be loaded or saved with a single call (see scripts/standard_loadsave.inc). For other purposes please use specific objects, like Simulator, World, Populations, etc.]]></description>
-		<element name="autosaveperiod" type="integer" min="0" max="100000">
-			<description><![CDATA[Save simulation state once every n-th event
-(events are defined by the script. For 'standard.expdef' it is after each death).
-Save EXPT file first to initialize name for autosave files.]]></description>
-		</element>
-		<element name="bnoise_struct" type="float" min="0" max="10" default="0">
-			<description><![CDATA[When >0, body constructs of creatures (position of Parts) will be randomly disturbed when they are created.]]></description>
-		</element>
-		<element name="bnoise_vel" type="float" min="0" max="10" default="0">
-			<description><![CDATA[Random velocities will be applied to all body Parts (in MechaStick) or rigid segments (in ODE) of newly created creatures.]]></description>
-		</element>
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="createrr" type="integer" min="0" max="2" default="1"/>
-		<element name="creatwarnfail" type="integer" min="0" max="1">
-			<description><![CDATA[Creatures grown with warnings will not be simulated.]]></description>
-		</element>
-		<element name="expdef" type="string">
-			<description><![CDATA[Choose the experiment framework
-(in Windows GUI, confirm by pressing 'Apply')
-
-Stop the simulation before selecting another experiment definition.
-It is a good practice to initialize the experiment before running the simulation.]]></description>
-		</element>
-		<element name="expdef_info" type="string"/>
-		<element name="expdef_title" type="string"/>
-		<element name="f0_c_del" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_c_new" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_c_wei" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_del" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_new" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_rsf" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_stf" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_j_stm" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_n_del" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_n_new" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_n_prp" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_nodel_tag" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[You can tag elements using their 'i' field and the i="mi=d" tag.
-Mutations will not delete such elements.
-The i="mi=dm" combination is allowed.]]></description>
-		</element>
-		<element name="f0_nomod_tag" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[You can tag elements using their 'i' field and the i="mi=m" tag.
-Mutations will not modify properties of such elements.
-The i="mi=md" combination is allowed.]]></description>
-		</element>
-		<element name="f0_p_asm" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_del" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_frc" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_ing" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_mas" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_new" type="float" min="0" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_pos" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f0_p_swp" type="float" min="0" max="100" default="10">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f1_mut_exmod" type="string">
-			<description><![CDATA[Modifiers that will not be added nor deleted during mutation
-(all: RrLlAaCcFfMmSsIiQqWwEe)]]></description>
-		</element>
-		<element name="f1_nmConn" type="float" min="0" max="100" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f1_nmNeu" type="float" min="0" max="100" default="0.05">
-			<description><![CDATA[Adds a (connected) neuron or removes a neuron]]></description>
-		</element>
-		<element name="f1_nmProp" type="float" min="0" max="100" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f1_nmVal" type="float" min="0" max="100" default="0.05"/>
-		<element name="f1_nmWei" type="float" min="0" max="100" default="1"/>
-		<element name="f1_smComma" type="float" min="0" max="100" default="0.02"/>
-		<element name="f1_smJunct" type="float" min="0" max="100" default="0.02"/>
-		<element name="f1_smModif" type="float" min="0" max="100" default="0.1">
-			<description><![CDATA[Modifiers: RrLlAaCcFfMmSsIiQqWwEe]]></description>
-		</element>
-		<element name="f1_smX" type="float" min="0" max="100" default="0.05"/>
-		<element name="f1_xo_propor" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[Cross over (exchange) corresponding segments of the two parent genotypes?
-
-f1 uses a two-point crossing over.
-If this option is turned on, cut points will be selected proportionally to neural genes.
-Thus, if both parents have the same number of neurons, then this will be preserved in their children.]]></description>
-		</element>
-		<element name="f2_mutAddOper" type="float" min="0" max="1" default="0.4">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutConnElem" type="float" min="0" max="1" default="0.33">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutDelOper" type="float" min="0" max="1" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutHandleOper" type="float" min="0" max="1" default="0.3">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutJointElem" type="float" min="0" max="1" default="0.33">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutNeuroElem" type="float" min="0" max="1" default="0.33">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f2_mutPropOper" type="float" min="0" max="1" default="0.2">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutDelIns" type="float" min="0" max="1" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutDelInsLength" type="integer" min="1" max="100" default="5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutDelInsPerChar" type="float" min="0" max="1" default="0.05">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutDuplication" type="float" min="0" max="1" default="0.05">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutSubstitution" type="float" min="0" max="1" default="0.6">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutSubstPerChar" type="float" min="0" max="1" default="0.1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_mutTranslocation" type="float" min="0" max="1" default="0.15">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_xovCrossingOver" type="float" min="0" max="1" default="0.2">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f3_xovGeneTransfer" type="float" min="0" max="1" default="0.8">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="f4_mut_add" type="float" min="0" max="100" default="50">
-			<description><![CDATA[mutation: probability of adding a node]]></description>
-		</element>
-		<element name="f4_mut_add_conn" type="float" min="0" max="100" default="15">
-			<description><![CDATA[add node mutation: probability of adding a neural connection]]></description>
-		</element>
-		<element name="f4_mut_add_div" type="float" min="0" max="100" default="20">
-			<description><![CDATA[add node mutation: probability of adding a division]]></description>
-		</element>
-		<element name="f4_mut_add_neupar" type="float" min="0" max="100" default="5">
-			<description><![CDATA[add node mutation: probability of adding a neuron property/modifier]]></description>
-		</element>
-		<element name="f4_mut_add_rep" type="float" min="0" max="100" default="10">
-			<description><![CDATA[add node mutation: probability of adding a repetition]]></description>
-		</element>
-		<element name="f4_mut_add_simp" type="float" min="0" max="100" default="50">
-			<description><![CDATA[add node mutation: probability of adding a random, simple gene]]></description>
-		</element>
-		<element name="f4_mut_del" type="float" min="0" max="100" default="20">
-			<description><![CDATA[mutation: probability of deleting a node]]></description>
-		</element>
-		<element name="f4_mut_mod" type="float" min="0" max="100" default="30">
-			<description><![CDATA[mutation: probability of changing a node]]></description>
-		</element>
-		<element name="filecomm" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[Display comments encountered in opened files]]></description>
-		</element>
-		<element name="gen_extmutinfo" type="integer" min="0" max="2" default="0">
-			<description><![CDATA[If active, information about employed mutation method will be stored in the 'info' field of each mutated genotype.]]></description>
-		</element>
-		<element name="gen_hilite" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[Use colors for genes?
-(slows down viewing/editing of huge genotypes)]]></description>
-		</element>
-		<element name="gen_hist" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[Required for phylogenetic analysis]]></description>
-		</element>
-		<element name="genkonw0" type="integer" min="0" max="1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genkonw1" type="integer" min="0" max="1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genkonw2" type="integer" min="0" max="1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genkonw3" type="integer" min="0" max="1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genolib" type="GenePools"/>
-		<element name="genoper_f0" type="integer" min="0" max="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genoper_f1" type="integer" min="0" max="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genoper_f2" type="integer" min="0" max="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genoper_f3" type="integer" min="0" max="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="genoper_f4" type="integer" min="0" max="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="groupchk" type="integer" min="0" max="1"/>
-		<element name="importchk" type="integer" min="0" max="1"/>
-		<element name="livelib" type="Populations"/>
-		<element name="loadchk" type="integer" min="0" max="1"/>
-		<element name="maxjoint" type="float" min="0" max="100" default="2"/>
-		<element name="minjoint" type="float" min="0" max="100" default="0"/>
-		<element name="neuadd_N" type="integer" min="0" max="1">
-			<description><![CDATA[Standard neuron
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-
-
-Properties:
-   Inertia (in) float 0..1
-   Force (fo) float 0..999
-   Sigmoid (si) float -99999..99999
-   State (s) float -1..1]]></description>
-		</element>
-		<element name="neuadd_Nu" type="integer" min="0" max="1">
-			<description><![CDATA[Works like standard neuron (N) but the output value is scaled to 0...+1 instead of -1...+1.
-Having 0 as one of the saturation states should help in "gate circuits", where input signal is passed through or blocked depending on the other singal.
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-
-
-Properties:
-   Inertia (in) float 0..1
-   Force (fo) float 0..999
-   Sigmoid (si) float -99999..99999
-   State (s) float -1..1]]></description>
-		</element>
-		<element name="neuadd_G" type="integer" min="0" max="1">
-			<description><![CDATA[Equilibrium sensor.
-0=the stick is horizontal
-+1/-1=the stick is vertical
-
-Characteristics:
-   does not use inputs
-   provides output value
-   should be located on a Joint
-]]></description>
-		</element>
-		<element name="neuadd_T" type="integer" min="0" max="1">
-			<description><![CDATA[Touch sensor.
--1=no contact
-0=just touching
->0=pressing, value depends on the force applied
-
-Characteristics:
-   does not use inputs
-   provides output value
-   should be located on a Part
-
-
-Properties:
-   Range (r) float 0..1]]></description>
-		</element>
-		<element name="neuadd_S" type="integer" min="0" max="1">
-			<description><![CDATA[Smell sensor. Aggregated "smell of energy" experienced from all energy objects (creatures and food pieces).
-Close objects have bigger influence than the distant ones: for each energy source, its partial feeling is proportional to its energy/(distance^2)
-
-Characteristics:
-   does not use inputs
-   provides output value
-   should be located on a Part
-]]></description>
-		</element>
-		<element name="neuadd_*" type="integer" min="0" max="1">
-			<description><![CDATA[Constant value
-
-Characteristics:
-   does not use inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="neuadd_|" type="integer" min="0" max="1">
-			<description><![CDATA[Characteristics:
-   uses single input
-   does not provide output value
-   should be located on a Joint
-
-
-Properties:
-   power (p) float 0.01..1
-   bending range (r) float 0..1]]></description>
-		</element>
-		<element name="neuadd_@" type="integer" min="0" max="1">
-			<description><![CDATA[Characteristics:
-   uses single input
-   does not provide output value
-   should be located on a Joint
-
-
-Properties:
-   power (p) float 0.01..1]]></description>
-		</element>
-		<element name="neuadd_D" type="integer" min="0" max="1">
-			<description><![CDATA[Calculate the difference between the current and previous input value. Multiple inputs are aggregated with respect to their weights
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="neuadd_Fuzzy" type="integer" min="0" max="1">
-			<description><![CDATA[Refer to publications to learn more about this neuron.
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-
-
-Properties:
-   number of fuzzy sets (ns) integer
-   number of rules (nr) integer
-   fuzzy sets (fs) string
-   fuzzy rules (fr) string]]></description>
-		</element>
-		<element name="neuadd_VEye" type="integer" min="0" max="1">
-			<description><![CDATA[Refer to publications to learn more about this neuron.
-
-Characteristics:
-   uses single input
-   provides output value
-   should be located on a Part
-
-
-Properties:
-   target.x (tx) float
-   target.y (ty) float
-   target.z (tz) float
-   target shape (ts) string
-   perspective (p) float 0.1..10
-   scale (s) float 0.1..100
-   show hidden lines (h) integer 0..1
-   output lines count (each line needs four channels) (o) integer 0..99
-   debug (d) integer 0..1]]></description>
-		</element>
-		<element name="neuadd_VMotor" type="integer" min="0" max="1">
-			<description><![CDATA[Must be connected to the VEye and properly set up. Refer to publications to learn more about this neuron.
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-
-
-Properties:
-   number of basic features (noIF) integer
-   number of degrees of freedom (noDim) integer
-   parameters (params) string]]></description>
-		</element>
-		<element name="neuadd_Sti" type="integer" min="0" max="1">
-			<description><![CDATA[Characteristics:
-   uses single input
-   does not provide output value
-   should be located on a Part
-]]></description>
-		</element>
-		<element name="neuadd_LMu" type="integer" min="0" max="1">
-			<description><![CDATA[Characteristics:
-   uses single input
-   does not provide output value
-   should be located on a Joint
-
-
-Properties:
-   power (p) float 0.01..1]]></description>
-		</element>
-		<element name="neuadd_Water" type="integer" min="0" max="1">
-			<description><![CDATA[Output signal:
-0=on or above water surface
-1=under water (deeper than 1)
-0..1=in the transient area just below water surface
-
-Characteristics:
-   does not use inputs
-   provides output value
-   should be located on a Part
-]]></description>
-		</element>
-		<element name="neuadd_Energy" type="integer" min="0" max="1">
-			<description><![CDATA[The current energy level divided by the initial energy level.
-Usually falls from initial 1.0 down to 0.0 and then the creature dies. It can rise above 1.0 if enough food is ingested
-
-Characteristics:
-   does not use inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="neuadd_Ch" type="integer" min="0" max="1">
-			<description><![CDATA[Combines all input signals into a single multichannel output; Note: ChSel and ChMux are the only neurons which support multiple channels. Other neurons discard everything except the first channel.
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="neuadd_ChMux" type="integer" min="0" max="1">
-			<description><![CDATA[Outputs the selected channel from the second (multichannel) input. The first input is used as the selector value (-1=select first channel, .., 1=last channel)
-
-Characteristics:
-   uses 2 inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="neuadd_ChSel" type="integer" min="0" max="1">
-			<description><![CDATA[Outputs a single channel (selected by the "ch" parameter) from multichannel input
-
-Characteristics:
-   uses single input
-   provides output value
-   does not require location in body
-
-
-Properties:
-   channel (ch) integer]]></description>
-		</element>
-		<element name="neuadd_Rnd" type="integer" min="0" max="1">
-			<description><![CDATA[Generates random noise (subsequent random values in the range of -1..+1)
-
-Characteristics:
-   does not use inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="neuadd_Sin" type="integer" min="0" max="1">
-			<description><![CDATA[Output frequency = f0+input
-
-Characteristics:
-   uses single input
-   provides output value
-   does not require location in body
-
-
-Properties:
-   base frequency (f0) float -1..1
-   time (t) float 0..6.28319]]></description>
-		</element>
-		<element name="ncl_N" type="integer" min="0" max="1">
-			<description><![CDATA[Standard neuron
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-
-
-Properties:
-   Inertia (in) float 0..1
-   Force (fo) float 0..999
-   Sigmoid (si) float -99999..99999
-   State (s) float -1..1]]></description>
-		</element>
-		<element name="ncl_Nu" type="integer" min="0" max="1">
-			<description><![CDATA[Works like standard neuron (N) but the output value is scaled to 0...+1 instead of -1...+1.
-Having 0 as one of the saturation states should help in "gate circuits", where input signal is passed through or blocked depending on the other singal.
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-
-
-Properties:
-   Inertia (in) float 0..1
-   Force (fo) float 0..999
-   Sigmoid (si) float -99999..99999
-   State (s) float -1..1]]></description>
-		</element>
-		<element name="ncl_G" type="integer" min="0" max="1">
-			<description><![CDATA[Equilibrium sensor.
-0=the stick is horizontal
-+1/-1=the stick is vertical
-
-Characteristics:
-   does not use inputs
-   provides output value
-   should be located on a Joint
-]]></description>
-		</element>
-		<element name="ncl_T" type="integer" min="0" max="1">
-			<description><![CDATA[Touch sensor.
--1=no contact
-0=just touching
->0=pressing, value depends on the force applied
-
-Characteristics:
-   does not use inputs
-   provides output value
-   should be located on a Part
-
-
-Properties:
-   Range (r) float 0..1]]></description>
-		</element>
-		<element name="ncl_S" type="integer" min="0" max="1">
-			<description><![CDATA[Smell sensor. Aggregated "smell of energy" experienced from all energy objects (creatures and food pieces).
-Close objects have bigger influence than the distant ones: for each energy source, its partial feeling is proportional to its energy/(distance^2)
-
-Characteristics:
-   does not use inputs
-   provides output value
-   should be located on a Part
-]]></description>
-		</element>
-		<element name="ncl_*" type="integer" min="0" max="1">
-			<description><![CDATA[Constant value
-
-Characteristics:
-   does not use inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="ncl_|" type="integer" min="0" max="1">
-			<description><![CDATA[Characteristics:
-   uses single input
-   does not provide output value
-   should be located on a Joint
-
-
-Properties:
-   power (p) float 0.01..1
-   bending range (r) float 0..1]]></description>
-		</element>
-		<element name="ncl_@" type="integer" min="0" max="1">
-			<description><![CDATA[Characteristics:
-   uses single input
-   does not provide output value
-   should be located on a Joint
-
-
-Properties:
-   power (p) float 0.01..1]]></description>
-		</element>
-		<element name="ncl_D" type="integer" min="0" max="1">
-			<description><![CDATA[Calculate the difference between the current and previous input value. Multiple inputs are aggregated with respect to their weights
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="ncl_Fuzzy" type="integer" min="0" max="1">
-			<description><![CDATA[Refer to publications to learn more about this neuron.
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-
-
-Properties:
-   number of fuzzy sets (ns) integer
-   number of rules (nr) integer
-   fuzzy sets (fs) string
-   fuzzy rules (fr) string]]></description>
-		</element>
-		<element name="ncl_VEye" type="integer" min="0" max="1">
-			<description><![CDATA[Refer to publications to learn more about this neuron.
-
-Characteristics:
-   uses single input
-   provides output value
-   should be located on a Part
-
-
-Properties:
-   target.x (tx) float
-   target.y (ty) float
-   target.z (tz) float
-   target shape (ts) string
-   perspective (p) float 0.1..10
-   scale (s) float 0.1..100
-   show hidden lines (h) integer 0..1
-   output lines count (each line needs four channels) (o) integer 0..99
-   debug (d) integer 0..1]]></description>
-		</element>
-		<element name="ncl_VMotor" type="integer" min="0" max="1">
-			<description><![CDATA[Must be connected to the VEye and properly set up. Refer to publications to learn more about this neuron.
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-
-
-Properties:
-   number of basic features (noIF) integer
-   number of degrees of freedom (noDim) integer
-   parameters (params) string]]></description>
-		</element>
-		<element name="ncl_Sti" type="integer" min="0" max="1">
-			<description><![CDATA[Characteristics:
-   uses single input
-   does not provide output value
-   should be located on a Part
-]]></description>
-		</element>
-		<element name="ncl_LMu" type="integer" min="0" max="1">
-			<description><![CDATA[Characteristics:
-   uses single input
-   does not provide output value
-   should be located on a Joint
-
-
-Properties:
-   power (p) float 0.01..1]]></description>
-		</element>
-		<element name="ncl_Water" type="integer" min="0" max="1">
-			<description><![CDATA[Output signal:
-0=on or above water surface
-1=under water (deeper than 1)
-0..1=in the transient area just below water surface
-
-Characteristics:
-   does not use inputs
-   provides output value
-   should be located on a Part
-]]></description>
-		</element>
-		<element name="ncl_Energy" type="integer" min="0" max="1">
-			<description><![CDATA[The current energy level divided by the initial energy level.
-Usually falls from initial 1.0 down to 0.0 and then the creature dies. It can rise above 1.0 if enough food is ingested
-
-Characteristics:
-   does not use inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="ncl_Ch" type="integer" min="0" max="1">
-			<description><![CDATA[Combines all input signals into a single multichannel output; Note: ChSel and ChMux are the only neurons which support multiple channels. Other neurons discard everything except the first channel.
-
-Characteristics:
-   supports any number of inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="ncl_ChMux" type="integer" min="0" max="1">
-			<description><![CDATA[Outputs the selected channel from the second (multichannel) input. The first input is used as the selector value (-1=select first channel, .., 1=last channel)
-
-Characteristics:
-   uses 2 inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="ncl_ChSel" type="integer" min="0" max="1">
-			<description><![CDATA[Outputs a single channel (selected by the "ch" parameter) from multichannel input
-
-Characteristics:
-   uses single input
-   provides output value
-   does not require location in body
-
-
-Properties:
-   channel (ch) integer]]></description>
-		</element>
-		<element name="ncl_Rnd" type="integer" min="0" max="1">
-			<description><![CDATA[Generates random noise (subsequent random values in the range of -1..+1)
-
-Characteristics:
-   does not use inputs
-   provides output value
-   does not require location in body
-]]></description>
-		</element>
-		<element name="ncl_Sin" type="integer" min="0" max="1">
-			<description><![CDATA[Output frequency = f0+input
-
-Characteristics:
-   uses single input
-   provides output value
-   does not require location in body
-
-
-Properties:
-   base frequency (f0) float -1..1
-   time (t) float 0..6.28319]]></description>
-		</element>
-		<element name="nnspeed" type="float" min="0" max="1000" default="1">
-			<description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description>
-		</element>
-		<element name="odeairdrag" type="float" min="0" max="0.5" default="0.01">
-			<description><![CDATA[A drag force ("air drag") proportional to the velocity of mass centers of moving parts]]></description>
-		</element>
-		<element name="odecol2bounce" type="float" min="0" max="1" default="0.1"/>
-		<element name="odecol2bouncevel" type="float" min="0" max="1" default="0.01"/>
-		<element name="odecol2mumax" type="float" min="0" max="10" default="1">
-			<description><![CDATA[Mu coefficient for Parts with maximal friction (i.e. "FFFFF" in f1)]]></description>
-		</element>
-		<element name="odecol2mumin" type="float" min="0" max="10" default="0.1">
-			<description><![CDATA[Mu coefficient for Parts with minimal friction (i.e. "fffff" in f1)]]></description>
-		</element>
-		<element name="odecol2softcfm" type="float" min="0" max="1" default="0"/>
-		<element name="odecolbounce" type="float" min="0" max="1" default="0.1"/>
-		<element name="odecolbouncevel" type="float" min="0" max="1" default="0.01"/>
-		<element name="odecolmumax" type="float" min="0" max="10" default="5">
-			<description><![CDATA[Mu coefficient for Parts with maximal friction (i.e. "FFFFF" in f1)]]></description>
-		</element>
-		<element name="odecolmumin" type="float" min="0" max="10" default="0.1">
-			<description><![CDATA[Mu coefficient for Parts with minimal friction (i.e. "fffff" in f1)]]></description>
-		</element>
-		<element name="odecolsoftcfm" type="float" min="0" max="1" default="0"/>
-		<element name="odemusclemax" type="float" min="0" max="100" default="10">
-			<description><![CDATA[i.e. "MMMMM" if f1]]></description>
-		</element>
-		<element name="odemusclemin" type="float" min="0" max="100" default="0">
-			<description><![CDATA[i.e. "mmmmm" in f1]]></description>
-		</element>
-		<element name="odemusclespeed" type="float" min="0" max="10" default="1">
-			<description><![CDATA[Muscle state cannot change faster than the supplied value]]></description>
-		</element>
-		<element name="odeseed" type="integer" min="0" max="2">
-			<description><![CDATA[Affects collisions.
-- 'Truly random' is closest to the standard ODE operation. Use Math.seed to influence randomness in ODE collisions
-- 'Deterministic' automatically calculates random seed in each step based on the current simulation (world) state, which makes the simulation repeatable but more random than 'Fixed'
-- 'Fixed' is completely deterministic and does not depend on Math.seed. This might negatively affect ODE accuracy
-]]></description>
-		</element>
-		<element name="odeshape" type="integer" min="0" max="1"/>
-		<element name="odestep" type="float" min="0.001" max="1" default="0.05"/>
-		<element name="odewaterbuoy" type="float" min="0" max="2" default="1"/>
-		<element name="odewaterdrag" type="float" min="0.001" max="1" default="0.5"/>
-		<element name="overwrite" type="integer" min="0" max="1">
-			<description><![CDATA[Overwite existing files or create their backups]]></description>
-		</element>
-		<element name="randinit" type="float" min="0" max="10" default="0.01">
-			<description><![CDATA[Allowed range for initializing all neuron states with uniform distribution random numbers and zero mean. Set 0 for deterministic initialization.]]></description>
-		</element>
-		<element name="resetonexpdef" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[If turned on: when a new experiment definition is selected, default values are loaded for most of the simulator parameters, and gene pools and populations are cleared.
-When turned off: parameters from previous experiment definition will remain.]]></description>
-		</element>
-		<element name="running" type="integer" min="0" max="1">
-			<description><![CDATA[for synchronizing the user interface state]]></description>
-		</element>
-		<element name="signals" type="WorldSignals"/>
-		<element name="simil_method" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="simil_neuro" type="float" min="0" max="100" default="0.5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="simil_partdeg" type="float" min="0" max="100" default="1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="simil_parts" type="float" min="0" max="100" default="0">
-			<description><![CDATA[Differing number of parts is also handled by the 'part degree' similarity component.]]></description>
-		</element>
-		<element name="simspeed" type="integer">
-			<description><![CDATA[steps/second]]></description>
-		</element>
-		<element name="simtype" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[MechaStick is a fast and simple primary Framsticks simulation engine.
-ODE is Open Dynamics Engine by Russel Smith et al.
-
-NOTE: switching between simulation engines causes removal of all objects in the world (e.g. creatures).]]></description>
-		</element>
-		<element name="symAlphaSteps" type="integer" min="2" max="50" default="20">
-			<description><![CDATA[Default number of samples per full angle (#1)]]></description>
-		</element>
-		<element name="symBetaSteps" type="integer" min="2" max="50" default="20">
-			<description><![CDATA[Default number of samples per full angle (#2)]]></description>
-		</element>
-		<element name="symPosSteps" type="integer" min="2" max="50" default="10">
-			<description><![CDATA[Default number of samples per stick length]]></description>
-		</element>
-		<element name="symResultA" type="float"/>
-		<element name="symResultB" type="float"/>
-		<element name="symResultC" type="float"/>
-		<element name="symResultD" type="float"/>
-		<element name="time" type="integer"/>
-		<element name="touchrange" type="float" min="0" max="100" default="1"/>
-		<element name="usercode" type="string">
-			<description><![CDATA[This script overrides the experiment definition]]></description>
-		</element>
-		<element name="vmdebug" type="integer" min="0" max="1"/>
-		<element name="world" type="World"/>
-		<element name="wrldbnd" type="integer" min="0" max="2" default="1"/>
-		<element name="wrldg" type="float" min="0" max="10" default="1">
-			<description><![CDATA[You can adjust gravity for your experiments.
-The "official" setting used to evaluate and compare creatures is 1.]]></description>
-		</element>
-		<element name="wrldmap" type="string">
-			<description><![CDATA[Description of the world (Type: Blocks or Heighfield). Enter
-   r <sizex> <sizey> [seed]
-to generate a random landscape, or
-   m <sizex> <sizey> digits
-   M <sizex> <sizey> numbers
-to provide height values.
-
-See also the WorldMap object.]]></description>
-		</element>
-		<element name="wrldsiz" type="float" min="10" max="1000" default="20">
-			<description><![CDATA[Side length of the world]]></description>
-		</element>
-		<element name="wrldtyp" type="integer" min="0" max="2" default="0"/>
-		<element name="wrldwat" type="float" min="-20" max="30" default="-1"/>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="beep" function="true" type="void">
+		<element name="print" function="true" type="void" flags="32">
+			<description><![CDATA[One argument: message to be printed]]></description>
+			<arguments>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="message" function="true" type="void" flags="32">
+			<description><![CDATA[The second argument can be:
+ -1 = debugging message
+ 0 = information
+ 1 = warning
+ 2 = error
+ 3 = critical error]]></description>
+			<arguments>
+				<argument name="text" type="string"/>
+				<argument name="level" type="integer"/>
+			</arguments>
+		</element>
+		<element name="sleep" function="true" type="void" flags="32">
+			<description><![CDATA[Suspends the execution for a specified interval]]></description>
+			<arguments>
+				<argument name="milliseconds" type="integer"/>
+			</arguments>
+		</element>
+		<element name="beep" function="true" type="void" flags="32">
 			<description><![CDATA[Plays a default system sound]]></description>
 <arguments/></element>
-		<element name="calculateSymmetry" function="true" type="float">
-			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model using default precision parameters (symPosSteps,symAlphaSteps,symBetaSteps). Returns the symmetry plane, too (sets symResultA,B,C,D).
-Note: may take a long time for large creatures.]]></description>
-			<arguments>
-				<argument name="model" type="Model"/>
-			</arguments>
-		</element>
-		<element name="calculateSymmetry2" function="true" type="float">
-			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model using specified precision parameters. Returns the symmetry plane, too (sets symResultA,B,C,D).
-Note: may take a long time for large creatures.]]></description>
-			<arguments>
-				<argument name="model" type="Model"/>
-				<argument name="posSteps" type="integer"/>
-				<argument name="alphaSteps" type="integer"/>
-				<argument name="betaSteps" type="integer"/>
-			</arguments>
-		</element>
-		<element name="calculateSymmetryForPlane" function="true" type="float">
-			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model and given a specific plane defined by coefficients A, B, C, D.]]></description>
-			<arguments>
-				<argument name="model" type="Model"/>
-				<argument name="A" type="float"/>
-				<argument name="B" type="float"/>
-				<argument name="C" type="float"/>
-				<argument name="D" type="float"/>
-			</arguments>
-		</element>
-		<element name="checkpoint" function="true" type="void">
-			<description><![CDATA[This function was previously called "autosave".]]></description>
-<arguments/></element>
-		<element name="clear" function="true"/>
-		<element name="crossOver" function="true" type="Geno">
-			<description><![CDATA[returns crossed over genotype]]></description>
-			<arguments>
-				<argument type="Geno"/>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="eval" function="true" type="void">
-			<arguments>
-				<argument name="script expression" type="string"/>
-			</arguments>
-		</element>
-		<element name="evaluateDistance" function="true" type="float">
-			<description><![CDATA[calculate dissimilarity between two models created from Geno objects]]></description>
-			<arguments>
-				<argument type="Geno"/>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="export" function="true" type="void">
+		<element name="sound" function="true" type="void" flags="32">
+			<description><![CDATA[Generates a simple tone on the speaker]]></description>
+			<arguments>
+				<argument name="freqency in Hz" type="integer"/>
+				<argument name="length in milliseconds" type="integer"/>
+			</arguments>
+		</element>
+		<element name="eval" function="true" type="void" flags="32">
+			<description><![CDATA[The argument must be a complete statement, e.g. "return 2+2;" is valid, while "2+2" is not. The EvalError object is returned for invalid statements.
+Example:
+var statement="function fun(a) {return a*a;} return fun(Math.pi);";
+var result=Simulator.eval(statement);
+if (typeof result=="EvalError")
+   Simulator.print("Error:"+result.message);
+else
+   Simulator.print("Result:"+result);]]></description>
+			<arguments>
+				<argument name="script statement" type="string"/>
+			</arguments>
+		</element>
+		<element name="load" function="true" type="void" flags="32">
+			<description><![CDATA[Load experiment file (calls onExpLoad() in the current experiment definition). This function is intended to replace the simulator state; the old state is cleared by automatically calling "resetToDefaults()". Use "import" if you don't want to loose the old simulator state.]]></description>
+			<arguments>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="import" function="true" type="void" flags="32">
+			<description><![CDATA[Load some data from file. The second optional argument selects what section(s) will be imported:
+	1 - experiment (works like "load" and can reset the simulator state!)
+	2 - genotypes
+	4 - simulator parameters
+	8 - genepool settings
+	16 - population settings
+	32 - new groups will be created for imported genepools and populations
+	64 - allow switching to a different expdef while importing parameters (4)
+
+The standard behavior (without the second argument) is to import genotypes, parameters, and genepool and population settings (2+4+8+16). Note that "64" is not included by default, because the expdef change resets all simulator parameters, which contradicts the usual meaning of "import" in Framsticks ("add data", as opposed to "load" meaning "replace data"). Moreover, using the "64" option in scripts can be dengerous, especially all expdef and show scripts should always declare the proper expdef name in their header rather than change the expdef directly. Without the "64" option, it is always safe to "import" any file in a script regardless of the current simulator state.]]></description>
+			<arguments>
+				<argument name="filename" type="string"/>
+				<argument name="options" type="integer"/>
+			</arguments>
+		</element>
+		<element name="import" function="true" type="void" flags="32">
+			<description><![CDATA[Equivalent to import(filename,2+4+8+16) - imports genotypes, parameters, genepool and population settings]]></description>
+			<arguments>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="save" function="true" type="untyped" flags="32">
+			<description><![CDATA[Save experiment file (calls onExpSave() in the current experiment definition)]]></description>
+			<arguments>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="export" function="true" type="untyped" flags="32">
 			<description><![CDATA[Save some data to file. arguments:
 - filename
@@ -3730,70 +3308,191 @@
 			</arguments>
 		</element>
-		<element name="getSimplest" function="true" type="Geno">
-			<description><![CDATA[returns the simplest genotype for a given encoding (format). 0 means f0, 4 means f4, etc.]]></description>
-			<arguments>
-				<argument name="format" type="integer"/>
-			</arguments>
-		</element>
-		<element name="import" function="true" type="void">
-			<description><![CDATA[Load some data from file. The second optional argument selects what section(s) will be imported:
- 1 - experiment (works like "load" and can reset the simulator state!)
- 2 - genotypes
- 4 - simulator parameters
- 8 - genepool settings
- 16 - population settings
- 32 - new groups will be created for imported genepools and populations
-64 - allow switching to a different expdef while importing parameters (4)
-
-The standard behavior (without the second argument) is to import genotypes, parameters, and genepool and population settings (2+4+8+16). Note that "64" is not included by default, because the expdef change resets all simulator parameters, which contradicts the usual meaning of "import" in Framsticks ("add data", as opposed to "load" meaning "replace data"). Moreover, using the "64" option in scripts can be dengerous, especially all expdef and show scripts should always declare the proper expdef name in their header rather than change the expdef directly. Without the "64" option, it is always safe to "import" any file in a script regardless of the current simulator state.]]></description>
-			<arguments>
-				<argument name="filename" type="string"/>
-				<argument name="options" type="integer"/>
-			</arguments>
-		</element>
+		<element name="start" function="true" type="void" flags="4096">
+			<description><![CDATA[called by the user interface]]></description>
+<arguments/></element>
+		<element name="stop" function="true" type="void" flags="4096">
+			<description><![CDATA[the expdef script calls this to stop simulation]]></description>
+<arguments/></element>
+		<element name="running" type="integer" min="0" max="1" flags="4130">
+			<description><![CDATA[useful for synchronizing the user interface state]]></description>
+		</element>
+		<element name="step" function="true" type="void" flags="32"><arguments/></element>
+		<element name="time" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Simulator.time will be removed because of its misleading name, please use Simulator.stepNumber instead.]]></description>
+		</element>
+		<element name="stepNumber" type="integer" flags="34"/>
+		<element name="simspeed" type="integer" flags="4131">
+			<description><![CDATA[steps/second]]></description>
+		</element>
+		<element name="expdef" type="string">
+			<description><![CDATA[Choose the experiment framework
+(in Windows GUI, confirm by pressing 'Apply')
+
+Stop the simulation before selecting another experiment definition.
+It is a good practice to initialize the experiment before running the simulation.]]></description>
+		</element>
+		<element name="expdef_title" type="string" flags="3"/>
+		<element name="expdef_info" type="string" flags="3"/>
 		<element name="init" function="true" type="void">
 			<description><![CDATA[Performs initialization procedures, like resetting counters, states, gene pools, etc.]]></description>
 <arguments/></element>
-		<element name="load" function="true" type="void">
-			<description><![CDATA[Load experiment file (calls onExpLoad() in the current experiment definition). This function is intended to replace the simulator state; the old state is cleared by automatically calling "resetToDefaults()" (only if "resetonexpdef" is enabled). Use "import" if you don't want to loose the old simulator state.]]></description>
-			<arguments>
-				<argument name="filename" type="string"/>
-			</arguments>
-		</element>
 		<element name="loadexpdef" function="true" type="void"><arguments/></element>
-		<element name="loadNeurons" function="true" type="void">
+		<element name="usercode" type="string" min="1">
+			<description><![CDATA[You can override any function from the original experiment definition script. Use the same function names and provide alternative implementations.
+Example:
+
+function onBorn(cr)
+{
+  Simulator.print("A creature is born: "+cr.name);
+  super_onBorn(cr); //calls the original implementation
+}]]></description>
+		</element>
+		<element name="autosaveperiod" type="integer" min="0" max="100000">
+			<description><![CDATA[Save simulation state once every n-th event
+(events are defined by the script. For 'standard.expdef' it is after each death).
+Save EXPT file first to initialize name for autosave files.
+Slave simulators (in multithreaded experiments) ignore this setting and never create autosave files.]]></description>
+		</element>
+		<element name="overwrite" type="integer" min="0" max="1" default="0">
+			<description><![CDATA[Lets you choose what to do when a file is created with the same name as an already existing file: overwite the existing file or create its backup?]]></description>
+		</element>
+		<element name="filecomm" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[Display comments encountered in opened files]]></description>
+		</element>
+		<element name="checkpoint" function="true" type="void" flags="32">
+			<description><![CDATA[This function was previously called "autosave".]]></description>
+<arguments/></element>
+		<element name="checkpointData" function="true" type="void" flags="32">
+			<description><![CDATA[In the distributed/paralellized scenario the data passed as argument can be received by the controlling entity (onSlaveCheckpoint in multithreaded master experiment, /simulator/expevent in distributed network simulator)]]></description>
+			<arguments>
+				<argument name="any_data" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="lastCheckpoint" type="untyped" flags="35">
+			<description><![CDATA[Most recently reported by the experiment definition script.]]></description>
+		</element>
+		<element name="createrr" type="integer" min="0" max="2" default="1"/>
+		<element name="creatwarnfail" type="integer" min="0" max="1">
+			<description><![CDATA[Creatures grown with warnings will not be simulated.]]></description>
+		</element>
+		<element name="groupchk" type="integer" min="0" max="1" default="1"/>
+		<element name="vmdebug" type="integer" min="0" max="1"/>
+		<element name="resetToDefaults" function="true" type="void">
+			<description><![CDATA[Clears groups and loads default values for simulator parameters, then calls onExpDefLoad() of the current experiment definition.]]></description>
+<arguments/></element>
+		<element name="new" function="true" type="Simulator" flags="32"><arguments/></element>
+		<element name="slaves" type="SlaveSimulators" flags="35"/>
+		<element name="cpus" type="integer" flags="35"/>
+		<element name="world" type="World" flags="35"/>
+		<element name="populations" type="Populations" flags="35"/>
+		<element name="genepools" type="GenePools" flags="35"/>
+		<element name="expparams" type="ExpParams" flags="35"/>
+		<element name="expstate" type="ExpState" flags="35"/>
+		<element name="genman" type="GenMan" flags="35"/>
+		<element name="loadNeurons" function="true" type="void" flags="32">
 			<arguments>
 				<argument name="directory path" type="string"/>
 			</arguments>
 		</element>
-		<element name="message" function="true" type="void">
-			<description><![CDATA[The second argument can be:
- -1 = debugging message
- 0 = information
- 1 = warning
- 2 = error
- 3 = critical error]]></description>
-			<arguments>
-				<argument name="text" type="string"/>
-				<argument name="level" type="integer"/>
-			</arguments>
-		</element>
-		<element name="mutate" function="true" type="Geno">
-			<description><![CDATA[returns mutated Geno object from supplied Geno]]></description>
-			<arguments>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="new" function="true" type="Simulator"><arguments/></element>
-		<element name="operReport" function="true" type="void">
-			<description><![CDATA[Show available genetic operators]]></description>
+		<element name="user" type="untyped" flags="34"/>
+		<element name="identity" type="integer" flags="35">
+			<description><![CDATA[-1 for master simulator, 0...count-1 for slaves]]></description>
+		</element>
+		<element name="refreshGUI" function="true" type="void" flags="32">
+			<description><![CDATA[Notify all populations and gene pools content changed.]]></description>
 <arguments/></element>
-		<element name="print" function="true" type="void">
-			<description><![CDATA[One argument: message to be printed]]></description>
-			<arguments>
-				<argument name="text" type="string"/>
-			</arguments>
-		</element>
-		<element name="rayIntersection" function="true" type="float">
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
+		<element name="wrldtyp" type="integer" min="0" max="2" default="0"/>
+		<element name="wrldsiz" type="float" min="10" max="1000" default="20.0">
+			<description><![CDATA[Side length of the world]]></description>
+		</element>
+		<element name="wrldmap" type="string">
+			<description><![CDATA[Description of the world (Type: Blocks or Heighfield). Enter
+   r <sizex> <sizey> [seed]
+to generate a random landscape, or
+   m <sizex> <sizey> digits
+   M <sizex> <sizey> numbers
+to provide height values.
+
+See also the WorldMap object.]]></description>
+		</element>
+		<element name="wrldwat" type="float" min="-20" max="200" default="-1.0"/>
+		<element name="wrldbnd" type="integer" min="0" max="2" default="0">
+			<description><![CDATA[Teleporting a creature that is outside of the world area is attempted every 'performance sampling period' steps. Teleport succeeds only when the target location in the world is empty (there is no collision).]]></description>
+		</element>
+		<element name="wrldg" type="float" min="0" max="10" default="1.0">
+			<description><![CDATA[You can adjust gravity for your experiments.
+The "official" setting used to evaluate and compare creatures is 1.]]></description>
+		</element>
+		<element name="wrldchg" function="true" type="void" flags="32"><arguments/></element>
+		<element name="simtype" type="integer" min="0" max="1" default="0">
+			<description><![CDATA[MechaStick is a fast and simple primary Framsticks simulation engine.
+ODE is Open Dynamics Engine by Russel Smith et al.
+
+NOTE: switching between simulation engines causes removal of all objects in the world (e.g. creatures).]]></description>
+		</element>
+		<element name="nnspeed" type="float" min="0" max="1000" default="1.0">
+			<description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description>
+		</element>
+		<element name="signals" type="WorldSignals" flags="35"/>
+		<element name="odeshape" type="integer" min="0" max="1"/>
+		<element name="odestep" type="float" min="0.001" max="1" default="0.05"/>
+		<element name="odemusclemin" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[i.e. "mmmmm" in f1]]></description>
+		</element>
+		<element name="odemusclemax" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[i.e. "MMMMM" if f1]]></description>
+		</element>
+		<element name="odemusclespeed" type="float" min="0" max="10" default="1.0">
+			<description><![CDATA[Muscle state cannot change faster than the supplied value]]></description>
+		</element>
+		<element name="odeairdrag" type="float" min="0" max="0.5" default="0.01">
+			<description><![CDATA[A drag force ("air drag") proportional to the velocity of mass centers of moving parts]]></description>
+		</element>
+		<element name="odewaterdrag" type="float" min="0.001" max="1" default="0.5"/>
+		<element name="odewaterbuoy" type="float" min="0" max="2" default="1.0"/>
+		<element name="odeseed" type="integer" min="0" max="2">
+			<description><![CDATA[Affects collisions.
+- 'Truly random' is closest to the standard ODE operation. Use Math.seed to influence randomness in ODE collisions.
+- 'Deterministic' automatically calculates random seed in each step based on the current simulation (world) state, which makes the simulation repeatable but more random than 'Fixed'.
+- 'Fixed' is completely deterministic and does not depend on Math.seed - the same seed value is set before each step. This might negatively affect ODE accuracy.
+]]></description>
+		</element>
+		<element name="odesepsticks" type="integer" min="0" max="1" default="0">
+			<description><![CDATA[Each stick gets a separate ODE body (like in MechaStick)]]></description>
+		</element>
+		<element name="odeworlderp" type="float" min="0" max="1" default="0.2">
+			<description><![CDATA[World ERP (error reduction parameter)]]></description>
+		</element>
+		<element name="odeworldcfm" type="float" min="0" max="1" default="1e-05">
+			<description><![CDATA[World CFM (constraint force mixing)]]></description>
+		</element>
+		<element name="odecolmumin" type="float" min="0" max="10" default="0.1">
+			<description><![CDATA[Mu coefficient for Parts with minimal friction (i.e. "fffff" in f1)]]></description>
+		</element>
+		<element name="odecolmumax" type="float" min="0" max="10" default="5.0">
+			<description><![CDATA[Mu coefficient for Parts with maximal friction (i.e. "FFFFF" in f1)]]></description>
+		</element>
+		<element name="odecolbounce" type="float" min="0" max="1" default="0.1"/>
+		<element name="odecolbouncevel" type="float" min="0" max="1" default="0.01"/>
+		<element name="odecolsoftcfm" type="float" min="0" max="1" default="0.0"/>
+		<element name="odecolsofterp" type="float" min="0" max="1" default="0.0"/>
+		<element name="odecol2mumin" type="float" min="0" max="10" default="0.1">
+			<description><![CDATA[Mu coefficient for Parts with minimal friction (i.e. "fffff" in f1)]]></description>
+		</element>
+		<element name="odecol2mumax" type="float" min="0" max="10" default="1.0">
+			<description><![CDATA[Mu coefficient for Parts with maximal friction (i.e. "FFFFF" in f1)]]></description>
+		</element>
+		<element name="odecol2bounce" type="float" min="0" max="1" default="0.1"/>
+		<element name="odecol2bouncevel" type="float" min="0" max="1" default="0.01"/>
+		<element name="odecol2softcfm" type="float" min="0" max="1" default="0.0"/>
+		<element name="odecol2softerp" type="float" min="0" max="1" default="0.0"/>
+		<element name="rayIntersection" function="true" type="float" flags="32">
 			<arguments>
 				<argument name="position x" type="float"/>
@@ -3806,16 +3505,882 @@
 			</arguments>
 		</element>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
-		<element name="resetToDefaults" function="true" type="void">
-			<description><![CDATA[Clears groups and loads default values for simulator parameters, then calls onExpDefLoad() of the current experiment definition.]]></description>
+		<element name="gen_hist" type="integer" min="0" max="1" default="0" flags="2">
+			<description><![CDATA[Required for phylogenetic analysis]]></description>
+		</element>
+		<element name="gen_hilite" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[Use colors for genes?
+(slows down viewing/editing of huge genotypes)]]></description>
+		</element>
+		<element name="gen_extmutinfo" type="integer" min="0" max="2" default="0">
+			<description><![CDATA[If active, information about employed mutation method will be stored in the 'info' field of each mutated genotype.]]></description>
+		</element>
+		<element name="operReport" function="true" type="void" flags="2">
+			<description><![CDATA[Show available genetic operators]]></description>
 <arguments/></element>
-		<element name="save" function="true" type="void">
-			<description><![CDATA[Save experiment file (calls onExpSave() in the current experiment definition)]]></description>
-			<arguments>
-				<argument name="filename" type="string"/>
-			</arguments>
-		</element>
-		<element name="sleep" function="true" type="void">
+		<element name="toHTML" function="true" type="string" flags="2">
+			<description><![CDATA[returns genotype expressed as colored HTML]]></description>
+			<arguments>
+				<argument type="string"/>
+			</arguments>
+		</element>
+		<element name="toHTMLshort" function="true" type="string" flags="2">
+			<description><![CDATA[returns genotype (abbreviated if needed) expressed as colored HTML]]></description>
+			<arguments>
+				<argument type="string"/>
+			</arguments>
+		</element>
+		<element name="validate" function="true" type="Geno" flags="34">
+			<description><![CDATA[returns validated (if possible) Geno object from supplied Geno]]></description>
+			<arguments>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="mutate" function="true" type="Geno" flags="34">
+			<description><![CDATA[returns mutated Geno object from supplied Geno]]></description>
+			<arguments>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="crossOver" function="true" type="Geno" flags="34">
+			<description><![CDATA[returns crossed over genotype]]></description>
+			<arguments>
+				<argument type="Geno"/>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="getSimplest" function="true" type="Geno" flags="34">
+			<description><![CDATA[returns the simplest genotype for a given encoding (format). 0 means f0, 4 means f4, etc.]]></description>
+			<arguments>
+				<argument name="format" type="integer"/>
+			</arguments>
+		</element>
+		<element name="genoper_f0" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f1" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f2" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f3" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f4" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_f9" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genoper_fF" type="integer" min="0" max="0" flags="65">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="neuadd_N" type="integer" min="0" max="1">
+			<description><![CDATA[Standard neuron
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+
+
+Properties:
+   Inertia (in) float 0..1
+   Force (fo) float 0..999
+   Sigmoid (si) float -99999..99999
+   State (s) float -1..1]]></description>
+		</element>
+		<element name="neuadd_Nu" type="integer" min="0" max="1">
+			<description><![CDATA[Works like standard neuron (N) but the output value is scaled to 0...+1 instead of -1...+1.
+Having 0 as one of the saturation states should help in "gate circuits", where input signal is passed through or blocked depending on the other singal.
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+
+
+Properties:
+   Inertia (in) float 0..1
+   Force (fo) float 0..999
+   Sigmoid (si) float -99999..99999
+   State (s) float -1..1]]></description>
+		</element>
+		<element name="neuadd_G" type="integer" min="0" max="1">
+			<description><![CDATA[Equilibrium sensor.
+0=the stick is horizontal
++1/-1=the stick is vertical
+
+Characteristics:
+   does not use inputs
+   provides output value
+   should be located on a Joint
+]]></description>
+		</element>
+		<element name="neuadd_T" type="integer" min="0" max="1">
+			<description><![CDATA[Touch sensor.
+-1=no contact
+0=just touching
+>0=pressing, value depends on the force applied
+
+Characteristics:
+   does not use inputs
+   provides output value
+   should be located on a Part
+
+
+Properties:
+   Range (r) float 0..1]]></description>
+		</element>
+		<element name="neuadd_S" type="integer" min="0" max="1">
+			<description><![CDATA[Smell sensor. Aggregated "smell of energy" experienced from all energy objects (creatures and food pieces).
+Close objects have bigger influence than the distant ones: for each energy source, its partial feeling is proportional to its energy/(distance^2)
+
+Characteristics:
+   does not use inputs
+   provides output value
+   should be located on a Part
+]]></description>
+		</element>
+		<element name="neuadd_Constant" type="integer" min="0" max="1">
+			<description><![CDATA[Constant value
+
+Characteristics:
+   does not use inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="neuadd_Bend_muscle" type="integer" min="0" max="1">
+			<description><![CDATA[Characteristics:
+   uses single input
+   does not provide output value
+   should be located on a Joint
+
+
+Properties:
+   power (p) float 0.01..1
+   bending range (r) float 0..1]]></description>
+		</element>
+		<element name="neuadd_Rotation_muscle" type="integer" min="0" max="1">
+			<description><![CDATA[Characteristics:
+   uses single input
+   does not provide output value
+   should be located on a Joint
+
+
+Properties:
+   power (p) float 0.01..1]]></description>
+		</element>
+		<element name="neuadd_D" type="integer" min="0" max="1">
+			<description><![CDATA[Calculate the difference between the current and previous input value. Multiple inputs are aggregated with respect to their weights
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="neuadd_Fuzzy" type="integer" min="0" max="1">
+			<description><![CDATA[Refer to publications to learn more about this neuron.
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+
+
+Properties:
+   number of fuzzy sets (ns) integer
+   number of rules (nr) integer
+   fuzzy sets (fs) string
+   fuzzy rules (fr) string]]></description>
+		</element>
+		<element name="neuadd_VEye" type="integer" min="0" max="1">
+			<description><![CDATA[Refer to publications to learn more about this neuron.
+
+Characteristics:
+   uses single input
+   provides output value
+   should be located on a Part
+
+
+Properties:
+   target.x (tx) float
+   target.y (ty) float
+   target.z (tz) float
+   target shape (ts) string
+   perspective (p) float 0.1..10
+   scale (s) float 0.1..100
+   show hidden lines (h) integer 0..1
+   output lines count (each line needs four channels) (o) integer 0..99
+   debug (d) integer 0..1]]></description>
+		</element>
+		<element name="neuadd_VMotor" type="integer" min="0" max="1">
+			<description><![CDATA[Must be connected to the VEye and properly set up. Refer to publications to learn more about this neuron.
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+
+
+Properties:
+   number of basic features (noIF) integer
+   number of degrees of freedom (noDim) integer
+   parameters (params) string]]></description>
+		</element>
+		<element name="neuadd_Sti" type="integer" min="0" max="1">
+			<description><![CDATA[Characteristics:
+   uses single input
+   does not provide output value
+   should be located on a Part
+]]></description>
+		</element>
+		<element name="neuadd_LMu" type="integer" min="0" max="1">
+			<description><![CDATA[Characteristics:
+   uses single input
+   does not provide output value
+   should be located on a Joint
+
+
+Properties:
+   power (p) float 0.01..1]]></description>
+		</element>
+		<element name="neuadd_Water" type="integer" min="0" max="1">
+			<description><![CDATA[Output signal:
+0=on or above water surface
+1=under water (deeper than 1)
+0..1=in the transient area just below water surface
+
+Characteristics:
+   does not use inputs
+   provides output value
+   should be located on a Part
+]]></description>
+		</element>
+		<element name="neuadd_Energy" type="integer" min="0" max="1">
+			<description><![CDATA[The current energy level divided by the initial energy level.
+Usually falls from initial 1.0 down to 0.0 and then the creature dies. It can rise above 1.0 if enough food is ingested
+
+Characteristics:
+   does not use inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="neuadd_Ch" type="integer" min="0" max="1">
+			<description><![CDATA[Combines all input signals into a single multichannel output; Note: ChSel and ChMux are the only neurons which support multiple channels. Other neurons discard everything except the first channel.
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="neuadd_ChMux" type="integer" min="0" max="1">
+			<description><![CDATA[Outputs the selected channel from the second (multichannel) input. The first input is used as the selector value (-1=select first channel, .., 1=last channel)
+
+Characteristics:
+   uses 2 inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="neuadd_ChSel" type="integer" min="0" max="1">
+			<description><![CDATA[Outputs a single channel (selected by the "ch" parameter) from multichannel input
+
+Characteristics:
+   uses single input
+   provides output value
+   does not require location in body
+
+
+Properties:
+   channel (ch) integer]]></description>
+		</element>
+		<element name="neuadd_Rnd" type="integer" min="0" max="1">
+			<description><![CDATA[Generates random noise (subsequent random values in the range of -1..+1)
+
+Characteristics:
+   does not use inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="neuadd_Sin" type="integer" min="0" max="1">
+			<description><![CDATA[Output frequency = f0+input
+
+Characteristics:
+   uses single input
+   provides output value
+   does not require location in body
+
+
+Properties:
+   base frequency (f0) float -1..1
+   time (t) float 0..6.28319]]></description>
+		</element>
+		<element name="f0_nodel_tag" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[You can tag elements using their 'i' field and the i="mi=d" tag.
+Mutations will not delete such elements.
+The i="mi=dm" combination is allowed.]]></description>
+		</element>
+		<element name="f0_nomod_tag" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[You can tag elements using their 'i' field and the i="mi=m" tag.
+Mutations will not modify properties of such elements.
+The i="mi=md" combination is allowed.]]></description>
+		</element>
+		<element name="f0_p_new" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_del" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_swp" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_pos" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_mas" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_frc" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_ing" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_asm" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_p_vsiz" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_new" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_del" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_stm" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_stf" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_rsf" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_vred" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_vgrn" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_j_vblu" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_n_new" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_n_del" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_n_prp" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_c_new" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_c_del" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f0_c_wei" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f1_xo_propor" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[Cross over (exchange) corresponding segments of the two parent genotypes?
+
+f1 uses a two-point crossing over.
+If this option is turned on, cut points will be selected proportionally to neural genes.
+Thus, if both parents have the same number of neurons, then this will be preserved in their children.]]></description>
+		</element>
+		<element name="f1_smX" type="float" min="0" max="100" default="0.05"/>
+		<element name="f1_smJunct" type="float" min="0" max="100" default="0.02"/>
+		<element name="f1_smComma" type="float" min="0" max="100" default="0.02"/>
+		<element name="f1_smModif" type="float" min="0" max="100" default="0.1">
+			<description><![CDATA[Modifiers: LlRrCcQqFfMmIiWwEeAaSsDdGgBbHh]]></description>
+		</element>
+		<element name="f1_mut_exmod" type="string" max="30">
+			<description><![CDATA[Modifiers that will not be added nor deleted during mutation
+(all: LlRrCcQqFfMmIiWwEeAaSsDdGgBbHh)]]></description>
+		</element>
+		<element name="f1_nmNeu" type="float" min="0" max="100" default="0.05">
+			<description><![CDATA[Adds a (connected) neuron or removes a neuron]]></description>
+		</element>
+		<element name="f1_nmConn" type="float" min="0" max="100" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f1_nmProp" type="float" min="0" max="100" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f1_nmWei" type="float" min="0" max="100" default="1.0"/>
+		<element name="f1_nmVal" type="float" min="0" max="100" default="0.05"/>
+		<element name="f2_mutAddOper" type="float" min="0" max="1" default="0.4">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutJointElem" type="float" min="0" max="1" default="0.33">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutNeuroElem" type="float" min="0" max="1" default="0.33">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutConnElem" type="float" min="0" max="1" default="0.33">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutDelOper" type="float" min="0" max="1" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutHandleOper" type="float" min="0" max="1" default="0.3">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f2_mutPropOper" type="float" min="0" max="1" default="0.2">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutSubstitution" type="float" min="0" max="1" default="0.6">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutSubstPerChar" type="float" min="0" max="1" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutDelIns" type="float" min="0" max="1" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutDelInsPerChar" type="float" min="0" max="1" default="0.05">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutDelInsLength" type="integer" min="1" max="100" default="5">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutDuplication" type="float" min="0" max="1" default="0.05">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_mutTranslocation" type="float" min="0" max="1" default="0.15">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_xovGeneTransfer" type="float" min="0" max="1" default="0.8">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f3_xovCrossingOver" type="float" min="0" max="1" default="0.2">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="f4_mut_add" type="float" min="0" max="100" default="50.0">
+			<description><![CDATA[mutation: probability of adding a node]]></description>
+		</element>
+		<element name="f4_mut_add_div" type="float" min="0" max="100" default="20.0">
+			<description><![CDATA[add node mutation: probability of adding a division]]></description>
+		</element>
+		<element name="f4_mut_add_conn" type="float" min="0" max="100" default="15.0">
+			<description><![CDATA[add node mutation: probability of adding a neural connection]]></description>
+		</element>
+		<element name="f4_mut_add_neupar" type="float" min="0" max="100" default="5.0">
+			<description><![CDATA[add node mutation: probability of adding a neuron property/modifier]]></description>
+		</element>
+		<element name="f4_mut_add_rep" type="float" min="0" max="100" default="10.0">
+			<description><![CDATA[add node mutation: probability of adding a repetition]]></description>
+		</element>
+		<element name="f4_mut_add_simp" type="float" min="0" max="100" default="50.0">
+			<description><![CDATA[add node mutation: probability of adding a random, simple gene]]></description>
+		</element>
+		<element name="f4_mut_del" type="float" min="0" max="100" default="20.0">
+			<description><![CDATA[mutation: probability of deleting a node]]></description>
+		</element>
+		<element name="f4_mut_mod" type="float" min="0" max="100" default="30.0">
+			<description><![CDATA[mutation: probability of changing a node]]></description>
+		</element>
+		<element name="f9_mut" type="float" min="0" max="1" default="0.1">
+			<description><![CDATA[How many genes should be mutated during single mutation (1=all genes, 0.1=ten percent)]]></description>
+		</element>
+		<element name="fF_xover" type="float" min="0" max="0.5" default="0.5">
+			<description><![CDATA[0.5 => children are averaged parents.
+0.2 => children are only 20% different from parents.
+0 => each child is identical to one parent (no crossover).]]></description>
+		</element>
+		<element name="genkonw0" type="integer" min="0" max="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genkonw1" type="integer" min="0" max="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genkonw2" type="integer" min="0" max="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genkonw3" type="integer" min="0" max="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genkonw4" type="integer" min="0" max="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="genkonw5" type="integer" min="0" max="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="randinit" type="float" min="0" max="10" default="0.01">
+			<description><![CDATA[Allowed range for initializing all neuron states with uniform distribution random numbers and zero mean. Set to 0 for deterministic initialization.]]></description>
+		</element>
+		<element name="nnoise" type="float" min="0" max="1" default="0.0">
+			<description><![CDATA[Gaussian neural noise: a random value is added to each neural output in each simulation step. Set standard deviation here to add random noise, or 0 for deterministic simulation.]]></description>
+		</element>
+		<element name="touchrange" type="float" min="0" max="100" default="1.0"/>
+		<element name="bnoise_struct" type="float" min="0" max="10" default="0.0">
+			<description><![CDATA[When >0, body constructs of creatures (position of Parts) will be randomly disturbed when they are created.]]></description>
+		</element>
+		<element name="bnoise_vel" type="float" min="0" max="10" default="0.0">
+			<description><![CDATA[Random velocities will be applied to all body Parts (in MechaStick) or rigid segments (in ODE) of newly created creatures.]]></description>
+		</element>
+		<element name="ncl_N" type="integer" min="0" max="1">
+			<description><![CDATA[Standard neuron
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+
+
+Properties:
+   Inertia (in) float 0..1
+   Force (fo) float 0..999
+   Sigmoid (si) float -99999..99999
+   State (s) float -1..1]]></description>
+		</element>
+		<element name="ncl_Nu" type="integer" min="0" max="1">
+			<description><![CDATA[Works like standard neuron (N) but the output value is scaled to 0...+1 instead of -1...+1.
+Having 0 as one of the saturation states should help in "gate circuits", where input signal is passed through or blocked depending on the other singal.
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+
+
+Properties:
+   Inertia (in) float 0..1
+   Force (fo) float 0..999
+   Sigmoid (si) float -99999..99999
+   State (s) float -1..1]]></description>
+		</element>
+		<element name="ncl_G" type="integer" min="0" max="1">
+			<description><![CDATA[Equilibrium sensor.
+0=the stick is horizontal
++1/-1=the stick is vertical
+
+Characteristics:
+   does not use inputs
+   provides output value
+   should be located on a Joint
+]]></description>
+		</element>
+		<element name="ncl_T" type="integer" min="0" max="1">
+			<description><![CDATA[Touch sensor.
+-1=no contact
+0=just touching
+>0=pressing, value depends on the force applied
+
+Characteristics:
+   does not use inputs
+   provides output value
+   should be located on a Part
+
+
+Properties:
+   Range (r) float 0..1]]></description>
+		</element>
+		<element name="ncl_S" type="integer" min="0" max="1">
+			<description><![CDATA[Smell sensor. Aggregated "smell of energy" experienced from all energy objects (creatures and food pieces).
+Close objects have bigger influence than the distant ones: for each energy source, its partial feeling is proportional to its energy/(distance^2)
+
+Characteristics:
+   does not use inputs
+   provides output value
+   should be located on a Part
+]]></description>
+		</element>
+		<element name="ncl_Constant" type="integer" min="0" max="1">
+			<description><![CDATA[Constant value
+
+Characteristics:
+   does not use inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="ncl_Bend_muscle" type="integer" min="0" max="1">
+			<description><![CDATA[Characteristics:
+   uses single input
+   does not provide output value
+   should be located on a Joint
+
+
+Properties:
+   power (p) float 0.01..1
+   bending range (r) float 0..1]]></description>
+		</element>
+		<element name="ncl_Rotation_muscle" type="integer" min="0" max="1">
+			<description><![CDATA[Characteristics:
+   uses single input
+   does not provide output value
+   should be located on a Joint
+
+
+Properties:
+   power (p) float 0.01..1]]></description>
+		</element>
+		<element name="ncl_D" type="integer" min="0" max="1">
+			<description><![CDATA[Calculate the difference between the current and previous input value. Multiple inputs are aggregated with respect to their weights
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="ncl_Fuzzy" type="integer" min="0" max="1">
+			<description><![CDATA[Refer to publications to learn more about this neuron.
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+
+
+Properties:
+   number of fuzzy sets (ns) integer
+   number of rules (nr) integer
+   fuzzy sets (fs) string
+   fuzzy rules (fr) string]]></description>
+		</element>
+		<element name="ncl_VEye" type="integer" min="0" max="1">
+			<description><![CDATA[Refer to publications to learn more about this neuron.
+
+Characteristics:
+   uses single input
+   provides output value
+   should be located on a Part
+
+
+Properties:
+   target.x (tx) float
+   target.y (ty) float
+   target.z (tz) float
+   target shape (ts) string
+   perspective (p) float 0.1..10
+   scale (s) float 0.1..100
+   show hidden lines (h) integer 0..1
+   output lines count (each line needs four channels) (o) integer 0..99
+   debug (d) integer 0..1]]></description>
+		</element>
+		<element name="ncl_VMotor" type="integer" min="0" max="1">
+			<description><![CDATA[Must be connected to the VEye and properly set up. Refer to publications to learn more about this neuron.
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+
+
+Properties:
+   number of basic features (noIF) integer
+   number of degrees of freedom (noDim) integer
+   parameters (params) string]]></description>
+		</element>
+		<element name="ncl_Sti" type="integer" min="0" max="1">
+			<description><![CDATA[Characteristics:
+   uses single input
+   does not provide output value
+   should be located on a Part
+]]></description>
+		</element>
+		<element name="ncl_LMu" type="integer" min="0" max="1">
+			<description><![CDATA[Characteristics:
+   uses single input
+   does not provide output value
+   should be located on a Joint
+
+
+Properties:
+   power (p) float 0.01..1]]></description>
+		</element>
+		<element name="ncl_Water" type="integer" min="0" max="1">
+			<description><![CDATA[Output signal:
+0=on or above water surface
+1=under water (deeper than 1)
+0..1=in the transient area just below water surface
+
+Characteristics:
+   does not use inputs
+   provides output value
+   should be located on a Part
+]]></description>
+		</element>
+		<element name="ncl_Energy" type="integer" min="0" max="1">
+			<description><![CDATA[The current energy level divided by the initial energy level.
+Usually falls from initial 1.0 down to 0.0 and then the creature dies. It can rise above 1.0 if enough food is ingested
+
+Characteristics:
+   does not use inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="ncl_Ch" type="integer" min="0" max="1">
+			<description><![CDATA[Combines all input signals into a single multichannel output; Note: ChSel and ChMux are the only neurons which support multiple channels. Other neurons discard everything except the first channel.
+
+Characteristics:
+   supports any number of inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="ncl_ChMux" type="integer" min="0" max="1">
+			<description><![CDATA[Outputs the selected channel from the second (multichannel) input. The first input is used as the selector value (-1=select first channel, .., 1=last channel)
+
+Characteristics:
+   uses 2 inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="ncl_ChSel" type="integer" min="0" max="1">
+			<description><![CDATA[Outputs a single channel (selected by the "ch" parameter) from multichannel input
+
+Characteristics:
+   uses single input
+   provides output value
+   does not require location in body
+
+
+Properties:
+   channel (ch) integer]]></description>
+		</element>
+		<element name="ncl_Rnd" type="integer" min="0" max="1">
+			<description><![CDATA[Generates random noise (subsequent random values in the range of -1..+1)
+
+Characteristics:
+   does not use inputs
+   provides output value
+   does not require location in body
+]]></description>
+		</element>
+		<element name="ncl_Sin" type="integer" min="0" max="1">
+			<description><![CDATA[Output frequency = f0+input
+
+Characteristics:
+   uses single input
+   provides output value
+   does not require location in body
+
+
+Properties:
+   base frequency (f0) float -1..1
+   time (t) float 0..6.28319]]></description>
+		</element>
+		<element name="simil_parts" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[Differing number of parts is also handled by the 'part degree' similarity component.]]></description>
+		</element>
+		<element name="simil_partdeg" type="float" min="0" max="100" default="1.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="simil_neuro" type="float" min="0" max="100" default="0.1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="simil_partgeom" type="float" min="0" max="100" default="0.0">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="evaluateDistance" function="true" type="float" flags="34">
+			<description><![CDATA[Calculates dissimilarity between two models created from Geno objects.]]></description>
+			<arguments>
+				<argument type="Geno"/>
+				<argument type="Geno"/>
+			</arguments>
+		</element>
+		<element name="calculateSymmetry" function="true" type="float" flags="32">
+			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model using default precision parameters (symPosSteps,symAlphaSteps,symBetaSteps). Returns the symmetry plane, too (sets symResultA,B,C,D).
+Note: may take a long time for large creatures.]]></description>
+			<arguments>
+				<argument name="model" type="Model"/>
+			</arguments>
+		</element>
+		<element name="calculateSymmetry2" function="true" type="float" flags="32">
+			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model using specified precision parameters. Returns the symmetry plane, too (sets symResultA,B,C,D).
+Note: may take a long time for large creatures.]]></description>
+			<arguments>
+				<argument name="model" type="Model"/>
+				<argument name="posSteps" type="integer"/>
+				<argument name="alphaSteps" type="integer"/>
+				<argument name="betaSteps" type="integer"/>
+			</arguments>
+		</element>
+		<element name="calculateSymmetryForPlane" function="true" type="float" flags="32">
+			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model and given a specific plane defined by coefficients A, B, C, D.]]></description>
+			<arguments>
+				<argument name="model" type="Model"/>
+				<argument name="A" type="float"/>
+				<argument name="B" type="float"/>
+				<argument name="C" type="float"/>
+				<argument name="D" type="float"/>
+			</arguments>
+		</element>
+		<element name="symPosSteps" type="integer" min="2" max="50" default="10">
+			<description><![CDATA[Default number of samples per stick length]]></description>
+		</element>
+		<element name="symAlphaSteps" type="integer" min="2" max="50" default="20">
+			<description><![CDATA[Default number of samples per full angle (#1)]]></description>
+		</element>
+		<element name="symBetaSteps" type="integer" min="2" max="50" default="20">
+			<description><![CDATA[Default number of samples per full angle (#2)]]></description>
+		</element>
+		<element name="symResultA" type="float" flags="35"/>
+		<element name="symResultB" type="float" flags="35"/>
+		<element name="symResultC" type="float" flags="35"/>
+		<element name="symResultD" type="float" flags="35"/>
+		<element name="geom_density" type="float" min="0.01" max="100" default="1.0">
+			<description><![CDATA[Affects the geometry calculation precision]]></description>
+		</element>
+		<element name="forModel" function="true" type="ModelGeometry" flags="32">
+			<description><![CDATA[The returned ModelGeometry object can be used to calculate geometric properties (volume, area, sizes) of the associated model. The density is copied from the current global ModelGeometry.geom_density on object creation.]]></description>
+			<arguments>
+				<argument type="Model"/>
+			</arguments>
+		</element>
+		<element name="volume" function="true" type="float" flags="288"><arguments/></element>
+		<element name="area" function="true" type="float" flags="288"><arguments/></element>
+		<element name="sizesAndAxes" function="true" type="Vector" flags="288">
+			<description><![CDATA[The returned vector contains XYZ (sizes) and Orient (axes) objects.]]></description>
+<arguments/></element>
+		<element name="minjoint" type="float" min="0" max="100" default="0.0"/>
+		<element name="maxjoint" type="float" min="0" max="100" default="2.0"/>
+	</type>
+	<type name="Simulator" context="Global context">
+<description><![CDATA[The Framsticks simulator.]]></description>
+		<element name="print" function="true" type="void" flags="32">
+			<description><![CDATA[One argument: message to be printed]]></description>
+			<arguments>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="message" function="true" type="void" flags="32">
+			<description><![CDATA[The second argument can be:
+ -1 = debugging message
+ 0 = information
+ 1 = warning
+ 2 = error
+ 3 = critical error]]></description>
+			<arguments>
+				<argument name="text" type="string"/>
+				<argument name="level" type="integer"/>
+			</arguments>
+		</element>
+		<element name="sleep" function="true" type="void" flags="32">
 			<description><![CDATA[Suspends the execution for a specified interval]]></description>
 			<arguments>
@@ -3823,5 +4388,8 @@
 			</arguments>
 		</element>
-		<element name="sound" function="true" type="void">
+		<element name="beep" function="true" type="void" flags="32">
+			<description><![CDATA[Plays a default system sound]]></description>
+<arguments/></element>
+		<element name="sound" function="true" type="void" flags="32">
 			<description><![CDATA[Generates a simple tone on the speaker]]></description>
 			<arguments>
@@ -3830,111 +4398,52 @@
 			</arguments>
 		</element>
-		<element name="start" function="true" type="void">
-			<description><![CDATA[called by the user interface]]></description>
-<arguments/></element>
-		<element name="step" function="true" type="void"><arguments/></element>
-		<element name="stop" function="true" type="void">
-			<description><![CDATA[the expdef script calls this to stop simulation]]></description>
-<arguments/></element>
-		<element name="toHTML" function="true" type="string">
-			<description><![CDATA[returns genotype expressed as colored HTML]]></description>
-			<arguments>
-				<argument type="string"/>
-			</arguments>
-		</element>
-		<element name="toHTMLshort" function="true" type="string">
-			<description><![CDATA[returns genotype (abbreviated if needed) expressed as colored HTML]]></description>
-			<arguments>
-				<argument type="string"/>
-			</arguments>
-		</element>
-		<element name="validate" function="true" type="Geno">
-			<description><![CDATA[returns validated (if possible) Geno object from supplied Geno]]></description>
-			<arguments>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-		<element name="wrldchg" function="true" type="void"><arguments/></element>
-	</type>
-	<type name="Similarity" context="Global context">
-		<element name="simil_method" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="simil_neuro" type="float" min="0" max="100" default="0.5">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="simil_partdeg" type="float" min="0" max="100" default="1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="simil_parts" type="float" min="0" max="100" default="0">
-			<description><![CDATA[Differing number of parts is also handled by the 'part degree' similarity component.]]></description>
-		</element>
-		<element name="evaluateDistance" function="true" type="float">
-			<description><![CDATA[calculate dissimilarity between two models created from Geno objects]]></description>
-			<arguments>
-				<argument type="Geno"/>
-				<argument type="Geno"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="Simulator" context="Global context">
-<description><![CDATA[The Framsticks simulator.]]></description>
-		<element name="autosaveperiod" type="integer" min="0" max="100000">
-			<description><![CDATA[Save simulation state once every n-th event
-(events are defined by the script. For 'standard.expdef' it is after each death).
-Save EXPT file first to initialize name for autosave files.]]></description>
-		</element>
-		<element name="createrr" type="integer" min="0" max="2" default="1"/>
-		<element name="creatwarnfail" type="integer" min="0" max="1">
-			<description><![CDATA[Creatures grown with warnings will not be simulated.]]></description>
-		</element>
-		<element name="expdef" type="string">
-			<description><![CDATA[Choose the experiment framework
-(in Windows GUI, confirm by pressing 'Apply')
-
-Stop the simulation before selecting another experiment definition.
-It is a good practice to initialize the experiment before running the simulation.]]></description>
-		</element>
-		<element name="expdef_info" type="string"/>
-		<element name="expdef_title" type="string"/>
-		<element name="filecomm" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[Display comments encountered in opened files]]></description>
-		</element>
-		<element name="genolib" type="GenePools"/>
-		<element name="groupchk" type="integer" min="0" max="1"/>
-		<element name="importchk" type="integer" min="0" max="1"/>
-		<element name="livelib" type="Populations"/>
-		<element name="loadchk" type="integer" min="0" max="1"/>
-		<element name="overwrite" type="integer" min="0" max="1">
-			<description><![CDATA[Overwite existing files or create their backups]]></description>
-		</element>
-		<element name="resetonexpdef" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[If turned on: when a new experiment definition is selected, default values are loaded for most of the simulator parameters, and gene pools and populations are cleared.
-When turned off: parameters from previous experiment definition will remain.]]></description>
-		</element>
-		<element name="running" type="integer" min="0" max="1">
-			<description><![CDATA[for synchronizing the user interface state]]></description>
-		</element>
-		<element name="simspeed" type="integer">
-			<description><![CDATA[steps/second]]></description>
-		</element>
-		<element name="time" type="integer"/>
-		<element name="usercode" type="string">
-			<description><![CDATA[This script overrides the experiment definition]]></description>
-		</element>
-		<element name="vmdebug" type="integer" min="0" max="1"/>
-		<element name="world" type="World"/>
-		<element name="beep" function="true" type="void">
-			<description><![CDATA[Plays a default system sound]]></description>
-<arguments/></element>
-		<element name="checkpoint" function="true" type="void">
-			<description><![CDATA[This function was previously called "autosave".]]></description>
-<arguments/></element>
-		<element name="eval" function="true" type="void">
-			<arguments>
-				<argument name="script expression" type="string"/>
-			</arguments>
-		</element>
-		<element name="export" function="true" type="void">
+		<element name="eval" function="true" type="void" flags="32">
+			<description><![CDATA[The argument must be a complete statement, e.g. "return 2+2;" is valid, while "2+2" is not. The EvalError object is returned for invalid statements.
+Example:
+var statement="function fun(a) {return a*a;} return fun(Math.pi);";
+var result=Simulator.eval(statement);
+if (typeof result=="EvalError")
+   Simulator.print("Error:"+result.message);
+else
+   Simulator.print("Result:"+result);]]></description>
+			<arguments>
+				<argument name="script statement" type="string"/>
+			</arguments>
+		</element>
+		<element name="load" function="true" type="void" flags="32">
+			<description><![CDATA[Load experiment file (calls onExpLoad() in the current experiment definition). This function is intended to replace the simulator state; the old state is cleared by automatically calling "resetToDefaults()". Use "import" if you don't want to loose the old simulator state.]]></description>
+			<arguments>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="import" function="true" type="void" flags="32">
+			<description><![CDATA[Load some data from file. The second optional argument selects what section(s) will be imported:
+	1 - experiment (works like "load" and can reset the simulator state!)
+	2 - genotypes
+	4 - simulator parameters
+	8 - genepool settings
+	16 - population settings
+	32 - new groups will be created for imported genepools and populations
+	64 - allow switching to a different expdef while importing parameters (4)
+
+The standard behavior (without the second argument) is to import genotypes, parameters, and genepool and population settings (2+4+8+16). Note that "64" is not included by default, because the expdef change resets all simulator parameters, which contradicts the usual meaning of "import" in Framsticks ("add data", as opposed to "load" meaning "replace data"). Moreover, using the "64" option in scripts can be dengerous, especially all expdef and show scripts should always declare the proper expdef name in their header rather than change the expdef directly. Without the "64" option, it is always safe to "import" any file in a script regardless of the current simulator state.]]></description>
+			<arguments>
+				<argument name="filename" type="string"/>
+				<argument name="options" type="integer"/>
+			</arguments>
+		</element>
+		<element name="import" function="true" type="void" flags="32">
+			<description><![CDATA[Equivalent to import(filename,2+4+8+16) - imports genotypes, parameters, genepool and population settings]]></description>
+			<arguments>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="save" function="true" type="untyped" flags="32">
+			<description><![CDATA[Save experiment file (calls onExpSave() in the current experiment definition)]]></description>
+			<arguments>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="export" function="true" type="untyped" flags="32">
 			<description><![CDATA[Save some data to file. arguments:
 - filename
@@ -3956,223 +4465,376 @@
 			</arguments>
 		</element>
-		<element name="import" function="true" type="void">
-			<description><![CDATA[Load some data from file. The second optional argument selects what section(s) will be imported:
- 1 - experiment (works like "load" and can reset the simulator state!)
- 2 - genotypes
- 4 - simulator parameters
- 8 - genepool settings
- 16 - population settings
- 32 - new groups will be created for imported genepools and populations
-64 - allow switching to a different expdef while importing parameters (4)
-
-The standard behavior (without the second argument) is to import genotypes, parameters, and genepool and population settings (2+4+8+16). Note that "64" is not included by default, because the expdef change resets all simulator parameters, which contradicts the usual meaning of "import" in Framsticks ("add data", as opposed to "load" meaning "replace data"). Moreover, using the "64" option in scripts can be dengerous, especially all expdef and show scripts should always declare the proper expdef name in their header rather than change the expdef directly. Without the "64" option, it is always safe to "import" any file in a script regardless of the current simulator state.]]></description>
-			<arguments>
-				<argument name="filename" type="string"/>
-				<argument name="options" type="integer"/>
-			</arguments>
-		</element>
+		<element name="start" function="true" type="void" flags="4096">
+			<description><![CDATA[called by the user interface]]></description>
+<arguments/></element>
+		<element name="stop" function="true" type="void" flags="4096">
+			<description><![CDATA[the expdef script calls this to stop simulation]]></description>
+<arguments/></element>
+		<element name="running" type="integer" min="0" max="1" flags="4130">
+			<description><![CDATA[useful for synchronizing the user interface state]]></description>
+		</element>
+		<element name="step" function="true" type="void" flags="32"><arguments/></element>
+		<element name="time" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Simulator.time will be removed because of its misleading name, please use Simulator.stepNumber instead.]]></description>
+		</element>
+		<element name="stepNumber" type="integer" flags="34"/>
+		<element name="simspeed" type="integer" flags="4131">
+			<description><![CDATA[steps/second]]></description>
+		</element>
+		<element name="expdef" type="string">
+			<description><![CDATA[Choose the experiment framework
+(in Windows GUI, confirm by pressing 'Apply')
+
+Stop the simulation before selecting another experiment definition.
+It is a good practice to initialize the experiment before running the simulation.]]></description>
+		</element>
+		<element name="expdef_title" type="string" flags="3"/>
+		<element name="expdef_info" type="string" flags="3"/>
 		<element name="init" function="true" type="void">
 			<description><![CDATA[Performs initialization procedures, like resetting counters, states, gene pools, etc.]]></description>
 <arguments/></element>
-		<element name="load" function="true" type="void">
-			<description><![CDATA[Load experiment file (calls onExpLoad() in the current experiment definition). This function is intended to replace the simulator state; the old state is cleared by automatically calling "resetToDefaults()" (only if "resetonexpdef" is enabled). Use "import" if you don't want to loose the old simulator state.]]></description>
-			<arguments>
-				<argument name="filename" type="string"/>
-			</arguments>
-		</element>
 		<element name="loadexpdef" function="true" type="void"><arguments/></element>
-		<element name="loadNeurons" function="true" type="void">
-			<arguments>
-				<argument name="directory path" type="string"/>
-			</arguments>
-		</element>
-		<element name="message" function="true" type="void">
-			<description><![CDATA[The second argument can be:
- -1 = debugging message
- 0 = information
- 1 = warning
- 2 = error
- 3 = critical error]]></description>
-			<arguments>
-				<argument name="text" type="string"/>
-				<argument name="level" type="integer"/>
-			</arguments>
-		</element>
-		<element name="new" function="true" type="Simulator"><arguments/></element>
-		<element name="print" function="true" type="void">
-			<description><![CDATA[One argument: message to be printed]]></description>
-			<arguments>
-				<argument name="text" type="string"/>
-			</arguments>
-		</element>
+		<element name="usercode" type="string" min="1">
+			<description><![CDATA[You can override any function from the original experiment definition script. Use the same function names and provide alternative implementations.
+Example:
+
+function onBorn(cr)
+{
+  Simulator.print("A creature is born: "+cr.name);
+  super_onBorn(cr); //calls the original implementation
+}]]></description>
+		</element>
+		<element name="autosaveperiod" type="integer" min="0" max="100000">
+			<description><![CDATA[Save simulation state once every n-th event
+(events are defined by the script. For 'standard.expdef' it is after each death).
+Save EXPT file first to initialize name for autosave files.
+Slave simulators (in multithreaded experiments) ignore this setting and never create autosave files.]]></description>
+		</element>
+		<element name="overwrite" type="integer" min="0" max="1" default="0">
+			<description><![CDATA[Lets you choose what to do when a file is created with the same name as an already existing file: overwite the existing file or create its backup?]]></description>
+		</element>
+		<element name="filecomm" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[Display comments encountered in opened files]]></description>
+		</element>
+		<element name="checkpoint" function="true" type="void" flags="32">
+			<description><![CDATA[This function was previously called "autosave".]]></description>
+<arguments/></element>
+		<element name="checkpointData" function="true" type="void" flags="32">
+			<description><![CDATA[In the distributed/paralellized scenario the data passed as argument can be received by the controlling entity (onSlaveCheckpoint in multithreaded master experiment, /simulator/expevent in distributed network simulator)]]></description>
+			<arguments>
+				<argument name="any_data" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="lastCheckpoint" type="untyped" flags="35">
+			<description><![CDATA[Most recently reported by the experiment definition script.]]></description>
+		</element>
+		<element name="createrr" type="integer" min="0" max="2" default="1"/>
+		<element name="creatwarnfail" type="integer" min="0" max="1">
+			<description><![CDATA[Creatures grown with warnings will not be simulated.]]></description>
+		</element>
+		<element name="groupchk" type="integer" min="0" max="1" default="1"/>
+		<element name="vmdebug" type="integer" min="0" max="1"/>
 		<element name="resetToDefaults" function="true" type="void">
 			<description><![CDATA[Clears groups and loads default values for simulator parameters, then calls onExpDefLoad() of the current experiment definition.]]></description>
 <arguments/></element>
-		<element name="save" function="true" type="void">
-			<description><![CDATA[Save experiment file (calls onExpSave() in the current experiment definition)]]></description>
-			<arguments>
-				<argument name="filename" type="string"/>
-			</arguments>
-		</element>
-		<element name="sleep" function="true" type="void">
-			<description><![CDATA[Suspends the execution for a specified interval]]></description>
-			<arguments>
-				<argument name="milliseconds" type="integer"/>
-			</arguments>
-		</element>
-		<element name="sound" function="true" type="void">
-			<description><![CDATA[Generates a simple tone on the speaker]]></description>
-			<arguments>
-				<argument name="freqency in Hz" type="integer"/>
-				<argument name="length in milliseconds" type="integer"/>
-			</arguments>
-		</element>
-		<element name="start" function="true" type="void">
-			<description><![CDATA[called by the user interface]]></description>
+		<element name="new" function="true" type="Simulator" flags="32"><arguments/></element>
+		<element name="slaves" type="SlaveSimulators" flags="35"/>
+		<element name="cpus" type="integer" flags="35"/>
+		<element name="world" type="World" flags="35"/>
+		<element name="populations" type="Populations" flags="35"/>
+		<element name="genepools" type="GenePools" flags="35"/>
+		<element name="expparams" type="ExpParams" flags="35"/>
+		<element name="expstate" type="ExpState" flags="35"/>
+		<element name="genman" type="GenMan" flags="35"/>
+		<element name="loadNeurons" function="true" type="void" flags="32">
+			<arguments>
+				<argument name="directory path" type="string"/>
+			</arguments>
+		</element>
+		<element name="user" type="untyped" flags="34"/>
+		<element name="identity" type="integer" flags="35">
+			<description><![CDATA[-1 for master simulator, 0...count-1 for slaves]]></description>
+		</element>
+		<element name="refreshGUI" function="true" type="void" flags="32">
+			<description><![CDATA[Notify all populations and gene pools content changed.]]></description>
 <arguments/></element>
-		<element name="step" function="true" type="void"><arguments/></element>
-		<element name="stop" function="true" type="void">
-			<description><![CDATA[the expdef script calls this to stop simulation]]></description>
+	</type>
+	<type name="SlaveSimulators" context="Global context">
+		<element name="size" type="integer" min="0" max="50">
+			<description><![CDATA[Changing this value will create/remove slave simulator objects as needed.]]></description>
+		</element>
+		<element name="get" function="true" type="Simulator">
+			<description><![CDATA[Access the slave simulator object (Simulator.slaves[index] works, too).
+Important: Do not operate on a simulator that is currently running, always stop() it first.]]></description>
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="running" type="integer" flags="1">
+			<description><![CDATA[Note that if running>0 then the number of running simulations can be outdated in the very moment you read this field, because the expdef can stop itself anytime. If running==0, then it is guaranteed to stay 0 until someone calls start() on some of the slave simulator objects.]]></description>
+		</element>
+		<element name="create" function="true" type="Simulator">
+			<description><![CDATA[If you need to create AND store the reference to a newly created simulator object, then this function may be more readable than var s=Simulator.slaves[Simulator.slaves.size++];]]></description>
 <arguments/></element>
+		<element name="remove" function="true" type="void">
+			<description><![CDATA[Also calls stop() if the simulator is running. Events assocated with the simulator being deleted are cancelled, so the expdef will not see the usual onSlaveStop.]]></description>
+			<arguments>
+				<argument name="index_or_object" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="removeAll" function="true">
+			<description><![CDATA[Same as Simulator.slaves=0;]]></description>
+		</element>
+		<element name="startAll" function="true"/>
+		<element name="stopAll" function="true"/>
+		<element name="cancelEventsFromSlave" function="true" type="void">
+			<description><![CDATA[If the onSlaveStop() event is used to schedule work to a simulator, then you might want to cancel pending events when the experiment is aborted - otherwise it may be difficult to distinguish between self-stop events (called internally from the slave simulator to signal the job was completed) from abort-stop events (requested by the supervising simulator). Calling Simulator.slaves.stopAll(); Simulator.slaves.cancelAllEvents(); makes sure that no old events will be detected after that time point. Without cancelling, the old onSlaveStop() notification (the consequence of the abort-stop) might arrive after the next start() which may confuse the expdef code (slave events are asynchronous).]]></description>
+			<arguments>
+				<argument type="Simulator"/>
+			</arguments>
+		</element>
+		<element name="cancelAllEvents" function="true">
+			<description><![CDATA[see cancelEventsFromSlave()]]></description>
+		</element>
+		<element name="isolation" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[Slave simulator access is filtered to exclude object references across simulator boundaries and ensure a safe multithreaded operation.
+1. Slave simulations objects can't be accessed from master while the slave simulator is running (except for Simulator.stop/start/running).
+2. Master simulator objects can't be passed to slave simulators
+3. Data objects (Vectors and Dictionaries) are passed by value rather than by reference (to make sure that no simulator contains a reference to another simulator's data).
+Setting isolation=0 disables these restrictions, which can lead to unpredictable results or crashes, but is sometimes useful for inspecting true object relationships.
+  Sample cases:
+Simulator.slaves[0].stop(); - always permitted
+Simulator.slaves[0].expdef="prime"; - permitted if the slave simulator is not running
+var vec=[1,2,3]; Simulator.slaves[0].user=vec; vec.clear(); - vec has changed, user field is still [1,2,3]
+var vec=[1,2,GenePools[0]]; Simulator.slaves[0].user=vec; - user field becomes [1,2,null] (because master's GenePool object can't be passed to the slave)
+var g=Simulator.slaves[0].genepools[0][0].genotype; - but the slave's GenePool can be accessed from master (if the slave is not running at the moment)]]></description>
+		</element>
 	</type>
 	<type name="stats" context="Global context">
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="gen_count" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="gen_mfailed" type="integer">
+		<element name="gen_count" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_mvalid" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_mvalidated" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_minvalid" type="integer" flags="1">
+			<description><![CDATA[couldn't be repaired]]></description>
+		</element>
+		<element name="gen_mfailed" type="integer" flags="1">
 			<description><![CDATA[couldn't be performed]]></description>
 		</element>
-		<element name="gen_minvalid" type="integer">
+		<element name="gen_xovalid" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_xovalidated" type="integer" flags="1">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="gen_xoinvalid" type="integer" flags="1">
 			<description><![CDATA[couldn't be repaired]]></description>
 		</element>
-		<element name="gen_mutimpr" type="float">
+		<element name="gen_xofailed" type="integer" flags="1">
+			<description><![CDATA[couldn't be performed]]></description>
+		</element>
+		<element name="gen_mutimpr" type="float" flags="1">
 			<description><![CDATA[total cumulative mutation change]]></description>
 		</element>
-		<element name="gen_mvalid" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="gen_mvalidated" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="gen_xofailed" type="integer">
-			<description><![CDATA[couldn't be performed]]></description>
-		</element>
-		<element name="gen_xoimpr" type="float">
+		<element name="gen_xoimpr" type="float" flags="1">
 			<description><![CDATA[total cumulative crossover change]]></description>
 		</element>
-		<element name="gen_xoinvalid" type="integer">
-			<description><![CDATA[couldn't be repaired]]></description>
-		</element>
-		<element name="gen_xovalid" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="gen_xovalidated" type="integer">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="st_avg_c_velocity" type="float"/>
-		<element name="st_avg_c_vertpos" type="float"/>
-		<element name="st_avg_c_vertvelocity" type="float"/>
-		<element name="st_avg_center_x" type="float"/>
-		<element name="st_avg_center_y" type="float"/>
-		<element name="st_avg_center_z" type="float"/>
-		<element name="st_avg_distance" type="float"/>
-		<element name="st_avg_fit" type="float"/>
-		<element name="st_avg_fit2" type="float"/>
-		<element name="st_avg_gnum" type="float"/>
-		<element name="st_avg_instances" type="float"/>
-		<element name="st_avg_lifespan" type="float"/>
-		<element name="st_avg_num" type="float"/>
-		<element name="st_avg_numconnections" type="float"/>
-		<element name="st_avg_numjoints" type="float"/>
-		<element name="st_avg_numneurons" type="float"/>
-		<element name="st_avg_numparts" type="float"/>
-		<element name="st_avg_pos_x" type="float"/>
-		<element name="st_avg_pos_y" type="float"/>
-		<element name="st_avg_pos_z" type="float"/>
-		<element name="st_avg_size_x" type="float"/>
-		<element name="st_avg_size_y" type="float"/>
-		<element name="st_avg_size_z" type="float"/>
-		<element name="st_avg_velocity" type="float"/>
-		<element name="st_avg_vertpos" type="float"/>
-		<element name="st_avg_vertvel" type="float"/>
-		<element name="st_count" type="integer"/>
-		<element name="st_max_c_velocity" type="float"/>
-		<element name="st_max_c_vertpos" type="float"/>
-		<element name="st_max_c_vertvelocity" type="float"/>
-		<element name="st_max_center_x" type="float"/>
-		<element name="st_max_center_y" type="float"/>
-		<element name="st_max_center_z" type="float"/>
-		<element name="st_max_distance" type="float"/>
-		<element name="st_max_fit" type="float"/>
-		<element name="st_max_fit2" type="float"/>
-		<element name="st_max_gnum" type="float"/>
-		<element name="st_max_instances" type="float"/>
-		<element name="st_max_lifespan" type="float"/>
-		<element name="st_max_num" type="float"/>
-		<element name="st_max_numconnections" type="float"/>
-		<element name="st_max_numjoints" type="float"/>
-		<element name="st_max_numneurons" type="float"/>
-		<element name="st_max_numparts" type="float"/>
-		<element name="st_max_pos_x" type="float"/>
-		<element name="st_max_pos_y" type="float"/>
-		<element name="st_max_pos_z" type="float"/>
-		<element name="st_max_size_x" type="float"/>
-		<element name="st_max_size_y" type="float"/>
-		<element name="st_max_size_z" type="float"/>
-		<element name="st_max_velocity" type="float"/>
-		<element name="st_max_vertpos" type="float"/>
-		<element name="st_max_vertvel" type="float"/>
-		<element name="st_min_c_velocity" type="float"/>
-		<element name="st_min_c_vertpos" type="float"/>
-		<element name="st_min_c_vertvelocity" type="float"/>
-		<element name="st_min_center_x" type="float"/>
-		<element name="st_min_center_y" type="float"/>
-		<element name="st_min_center_z" type="float"/>
-		<element name="st_min_distance" type="float"/>
-		<element name="st_min_fit" type="float"/>
-		<element name="st_min_fit2" type="float"/>
-		<element name="st_min_gnum" type="float"/>
-		<element name="st_min_instances" type="float"/>
-		<element name="st_min_lifespan" type="float"/>
-		<element name="st_min_num" type="float"/>
-		<element name="st_min_numconnections" type="float"/>
-		<element name="st_min_numjoints" type="float"/>
-		<element name="st_min_numneurons" type="float"/>
-		<element name="st_min_numparts" type="float"/>
-		<element name="st_min_pos_x" type="float"/>
-		<element name="st_min_pos_y" type="float"/>
-		<element name="st_min_pos_z" type="float"/>
-		<element name="st_min_size_x" type="float"/>
-		<element name="st_min_size_y" type="float"/>
-		<element name="st_min_size_z" type="float"/>
-		<element name="st_min_velocity" type="float"/>
-		<element name="st_min_vertpos" type="float"/>
-		<element name="st_min_vertvel" type="float"/>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="clrstats" function="true" type="void">
+		<element name="clrstats" function="true" type="void" flags="2">
 			<description><![CDATA[]]></description>
 <arguments/></element>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
+		<element name="st_count" type="integer" flags="1"/>
+		<element name="st_min_numparts" type="float" flags="65"/>
+		<element name="st_avg_numparts" type="float" flags="65"/>
+		<element name="st_max_numparts" type="float" flags="65"/>
+		<element name="st_min_numjoints" type="float" flags="65"/>
+		<element name="st_avg_numjoints" type="float" flags="65"/>
+		<element name="st_max_numjoints" type="float" flags="65"/>
+		<element name="st_min_numneurons" type="float" flags="65"/>
+		<element name="st_avg_numneurons" type="float" flags="65"/>
+		<element name="st_max_numneurons" type="float" flags="65"/>
+		<element name="st_min_numconnections" type="float" flags="65"/>
+		<element name="st_avg_numconnections" type="float" flags="65"/>
+		<element name="st_max_numconnections" type="float" flags="65"/>
+		<element name="st_min_num" type="float" flags="65"/>
+		<element name="st_avg_num" type="float" flags="65"/>
+		<element name="st_max_num" type="float" flags="65"/>
+		<element name="st_min_gnum" type="float" flags="65"/>
+		<element name="st_avg_gnum" type="float" flags="65"/>
+		<element name="st_max_gnum" type="float" flags="65"/>
+		<element name="st_min_instances" type="float" flags="65"/>
+		<element name="st_avg_instances" type="float" flags="65"/>
+		<element name="st_max_instances" type="float" flags="65"/>
+		<element name="st_min_lifespan" type="float" flags="65"/>
+		<element name="st_avg_lifespan" type="float" flags="65"/>
+		<element name="st_max_lifespan" type="float" flags="65"/>
+		<element name="st_min_velocity" type="float" flags="65"/>
+		<element name="st_avg_velocity" type="float" flags="65"/>
+		<element name="st_max_velocity" type="float" flags="65"/>
+		<element name="st_min_distance" type="float" flags="65"/>
+		<element name="st_avg_distance" type="float" flags="65"/>
+		<element name="st_max_distance" type="float" flags="65"/>
+		<element name="st_min_vertvel" type="float" flags="65"/>
+		<element name="st_avg_vertvel" type="float" flags="65"/>
+		<element name="st_max_vertvel" type="float" flags="65"/>
+		<element name="st_min_vertpos" type="float" flags="65"/>
+		<element name="st_avg_vertpos" type="float" flags="65"/>
+		<element name="st_max_vertpos" type="float" flags="65"/>
+		<element name="st_min_fit" type="float" flags="65"/>
+		<element name="st_avg_fit" type="float" flags="65"/>
+		<element name="st_max_fit" type="float" flags="65"/>
+		<element name="st_min_fit2" type="float" flags="65"/>
+		<element name="st_avg_fit2" type="float" flags="65"/>
+		<element name="st_max_fit2" type="float" flags="65"/>
+		<element name="st_min_c_velocity" type="float" flags="65"/>
+		<element name="st_avg_c_velocity" type="float" flags="65"/>
+		<element name="st_max_c_velocity" type="float" flags="65"/>
+		<element name="st_min_c_vertvelocity" type="float" flags="65"/>
+		<element name="st_avg_c_vertvelocity" type="float" flags="65"/>
+		<element name="st_max_c_vertvelocity" type="float" flags="65"/>
+		<element name="st_min_c_vertpos" type="float" flags="65"/>
+		<element name="st_avg_c_vertpos" type="float" flags="65"/>
+		<element name="st_max_c_vertpos" type="float" flags="65"/>
+		<element name="st_min_pos_x" type="float" flags="65"/>
+		<element name="st_avg_pos_x" type="float" flags="65"/>
+		<element name="st_max_pos_x" type="float" flags="65"/>
+		<element name="st_min_pos_y" type="float" flags="65"/>
+		<element name="st_avg_pos_y" type="float" flags="65"/>
+		<element name="st_max_pos_y" type="float" flags="65"/>
+		<element name="st_min_pos_z" type="float" flags="65"/>
+		<element name="st_avg_pos_z" type="float" flags="65"/>
+		<element name="st_max_pos_z" type="float" flags="65"/>
+		<element name="st_min_size_x" type="float" flags="65"/>
+		<element name="st_avg_size_x" type="float" flags="65"/>
+		<element name="st_max_size_x" type="float" flags="65"/>
+		<element name="st_min_size_y" type="float" flags="65"/>
+		<element name="st_avg_size_y" type="float" flags="65"/>
+		<element name="st_max_size_y" type="float" flags="65"/>
+		<element name="st_min_size_z" type="float" flags="65"/>
+		<element name="st_avg_size_z" type="float" flags="65"/>
+		<element name="st_max_size_z" type="float" flags="65"/>
+		<element name="st_min_center_x" type="float" flags="65"/>
+		<element name="st_avg_center_x" type="float" flags="65"/>
+		<element name="st_max_center_x" type="float" flags="65"/>
+		<element name="st_min_center_y" type="float" flags="65"/>
+		<element name="st_avg_center_y" type="float" flags="65"/>
+		<element name="st_max_center_y" type="float" flags="65"/>
+		<element name="st_min_center_z" type="float" flags="65"/>
+		<element name="st_avg_center_z" type="float" flags="65"/>
+		<element name="st_max_center_z" type="float" flags="65"/>
+	</type>
+	<type name="StopEvent" context="Global context">
+<description><![CDATA[Used in onSlaveStop() which is called when a Slave Simulator is stopped.]]></description>
+		<element name="index" type="integer" flags="1"/>
+		<element name="slave" type="Simulator" flags="1"/>
 	</type>
 	<type name="String" context="Global context">
 <description><![CDATA[String functions library.]]></description>
-		<element name="char" function="true" type="string">
-			<arguments>
-				<argument type="integer"/>
-			</arguments>
-		</element>
-		<element name="code" function="true" type="integer">
+		<element name="len" function="true" type="integer">
+			<description><![CDATA[String.len("abcdef") == 6]]></description>
 			<arguments>
 				<argument type="string"/>
 			</arguments>
 		</element>
+		<element name="replace" function="true" type="string">
+			<description><![CDATA[String.replace("abcdef","cd","X") == "abXef"]]></description>
+			<arguments>
+				<argument name="input_string" type="string"/>
+				<argument name="search" type="string"/>
+				<argument name="substitute" type="string"/>
+			</arguments>
+		</element>
+		<element name="split" function="true" type="Vector">
+			<description><![CDATA[return the vector of substrings, cut at separator positions.
+subsequent separators give empty words:
+split("word1---word2-word3","-") returns ["word1","","","word2","word3"]]]></description>
+			<arguments>
+				<argument type="string"/>
+				<argument name="word separator" type="string"/>
+			</arguments>
+		</element>
+		<element name="split2" function="true" type="Vector">
+			<description><![CDATA[return the vector of substrings, cut at separator positions.
+subsequent separators are treated as one:
+split2("word1---word2-word3","-") returns ["word1","word2","word3"]]]></description>
+			<arguments>
+				<argument type="string"/>
+				<argument name="word separator" type="string"/>
+			</arguments>
+		</element>
+		<element name="indexOf" function="true" type="integer">
+			<description><![CDATA[String.indexOf("abcdef","cd") == 2
+String.indexOf("abcdef","dc") == -1
+]]></description>
+			<arguments>
+				<argument type="string"/>
+				<argument name="substring" type="string"/>
+			</arguments>
+		</element>
+		<element name="indexOfStart" function="true" type="integer">
+			<description><![CDATA[String.indexOfStart("abcdef","cd",1) == 2
+String.indexOfStart("abcdef","cd",3) == -1
+]]></description>
+			<arguments>
+				<argument type="string"/>
+				<argument name="substring" type="string"/>
+				<argument name="start index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="substr" function="true" type="string">
+			<description><![CDATA[String.substr("abcdef",3,2) == "de"]]></description>
+			<arguments>
+				<argument type="string"/>
+				<argument name="first character" type="integer"/>
+				<argument name="number of characters" type="integer"/>
+			</arguments>
+		</element>
+		<element name="substr" function="true" type="string">
+			<description><![CDATA[String.substr("abcdef",3) == "def"]]></description>
+			<arguments>
+				<argument type="string"/>
+				<argument name="first character" type="integer"/>
+			</arguments>
+		</element>
+		<element name="left" function="true" type="string">
+			<description><![CDATA[String.left("abcdef",3) == "abc"]]></description>
+			<arguments>
+				<argument type="string"/>
+				<argument name="number of characters" type="integer"/>
+			</arguments>
+		</element>
+		<element name="right" function="true" type="string">
+			<description><![CDATA[String.right("abcdef",3) == "def"]]></description>
+			<arguments>
+				<argument type="string"/>
+				<argument name="number of characters" type="integer"/>
+			</arguments>
+		</element>
+		<element name="startsWith" function="true" type="integer">
+			<arguments>
+				<argument name="string" type="string"/>
+				<argument name="substring" type="string"/>
+			</arguments>
+		</element>
+		<element name="endsWith" function="true" type="integer">
+			<arguments>
+				<argument name="string" type="string"/>
+				<argument name="substring" type="string"/>
+			</arguments>
+		</element>
 		<element name="format" function="true" type="string">
-			<description><![CDATA[Works like the standard C library "sprintf()" but only one %-argument is accepted.
-Format string: %[-][+][0][width[.precision]]type
+			<description><![CDATA[Works like the standard C library "sprintf()". The '%' operator can be used as a shortcut, e.g. String.format("%x",123) is equivalent of "%x" % 123
+Character seqences beginning with % found in the format string are replaced by formatted values produced according to their corresponding format specifiers: %[-][+][0][width[.precision]]type
  -: left adjust (default is right adjust)
  +: place a sign (+ or -) before a number
@@ -4180,195 +4842,136 @@
  width: minimum field width
  precision: minimum number of decimal digits
- type: d=decimal integer, x/X=hexadecimal integer, f/g=floating point number, e="scientific" style floating point, t=time
+ type: d=decimal integer, x/X=hexadecimal integer, f/g=floating point number, e="scientific" style floating point, c=character of a given ascii code, t=time, %=special case, outputs the literal % character
+Multiple values can be formatted in one call, by passing a vector as the second argument:
+String.format("a=%03d b=%.2f c=%s",[a,b,c]) or "a=%03d b=%.2f c=%s" % [a,b,c]
+Alternatively, if no % characters are required in the output string, the chained call can be used:
+"a=%03d b=%.2f c=%s" % a % b % c
+The above expression works as expected, because, unlike the regular sprintf, the formatting function preserves % characters left after using all input arguments:
+ input:          "a=%03d b=%.2f c=%s" % a % b % c
+ actual meaning: (("a=%03d b=%.2f c=%s" % a) % b) % c
+ phase 1:        ("a=000 b=%.2f c=%s" % b) % c
+ phase 2:        "a=000 b=0.00 c=%s" % c
+ result:         "a=000 b=0.00 c=0"
+
 Examples:
- String.format("|%07.2f|",Math.pi) -> ="|0003.14|"
- String.format("|%04x|",255) -> ="|00ff|"
- String.format("|%7s|","text") -> ="|   text|"
- String.format("|%-7d|",12345) -> ="|12345  |"
- String.format("%t",Math.time) -> ="Sun Apr 29 19:22:02 2007"
- String.format("%T",Math.time) -> ="2007-05-29 19:22:02"
-]]></description>
-			<arguments>
-				<argument name="format" type="string"/>
-				<argument name="value" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="indexOf" function="true" type="integer">
-			<description><![CDATA[String.indexOf("abcdef","cd") -> 2
-String.indexOf("abcdef","dc") -> -1
-]]></description>
+ String.format("|%07.2f|",Math.pi) == "|0003.14|"
+ String.format("|%04x|",255) == "|00ff|"
+ String.format("|%7s|","text") == "|   text|"
+ String.format("|%-7d|",12345) == "|12345  |"
+ String.format("%t",Math.time) == "Sun Apr 29 19:22:02 2007"
+ String.format("%T",Math.time) == "2007-05-29 19:22:02"
+ String.format("x=%d%%",100) == "100%"]]></description>
+			<arguments>
+				<argument name="format_string" type="string"/>
+				<argument name="value_or_vector" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="parseInt" function="true" type="integer">
+			<description><![CDATA[If the supplied string is not an integer, returns 0 and posts an error message.]]></description>
 			<arguments>
 				<argument type="string"/>
-				<argument name="substring" type="string"/>
-			</arguments>
-		</element>
-		<element name="indexOfStart" function="true" type="integer">
-			<description><![CDATA[String.indexOfStart("abcdef","cd",1) -> 2
-String.indexOfStart("abcdef","cd",3) -> -1
-]]></description>
+			</arguments>
+		</element>
+		<element name="parseFloat" function="true" type="float">
+			<description><![CDATA[If the supplied string is not a number, returns 0.0 and posts an error message.]]></description>
 			<arguments>
 				<argument type="string"/>
-				<argument name="substring" type="string"/>
-				<argument name="start index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="left" function="true" type="string">
-			<description><![CDATA[String.left("abcdef",3) -> ="abc"]]></description>
+			</arguments>
+		</element>
+		<element name="parseNumber" function="true" type="untyped">
+			<description><![CDATA[Returns an integer, a floating point, or null if the string cannot be parsed as a number.
+The 'typeof' operator can be used to distinguish between an integer and a floating point value:
+typeof(String.parseNumber("qwerty")) == "null"
+typeof(String.parseNumber("1234")) == "int"
+typeof(String.parseNumber("3.14")) == "float"]]></description>
 			<arguments>
 				<argument type="string"/>
-				<argument name="number of characters" type="integer"/>
-			</arguments>
-		</element>
-		<element name="len" function="true" type="integer">
-			<description><![CDATA[String.len("abcdef") -> 6]]></description>
+			</arguments>
+		</element>
+		<element name="code" function="true" type="integer">
 			<arguments>
 				<argument type="string"/>
 			</arguments>
 		</element>
-		<element name="parseFloat" function="true" type="float">
+		<element name="char" function="true" type="string">
+			<arguments>
+				<argument type="integer"/>
+			</arguments>
+		</element>
+		<element name="toUpper" function="true" type="string">
 			<arguments>
 				<argument type="string"/>
 			</arguments>
 		</element>
-		<element name="parseInt" function="true" type="integer">
+		<element name="toLower" function="true" type="string">
 			<arguments>
 				<argument type="string"/>
 			</arguments>
 		</element>
-		<element name="replace" function="true" type="string">
-			<description><![CDATA[String.replace("abcdef","cd","X") -> "abXef"]]></description>
-			<arguments>
-				<argument name="search" type="string"/>
-				<argument name="substitute" type="string"/>
-			</arguments>
-		</element>
-		<element name="right" function="true" type="string">
-			<description><![CDATA[String.right("abcdef",3) -> ="def"]]></description>
+		<element name="serialize" function="true" type="string">
+			<description><![CDATA[convert to textual representation, preserving the object hierarchy]]></description>
+			<arguments>
+				<argument type="untyped"/>
+			</arguments>
+		</element>
+		<element name="deserialize" function="true" type="untyped">
+			<description><![CDATA[extract objects from textual representation]]></description>
 			<arguments>
 				<argument type="string"/>
-				<argument name="number of characters" type="integer"/>
-			</arguments>
-		</element>
-		<element name="split" function="true" type="Vector">
-			<description><![CDATA[return the vector of substrings, cut at separator positions.
-subsequent separators give empty words: split("word1---word2-word3","-") -> ["word1","","","word2","word3"]]]></description>
+			</arguments>
+		</element>
+		<element name="hash" function="true" type="integer">
 			<arguments>
 				<argument type="string"/>
-				<argument name="word separator" type="string"/>
-			</arguments>
-		</element>
-		<element name="split2" function="true" type="Vector">
-			<description><![CDATA[return the vector of substrings, cut at separator positions.
-subsequent separators are treated as one: split2("word1---word2-word3","-") -> ["word1","word2","word3"]]]></description>
+			</arguments>
+		</element>
+		<element name="diff" function="true" type="Vector">
+			<description><![CDATA[Returns the vector of minimal differences between two strings. The vector contains either 2-element subvectors with differing substrings ["text-1","text-2"] or strings "same".
+
+For example, String.diff("thisisatest", "testing123testing") returns [t,[hi,e],s,[,t],i,[sa,ng123],test,[,ing]].
+
+Use this function for short strings, as it requires 4*length(string1)*length(string2) bytes of memory.]]></description>
 			<arguments>
 				<argument type="string"/>
-				<argument name="word separator" type="string"/>
-			</arguments>
-		</element>
-		<element name="substr" function="true" type="string">
-			<description><![CDATA[String.substr("abcdef",3,2) -> ="de"]]></description>
-			<arguments>
 				<argument type="string"/>
-				<argument name="first character" type="integer"/>
-				<argument name="number of characters" type="integer"/>
-			</arguments>
-		</element>
-		<element name="toLower" function="true" type="string">
-			<arguments>
-				<argument type="string"/>
-			</arguments>
-		</element>
-		<element name="toUpper" function="true" type="string">
-			<arguments>
-				<argument type="string"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="Symmetry" context="Global context">
-		<element name="symAlphaSteps" type="integer" min="2" max="50" default="20">
-			<description><![CDATA[Default number of samples per full angle (#1)]]></description>
-		</element>
-		<element name="symBetaSteps" type="integer" min="2" max="50" default="20">
-			<description><![CDATA[Default number of samples per full angle (#2)]]></description>
-		</element>
-		<element name="symPosSteps" type="integer" min="2" max="50" default="10">
-			<description><![CDATA[Default number of samples per stick length]]></description>
-		</element>
-		<element name="symResultA" type="float"/>
-		<element name="symResultB" type="float"/>
-		<element name="symResultC" type="float"/>
-		<element name="symResultD" type="float"/>
-		<element name="calculateSymmetry" function="true" type="float">
-			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model using default precision parameters (symPosSteps,symAlphaSteps,symBetaSteps). Returns the symmetry plane, too (sets symResultA,B,C,D).
-Note: may take a long time for large creatures.]]></description>
-			<arguments>
-				<argument name="model" type="Model"/>
-			</arguments>
-		</element>
-		<element name="calculateSymmetry2" function="true" type="float">
-			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model using specified precision parameters. Returns the symmetry plane, too (sets symResultA,B,C,D).
-Note: may take a long time for large creatures.]]></description>
-			<arguments>
-				<argument name="model" type="Model"/>
-				<argument name="posSteps" type="integer"/>
-				<argument name="alphaSteps" type="integer"/>
-				<argument name="betaSteps" type="integer"/>
-			</arguments>
-		</element>
-		<element name="calculateSymmetryForPlane" function="true" type="float">
-			<description><![CDATA[Returns bilateral symmetry (0.0 .. 1.0) for a given Model and given a specific plane defined by coefficients A, B, C, D.]]></description>
-			<arguments>
-				<argument name="model" type="Model"/>
-				<argument name="A" type="float"/>
-				<argument name="B" type="float"/>
-				<argument name="C" type="float"/>
-				<argument name="D" type="float"/>
 			</arguments>
 		</element>
 	</type>
 	<type name="UserScripts" context="Global context">
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
 	</type>
 	<type name="Vector" context="Global context">
-<description><![CDATA[Vector is 1-dimensional array, indexed by integer value (starting from 0). Multidimensional arrays can be simulated by putting other Vector objects into the Vector.
-Example:
-var v=Vector.new();
-v.add(123); v.add("string");]]></description>
-		<element name="avg" type="float"/>
-		<element name="size" type="integer"/>
-		<element name="stdev" type="float">
-			<description><![CDATA[=sqrt(sum((element[i]-avg)^2)/(size-1)) which is estimated population std.dev. from sample std.dev.]]></description>
-		</element>
-		<element name="toString" type="string"/>
-		<element name="add" function="true" type="void">
-			<arguments>
-				<argument name="value" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="clear" function="true" type="void"><arguments/></element>
-		<element name="find" function="true" type="integer">
-			<description><![CDATA[returns the element index or -1 if not found]]></description>
-			<arguments>
-				<argument name="value" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="get" function="true" type="untyped">
+<description><![CDATA[Vector is a 1-dimensional array indexed by an integer value (starting from 0). Multidimensional arrays can be simulated by putting other Vector objects into a Vector.
+Examples:
+	var v1=Vector.new();
+	v1.add(123);
+	v1.add("string");
+A short way of doing the same (square brackets create a vector):
+	var v2=[123,"string"];
+Simulate a 2D array:
+	var v3=[[1,2,3],[4,5],[6]];
+You can iterate directly over values of a Vector using for(...in...) loops:
+	for(var element in v3) Simulator.print(element);]]></description>
+		<element name="clear" function="true" type="void" flags="256"><arguments/></element>
+		<element name="size" type="integer" flags="257"/>
+		<element name="remove" function="true" type="void" flags="256">
 			<arguments>
 				<argument name="position" type="integer"/>
 			</arguments>
 		</element>
-		<element name="new" function="true" type="Vector"><arguments/></element>
-		<element name="remove" function="true" type="void">
+		<element name="get" function="true" type="untyped" flags="256">
+			<description><![CDATA[object[position] can be always used instead of object.get(position)]]></description>
 			<arguments>
 				<argument name="position" type="integer"/>
 			</arguments>
 		</element>
-		<element name="set" function="true" type="void">
+		<element name="set" function="true" type="void" flags="256">
+			<description><![CDATA[object[position]=value can be always used instead of object.set(position,value)]]></description>
 			<arguments>
 				<argument name="position" type="integer"/>
@@ -4376,21 +4979,42 @@
 			</arguments>
 		</element>
+		<element name="add" function="true" type="void" flags="256">
+			<arguments>
+				<argument name="value" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="find" function="true" type="integer" flags="256">
+			<description><![CDATA[returns the element index or -1 if not found]]></description>
+			<arguments>
+				<argument name="value" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="avg" type="float" flags="257"/>
+		<element name="stdev" type="float" flags="257">
+			<description><![CDATA[=sqrt(sum((element[i]-avg)^2)/(size-1)) which is estimated population std.dev. from sample std.dev.]]></description>
+		</element>
+		<element name="toString" type="string" flags="257"/>
+		<element name="new" function="true" type="Vector"><arguments/></element>
+		<element name="sort" function="true" type="void" flags="256">
+			<description><![CDATA[comparator can be null, giving the "natural" sorting order (depending on element type), otherwise it must be a function reference obtained from the 'function' operator.
+
+Example:
+function compareLastDigit(a,b) {return (a%10)<(b%10);}
+var v=[16,23,35,42,54,61];
+v.sort(function compareLastDigit);]]></description>
+			<arguments>
+				<argument name="comparator" type="FunctionReference"/>
+			</arguments>
+		</element>
+		<element name="iterator" type="Object" flags="257"/>
+		<element name="clone" function="true" type="Vector" flags="256">
+			<description><![CDATA[The resulting clone is a shallow copy (contains the same object references as the original). A deep copy can be obtained through serialization: String.deserialize(String.serialize(object));]]></description>
+<arguments/></element>
 	</type>
 	<type name="World" context="Global context">
 <description><![CDATA[Environment properties.]]></description>
-		<element name="nnspeed" type="float" min="0" max="1000" default="1">
-			<description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description>
-		</element>
-		<element name="signals" type="WorldSignals"/>
-		<element name="simtype" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[MechaStick is a fast and simple primary Framsticks simulation engine.
-ODE is Open Dynamics Engine by Russel Smith et al.
-
-NOTE: switching between simulation engines causes removal of all objects in the world (e.g. creatures).]]></description>
-		</element>
-		<element name="wrldbnd" type="integer" min="0" max="2" default="1"/>
-		<element name="wrldg" type="float" min="0" max="10" default="1">
-			<description><![CDATA[You can adjust gravity for your experiments.
-The "official" setting used to evaluate and compare creatures is 1.]]></description>
+		<element name="wrldtyp" type="integer" min="0" max="2" default="0"/>
+		<element name="wrldsiz" type="float" min="10" max="1000" default="20.0">
+			<description><![CDATA[Side length of the world]]></description>
 		</element>
 		<element name="wrldmap" type="string">
@@ -4404,10 +5028,23 @@
 See also the WorldMap object.]]></description>
 		</element>
-		<element name="wrldsiz" type="float" min="10" max="1000" default="20">
-			<description><![CDATA[Side length of the world]]></description>
-		</element>
-		<element name="wrldtyp" type="integer" min="0" max="2" default="0"/>
-		<element name="wrldwat" type="float" min="-20" max="30" default="-1"/>
-		<element name="wrldchg" function="true" type="void"><arguments/></element>
+		<element name="wrldwat" type="float" min="-20" max="200" default="-1.0"/>
+		<element name="wrldbnd" type="integer" min="0" max="2" default="0">
+			<description><![CDATA[Teleporting a creature that is outside of the world area is attempted every 'performance sampling period' steps. Teleport succeeds only when the target location in the world is empty (there is no collision).]]></description>
+		</element>
+		<element name="wrldg" type="float" min="0" max="10" default="1.0">
+			<description><![CDATA[You can adjust gravity for your experiments.
+The "official" setting used to evaluate and compare creatures is 1.]]></description>
+		</element>
+		<element name="wrldchg" function="true" type="void" flags="32"><arguments/></element>
+		<element name="simtype" type="integer" min="0" max="1" default="0">
+			<description><![CDATA[MechaStick is a fast and simple primary Framsticks simulation engine.
+ODE is Open Dynamics Engine by Russel Smith et al.
+
+NOTE: switching between simulation engines causes removal of all objects in the world (e.g. creatures).]]></description>
+		</element>
+		<element name="nnspeed" type="float" min="0" max="1000" default="1.0">
+			<description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description>
+		</element>
+		<element name="signals" type="WorldSignals" flags="35"/>
 	</type>
 	<type name="WorldMap" context="Global context">
@@ -4418,6 +5055,6 @@
 Smooth: x/ysize=World.wrldsiz+2 rows of vertices (creating World.wrldsiz+1 rows of triangles, everything within the world boundaries)
 ]]></description>
-		<element name="xsize" type="integer"/>
-		<element name="ysize" type="integer"/>
+		<element name="xsize" type="integer" flags="1"/>
+		<element name="ysize" type="integer" flags="1"/>
 		<element name="getHeight" function="true" type="float">
 			<description><![CDATA[Height at any 2d coordinate]]></description>
@@ -4445,14 +5082,17 @@
 			</arguments>
 		</element>
+		<element name="intersect" function="true" type="Vector">
+			<description><![CDATA[Works like intersect(3d point,3d direction,range) for inifinite range, that is without limiting the intersection distance]]></description>
+			<arguments>
+				<argument name="3d point" type="Vector"/>
+				<argument name="3d direction" type="Vector"/>
+			</arguments>
+		</element>
 	</type>
 	<type name="WorldSignals" context="Global context">
-<description><![CDATA[Use this object to create stationary signals, not associated with any moving object and receive signals from any location in the world. There are Creature and Neuro-based variants of this object that automatically operate from the creature's or neuron's position.
-
-See also: Signal]]></description>
-		<element name="size" type="integer">
-			<description><![CDATA[Number of signals in this set.]]></description>
-		</element>
+<description><![CDATA[Use this object to create stationary signals (not associated with any moving object) and to receive signals from any location in the world. There are Creature-based and Neuro-based variants of this object that automatically operate from creature's or neuron's position.
+
+See also: Signal, CreatureSignals, NeuroSignals.]]></description>
 		<element name="add" function="true" type="Signal">
-			<description><![CDATA[Create a new signal]]></description>
 			<arguments>
 				<argument name="position" type="XYZ"/>
@@ -4460,13 +5100,4 @@
 			</arguments>
 		</element>
-		<element name="clear" function="true" type="void">
-			<description><![CDATA[Delete all signals]]></description>
-<arguments/></element>
-		<element name="get" function="true" type="Signal">
-			<description><![CDATA[Access individual signals (index=0 .. size-1)]]></description>
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
 		<element name="receive" function="true" type="float">
 			<description><![CDATA[Receive the aggregated signal power in a given channel.]]></description>
@@ -4476,4 +5107,12 @@
 			</arguments>
 		</element>
+		<element name="receiveSet" function="true" type="Vector">
+			<description><![CDATA[Get all signals in the specified range. Returns a read-only vector object containing Signal objects - individual signals can be accessed as result[0], .., result[result.size-1].]]></description>
+			<arguments>
+				<argument name="position" type="XYZ"/>
+				<argument name="channel" type="string"/>
+				<argument name="max distance" type="float"/>
+			</arguments>
+		</element>
 		<element name="receiveFilter" function="true" type="float">
 			<description><![CDATA[Receive the aggregated signal power in a given channel.
@@ -4481,5 +5120,5 @@
 Additional filtering options:
 - Max distance only receives the neighbor signals (based on their physical location)
-- Flavor filtering: only signals having the flavor close to the specified one will be received. The filter value is the maximum allowed difference.]]></description>
+- Flavor filtering: only signals having the flavor similar to the specified value will be received. The flavorfilter value is the difference of flavor that reduces the received signal to 0. The "flavor attenuation" is linear, i.e., signals differing by (filter/2) in flavor will be reduced to 50%.]]></description>
 			<arguments>
 				<argument name="position" type="XYZ"/>
@@ -4487,9 +5126,9 @@
 				<argument name="max distance" type="float"/>
 				<argument name="flavor" type="float"/>
-				<argument name="filter" type="float"/>
-			</arguments>
-		</element>
-		<element name="receiveSet" function="true" type="Vector">
-			<description><![CDATA[Get all signals in the specified range. Returns a readonly vector object containing Signal objects (individual signals can be accessed as result[0] throught result[result.size-1]).]]></description>
+				<argument name="flavorfilter" type="float"/>
+			</arguments>
+		</element>
+		<element name="receiveSingle" function="true" type="Signal">
+			<description><![CDATA[Find the signal source that has the highest signal power (taking into account distance).]]></description>
 			<arguments>
 				<argument name="position" type="XYZ"/>
@@ -4498,27 +5137,32 @@
 			</arguments>
 		</element>
-		<element name="receiveSingle" function="true" type="Signal">
-			<description><![CDATA[Find the signal source having the highest signal power (including the distance)]]></description>
-			<arguments>
-				<argument name="position" type="XYZ"/>
-				<argument name="channel" type="string"/>
-				<argument name="max distance" type="float"/>
-			</arguments>
-		</element>
+		<element name="get" function="true" type="Signal">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="size" type="integer" flags="1"/>
+		<element name="clear" function="true" type="void" flags="1"><arguments/></element>
 	</type>
 	<type name="XYZ" context="Global context">
 <description><![CDATA[3D vector]]></description>
-		<element name="length" type="float"/>
-		<element name="toString" type="string"/>
-		<element name="x" type="float"/>
-		<element name="y" type="float"/>
-		<element name="z" type="float"/>
-		<element name="add" function="true" type="void">
-			<description><![CDATA[Note: it does not return a new object, just modifies the existing one]]></description>
-			<arguments>
-				<argument type="XYZ"/>
-			</arguments>
-		</element>
-		<element name="clone" function="true" type="XYZ">
+		<element name="x" type="float" flags="256"/>
+		<element name="y" type="float" flags="256"/>
+		<element name="z" type="float" flags="256"/>
+		<element name="new" function="true" type="XYZ">
+			<description><![CDATA[3D vectors objects can be also created using the (x,y,z) notation, i.e. var v=(1,2,3) is the same as var v=XYZ.new(1,2,3);]]></description>
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="z" type="float"/>
+			</arguments>
+		</element>
+		<element name="newFromVector" function="true" type="XYZ">
+			<description><![CDATA[used for deserialization]]></description>
+			<arguments>
+				<argument type="Vector"/>
+			</arguments>
+		</element>
+		<element name="clone" function="true" type="XYZ" flags="256">
 			<description><![CDATA[Note: copying object references does not create new objects. Use clone() if a new object is needed.
 
@@ -4528,12 +5172,10 @@
 //o2 is now (1,9999,3) but o3 is still (1,2,3)]]></description>
 <arguments/></element>
-		<element name="get" function="true" type="float">
-			<description><![CDATA[this function makes the XYZ objects "indexable" (so you can use [] for accessing subsequent fields, like in Vector)]]></description>
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="new" function="true" type="XYZ">
-			<description><![CDATA[3D vectors objects can be also created using the (x,y,z) notation, i.e. var v=(1,2,3) is the same as var v=XYZ.new(1,2,3);]]></description>
+		<element name="set" function="true" type="void" flags="256">
+			<arguments>
+				<argument type="XYZ"/>
+			</arguments>
+		</element>
+		<element name="set3" function="true" type="void" flags="256">
 			<arguments>
 				<argument name="x" type="float"/>
@@ -4542,91 +5184,173 @@
 			</arguments>
 		</element>
-		<element name="normalize" function="true" type="void">
+		<element name="add" function="true" type="void" flags="256">
+			<description><![CDATA[Note: it does not return a new object, just modifies the existing one]]></description>
+			<arguments>
+				<argument type="XYZ"/>
+			</arguments>
+		</element>
+		<element name="sub" function="true" type="void" flags="256">
+			<description><![CDATA[Note: it does not return a new object, just modifies the existing one]]></description>
+			<arguments>
+				<argument type="XYZ"/>
+			</arguments>
+		</element>
+		<element name="scale" function="true" type="void" flags="256">
+			<arguments>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="length" type="float" flags="257"/>
+		<element name="normalize" function="true" type="void" flags="256">
 			<description><![CDATA[scales the vector length to 1.0]]></description>
 <arguments/></element>
-		<element name="revRotate" function="true" type="void">
+		<element name="toString" type="string" flags="257"/>
+		<element name="toVector" type="Vector" flags="257"/>
+		<element name="rotate" function="true" type="void" flags="256">
 			<arguments>
 				<argument type="Orient"/>
 			</arguments>
 		</element>
-		<element name="rotate" function="true" type="void">
+		<element name="revRotate" function="true" type="void" flags="256">
 			<arguments>
 				<argument type="Orient"/>
 			</arguments>
 		</element>
-		<element name="scale" function="true" type="void">
-			<arguments>
-				<argument type="float"/>
-			</arguments>
-		</element>
-		<element name="set" function="true" type="void">
-			<arguments>
-				<argument type="XYZ"/>
-			</arguments>
-		</element>
-		<element name="set3" function="true" type="void">
-			<arguments>
-				<argument name="x" type="float"/>
-				<argument name="y" type="float"/>
-				<argument name="z" type="float"/>
-			</arguments>
-		</element>
-		<element name="sub" function="true" type="void">
-			<description><![CDATA[Note: it does not return a new object, just modifies the existing one]]></description>
-			<arguments>
-				<argument type="XYZ"/>
+		<element name="get" function="true" type="float" flags="256">
+			<description><![CDATA[this function makes the XYZ objects "indexable" (so you can use [] for accessing subsequent fields, like in Vector)]]></description>
+			<arguments>
+				<argument name="index" type="integer"/>
 			</arguments>
 		</element>
 	</type>
 	<type name="ExpParams" context="Experiment definition">
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
 	</type>
 	<type name="ExpState" context="Experiment definition">
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
 	</type>
 	<type name="n" context="Neuron definitions">
+		<element name="p" type="integer" min="-1" max="999999" default="-1"/>
+		<element name="j" type="integer" min="-1" max="999999" default="-1"/>
 		<element name="d" type="string"/>
-		<element name="getInputCount" type="integer"/>
 		<element name="i" type="string"/>
-		<element name="j" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="p" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="Vstyle" type="string"/>
-		<element name="getInputNeuroDef" function="true" type="NeuroDef">
+		<element name="Vstyle" type="string" max="-1" default="neuro"/>
+		<element name="getInputCount" type="integer" flags="3"/>
+		<element name="getInputNeuroDef" function="true" type="NeuroDef" flags="3">
 			<arguments>
 				<argument type="integer"/>
 			</arguments>
 		</element>
-		<element name="getInputNeuroIndex" function="true" type="integer">
+		<element name="getInputNeuroIndex" function="true" type="integer" flags="3">
 			<arguments>
 				<argument type="integer"/>
 			</arguments>
 		</element>
-		<element name="getInputWeight" function="true" type="float">
+		<element name="getInputWeight" function="true" type="float" flags="3">
 			<arguments>
 				<argument type="integer"/>
 			</arguments>
 		</element>
+		<element name="classObject" type="NeuroClass" flags="3"/>
 	</type>
 	<type name="Neuro" context="Neuron definitions">
 <description><![CDATA[Live Neuron object.]]></description>
+		<element name="getInputState" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputWeight" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getWeightedInputState" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputSum" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getWeightedInputSum" function="true" type="float">
+			<description><![CDATA[Uses any number of inputs starting with the specified input. getWeightedInputSum(0)=weightedInputSum]]></description>
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputCount" type="integer" flags="1"/>
+		<element name="inputSum" type="float" flags="1"/>
+		<element name="weightedInputSum" type="float" flags="1"/>
+		<element name="getInputChannelCount" function="true" type="integer">
+			<arguments>
+				<argument name="input" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputStateChannel" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+				<argument name="channel" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getWeightedInputStateChannel" function="true" type="float">
+			<arguments>
+				<argument name="input" type="integer"/>
+				<argument name="channel" type="integer"/>
+			</arguments>
+		</element>
+		<element name="state" type="float">
+			<description><![CDATA[When read, returns the current neuron state.
+When written, sets the 'internal' neuron state that will become current in the next step.
+Typically you should use this field, and not currState.]]></description>
+		</element>
 		<element name="channelCount" type="integer"/>
-		<element name="creature" type="Creature"/>
+		<element name="getStateChannel" function="true" type="float">
+			<arguments>
+				<argument name="channel" type="integer"/>
+			</arguments>
+		</element>
+		<element name="setStateChannel" function="true" type="void">
+			<arguments>
+				<argument name="channel" type="integer"/>
+				<argument name="value" type="float"/>
+			</arguments>
+		</element>
+		<element name="hold" type="integer" min="0" max="1">
+			<description><![CDATA["Holding" means keeping the neuron state as is, blocking the regular neuron operation. This is useful when your script needs to inject some control signals into the NN. Without "holding", live neurons would be constantly overwriting your changes, and the rest of the NN could see inconsistent states, depending on the connections. Setting hold=1 ensures the neuron state will be only set by you, and not by the neuron. The enforced signal value can be set using Neuro.currState before or after setting hold=1. Set hold=0 to resume normal operation.]]></description>
+		</element>
 		<element name="currState" type="float">
-			<description><![CDATA[The only difference from the "state" field is that currState, when written, changes the internal neuron state immediately (which disturbs the regular synchronous NN operation). This feature should only be used while controlling the neuron 'from outside' (like a neuro probe) and not in the neuron definition. See also: Neuro.hold]]></description>
-		</element>
-		<element name="def" type="NeuroDef"/>
-		<element name="fields" type="Fields">
+			<description><![CDATA[When read, it behaves just like the 'state' field.
+When written, changes the current neuron state immediately, which disturbs the regular synchronous NN operation.
+This feature should only be used while controlling the neuron 'from outside' (like a neuro probe) and not in the neuron definition. See also: Neuro.hold]]></description>
+		</element>
+		<element name="setCurrStateChannel" function="true" type="void">
+			<description><![CDATA[Analogous to "currState".]]></description>
+			<arguments>
+				<argument name="channel" type="integer"/>
+				<argument name="value" type="float"/>
+			</arguments>
+		</element>
+		<element name="position_x" type="float" flags="1"/>
+		<element name="position_y" type="float" flags="1"/>
+		<element name="position_z" type="float" flags="1"/>
+		<element name="creature" type="Creature" flags="1"/>
+		<element name="part" type="MechPart" flags="1"/>
+		<element name="joint" type="MechJoint" flags="1"/>
+		<element name="fields" type="Fields" flags="1">
 			<description><![CDATA[Neurons can have different fields depending on their class. Script neurons have their fields defined using the "prop:" syntax. If you develop a custom neuron script you should use the Fields object for accessing your own neuron fields. The Neuro.fields property is meant for accessing the neuron fields from the outside script.
 Examples:
@@ -4643,272 +5367,215 @@
  Simulator.print(iobj.getId(i)+" ("+iobj.getName(i)+")");]]></description>
 		</element>
-		<element name="getInputCount" type="integer"/>
-		<element name="hold" type="integer" min="0" max="1">
-			<description><![CDATA["Holding" means keeping the neuron state as is, blocking the regular neuron operation. This is useful when your script needs to inject some control signals into the NN. Without "holding", live neurons would be constantly overwriting your changes, and the rest of the NN could see inconsistent states, depending on the connections. Setting hold=1 ensures the neuron state will be only set by you, and not by the neuron. The enforced signal value can be set using Neuro.currState before or after setting hold=1. Set hold=0 to resume normal operation.]]></description>
-		</element>
-		<element name="inputSum" type="float"/>
-		<element name="joint" type="MechJoint"/>
-		<element name="part" type="MechPart"/>
-		<element name="position_x" type="float"/>
-		<element name="position_y" type="float"/>
-		<element name="position_z" type="float"/>
-		<element name="signals" type="NeuroSignals"/>
-		<element name="state" type="float">
-			<description><![CDATA[When read, returns the current neuron state.
-When written, sets the next neuron state (for use in the neuron definition)]]></description>
-		</element>
-		<element name="weightedInputSum" type="float"/>
-		<element name="getInputChannelCount" function="true" type="integer">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputState" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputStateChannel" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-				<argument name="channel" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputSum" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputWeight" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getStateChannel" function="true" type="float">
-			<arguments>
-				<argument name="channel" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getWeightedInputState" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getWeightedInputStateChannel" function="true" type="float">
-			<arguments>
-				<argument name="input" type="integer"/>
-				<argument name="channel" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getWeightedInputSum" function="true" type="float">
-			<description><![CDATA[Uses any number of inputs starting with the specified input. getWeightedInputSum(0)=weightedInputSum]]></description>
-			<arguments>
-				<argument name="input" type="integer"/>
-			</arguments>
-		</element>
-		<element name="setCurrStateChannel" function="true" type="void">
-			<description><![CDATA[Analogous to "currState".]]></description>
-			<arguments>
-				<argument name="channel" type="integer"/>
-				<argument name="value" type="float"/>
-			</arguments>
-		</element>
-		<element name="setStateChannel" function="true" type="void">
-			<arguments>
-				<argument name="channel" type="integer"/>
-				<argument name="value" type="float"/>
-			</arguments>
-		</element>
+		<element name="def" type="NeuroDef" flags="1"/>
+		<element name="classObject" type="NeuroClass" flags="1"/>
+		<element name="signals" type="NeuroSignals" flags="1"/>
 	</type>
 	<type name="this" context="Fitness formula">
-<description><![CDATA[A Genotype with the associated performance information. All but one Genotype objects are placed in Genotype Groups. There is also a single static Genotype object not associated with a group, which is used as a temporary storage by genetic operators and some functions from GenePools.]]></description>
-		<element name="convtrace1" type="string"/>
-		<element name="distance" type="float"/>
-		<element name="energ0" type="float"/>
-		<element name="f0genotype" type="string">
-			<description><![CDATA[converted to f0 genotype]]></description>
-		</element>
-		<element name="fit" type="float"/>
-		<element name="fit2" type="float">
-			<description><![CDATA[Fitness shifted by (avg-n*stddev)]]></description>
-		</element>
-		<element name="geno" type="Geno">
-			<description><![CDATA[Geno object for this Genotype]]></description>
-		</element>
-		<element name="genotype" type="string"/>
-		<element name="gnum" type="integer"/>
+<description><![CDATA[A Genotype with the associated performance information. Adding genotypes to GenePool makes them accessible in Framsticks GUI and enables the use of GenePool selection methods.
+Before version 4.0rc4 the static Genotype object was used in functions operating on the "selected" genotype. This is now deprecated as all operations can be performed using the more convenient direct access (see GenePools).]]></description>
+		<element name="name" type="string" max="40"/>
+		<element name="genotype" type="string">
+			<description><![CDATA[Genes as a string of characters]]></description>
+		</element>
 		<element name="info" type="string">
 			<description><![CDATA[Additional information or comments]]></description>
 		</element>
+		<element name="simi" type="float" flags="3">
+			<description><![CDATA[Read about details:
+http://www.framsticks.com/node/795
+http://www.framsticks.com/node/890]]></description>
+		</element>
+		<element name="energ0" type="float" deprecated="true" flags="8227"/>
+		<element name="energy0" type="float" min="0" max="-1" default="0.0" flags="16"/>
+		<element name="strsiz" type="integer" deprecated="true" flags="8227"/>
+		<element name="strjoints" type="integer" deprecated="true" flags="8227"/>
+		<element name="nnsiz" type="integer" deprecated="true" flags="8227"/>
+		<element name="nncon" type="integer" deprecated="true" flags="8227"/>
+		<element name="numparts" type="integer" flags="16"/>
+		<element name="numjoints" type="integer" flags="16"/>
+		<element name="numneurons" type="integer" flags="16"/>
+		<element name="numconnections" type="integer" flags="16"/>
+		<element name="num" type="integer"/>
+		<element name="gnum" type="integer"/>
+		<element name="popsiz" type="integer" deprecated="true" flags="8226">
+			<description><![CDATA[Please use 'instances' instead of 'popsiz'.]]></description>
+		</element>
 		<element name="instances" type="integer">
 			<description><![CDATA[Copies of this genotype]]></description>
 		</element>
-		<element name="isValid" type="integer" min="0" max="1"/>
 		<element name="lifespan" type="float">
 			<description><![CDATA[Average life span]]></description>
 		</element>
-		<element name="name" type="string"/>
-		<element name="nncon" type="float"/>
-		<element name="nnsiz" type="float"/>
-		<element name="num" type="integer"/>
-		<element name="numconnections" type="float"/>
-		<element name="numjoints" type="float"/>
-		<element name="numneurons" type="float"/>
-		<element name="numparts" type="float"/>
-		<element name="popsiz" type="integer"/>
-		<element name="simi" type="float"/>
-		<element name="strjoints" type="float"/>
-		<element name="strsiz" type="float"/>
-		<element name="uid" type="string">
-			<description><![CDATA[Unique identifier]]></description>
-		</element>
+		<element name="velocity" type="float">
+			<description><![CDATA[Average velocity]]></description>
+		</element>
+		<element name="distance" type="float"/>
+		<element name="vertvel" type="float"/>
+		<element name="vertpos" type="float"/>
+		<element name="fit" type="float" flags="3"/>
+		<element name="fit2" type="float" flags="3">
+			<description><![CDATA[Fitness shifted by (avg-n*stddev)]]></description>
+		</element>
+		<element name="f0genotype" type="string" flags="3">
+			<description><![CDATA[converted to f0 genotype]]></description>
+		</element>
+		<element name="convtrace1" type="string" flags="3"/>
 		<element name="user1" type="untyped"/>
 		<element name="user2" type="untyped"/>
 		<element name="user3" type="untyped"/>
-		<element name="velocity" type="float">
-			<description><![CDATA[Average velocity]]></description>
-		</element>
+		<element name="mutate" function="true" type="void"><arguments/></element>
+		<element name="isValid" type="integer" min="0" max="1" deprecated="true" flags="8227">
+			<description><![CDATA[Use 'is_valid' instead of 'isValid'.]]></description>
+		</element>
+		<element name="is_valid" type="integer" min="-1" max="1" default="-1" flags="32">
+			<description><![CDATA[0 = invalid genotype
+1 = valid genotype
+-1 = validity is not known. This is a transient state. The value of "is_valid" will never be -1 when read. It is safe to treat is_valid as boolean in statements like "if (g.is_valid) ...". Setting "is_valid=-1" will make it 0 or 1 again. This third state (-1) is only needed for loading Genotype objects from files where the "is_valid" field might not be present.]]></description>
+		</element>
+		<element name="getNormalized" function="true" type="float" flags="35">
+			<arguments>
+				<argument name="property name or index" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="geno" type="Geno" flags="35">
+			<description><![CDATA[A Geno object for this Genotype]]></description>
+		</element>
+		<element name="uid" type="string" flags="33">
+			<description><![CDATA[Unique identifier]]></description>
+		</element>
+		<element name="getModel" function="true" type="Model" flags="35"><arguments/></element>
+		<element name="splitInstances" function="true" type="void" flags="32"><arguments/></element>
+		<element name="newFromString" function="true" type="Genotype" flags="32">
+			<arguments>
+				<argument name="genotype" type="string"/>
+			</arguments>
+		</element>
+		<element name="newFromGeno" function="true" type="Genotype" flags="32">
+			<arguments>
+				<argument name="geno" type="Geno"/>
+			</arguments>
+		</element>
+		<element name="newFromCreature" function="true" type="Genotype" flags="32">
+			<arguments>
+				<argument name="creature" type="Creature"/>
+			</arguments>
+		</element>
+		<element name="addPerformanceFromCreature" function="true" type="void" flags="34">
+			<description><![CDATA[Updates the Genotype's performance values merging them with the supplied Creture's performance. It assumes the Genotype.instances has a reasonable value and performs the proper weighting. Use your own function instead if these conditions are not met in your experiment.]]></description>
+			<arguments>
+				<argument type="Creature"/>
+			</arguments>
+		</element>
+		<element name="moveTo" function="true" type="void" flags="32">
+			<description><![CDATA[the genotype is removed from its current pool when pool=null]]></description>
+			<arguments>
+				<argument name="pool" type="GenePool"/>
+			</arguments>
+		</element>
+		<element name="copyTo" function="true" type="Genotype" flags="32">
+			<description><![CDATA[returns the duplicate genotype, created in the target pool]]></description>
+			<arguments>
+				<argument name="pool" type="GenePool"/>
+			</arguments>
+		</element>
+		<element name="delete" function="true" type="void" flags="32"><arguments/></element>
+		<element name="deleteOne" function="true" type="void" flags="32">
+			<description><![CDATA[]]></description>
+<arguments/></element>
+		<element name="genepool" type="untyped" flags="35">
+			<description><![CDATA[GenePool object or null when not in pool]]></description>
+		</element>
+		<element name="index" type="integer" flags="35">
+			<description><![CDATA[-1 when not in pool.
+Note that the index changes depending on the current genotype position in the pool. Use Genotype.uid if you need a permanent identifier that persists through the entire object lifetime.]]></description>
+		</element>
+		<element name="beforeLoad" function="true" type="void" flags="32"><arguments/></element>
+		<element name="afterLoad" function="true" type="void" flags="32"><arguments/></element>
+	</type>
+	<type name="Creature" context="Visual style definition">
+<description><![CDATA[The object inside the simulated world, including its physical structure, neural network and performance data. Food pieces, obstacles and other movable objects can be implemented as Creatures even though the are not "alive".
+Before version 4.0rc4 the static Creature object was used in event handlers and in functions operating on the "selected" creature. This is now deprecated as all operations can be performed using the more convenient direct access (see GenePools). For event handlers, the creature object will be passed as argument, like this:
+function onDied(cr) {Simulator.print("Creature "+cr.name+" has died");}
+See also: Population.]]></description>
+		<element name="name" type="string" max="30"/>
+		<element name="genotype" type="string" flags="1"/>
+		<element name="info" type="string">
+			<description><![CDATA[Additional info or comments]]></description>
+		</element>
+		<element name="group" type="untyped" deprecated="true" flags="8227">
+			<description><![CDATA[Deprecated. Use population instead.]]></description>
+		</element>
+		<element name="population" type="untyped" flags="35"/>
+		<element name="index" type="integer" flags="35">
+			<description><![CDATA[Note that the index changes depending on the current creature position in the population. Use Creature.uid if you need a permanent identifier that persists through the entire object lifetime.]]></description>
+		</element>
+		<element name="gnum" type="integer"/>
+		<element name="buildproblems" type="integer" flags="34"/>
+		<element name="energ0" type="float" deprecated="true" flags="8226"/>
+		<element name="energy0" type="float"/>
+		<element name="idleen" type="float"/>
+		<element name="energy" type="float"/>
+		<element name="energy_p" type="float"/>
+		<element name="energy_m" type="float"/>
+		<element name="energy_b" type="float"/>
+		<element name="perf" type="integer" min="0" max="2">
+			<description><![CDATA[Initial value of this property is taken from Population.enableperf]]></description>
+		</element>
+		<element name="nnenabled" type="integer" min="0" max="1"/>
+		<element name="bodysim" type="integer" min="0" max="1" default="1">
+			<description><![CDATA[(Physical) body simulation can be disabled for individual objects which makes them immovable. Disabled objects can still participate in collisions depending on their collisions masks.
+
+Bugs: the standard collision handler does not work for disabled objects when ODE simulation is used. It means that these objects won't physically interact with other objects. The custom (scripting) handlers work as expected.]]></description>
+		</element>
+		<element name="selfcol" type="integer" min="0" max="1">
+			<description><![CDATA[Enable/disable detection of self-collisions (within a creature body). They can only occur when using the ODE simulation engine. If enabled, the creature will have its sticks collide during lifespan.]]></description>
+		</element>
+		<element name="selfcolstate" function="true" type="integer" flags="32">
+			<description><![CDATA[Current self-collision state. In old versions this was a field, not a function.]]></description>
+<arguments/></element>
+		<element name="lifespan" type="integer"/>
+		<element name="distance" type="float"/>
+		<element name="c_velocity" type="float"/>
+		<element name="c_vertvelocity" type="float"/>
+		<element name="c_vertpos" type="float"/>
+		<element name="velocity" type="float"/>
 		<element name="vertpos" type="float"/>
 		<element name="vertvel" type="float"/>
-		<element name="getModel" function="true" type="Model"><arguments/></element>
-		<element name="getNormalized" function="true" type="float">
-			<arguments>
-				<argument name="property name or index" type="untyped"/>
-			</arguments>
-		</element>
-		<element name="mutate" function="true" type="void"><arguments/></element>
-	</type>
-	<type name="Creature" context="Visual style definition">
-<description><![CDATA[The object inside the simulated world, including its physical structure, neural network and performance data. Food pieces, obstacles and other movable objects can be implemented as Creatures even though the are not "alive". See also: Population.]]></description>
-		<element name="bodysim" type="integer" min="0" max="1" default="1">
-			<description><![CDATA[(Physical) body simulation can be disabled for individual objects which makes them immovable. Disabled objects can still participate in collisions depending on their collisions masks.
-
-Bugs: the standard collision handler does not work for disabled objects when ODE simulation is used. It means that these objects won't physically interact with other objects. The custom (scripting) handlers work as expected.]]></description>
-		</element>
-		<element name="buildproblems" type="integer"/>
-		<element name="c_velocity" type="float"/>
-		<element name="c_vertpos" type="float"/>
-		<element name="c_vertvelocity" type="float"/>
-		<element name="center_x" type="float">
-			<description><![CDATA[Center of gravity]]></description>
-		</element>
-		<element name="center_y" type="float">
-			<description><![CDATA[Center of gravity]]></description>
-		</element>
-		<element name="center_z" type="float">
-			<description><![CDATA[Center of gravity]]></description>
-		</element>
-		<element name="distance" type="float"/>
-		<element name="drive" type="XYZ">
-			<description><![CDATA[Measured in global coordinates]]></description>
-		</element>
-		<element name="energ0" type="float"/>
-		<element name="energy" type="float"/>
-		<element name="energy_b" type="float"/>
-		<element name="energy_m" type="float"/>
-		<element name="energy_p" type="float"/>
-		<element name="geno" type="Geno">
-			<description><![CDATA[Source genotype for this creature]]></description>
-		</element>
-		<element name="genotype" type="string"/>
-		<element name="gnum" type="integer"/>
-		<element name="group" type="untyped"/>
-		<element name="idleen" type="float"/>
-		<element name="index" type="integer">
-			<description><![CDATA[Index of this Creature in its Population.]]></description>
-		</element>
-		<element name="info" type="string">
-			<description><![CDATA[Additional info or comments]]></description>
-		</element>
-		<element name="lifespan" type="integer"/>
-		<element name="liveModel" type="Model">
-			<description><![CDATA[A Model object that is a copy of the current (temporary) geometry of this creature]]></description>
-		</element>
-		<element name="localDrive" type="XYZ">
-			<description><![CDATA[Measured in local coordinates, that is, with respect to the current orientation of the creature.
-See also: Creature.orient]]></description>
-		</element>
-		<element name="model" type="Model">
-			<description><![CDATA[Source Model for this creature]]></description>
-		</element>
-		<element name="name" type="string"/>
-		<element name="nnenabled" type="integer" min="0" max="1"/>
-		<element name="numjoints" type="integer"/>
-		<element name="numneurons" type="integer"/>
-		<element name="numparts" type="integer"/>
-		<element name="orient" type="Orient">
-			<description><![CDATA[By convention, the orientation of the creature is equal to the orientation of its first Part]]></description>
-		</element>
-		<element name="othermask" type="integer" min="0" max="2147483647" default="0"/>
-		<element name="perf" type="integer" min="0" max="2">
-			<description><![CDATA[Initial value of this property is taken from Population.enableperf]]></description>
-		</element>
-		<element name="pos_x" type="float">
+		<element name="pos_x" type="float" flags="3">
 			<description><![CDATA[(pos_x,pos_y,pos_z) is the point of minimal coordinates ("bottom left corner") of the creature, including imaginary Part sizes (Part.s, usually 1.0). See also: Creature.moveAbs]]></description>
 		</element>
-		<element name="pos_y" type="float">
+		<element name="pos_y" type="float" flags="3">
 			<description><![CDATA[See Creature.pos_x]]></description>
 		</element>
-		<element name="pos_z" type="float">
+		<element name="pos_z" type="float" flags="3">
 			<description><![CDATA[See Creature.pos_x]]></description>
 		</element>
-		<element name="selfcol" type="integer" min="0" max="1">
-			<description><![CDATA[Enable/disable detection of self-collisions (within a creature body). They can only occur when using the ODE simulation engine. If enabled, the creature will have its sticks collide during lifespan.]]></description>
-		</element>
-		<element name="selfcolstate" type="integer" min="0" max="1">
-			<description><![CDATA[Current self-collision state]]></description>
-		</element>
-		<element name="selfmask" type="integer" min="0" max="2147483647" default="0"/>
-		<element name="signals" type="CreatureSignals"/>
-		<element name="size_x" type="float">
+		<element name="size_x" type="float" flags="3">
 			<description><![CDATA[(size_x,size_y,size_z) are dimensions of the axis-aligned bounding box of the creature, including the imaginary part sizes (Part.s, usually 1.0). A creature consisting of a single default Part has the size of (2.0,2.0,2.0) - twice the Part.s value (like a sphere diameter is twice its radius).
 See also: Creature.moveAbs]]></description>
 		</element>
-		<element name="size_y" type="float">
+		<element name="size_y" type="float" flags="3">
 			<description><![CDATA[See Creature.size_x]]></description>
 		</element>
-		<element name="size_z" type="float">
+		<element name="size_z" type="float" flags="3">
 			<description><![CDATA[See Creature.size_x]]></description>
 		</element>
-		<element name="uid" type="string"/>
+		<element name="center_x" type="float" flags="1">
+			<description><![CDATA[Center of gravity]]></description>
+		</element>
+		<element name="center_y" type="float" flags="1">
+			<description><![CDATA[Center of gravity]]></description>
+		</element>
+		<element name="center_z" type="float" flags="1">
+			<description><![CDATA[Center of gravity]]></description>
+		</element>
+		<element name="numparts" type="integer" flags="3"/>
+		<element name="numjoints" type="integer" flags="3"/>
+		<element name="numneurons" type="integer" flags="3"/>
 		<element name="user1" type="untyped"/>
 		<element name="user2" type="untyped"/>
 		<element name="user3" type="untyped"/>
-		<element name="velocity" type="float"/>
-		<element name="vertpos" type="float"/>
-		<element name="vertvel" type="float"/>
-		<element name="currentGeometryAsF0" function="true" type="string"><arguments/></element>
-		<element name="getJoint" function="true" type="Joint">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getMechJoint" function="true" type="MechJoint">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getMechPart" function="true" type="MechPart">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getNeuro" function="true" type="Neuro">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getNeuroDef" function="true" type="NeuroDef">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getPart" function="true" type="Part">
-			<arguments>
-				<argument name="index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="localToWorld" function="true" type="XYZ">
-			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
+		<element name="move" function="true" type="void" flags="32">
+			<description><![CDATA[Shift the creature by a given vector.]]></description>
 			<arguments>
 				<argument name="x" type="float"/>
@@ -4917,6 +5584,14 @@
 			</arguments>
 		</element>
-		<element name="move" function="true" type="void">
-			<description><![CDATA[Shift the creature by a given vector.]]></description>
+		<element name="moveAbs" function="true" type="void" flags="32">
+			<description><![CDATA[Moves the creature so that its origin (pos_x,pos_y,pos_z) is placed at the given location. The origin is the point of minimal coordinates ("bottom left corner"), including imaginary part sizes (Part.s, usually 1.0).
+Assuming a simple single-stick creature "X" having parts at (0,0,0) and (1,0,0),
+
+origin (pos_x,pos_y,pos_z) = (-1,-1,-1)
+size (size_x,size_y,size_z) = (3,2,2)
+
+The following example places the bottom of a creature at a given location (x,y,z):
+Creature.moveAbs(x-(Creature.size_x/2),y-(Creature.size_y/2),z-1.0)
+(assuming that the part size is 1.0)]]></description>
 			<arguments>
 				<argument name="x" type="float"/>
@@ -4925,14 +5600,6 @@
 			</arguments>
 		</element>
-		<element name="moveAbs" function="true" type="void">
-			<description><![CDATA[Moves the creature so that its origin (pos_x,pos_y,pos_z) is placed at the given location. The origin is the point of minimal coordinates ("bottom left corner"), including imaginary part sizes (Part.s, usually 1.0).
-Assuming a simple single-stick creature "X" having parts at (0,0,0) and (1,0,0),
-
-origin (pos_x,pos_y,pos_z) = (-1,-1,-1)
-size (size_x,size_y,size_z) = (3,2,2)
-
-The following example places the bottom of a creature at a given location (x,y,z):
-Creature.moveAbs(x-(Creature.size_x/2),y-(Creature.size_y/2),z-1.0)
-(assuming that the part size is 1.0)]]></description>
+		<element name="moveLocal" function="true" type="void" flags="32">
+			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
 			<arguments>
 				<argument name="x" type="float"/>
@@ -4941,5 +5608,5 @@
 			</arguments>
 		</element>
-		<element name="moveLocal" function="true" type="void">
+		<element name="localToWorld" function="true" type="XYZ" flags="32">
 			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
 			<arguments>
@@ -4949,6 +5616,6 @@
 			</arguments>
 		</element>
-		<element name="rotate" function="true" type="void">
-			<description><![CDATA[Rotate the creature around X, Y and Z axes. Should only be used immediately after creating a new creature (before the first simulation step is performed for this creature), otherwise further simulation can be disturbed.]]></description>
+		<element name="worldToLocal" function="true" type="XYZ" flags="32">
+			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
 			<arguments>
 				<argument name="x" type="float"/>
@@ -4957,6 +5624,9 @@
 			</arguments>
 		</element>
-		<element name="rotateLocal" function="true" type="void">
-			<description><![CDATA[Rotate the creature around (local) X, Y and Z axes. Should only be used immediately after creating a new creature (before the first simulation step is performed for this creature), otherwise further simulation can be disturbed.]]></description>
+		<element name="orient" type="Orient" flags="33">
+			<description><![CDATA[By convention, the orientation of the creature is equal to the orientation of its first Part]]></description>
+		</element>
+		<element name="rotate" function="true" type="void" flags="32">
+			<description><![CDATA[Rotate the creature around X, Y and Z axes. Should only be used immediately after creating a new creature (before the first simulation step is performed for this creature), otherwise further simulation can be disturbed.]]></description>
 			<arguments>
 				<argument name="x" type="float"/>
@@ -4965,6 +5635,6 @@
 			</arguments>
 		</element>
-		<element name="worldToLocal" function="true" type="XYZ">
-			<description><![CDATA[Local coordinates are measured with respect to the position and orientation of the first Part]]></description>
+		<element name="rotateLocal" function="true" type="void" flags="32">
+			<description><![CDATA[Rotate the creature around (local) X, Y and Z axes. Should only be used immediately after creating a new creature (before the first simulation step is performed for this creature), otherwise further simulation can be disturbed.]]></description>
 			<arguments>
 				<argument name="x" type="float"/>
@@ -4973,4 +5643,66 @@
 			</arguments>
 		</element>
+		<element name="drive" type="XYZ" flags="34">
+			<description><![CDATA[Measured in global coordinates]]></description>
+		</element>
+		<element name="localDrive" type="XYZ" flags="34">
+			<description><![CDATA[Measured in local coordinates, that is, with respect to the current orientation of the creature.
+See also: Creature.orient]]></description>
+		</element>
+		<element name="getPart" function="true" type="Part" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getJoint" function="true" type="Joint" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getNeuroDef" function="true" type="NeuroDef" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getMechPart" function="true" type="MechPart" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getMechJoint" function="true" type="MechJoint" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getNeuro" function="true" type="Neuro" flags="32">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="selfmask" type="integer" min="0" max="2147483647" default="0" flags="32">
+			<description><![CDATA[Creature's selfmask is set according to the Creature's Population.selfmask. See Population.selfmask for detailed information about collision handling.]]></description>
+		</element>
+		<element name="othermask" type="integer" min="0" max="2147483647" default="0" flags="32">
+			<description><![CDATA[Creature's othermask is set according to the Creature's Population.othermask. See Population.selfmask for detailed information about collision handling.]]></description>
+		</element>
+		<element name="geno" type="Geno" flags="35">
+			<description><![CDATA[Source genotype for this creature]]></description>
+		</element>
+		<element name="model" type="Model" flags="35">
+			<description><![CDATA[Source Model for this creature]]></description>
+		</element>
+		<element name="liveModel" type="Model" flags="35">
+			<description><![CDATA[A Model object that is a copy of the current (temporary) geometry of this creature]]></description>
+		</element>
+		<element name="uid" type="string" flags="33"/>
+		<element name="signals" type="CreatureSignals" flags="35"/>
+		<element name="boundingBoxCollisions" function="true" type="integer" flags="34">
+			<description><![CDATA[Checks approximate collisions for the selected creature.
+Returns the collision mask calculated as ( creature.selfmask & other_creatures.othermask ).
+Passing non-zero argument is equivalent to setting a temporary selfmask for the current creature.]]></description>
+			<arguments>
+				<argument name="mask" type="integer"/>
+			</arguments>
+		</element>
 	</type>
 	<type name="Element" context="Visual style definition">
@@ -4979,67 +5711,57 @@
 This is a link between a creature's element (part/joint/neuron) and the geometry object (Element.node).
 Calling Element.useXXX() functions connects the static object references (Creature, Model, Part, Joint, Neuro, MechPart, MechJoint) to the proper creature elements. All these objects are invalid before doing that! E.g. you have to call "Element.useCreature()" before referring to "Creature.energy" in your _build() and _update() functions.]]></description>
-		<element name="node" type="integer"/>
-		<element name="useCreature" function="true"/>
+		<element name="node" type="SSGNode"/>
+		<element name="shadow" type="float"/>
+		<element name="useMechPart" function="true"/>
+		<element name="useMechJoint" function="true"/>
+		<element name="useMechJointPart1" function="true"/>
+		<element name="useMechJointPart2" function="true"/>
+		<element name="usePart" function="true"/>
 		<element name="useJoint" function="true"/>
 		<element name="useJointPart1" function="true"/>
 		<element name="useJointPart2" function="true"/>
-		<element name="useMechJoint" function="true"/>
-		<element name="useMechJointPart1" function="true"/>
-		<element name="useMechJointPart2" function="true"/>
-		<element name="useMechPart" function="true"/>
+		<element name="useNeuro" function="true"/>
+		<element name="useNeuroPart" function="true"/>
+		<element name="useNeuroJoint" function="true"/>
 		<element name="useModel" function="true"/>
-		<element name="useNeuro" function="true"/>
-		<element name="useNeuroJoint" function="true"/>
-		<element name="useNeuroPart" function="true"/>
-		<element name="usePart" function="true"/>
+		<element name="useCreature" function="true"/>
 	</type>
 	<type name="GeomBuilder" context="Visual style definition">
 <description><![CDATA[Scene graph access (build and manipulate the 3d object tree)]]></description>
 		<element name="code" type="string"/>
-		<element name="currentNode" type="integer"/>
-		<element name="defaultStyle" type="string"/>
-		<element name="matrix00" type="float"/>
-		<element name="matrix01" type="float"/>
-		<element name="matrix02" type="float"/>
-		<element name="matrix03" type="float"/>
-		<element name="matrix10" type="float"/>
-		<element name="matrix11" type="float"/>
-		<element name="matrix12" type="float"/>
-		<element name="matrix13" type="float"/>
-		<element name="matrix20" type="float"/>
-		<element name="matrix21" type="float"/>
-		<element name="matrix22" type="float"/>
-		<element name="matrix23" type="float"/>
-		<element name="matrix30" type="float"/>
-		<element name="matrix31" type="float"/>
-		<element name="matrix32" type="float"/>
-		<element name="matrix33" type="float"/>
-		<element name="rootNode" type="integer"/>
-		<element name="updatingNode" type="integer"/>
-		<element name="add" function="true" type="void">
+		<element name="currentNode" type="SSGNode" flags="34"/>
+		<element name="rootNode" type="SSGNode" flags="34"/>
+		<element name="updatingNode" type="SSGNode" flags="34"/>
+		<element name="defaultStyle" type="string" flags="2"/>
+		<element name="matrix00" type="float" flags="34"/>
+		<element name="matrix01" type="float" flags="34"/>
+		<element name="matrix02" type="float" flags="34"/>
+		<element name="matrix03" type="float" flags="34"/>
+		<element name="matrix10" type="float" flags="34"/>
+		<element name="matrix11" type="float" flags="34"/>
+		<element name="matrix12" type="float" flags="34"/>
+		<element name="matrix13" type="float" flags="34"/>
+		<element name="matrix20" type="float" flags="34"/>
+		<element name="matrix21" type="float" flags="34"/>
+		<element name="matrix22" type="float" flags="34"/>
+		<element name="matrix23" type="float" flags="34"/>
+		<element name="matrix30" type="float" flags="34"/>
+		<element name="matrix31" type="float" flags="34"/>
+		<element name="matrix32" type="float" flags="34"/>
+		<element name="matrix33" type="float" flags="34"/>
+		<element name="addTransform" function="true" flags="32">
+			<description><![CDATA[create the transform node as a child of the current node and make it the new current node.]]></description>
+		</element>
+		<element name="addBranch" function="true" flags="32">
+			<description><![CDATA[create the branch node as a child of the current node and make it the new current node]]></description>
+		</element>
+		<element name="add" function="true" type="void" flags="32">
 			<description><![CDATA[add a child node to the current node]]></description>
 			<arguments>
-				<argument name="node" type="integer"/>
-			</arguments>
-		</element>
-		<element name="addBranch" function="true">
-			<description><![CDATA[create the branch node as a child of the current node and make it the new current node]]></description>
-		</element>
-		<element name="addTransform" function="true">
-			<description><![CDATA[create the transform node as a child of the current node and make it the new current node.]]></description>
-		</element>
-		<element name="dump" function="true" type="void">
-			<arguments>
-				<argument name="node" type="integer"/>
-				<argument name="level" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getBranch" function="true" type="integer">
-			<arguments>
-				<argument name="branch node" type="integer"/>
-				<argument name="branch index" type="integer"/>
-			</arguments>
-		</element>
-		<element name="matrixMove" function="true" type="void">
+				<argument type="SSGNode"/>
+			</arguments>
+		</element>
+		<element name="matrixReset" function="true" flags="32"/>
+		<element name="matrixMove" function="true" type="void" flags="32">
 			<arguments>
 				<argument name="x" type="float"/>
@@ -5048,11 +5770,5 @@
 			</arguments>
 		</element>
-		<element name="matrixMove1" function="true" type="void">
-			<description><![CDATA[MechPart.pos can be used here]]></description>
-			<arguments>
-				<argument name="xyz" type="integer"/>
-			</arguments>
-		</element>
-		<element name="matrixOrient" function="true" type="void">
+		<element name="matrixScale" function="true" type="void" flags="32">
 			<arguments>
 				<argument name="x" type="float"/>
@@ -5061,12 +5777,5 @@
 			</arguments>
 		</element>
-		<element name="matrixOrient1" function="true" type="void">
-			<description><![CDATA[MechPart.orient can be used here]]></description>
-			<arguments>
-				<argument name="xyz" type="integer"/>
-			</arguments>
-		</element>
-		<element name="matrixReset" function="true"/>
-		<element name="matrixRotate" function="true" type="void">
+		<element name="matrixOrient" function="true" type="void" flags="32">
 			<arguments>
 				<argument name="x" type="float"/>
@@ -5075,10 +5784,5 @@
 			</arguments>
 		</element>
-		<element name="matrixRotate1" function="true" type="void">
-			<arguments>
-				<argument name="xyz" type="integer"/>
-			</arguments>
-		</element>
-		<element name="matrixScale" function="true" type="void">
+		<element name="matrixRotate" function="true" type="void" flags="32">
 			<arguments>
 				<argument name="x" type="float"/>
@@ -5087,8 +5791,37 @@
 			</arguments>
 		</element>
-		<element name="setMatrix" function="true" type="void">
+		<element name="matrixRotate1" function="true" type="void" flags="32">
+			<arguments>
+				<argument name="xyz" type="integer"/>
+			</arguments>
+		</element>
+		<element name="matrixMove1" function="true" type="void" flags="32">
+			<description><![CDATA[MechPart.pos can be used here]]></description>
+			<arguments>
+				<argument name="xyz" type="integer"/>
+			</arguments>
+		</element>
+		<element name="matrixOrient1" function="true" type="void" flags="32">
+			<description><![CDATA[MechPart.orient can be used here]]></description>
+			<arguments>
+				<argument name="xyz" type="integer"/>
+			</arguments>
+		</element>
+		<element name="setMatrix" function="true" type="void" flags="32">
 			<description><![CDATA[copy current matrix into specified node]]></description>
 			<arguments>
-				<argument name="transform node" type="integer"/>
+				<argument name="transform node" type="SSGNode"/>
+			</arguments>
+		</element>
+		<element name="getBranch" function="true" type="integer" flags="32">
+			<arguments>
+				<argument name="branch node" type="SSGNode"/>
+				<argument name="branch index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="dump" function="true" type="void" flags="32">
+			<arguments>
+				<argument name="node" type="SSGNode"/>
+				<argument name="level" type="integer"/>
 			</arguments>
 		</element>
@@ -5096,138 +5829,152 @@
 	<type name="GL" context="Visual style definition">
 <description><![CDATA[OpenGL constants used in GeomBuilder and Material functions.]]></description>
-		<element name="ALPHA_TEST" type="integer"/>
-		<element name="AMBIENT" type="integer"/>
-		<element name="AMBIENT_AND_DIFFUSE" type="integer"/>
-		<element name="BLEND" type="integer"/>
-		<element name="COLOR_MATERIAL" type="integer"/>
-		<element name="CULL_FACE" type="integer"/>
-		<element name="DIFFUSE" type="integer"/>
-		<element name="EMISSION" type="integer"/>
-		<element name="LIGHTING" type="integer"/>
-		<element name="LINE_LOOP" type="integer"/>
-		<element name="LINE_STRIP" type="integer"/>
-		<element name="LINES" type="integer"/>
-		<element name="POINTS" type="integer"/>
-		<element name="QUAD_STRIP" type="integer"/>
-		<element name="QUADS" type="integer"/>
-		<element name="SPECULAR" type="integer"/>
-		<element name="TEXTURE_2D" type="integer"/>
-		<element name="TRIANGLE_FAN" type="integer"/>
-		<element name="TRIANGLE_STRIP" type="integer"/>
-		<element name="TRIANGLES" type="integer"/>
+		<element name="POINTS" type="integer" flags="513"/>
+		<element name="LINES" type="integer" flags="513"/>
+		<element name="LINE_LOOP" type="integer" flags="513"/>
+		<element name="LINE_STRIP" type="integer" flags="513"/>
+		<element name="TRIANGLES" type="integer" flags="513"/>
+		<element name="TRIANGLE_STRIP" type="integer" flags="513"/>
+		<element name="TRIANGLE_FAN" type="integer" flags="513"/>
+		<element name="QUADS" type="integer" flags="513"/>
+		<element name="QUAD_STRIP" type="integer" flags="513"/>
+		<element name="TEXTURE_2D" type="integer" flags="513"/>
+		<element name="CULL_FACE" type="integer" flags="513"/>
+		<element name="COLOR_MATERIAL" type="integer" flags="513"/>
+		<element name="BLEND" type="integer" flags="513"/>
+		<element name="ALPHA_TEST" type="integer" flags="513"/>
+		<element name="LIGHTING" type="integer" flags="513"/>
+		<element name="AMBIENT" type="integer" flags="513"/>
+		<element name="DIFFUSE" type="integer" flags="513"/>
+		<element name="AMBIENT_AND_DIFFUSE" type="integer" flags="513"/>
+		<element name="SPECULAR" type="integer" flags="513"/>
+		<element name="EMISSION" type="integer" flags="513"/>
 	</type>
 	<type name="j" context="Visual style definition">
-		<element name="dx" type="float" min="-2" max="2" default="0"/>
-		<element name="dy" type="float" min="-2" max="2" default="0"/>
-		<element name="dz" type="float" min="-2" max="2" default="0"/>
+		<element name="p1" type="integer" min="-1" max="999999" default="-1" flags="1024"/>
+		<element name="p2" type="integer" min="-1" max="999999" default="-1" flags="1024"/>
+		<element name="rx" type="float"/>
+		<element name="ry" type="float" flags="1024"/>
+		<element name="rz" type="float" flags="1024"/>
+		<element name="dx" type="float" min="-2" max="2" default="0.0"/>
+		<element name="dy" type="float" min="-2" max="2" default="0.0" flags="1024"/>
+		<element name="dz" type="float" min="-2" max="2" default="0.0" flags="1024"/>
+		<element name="sh" type="integer" min="0" max="1" default="0"/>
+		<element name="stif" type="float" min="0" max="1" default="1.0"/>
+		<element name="rotstif" type="float" min="0" max="1" default="1.0"/>
+		<element name="stam" type="float" min="0" max="1" default="0.25"/>
 		<element name="i" type="string"/>
-		<element name="p1" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="p2" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="rotstif" type="float" min="0" max="1" default="1"/>
+		<element name="Vstyle" type="string" max="-1" default="joint"/>
+		<element name="vr" type="float" min="0" max="1" default="0.5"/>
+		<element name="vg" type="float" min="0" max="1" default="0.5" flags="1024"/>
+		<element name="vb" type="float" min="0" max="1" default="0.5" flags="1024"/>
+	</type>
+	<type name="Loader" context="Visual style definition">
+<description><![CDATA[Loads 3d objects files.
+Visual styles placed in subdirectories (like "matrix") automatically access the parent directory if the file is not found in their subdirectory.]]></description>
+		<element name="loaded" type="SSGNode"/>
+		<element name="load" function="true"/>
+	</type>
+	<type name="m" context="Visual style definition">
+		<element name="se" type="float" flags="1024"/>
+		<element name="Vstyle" type="string" max="-1"/>
+	</type>
+	<type name="Material" context="Visual style definition">
+<description><![CDATA[Manipulate 3d objects surface properties (Material objects can be associated with geometry nodes).]]></description>
+		<element name="new" function="true"/>
+		<element name="diffuse" type="integer"/>
+		<element name="ambient" type="integer"/>
+		<element name="specular" type="integer"/>
+		<element name="emission" type="integer"/>
+		<element name="shininess" type="float"/>
+		<element name="colormat" type="integer"/>
+		<element name="translucent" type="integer"/>
+		<element name="setSmooth" function="true"/>
+		<element name="setFlat" function="true"/>
+		<element name="enable" function="true"/>
+		<element name="disable" function="true"/>
+		<element name="care" function="true"/>
+		<element name="dontcare" function="true"/>
+		<element name="texture" type="string"/>
+		<element name="object" type="Object" flags="1"/>
+	</type>
+	<type name="MechJoint" context="Visual style definition">
+<description><![CDATA[Current joint properties during the simulation]]></description>
 		<element name="rx" type="float"/>
 		<element name="ry" type="float"/>
 		<element name="rz" type="float"/>
-		<element name="stam" type="float" min="0" max="1" default="0.25"/>
-		<element name="stif" type="float" min="0" max="1" default="1"/>
-		<element name="Vstyle" type="string"/>
-	</type>
-	<type name="Loader" context="Visual style definition">
-<description><![CDATA[Loads 3d objects files.
-Visual styles placed in subdirectories (like "matrix") automatically access the parent directory if the file is not found in their subdirectory.]]></description>
-		<element name="loaded" type="integer"/>
-		<element name="load" function="true"/>
-	</type>
-	<type name="m" context="Visual style definition">
-		<element name="se" type="float"/>
-		<element name="Vstyle" type="string"/>
-	</type>
-	<type name="Material" context="Visual style definition">
-<description><![CDATA[Manipulate 3d objects surface properties (Material objects can be associated with geometry nodes).]]></description>
-		<element name="ambient" type="integer"/>
-		<element name="colormat" type="integer"/>
-		<element name="diffuse" type="integer"/>
-		<element name="emission" type="integer"/>
-		<element name="object" type="Object"/>
-		<element name="shininess" type="float"/>
-		<element name="specular" type="integer"/>
-		<element name="texture" type="string"/>
-		<element name="translucent" type="integer"/>
-		<element name="care" function="true"/>
-		<element name="disable" function="true"/>
-		<element name="dontcare" function="true"/>
-		<element name="enable" function="true"/>
-		<element name="new" function="true"/>
-		<element name="setFlat" function="true"/>
-		<element name="setSmooth" function="true"/>
-	</type>
-	<type name="MechJoint" context="Visual style definition">
-<description><![CDATA[Current joint properties during the simulation]]></description>
-		<element name="absorient" type="integer"/>
-		<element name="calcorient" type="integer"/>
 		<element name="dx" type="float"/>
 		<element name="dy" type="float"/>
 		<element name="dz" type="float"/>
-		<element name="length" type="float"/>
-		<element name="orient" type="integer"/>
+		<element name="orient" type="Orient" flags="1"/>
+		<element name="absorient" type="Orient" flags="1"/>
+		<element name="calcorient" type="Orient" flags="1"/>
+		<element name="length" type="float" flags="1"/>
+		<element name="stif" type="float"/>
 		<element name="rotstif" type="float"/>
-		<element name="rotstress" type="float"/>
-		<element name="rx" type="float"/>
-		<element name="ry" type="float"/>
-		<element name="rz" type="float"/>
-		<element name="stif" type="float"/>
-		<element name="stress" type="float"/>
+		<element name="stress" type="float" flags="1"/>
+		<element name="rotstress" type="float" flags="1"/>
 	</type>
 	<type name="MechPart" context="Visual style definition">
 <description><![CDATA[Current part properties during the simulation]]></description>
-		<element name="fr" type="float"/>
-		<element name="m" type="float"/>
-		<element name="orient" type="integer"/>
-		<element name="pos" type="integer"/>
-		<element name="s" type="float"/>
-		<element name="vol" type="float"/>
 		<element name="x" type="float"/>
 		<element name="y" type="float"/>
 		<element name="z" type="float"/>
+		<element name="pos" type="XYZ" flags="1"/>
+		<element name="orient" type="Orient" flags="1"/>
+		<element name="m" type="float"/>
+		<element name="s" type="float"/>
+		<element name="vol" type="float"/>
+		<element name="fr" type="float"/>
 	</type>
 	<type name="n" context="Visual style definition">
+		<element name="p" type="integer" min="-1" max="999999" default="-1"/>
+		<element name="j" type="integer" min="-1" max="999999" default="-1"/>
+		<element name="d" type="string"/>
+		<element name="i" type="string"/>
+		<element name="Vstyle" type="string" max="-1" default="neuro"/>
+		<element name="getInputCount" type="integer" flags="3"/>
+		<element name="getInputNeuroDef" function="true" type="NeuroDef" flags="3">
+			<arguments>
+				<argument type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputNeuroIndex" function="true" type="integer" flags="3">
+			<arguments>
+				<argument type="integer"/>
+			</arguments>
+		</element>
+		<element name="getInputWeight" function="true" type="float" flags="3">
+			<arguments>
+				<argument type="integer"/>
+			</arguments>
+		</element>
+		<element name="classObject" type="NeuroClass" flags="3"/>
 		<element name="class" type="string"/>
-		<element name="d" type="string"/>
-		<element name="getInputCount" type="integer"/>
+		<element name="state" type="float"/>
+	</type>
+	<type name="p" context="Visual style definition">
+		<element name="x" type="float" flags="1024"/>
+		<element name="y" type="float" flags="1024"/>
+		<element name="z" type="float" flags="1024"/>
+		<element name="m" type="float" min="0.1" max="999" default="1.0"/>
+		<element name="sh" type="integer" min="0" max="3" default="0"/>
+		<element name="s" type="float" min="0.1" max="10" default="1.0"/>
+		<element name="sx" type="float" min="0.001" max="1000" default="1.0"/>
+		<element name="sy" type="float" min="0.001" max="1000" default="1.0"/>
+		<element name="sz" type="float" min="0.001" max="1000" default="1.0"/>
+		<element name="h" type="float" min="0" max="1" default="0.0"/>
+		<element name="dn" type="float" min="0.2" max="5" default="1.0"/>
+		<element name="fr" type="float" min="0" max="4" default="0.4"/>
+		<element name="ing" type="float" min="0" max="1" default="0.25"/>
+		<element name="as" type="float" min="0" max="1" default="0.25"/>
+		<element name="rx" type="float"/>
+		<element name="ry" type="float" flags="1024"/>
+		<element name="rz" type="float" flags="1024"/>
 		<element name="i" type="string"/>
-		<element name="j" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="p" type="integer" min="-1" max="999999" default="-1"/>
-		<element name="state" type="float"/>
-		<element name="Vstyle" type="string"/>
-		<element name="getInputNeuroDef" function="true" type="NeuroDef">
-			<arguments>
-				<argument type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputNeuroIndex" function="true" type="integer">
-			<arguments>
-				<argument type="integer"/>
-			</arguments>
-		</element>
-		<element name="getInputWeight" function="true" type="float">
-			<arguments>
-				<argument type="integer"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="p" context="Visual style definition">
-		<element name="as" type="float" min="0" max="1" default="0.25"/>
-		<element name="dn" type="float" min="0.2" max="5" default="1"/>
-		<element name="fr" type="float" min="0" max="4" default="0.4"/>
-		<element name="i" type="string"/>
-		<element name="ing" type="float" min="0" max="1" default="0.25"/>
-		<element name="m" type="float" min="0.1" max="999" default="1"/>
-		<element name="rx" type="float"/>
-		<element name="ry" type="float"/>
-		<element name="rz" type="float"/>
-		<element name="s" type="float" min="0.1" max="10" default="1"/>
-		<element name="Vstyle" type="string"/>
-		<element name="x" type="float"/>
-		<element name="y" type="float"/>
-		<element name="z" type="float"/>
+		<element name="Vstyle" type="string" max="-1" default="part"/>
+		<element name="vs" type="float" min="0.05" max="0.7" default="0.2"/>
+		<element name="vr" type="float" min="0" max="1" default="0.5"/>
+		<element name="vg" type="float" min="0" max="1" default="0.5" flags="1024"/>
+		<element name="vb" type="float" min="0" max="1" default="0.5" flags="1024"/>
 	</type>
 	<type name="Scene" context="Visual style definition">
@@ -5237,6 +5984,34 @@
 	</type>
 	<type name="VertexBuilder" context="Visual style definition">
-		<element name="material" type="Object"/>
-		<element name="node" type="integer">
+		<element name="new" function="true" type="void">
+			<arguments>
+				<argument name="type" type="integer"/>
+			</arguments>
+		</element>
+		<element name="newPolygon" function="true"/>
+		<element name="newTriangleFan" function="true"/>
+		<element name="newTriangles" function="true"/>
+		<element name="newTriangleStrip" function="true"/>
+		<element name="newQuads" function="true"/>
+		<element name="newQuadStrip" function="true"/>
+		<element name="newPoints" function="true"/>
+		<element name="newLines" function="true"/>
+		<element name="newLineLoop" function="true"/>
+		<element name="newLineStrip" function="true"/>
+		<element name="addVertex" function="true"/>
+		<element name="addNormal" function="true"/>
+		<element name="addNormal_1" function="true">
+			<description><![CDATA[use addNormal instead of this function]]></description>
+		</element>
+		<element name="addCalculatedNormal" function="true">
+			<description><![CDATA[calculate the normal vector from 3 coordinates. integer arguments are the vertices' indices. 0,1,2... = first, second, third vertex, -1,-2,-3,... = last, last-1, last-2 vertex]]></description>
+		</element>
+		<element name="addColor" function="true"/>
+		<element name="addTexCoord" function="true"/>
+		<element name="genTexCoordsXY" function="true"/>
+		<element name="genTexCoordsYZ" function="true"/>
+		<element name="genTexCoordsXZ" function="true"/>
+		<element name="genTexCoords" function="true"/>
+		<element name="node" type="SSGNode" flags="1">
 			<description><![CDATA[This field returns the geometry node for use in GeomBuilder. You have to set all relevant geometry properties before using this field. The usual sequence:
 1. newXXX - selects the geometry type (see your OpenGL manual for explanation)
@@ -5244,68 +6019,63 @@
 3. Use the resulting node ( GeomBuilder.add(VertexBuilder.node) )]]></description>
 		</element>
+		<element name="material" type="Object"/>
 		<element name="twosided" type="integer" min="0" max="1"/>
-		<element name="addCalculatedNormal" function="true">
-			<description><![CDATA[calculate the normal vector from 3 coordinates. integer arguments are the vertices' indices. 0,1,2... = first, second, third vertex, -1,-2,-3,... = last, last-1, last-2 vertex]]></description>
-		</element>
-		<element name="addColor" function="true"/>
-		<element name="addNormal" function="true"/>
-		<element name="addNormal_1" function="true">
-			<description><![CDATA[use addNormal instead of this function]]></description>
-		</element>
-		<element name="addTexCoord" function="true"/>
-		<element name="addVertex" function="true"/>
-		<element name="genTexCoords" function="true"/>
-		<element name="genTexCoordsXY" function="true"/>
-		<element name="genTexCoordsXZ" function="true"/>
-		<element name="genTexCoordsYZ" function="true"/>
-		<element name="new" function="true" type="void">
-			<arguments>
-				<argument name="type" type="integer"/>
-			</arguments>
-		</element>
-		<element name="newLineLoop" function="true"/>
-		<element name="newLines" function="true"/>
-		<element name="newLineStrip" function="true"/>
-		<element name="newPoints" function="true"/>
-		<element name="newPolygon" function="true"/>
-		<element name="newQuads" function="true"/>
-		<element name="newQuadStrip" function="true"/>
-		<element name="newTriangleFan" function="true"/>
-		<element name="newTriangles" function="true"/>
-		<element name="newTriangleStrip" function="true"/>
 	</type>
 	<type name="VisParams" context="Visual style definition">
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="modelpan" type="integer" min="0" max="3">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="shownames" type="integer" min="0" max="1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="worldpan" type="integer" min="0" max="3">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
+		<element name="worldpan" type="integer" min="0" max="3" default="2" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="worldbgcolor" type="integer" min="0" max="16777215" default="16764040" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="hideworld" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[Can be useful for screenshots]]></description>
+		</element>
+		<element name="modelpan" type="integer" min="0" max="3" default="1" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="bgcolor" type="integer" min="0" max="16777215" default="16764040" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="bbox" type="integer" min="0" max="1" default="1" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="joint_width" type="integer" min="10" max="150" default="100" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="shadows" type="integer" min="0" max="1" default="1" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="axes" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="shownames" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="symmetryplane" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[Displays a guess of the symmetry plane (may take a long time to compue for complex bodies).
+Use scripting and the ModelSymmetry class to compute symmetry accurately.
+Details of the symmetry estimation procedure are described in http://www.framsticks.com/node/808]]></description>
+		</element>
 	</type>
 	<type name="VisualModel" context="Visual style definition">
 <description><![CDATA[Visual representation of the Creature object.]]></description>
-		<element name="args" type="string">
+		<element name="rootNode" type="SSGNode" flags="34"/>
+		<element name="partshadow" type="float" flags="34"/>
+		<element name="jointshadow" type="float" flags="34"/>
+		<element name="style" type="string" flags="34">
+			<description><![CDATA[visual style applied to this object]]></description>
+		</element>
+		<element name="args" type="string" flags="34">
 			<description><![CDATA[style parameters: Vstyle=name(args)]]></description>
 		</element>
-		<element name="color" type="integer">
-			<description><![CDATA[0xBBGGRR, 0x808080=normal, 0x000000=black, 0xffffff=extra bright]]></description>
-		</element>
-		<element name="jointshadow" type="float"/>
-		<element name="partshadow" type="float"/>
-		<element name="rootNode" type="integer"/>
-		<element name="style" type="string">
-			<description><![CDATA[visual style applied to this object]]></description>
-		</element>
-		<element name="getArg" function="true" type="string">
+		<element name="getArg" function="true" type="string" flags="34">
 			<description><![CDATA[retrieve single style argument, as in:
 Vstyle=name(a=1,b=3)
@@ -5315,48 +6085,66 @@
 			</arguments>
 		</element>
+		<element name="color" type="integer" flags="34">
+			<description><![CDATA[0xBBGGRR, 0x808080=normal, 0x000000=black, 0xffffff=extra bright]]></description>
+		</element>
 	</type>
 	<type name="VisualStyle" context="Visual style definition">
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="code" type="string"/>
-		<element name="info" type="string"/>
-		<element name="modelpan" type="integer" min="0" max="3">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="name" type="string"/>
-		<element name="neurons" type="integer" min="0" max="1"/>
-		<element name="shownames" type="integer" min="0" max="1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="smooth" type="integer" min="0" max="1"/>
-		<element name="style" type="string"/>
-		<element name="tex" type="integer" min="0" max="2"/>
-		<element name="worldpan" type="integer" min="0" max="3">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="rebuild" function="true"/>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
-		<element name="streload" function="true"/>
+		<element name="style" type="string" default="standard"/>
+		<element name="name" type="string" flags="19"/>
+		<element name="info" type="string" flags="19"/>
+		<element name="code" type="string" flags="16419"/>
+		<element name="streload" function="true" flags="2"/>
+		<element name="rebuild" function="true" flags="34"/>
+		<element name="tex" type="integer" min="0" max="2" default="1"/>
+		<element name="smooth" type="integer" min="0" max="1" default="1"/>
+		<element name="neurons" type="integer" min="0" max="1" default="1"/>
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
+		<element name="worldpan" type="integer" min="0" max="3" default="2" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="worldbgcolor" type="integer" min="0" max="16777215" default="16764040" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="hideworld" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[Can be useful for screenshots]]></description>
+		</element>
+		<element name="modelpan" type="integer" min="0" max="3" default="1" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="bgcolor" type="integer" min="0" max="16777215" default="16764040" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="bbox" type="integer" min="0" max="1" default="1" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="joint_width" type="integer" min="10" max="150" default="100" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="shadows" type="integer" min="0" max="1" default="1" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="axes" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="shownames" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="symmetryplane" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[Displays a guess of the symmetry plane (may take a long time to compue for complex bodies).
+Use scripting and the ModelSymmetry class to compute symmetry accurately.
+Details of the symmetry estimation procedure are described in http://www.framsticks.com/node/808]]></description>
+		</element>
 	</type>
 	<type name="World" context="Visual style definition">
 <description><![CDATA[Environment properties.]]></description>
-		<element name="nnspeed" type="float" min="0" max="1000" default="1">
-			<description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description>
-		</element>
-		<element name="signals" type="WorldSignals"/>
-		<element name="simtype" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[MechaStick is a fast and simple primary Framsticks simulation engine.
-ODE is Open Dynamics Engine by Russel Smith et al.
-
-NOTE: switching between simulation engines causes removal of all objects in the world (e.g. creatures).]]></description>
-		</element>
-		<element name="wrldbnd" type="integer" min="0" max="2" default="1"/>
-		<element name="wrldg" type="float" min="0" max="10" default="1">
-			<description><![CDATA[You can adjust gravity for your experiments.
-The "official" setting used to evaluate and compare creatures is 1.]]></description>
+		<element name="wrldtyp" type="integer" min="0" max="2" default="0"/>
+		<element name="wrldsiz" type="float" min="10" max="1000" default="20.0">
+			<description><![CDATA[Side length of the world]]></description>
 		</element>
 		<element name="wrldmap" type="string">
@@ -5370,10 +6158,23 @@
 See also the WorldMap object.]]></description>
 		</element>
-		<element name="wrldsiz" type="float" min="10" max="1000" default="20">
-			<description><![CDATA[Side length of the world]]></description>
-		</element>
-		<element name="wrldtyp" type="integer" min="0" max="2" default="0"/>
-		<element name="wrldwat" type="float" min="-20" max="30" default="-1"/>
-		<element name="wrldchg" function="true" type="void"><arguments/></element>
+		<element name="wrldwat" type="float" min="-20" max="200" default="-1.0"/>
+		<element name="wrldbnd" type="integer" min="0" max="2" default="0">
+			<description><![CDATA[Teleporting a creature that is outside of the world area is attempted every 'performance sampling period' steps. Teleport succeeds only when the target location in the world is empty (there is no collision).]]></description>
+		</element>
+		<element name="wrldg" type="float" min="0" max="10" default="1.0">
+			<description><![CDATA[You can adjust gravity for your experiments.
+The "official" setting used to evaluate and compare creatures is 1.]]></description>
+		</element>
+		<element name="wrldchg" function="true" type="void" flags="32"><arguments/></element>
+		<element name="simtype" type="integer" min="0" max="1" default="0">
+			<description><![CDATA[MechaStick is a fast and simple primary Framsticks simulation engine.
+ODE is Open Dynamics Engine by Russel Smith et al.
+
+NOTE: switching between simulation engines causes removal of all objects in the world (e.g. creatures).]]></description>
+		</element>
+		<element name="nnspeed" type="float" min="0" max="1000" default="1.0">
+			<description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description>
+		</element>
+		<element name="signals" type="WorldSignals" flags="35"/>
 	</type>
 	<type name="WorldMap" context="Visual style definition">
@@ -5384,6 +6185,6 @@
 Smooth: x/ysize=World.wrldsiz+2 rows of vertices (creating World.wrldsiz+1 rows of triangles, everything within the world boundaries)
 ]]></description>
-		<element name="xsize" type="integer"/>
-		<element name="ysize" type="integer"/>
+		<element name="xsize" type="integer" flags="1"/>
+		<element name="ysize" type="integer" flags="1"/>
 		<element name="getHeight" function="true" type="float">
 			<description><![CDATA[Height at any 2d coordinate]]></description>
@@ -5411,37 +6212,38 @@
 			</arguments>
 		</element>
+		<element name="intersect" function="true" type="Vector">
+			<description><![CDATA[Works like intersect(3d point,3d direction,range) for inifinite range, that is without limiting the intersection distance]]></description>
+			<arguments>
+				<argument name="3d point" type="Vector"/>
+				<argument name="3d direction" type="Vector"/>
+			</arguments>
+		</element>
 	</type>
 	<type name="Signal" context="Signal label formula">
-		<element name="channel" type="string">
-			<description><![CDATA[Channel name, readonly.]]></description>
-		</element>
-		<element name="flavor" type="float">
-			<description><![CDATA[Signal flavor is can be used to differentiate between signals in a single channel. ]]></description>
-		</element>
-		<element name="pos" type="XYZ">
-			<description><![CDATA[Signal position, readonly.]]></description>
-		</element>
-		<element name="power" type="float">
+		<element name="value" type="untyped" flags="1">
+			<description><![CDATA[Signal value can be any type. On the receiver side it is only available by accessing the individual Signal objects, i.e. after calling receiveSet() or receiveSingle(). The aggregating functions receive() and receiveFilter() ignore this attribute.]]></description>
+		</element>
+		<element name="power" type="float" flags="1">
 			<description><![CDATA[Signal power affects the aggregated signal value returned from receive() and receiveFilter().]]></description>
 		</element>
-		<element name="value" type="untyped">
-			<description><![CDATA[Signal value can be any type. On the receiver side it is only available by accessing the individual Signal objects, i.e. after calling receiveSet() or receiveSingle(). The aggregating function receive() and receiveFilter() ignore this attribute.]]></description>
+		<element name="flavor" type="float" flags="1">
+			<description><![CDATA[Signal flavor can be used to differentiate between signals in a single channel.]]></description>
+		</element>
+		<element name="channel" type="string" flags="1">
+			<description><![CDATA[Channel name, read-only.]]></description>
+		</element>
+		<element name="pos" type="XYZ" flags="1">
+			<description><![CDATA[Signal position, read-only.]]></description>
 		</element>
 	</type>
 	<type name="ClassBrowser" context="Command line interface">
 <description><![CDATA[Object reference, can be used to provide online hints.]]></description>
-		<element name="resultCount" type="integer"/>
-		<element name="getLabel" function="true" type="string">
-			<description><![CDATA[Short texual label of the search result.]]></description>
-			<arguments>
-				<argument name="item" type="integer"/>
-			</arguments>
-		</element>
-		<element name="getText" function="true" type="string">
-			<description><![CDATA[Complete result text.]]></description>
-			<arguments>
-				<argument name="item" type="integer"/>
-			</arguments>
-		</element>
+		<element name="search" function="true" type="integer">
+			<description><![CDATA[Searches the class reference and returns the number of  hits (results). getXXX(item) function can be used to retrieve the results.]]></description>
+			<arguments>
+				<argument name="Text" type="string"/>
+			</arguments>
+		</element>
+		<element name="resultCount" type="integer" flags="1"/>
 		<element name="getType" function="true" type="integer">
 			<description><![CDATA[0 = Unknown
@@ -5463,8 +6265,14 @@
 			</arguments>
 		</element>
-		<element name="search" function="true" type="integer">
-			<description><![CDATA[Searches the class reference and returns the number of  hits (results). getXXX(item) function can be used to retrieve the results.]]></description>
-			<arguments>
-				<argument name="Text" type="string"/>
+		<element name="getLabel" function="true" type="string">
+			<description><![CDATA[Short texual label of the search result.]]></description>
+			<arguments>
+				<argument name="item" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getText" function="true" type="string">
+			<description><![CDATA[Complete result text.]]></description>
+			<arguments>
+				<argument name="item" type="integer"/>
 			</arguments>
 		</element>
@@ -5472,9 +6280,25 @@
 	<type name="CLI" context="Command line interface">
 <description><![CDATA[Commandline support functions.]]></description>
+		<element name="script" type="string"/>
+		<element name="execute" function="true" type="void">
+			<arguments>
+				<argument name="command" type="string"/>
+			</arguments>
+		</element>
 		<element name="cmdhandler" type="string"/>
-		<element name="msgtype" type="integer" min="0" max="1"/>
-		<element name="script" type="string"/>
-		<element name="stdin" type="Object"/>
-		<element name="stdout" type="Object"/>
+		<element name="quit" function="true"/>
+		<element name="print" function="true" type="void">
+			<arguments>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="println" function="true" type="void">
+			<arguments>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="quiet" type="integer" min="0" max="1">
+			<description><![CDATA[enabled by -Q]]></description>
+		</element>
 		<element name="addMacro" function="true" type="void">
 			<arguments>
@@ -5485,21 +6309,4 @@
 			</arguments>
 		</element>
-		<element name="execute" function="true" type="void">
-			<arguments>
-				<argument name="command" type="string"/>
-			</arguments>
-		</element>
-		<element name="listMacros" function="true" type="void"><arguments/></element>
-		<element name="print" function="true" type="void">
-			<arguments>
-				<argument name="text" type="string"/>
-			</arguments>
-		</element>
-		<element name="println" function="true" type="void">
-			<arguments>
-				<argument name="text" type="string"/>
-			</arguments>
-		</element>
-		<element name="quit" function="true"/>
 		<element name="removeMacro" function="true" type="void">
 			<description><![CDATA[(numargs==-2) means remove all macros matching the name, otherwise only one definition is removed]]></description>
@@ -5509,117 +6316,8 @@
 			</arguments>
 		</element>
-	</type>
-	<type name="CreatureCharts" context="Command line interface">
-<description><![CDATA[Manages charts for monitoring creatures performance.
-This class has no corresponding static object. If you want to use it, you have to create an object or get a reference to the existing object.]]></description>
-		<element name="creature" type="untyped"/>
-		<element name="selected" type="integer"/>
-		<element name="add" function="true">
-			<description><![CDATA[return the new Window object with chart as its client
-arguments: property to be tracked]]></description>
-		</element>
-		<element name="addSelected" function="true">
-			<description><![CDATA[Add the chart for currenly selected property]]></description>
-		</element>
-		<element name="createChart" function="true">
-			<description><![CDATA[return the new chart object (can be client for Window)
-arguments: property to be tracked]]></description>
-		</element>
-		<element name="removeAll" function="true"/>
-		<element name="resetAll" function="true">
-			<description><![CDATA[Removes all data from the chart windows.]]></description>
-		</element>
-	</type>
-	<type name="CreatureSelection" context="Command line interface">
-		<element name="count" type="integer"/>
-		<element name="add" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="get" function="true"/>
-		<element name="remove" function="true"/>
-	</type>
-	<type name="DynaChart" context="Command line interface">
-<description><![CDATA[Line chart (visual object). Can be used as the client object in the Window.]]></description>
-		<element name="xscale" type="integer" min="1" max="20"/>
-		<element name="add" function="true">
-			<description><![CDATA[add new value]]></description>
-		</element>
-		<element name="clear" function="true" type="void"><arguments/></element>
-		<element name="new" function="true" type="DynaChart"><arguments/></element>
-	</type>
-	<type name="DynaChart2D" context="Command line interface">
-<description><![CDATA[2D Line chart (visual object). Can be used as the client object in the Window.]]></description>
-		<element name="memory" type="integer" min="1" max="1000" default="100">
-			<description><![CDATA[maximum number of (x,y) pairs drawn in the graph.]]></description>
-		</element>
-		<element name="add" function="true" type="void">
-			<description><![CDATA[add (x,y) values for the next graph point]]></description>
-			<arguments>
-				<argument name="x coordinate" type="float"/>
-				<argument name="y coordinate" type="float"/>
-			</arguments>
-		</element>
-		<element name="clear" function="true" type="void"><arguments/></element>
-		<element name="new" function="true" type="DynaChart2D"><arguments/></element>
-	</type>
-	<type name="GLDisplay" context="Command line interface">
-<description><![CDATA[OpenGL display for the Framsticks Theater application.]]></description>
-		<element name="active" type="integer" min="0" max="1"/>
-		<element name="banner" type="string"/>
-		<element name="desiredsimspeed" type="float" min="0" max="999999" default="0">
-			<description><![CDATA[Desired simulation speed in steps/second. 0 = simulation is disabled.]]></description>
-		</element>
-		<element name="fps" type="float">
-			<description><![CDATA[Frames Per Second (measured)]]></description>
-		</element>
-		<element name="fpsvisible" type="integer" min="0" max="1"/>
-		<element name="maxfps" type="integer" min="1" max="100" default="30"/>
-		<element name="messagesVisible" type="integer" min="0" max="1"/>
-		<element name="messagesWindow" type="Object">
-			<description><![CDATA[get window object (class Window)]]></description>
-		</element>
-		<element name="minfps" type="integer" min="1" max="100" default="5"/>
-		<element name="simsteps" type="integer" min="0" max="999999" default="0">
-			<description><![CDATA[0 = simulation is disabled. In most cases you should use desiredsimspeed as it ensures automatic throttle control.]]></description>
-		</element>
-		<element name="size_x" type="integer"/>
-		<element name="size_y" type="integer"/>
-		<element name="userspeed" type="float" min="0" max="100" default="1">
-			<description><![CDATA[User interface sets this property to adjust simulation speed.]]></description>
-		</element>
-		<element name="clearMessages" function="true"/>
-		<element name="createWindow" function="true" type="Window">
-			<description><![CDATA[create and return the new window object.]]></description>
-			<arguments>
-				<argument name="style" type="integer"/>
-				<argument name="title" type="string"/>
-				<argument name="client" type="Object"/>
-			</arguments>
-		</element>
-		<element name="deleteWindow" function="true" type="void">
-			<arguments>
-				<argument type="Window"/>
-			</arguments>
-		</element>
-		<element name="draw" function="true"/>
-		<element name="newCreatureCharts" function="true"/>
-		<element name="newSimStatsCharts" function="true"/>
-		<element name="quit" function="true"/>
-		<element name="resume" function="true"/>
-		<element name="stop" function="true"/>
-	</type>
-	<type name="NeuroDiagram" context="Command line interface">
-<description><![CDATA[Can be used as the client object in the Window.]]></description>
-		<element name="hide" function="true" type="void"><arguments/></element>
-		<element name="new" function="true"/>
-		<element name="showCreature" function="true" type="void">
-			<arguments>
-				<argument type="Creature"/>
-			</arguments>
-		</element>
-		<element name="showModel" function="true" type="void">
-			<arguments>
-				<argument type="Model"/>
-			</arguments>
-		</element>
+		<element name="listMacros" function="true" type="void"><arguments/></element>
+		<element name="stdin" type="Object" flags="3"/>
+		<element name="stdout" type="Object" flags="3"/>
+		<element name="msgtype" type="integer" min="0" max="1"/>
 	</type>
 	<type name="RowFormat" context="Command line interface">
@@ -5630,18 +6328,15 @@
 RowFormat.prepare(Genotype.*,"name/20,strsiz/5,nnsiz/5,fit/6");
 CLI.println(RowFormat.format(Genotype.*));]]></description>
-		<element name="fieldsep" type="string">
-			<description><![CDATA[The character used for separating columns]]></description>
-		</element>
-		<element name="fillchar" type="string">
-			<description><![CDATA[The characted used for padding the columns contents]]></description>
-		</element>
-		<element name="header" type="string">
-			<description><![CDATA[Contains the field names with the same formatting applied (i.e. with fill and separators)]]></description>
-		</element>
-		<element name="addColumn" function="true" type="void">
-			<description><![CDATA[Low level call, adds a single column. "prepare" is better.]]></description>
-			<arguments>
-				<argument name="Field#" type="integer"/>
-				<argument name="Column width" type="integer"/>
+		<element name="prepare" function="true" type="void">
+			<description><![CDATA[Adds a number of columns, described as FIELD_NAME/WIDTH, columns are separated by "," (comma). Existing column definitions are not removed. Usually you will need to call "clear()" before "prepare".]]></description>
+			<arguments>
+				<argument name="Object" type="Object"/>
+				<argument name="Column Descriptions" type="string"/>
+			</arguments>
+		</element>
+		<element name="format" function="true" type="string">
+			<description><![CDATA[Returns the formatted string taking data from the supplied object.]]></description>
+			<arguments>
+				<argument name="Object" type="Object"/>
 			</arguments>
 		</element>
@@ -5649,71 +6344,687 @@
 			<description><![CDATA[Remove all existing column definitions.]]></description>
 <arguments/></element>
-		<element name="format" function="true" type="string">
-			<description><![CDATA[Returns the formatted string taking data from the supplied object.]]></description>
-			<arguments>
-				<argument name="Object" type="Object"/>
-			</arguments>
-		</element>
-		<element name="prepare" function="true" type="void">
-			<description><![CDATA[Adds a number of columns, described as FIELD_NAME/WIDTH, columns are separated by "," (comma). Existing column definitions are not removed. Usually you will need to call "clear()" before "prepare".]]></description>
-			<arguments>
-				<argument name="Object" type="Object"/>
-				<argument name="Column Descriptions" type="string"/>
-			</arguments>
-		</element>
-	</type>
-	<type name="ShowManager" context="Command line interface">
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="code" type="string"/>
-		<element name="dispinfo" type="integer" min="0" max="2"/>
-		<element name="expdef" type="string"/>
-		<element name="info" type="string"/>
-		<element name="mode" type="integer" min="0" max="2"/>
+		<element name="addColumn" function="true" type="void">
+			<description><![CDATA[Low level call, adds a single column. "prepare" is better.]]></description>
+			<arguments>
+				<argument name="Field#" type="integer"/>
+				<argument name="Column width" type="integer"/>
+			</arguments>
+		</element>
+		<element name="fillchar" type="string">
+			<description><![CDATA[The characted used for padding the columns contents]]></description>
+		</element>
+		<element name="fieldsep" type="string">
+			<description><![CDATA[The character used for separating columns]]></description>
+		</element>
+		<element name="header" type="string" flags="1">
+			<description><![CDATA[Contains the field names with the same formatting applied (i.e. with fill and separators)]]></description>
+		</element>
+	</type>
+	<type name="CreatureCharts" context="Framsticks Theater">
+<description><![CDATA[Manages charts for monitoring creatures performance.
+This class has no corresponding static object. If you want to use it, you have to create an object or get a reference to the existing object.]]></description>
+		<element name="selected" type="integer" flags="258"/>
+		<element name="addSelected" function="true" flags="256">
+			<description><![CDATA[Add the chart for currenly selected property]]></description>
+		</element>
+		<element name="add" function="true" flags="288">
+			<description><![CDATA[return the new Window object with chart as its client
+arguments: property to be tracked]]></description>
+		</element>
+		<element name="removeAll" function="true" flags="256"/>
+		<element name="resetAll" function="true" flags="256">
+			<description><![CDATA[Removes all data from the chart windows.]]></description>
+		</element>
+		<element name="createChart" function="true" flags="288">
+			<description><![CDATA[return the new chart object (can be client for Window)
+arguments: property to be tracked]]></description>
+		</element>
+		<element name="creature" type="untyped" flags="290"/>
+	</type>
+	<type name="CreatureSelection" context="Framsticks Theater">
+		<element name="count" type="integer" flags="1"/>
+		<element name="get" function="true" type="Creature">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="add" function="true" type="void">
+			<arguments>
+				<argument type="Creature"/>
+			</arguments>
+		</element>
+		<element name="remove" function="true" type="void">
+			<arguments>
+				<argument type="Creature"/>
+			</arguments>
+		</element>
+		<element name="clear" function="true" type="void"><arguments/></element>
+	</type>
+	<type name="DynaChart" context="Framsticks Theater">
+<description><![CDATA[Line chart (visual object). Can be used as the client object in the Window.]]></description>
+		<element name="new" function="true" type="DynaChart" flags="32"><arguments/></element>
+		<element name="add" function="true" flags="288">
+			<description><![CDATA[add new value]]></description>
+		</element>
+		<element name="clear" function="true" type="void" flags="288"><arguments/></element>
+		<element name="xscale" type="integer" min="1" max="20" flags="288"/>
+	</type>
+	<type name="DynaChart2D" context="Framsticks Theater">
+<description><![CDATA[2D Line chart (visual object). Can be used as the client object in the Window.]]></description>
+		<element name="new" function="true" type="DynaChart2D" flags="32"><arguments/></element>
+		<element name="add" function="true" type="void" flags="288">
+			<description><![CDATA[add (x,y) values for the next graph point]]></description>
+			<arguments>
+				<argument name="x coordinate" type="float"/>
+				<argument name="y coordinate" type="float"/>
+			</arguments>
+		</element>
+		<element name="clear" function="true" type="void" flags="288"><arguments/></element>
+		<element name="memory" type="integer" min="1" max="1000" default="100" flags="288">
+			<description><![CDATA[maximum number of (x,y) pairs drawn in the graph.]]></description>
+		</element>
+	</type>
+	<type name="GLDisplay" context="Framsticks Theater">
+<description><![CDATA[OpenGL display for the Framsticks Theater application.]]></description>
+		<element name="simsteps" type="integer" min="0" max="999999" default="0">
+			<description><![CDATA[0 = simulation is disabled. In most cases you should use desiredsimspeed as it ensures automatic throttle control.]]></description>
+		</element>
+		<element name="desiredsimspeed" type="float" min="0" max="999999" default="0.0">
+			<description><![CDATA[Desired simulation speed in steps/second. 0 = simulation is disabled.]]></description>
+		</element>
+		<element name="userspeed" type="float" min="0" max="100" default="1.0">
+			<description><![CDATA[User interface sets this property to adjust simulation speed.]]></description>
+		</element>
+		<element name="stop" function="true"/>
+		<element name="resume" function="true"/>
+		<element name="draw" function="true"/>
+		<element name="quit" function="true"/>
+		<element name="active" type="integer" min="0" max="1" flags="1"/>
+		<element name="banner" type="string"/>
+		<element name="minfps" type="integer" min="1" max="100" default="5"/>
+		<element name="maxfps" type="integer" min="1" max="100" default="30"/>
+		<element name="fps" type="float" flags="1">
+			<description><![CDATA[Frames Per Second (measured)]]></description>
+		</element>
+		<element name="fpsvisible" type="integer" min="0" max="1"/>
+		<element name="messagesVisible" type="integer" min="0" max="1"/>
+		<element name="clearMessages" function="true"/>
+		<element name="messagesWindow" type="Object" flags="1">
+			<description><![CDATA[get window object (class Window)]]></description>
+		</element>
+		<element name="size_x" type="integer" flags="1"/>
+		<element name="size_y" type="integer" flags="1"/>
+		<element name="createWindow" function="true" type="Window">
+			<description><![CDATA[create and return the new window object.]]></description>
+			<arguments>
+				<argument name="style" type="integer"/>
+				<argument name="title" type="string"/>
+				<argument name="client" type="Object"/>
+			</arguments>
+		</element>
+		<element name="deleteWindow" function="true" type="void">
+			<arguments>
+				<argument type="Window"/>
+			</arguments>
+		</element>
+		<element name="newCreatureCharts" function="true"/>
+		<element name="newSimStatsCharts" function="true"/>
+		<element name="user_interaction" type="integer" min="0" max="31" default="31">
+			<description><![CDATA[Bit field:
+1 - menu access
+2 - rotate camera
+4 - use manupulator
+8 - select creatures
+16 - change ShowManager options in menu (including switching shows)
+Bits 2-16 are not implemented in the old Framsticks Theater application.]]></description>
+		</element>
+		<element name="world_visibility" type="integer" min="0" max="7" default="7">
+			<description><![CDATA[Bit field:
+1 - background/panorama
+2 - environment
+4 - creatures
+Not implemented in the old Framsticks Theater application.]]></description>
+		</element>
+		<element name="menu_visible" type="integer" min="0" max="1">
+			<description><![CDATA[Not implemented in the old Framsticks Theater application.]]></description>
+		</element>
+		<element name="menu_state" type="string">
+			<description><![CDATA[Not implemented in the old Framsticks Theater application.]]></description>
+		</element>
+		<element name="back_action" type="string">
+			<description><![CDATA[Not implemented in the old Framsticks Theater application.]]></description>
+		</element>
+		<element name="skybox" type="string">
+			<description><![CDATA[Traditionally, all visualization aspects belonged to the *.style file, which is not yet implemented in mobi version. But actually, changing some (or even all) aspects of the world directly in the show might be highly desirable in many "interactive" scripts. So this is the forerunner.
+Skybox name can be a list of 6 cube face textures (separated by slash), single name with _ placeholder (will be replaced by 1-6 for 6 cube faces) or a regular name (the same texture on all 6 faces).
+Not implemented in the old Framsticks Theater application.]]></description>
+		</element>
+		<element name="bgcolor" type="integer">
+			<description><![CDATA[Not implemented in the old Framsticks Theater application.]]></description>
+		</element>
+		<element name="world3d" type="Obj3D" flags="1">
+			<description><![CDATA[Not implemented in the old Framsticks Theater application.]]></description>
+		</element>
+		<element name="project3D" function="true" type="XYZ">
+			<description><![CDATA[Returns 2D position of the 3D point in world or modelviewer coordinates, 'object' can be Obj3D or GUIElement/Model
+Not implemented in the old Framsticks Theater application.]]></description>
+			<arguments>
+				<argument name="object" type="untyped"/>
+				<argument name="point" type="XYZ"/>
+			</arguments>
+		</element>
+	</type>
+	<type name="GUI" context="Framsticks Theater">
+<description><![CDATA[Manage GUI elements]]></description>
+		<element name="newLabel" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="newButton" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="newImage" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="newFrame" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+			</arguments>
+		</element>
+		<element name="newModel" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+				<argument name="genotype" type="string"/>
+			</arguments>
+		</element>
+		<element name="newTextview" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="newList" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+			</arguments>
+		</element>
+		<element name="newDrawing" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+			</arguments>
+		</element>
+		<element name="newBubble" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="newSlider" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+				<argument name="value" type="integer"/>
+				<argument name="min" type="integer"/>
+				<argument name="max" type="integer"/>
+			</arguments>
+		</element>
+		<element name="newGroup" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+			</arguments>
+		</element>
+		<element name="newTextField" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+				<argument name="text" type="string"/>
+			</arguments>
+		</element>
+		<element name="get" function="true" type="GUIElement">
+			<arguments>
+				<argument name="name" type="string"/>
+			</arguments>
+		</element>
+		<element name="removeElement" function="true" type="void">
+			<arguments>
+				<argument name="object or name" type="untyped"/>
+			</arguments>
+		</element>
+		<element name="removeAll" function="true" type="void"><arguments/></element>
+		<element name="fontHeight" function="true" type="void">
+			<arguments>
+				<argument name="font id" type="integer"/>
+			</arguments>
+		</element>
+		<element name="clipboard" type="string"/>
+		<element name="setTimeout" function="true" type="void">
+			<description><![CDATA[Events can be rescheduled by reusing identifiers. Cancel the event by setting its function to null.]]></description>
+			<arguments>
+				<argument name="identifier" type="string"/>
+				<argument name="timeout" type="float"/>
+				<argument name="function" type="FunctionReference"/>
+			</arguments>
+		</element>
+		<element name="messageBox" function="true" type="void">
+			<arguments>
+				<argument name="title" type="string"/>
+				<argument name="message" type="string"/>
+			</arguments>
+		</element>
+		<element name="messageBox4" function="true" type="void">
+			<arguments>
+				<argument name="title" type="string"/>
+				<argument name="message" type="string"/>
+				<argument name="buttons" type="Vector"/>
+				<argument name="function" type="FunctionReference"/>
+			</arguments>
+		</element>
+		<element name="playSound" function="true" type="void">
+			<arguments>
+				<argument name="name" type="string"/>
+			</arguments>
+		</element>
+		<element name="KEY_BACK" type="integer" flags="1"/>
+		<element name="KEY_MENU" type="integer" flags="1"/>
+		<element name="KEY_SEARCH" type="integer" flags="1"/>
+		<element name="SHARING_HTML" type="string" flags="1"/>
+		<element name="top_left" type="Element" flags="1"/>
+		<element name="top_center" type="Element" flags="1"/>
+		<element name="top_right" type="Element" flags="1"/>
+		<element name="bottom_left" type="Element" flags="1"/>
+		<element name="bottom_center" type="Element" flags="1"/>
+		<element name="bottom_right" type="Element" flags="1"/>
+	</type>
+	<type name="GUIElement" context="Framsticks Theater">
+<description><![CDATA[GUI element]]></description>
 		<element name="name" type="string"/>
-		<element name="regname" type="string"/>
+		<element name="text" type="string"/>
+		<element name="image" type="untyped"/>
+		<element name="bgcolor" type="integer"/>
+		<element name="fgcolor" type="integer"/>
+		<element name="align" type="integer">
+			<description><![CDATA[labels: -1/0/1 means left/center/right, buttons and lists: 0/1 means horizontal/vertical]]></description>
+		</element>
+		<element name="valign" type="integer">
+			<description><![CDATA[-1/0/1 means top/center/bottom]]></description>
+		</element>
+		<element name="x" type="float"/>
+		<element name="y" type="float"/>
+		<element name="width" type="float"/>
+		<element name="height" type="float"/>
+		<element name="tooltip" type="string"/>
+		<element name="rowheight" type="float"/>
+		<element name="addItem" function="true" type="integer">
+			<arguments>
+				<argument name="label" type="string"/>
+				<argument name="image" type="string"/>
+			</arguments>
+		</element>
+		<element name="insertItem" function="true" type="integer">
+			<arguments>
+				<argument name="position" type="integer"/>
+				<argument name="label" type="string"/>
+				<argument name="image" type="string"/>
+			</arguments>
+		</element>
+		<element name="getItemLabel" function="true" type="string">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="getItemImage" function="true" type="string">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="setItemLabel" function="true" type="void">
+			<arguments>
+				<argument name="index" type="integer"/>
+				<argument name="label" type="string"/>
+			</arguments>
+		</element>
+		<element name="setItemImage" function="true" type="void">
+			<arguments>
+				<argument name="index" type="integer"/>
+				<argument name="image" type="string"/>
+			</arguments>
+		</element>
+		<element name="removeItem" function="true" type="void">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="removeAllItems" function="true" type="void"><arguments/></element>
+		<element name="itemcount" type="integer" flags="1"/>
+		<element name="rect" type="Rectangle"/>
+		<element name="absoluteRect" type="Rectangle"/>
+		<element name="setRect" function="true" type="void">
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="width" type="float"/>
+				<argument name="height" type="float"/>
+			</arguments>
+		</element>
+		<element name="setPos" function="true" type="void">
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+			</arguments>
+		</element>
+		<element name="setAutolayout" function="true" type="void">
+			<description><![CDATA[rel_* values refer to the parent element's dimensions]]></description>
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="width" type="float"/>
+				<argument name="height" type="float"/>
+				<argument name="rel_x" type="float"/>
+				<argument name="rel_y" type="float"/>
+				<argument name="rel_width" type="float"/>
+				<argument type="float"/>
+			</arguments>
+		</element>
+		<element name="minimalRect" type="Rectangle" flags="1"/>
+		<element name="font" type="integer" min="0" max="5"/>
+		<element name="selected" type="integer"/>
+		<element name="data" type="untyped"/>
+		<element name="mode" type="integer"/>
+		<element name="enabled" type="integer"/>
+		<element name="autorepeat" type="integer" min="0" max="1"/>
+		<element name="style" type="integer"/>
+		<element name="userdata" type="untyped"/>
+		<element name="visible" type="integer" min="0" max="1"/>
+		<element name="addTo" function="true" type="void">
+			<arguments>
+				<argument name="parent" type="GUIElement"/>
+			</arguments>
+		</element>
+		<element name="scrollIntoView" function="true" type="void">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="scroll_x" type="float" flags="1"/>
+		<element name="scroll_y" type="float" flags="1"/>
+		<element name="focus" type="integer" min="0" max="1"/>
+		<element name="edit" function="true" type="void">
+			<arguments>
+				<argument name="characters" type="string"/>
+			</arguments>
+		</element>
+		<element name="orient" type="Orient" flags="1"/>
+		<element name="min" type="float"/>
+		<element name="max" type="float"/>
+		<element name="animSetBegin" function="true" type="void"><arguments/></element>
+		<element name="animSetEnd" function="true" type="void"><arguments/></element>
+		<element name="startAnimation" function="true" type="void">
+			<arguments>
+				<argument name="duration" type="float"/>
+			</arguments>
+		</element>
+	</type>
+	<type name="ImageExport" context="Framsticks Theater">
+		<element name="imgex_outdir" type="string" default=".">
+			<description><![CDATA[Directory name WITHOUT trailing '/' sign]]></description>
+		</element>
+		<element name="imgex_outfiles" type="string" default="scene_%04d.jpg">
+			<description><![CDATA[Frame number replaces %d (eg. 'image%03d.jpg')]]></description>
+		</element>
+		<element name="imgex_format" type="integer" min="0" max="2"/>
+		<element name="imgex_compress" type="integer" min="0" max="100" default="15"/>
+		<element name="imgex_skip" type="integer">
+			<description><![CDATA[A scene file is generated each (n+1) simulation steps
+(a small value means more frames and smooth animation)]]></description>
+		</element>
+		<element name="imgex_startf" type="integer" min="0" max="1000000" default="0">
+			<description><![CDATA[Starting number]]></description>
+		</element>
+		<element name="imgex_maxframes" type="integer" min="0" max="1000000" default="10000">
+			<description><![CDATA[How many frames are to be generated?]]></description>
+		</element>
+		<element name="imgex_enable" function="true" flags="8"/>
+		<element name="imgex_disable" function="true" flags="8"/>
+		<element name="imgex_now" function="true" flags="8"/>
+		<element name="imgex_currframe" type="integer" flags="18"/>
+		<element name="imgex_enabled" type="integer" min="0" max="1" flags="18"/>
+		<element name="imgex_lastfile" type="string" flags="18"/>
+	</type>
+	<type name="Material" context="Framsticks Theater">
+<description><![CDATA[Material object]]></description>
+		<element name="new" function="true" type="Material"><arguments/></element>
+		<element name="color" type="string" flags="256"/>
+		<element name="lighting" type="integer" min="0" max="1" flags="256"/>
+		<element name="shine" type="integer" flags="256"/>
+		<element name="texture" type="string" flags="256"/>
+		<element name="shader" type="Shader" flags="256"/>
+	</type>
+	<type name="Matrix" context="Framsticks Theater">
+<description><![CDATA[4x4 Marix object]]></description>
+		<element name="new" function="true" type="Matrix"><arguments/></element>
+		<element name="newRotation" function="true" type="Matrix">
+			<arguments>
+				<argument name="angles" type="XYZ"/>
+			</arguments>
+		</element>
+		<element name="newTranslation" function="true" type="Matrix">
+			<arguments>
+				<argument name="translation" type="XYZ"/>
+			</arguments>
+		</element>
+		<element name="newScale" function="true" type="Matrix">
+			<arguments>
+				<argument name="angles" type="XYZ"/>
+			</arguments>
+		</element>
+		<element name="add" function="true" type="Matrix" flags="256">
+			<arguments>
+				<argument name="another matrix" type="Matrix"/>
+			</arguments>
+		</element>
+		<element name="mul" function="true" type="Matrix" flags="256">
+			<arguments>
+				<argument name="another matrix" type="Matrix"/>
+			</arguments>
+		</element>
+		<element name="translate" function="true" type="Matrix" flags="256">
+			<arguments>
+				<argument name="translation" type="XYZ"/>
+			</arguments>
+		</element>
+		<element name="rotate" function="true" type="Matrix" flags="256">
+			<arguments>
+				<argument name="axis" type="XYZ"/>
+				<argument name="angle" type="float"/>
+			</arguments>
+		</element>
+		<element name="scale" function="true" type="Matrix" flags="256">
+			<arguments>
+				<argument name="scale" type="XYZ"/>
+			</arguments>
+		</element>
+	</type>
+	<type name="NeuroDiagram" context="Framsticks Theater">
+<description><![CDATA[Can be used as the client object in the Window.]]></description>
+		<element name="new" function="true" flags="32"/>
+		<element name="showCreature" function="true" type="void" flags="288">
+			<arguments>
+				<argument type="Creature"/>
+			</arguments>
+		</element>
+		<element name="showModel" function="true" type="void" flags="288">
+			<arguments>
+				<argument type="Model"/>
+			</arguments>
+		</element>
+		<element name="hide" function="true" type="void" flags="288"><arguments/></element>
+	</type>
+	<type name="Obj3D" context="Framsticks Theater">
+<description><![CDATA[3D object]]></description>
+		<element name="newEmpty" function="true" type="Obj3D"><arguments/></element>
+		<element name="newFromCreature" function="true" type="Obj3D">
+			<arguments>
+				<argument type="untyped"/>
+			</arguments>
+		</element>
+		<element name="newText" function="true" type="Obj3D">
+			<arguments>
+				<argument name="text" type="string"/>
+				<argument name="horizontal align" type="integer"/>
+				<argument name="vertical align" type="integer"/>
+				<argument name="transformation" type="Matrix"/>
+			</arguments>
+		</element>
+		<element name="load" function="true" type="Obj3D">
+			<arguments>
+				<argument name="filename" type="string"/>
+			</arguments>
+		</element>
+		<element name="name" type="string" flags="256"/>
+		<element name="visible" type="integer" min="0" max="1" flags="256"/>
+		<element name="transparent" type="integer" min="0" max="1" flags="256"/>
+		<element name="material" type="Material" flags="256"/>
+		<element name="add" function="true" type="void" flags="256">
+			<arguments>
+				<argument name="child object" type="Obj3D"/>
+			</arguments>
+		</element>
+		<element name="get" function="true" type="Obj3D" flags="256">
+			<arguments>
+				<argument name="index" type="integer"/>
+			</arguments>
+		</element>
+		<element name="children" type="integer" flags="257"/>
+		<element name="parent" type="Obj3D" flags="257"/>
+		<element name="removeFromParent" function="true" type="void" flags="256"><arguments/></element>
+		<element name="deleteChildren" function="true" type="void" flags="256"><arguments/></element>
+		<element name="delete" function="true" type="void" flags="256"><arguments/></element>
+		<element name="center" type="XYZ" flags="257"/>
+		<element name="size" type="float" flags="257"/>
+		<element name="transform" type="Matrix" flags="256"/>
+		<element name="position" type="XYZ" flags="256"/>
+		<element name="rotation" type="XYZ" flags="256"/>
+		<element name="scale" type="XYZ" flags="256"/>
+		<element name="setPositionAndRotation" function="true" type="void" flags="256">
+			<arguments>
+				<argument name="position" type="XYZ"/>
+				<argument name="rotation" type="XYZ"/>
+			</arguments>
+		</element>
+	</type>
+	<type name="Rectangle" context="Framsticks Theater">
+<description><![CDATA[GUI Rectangle]]></description>
+		<element name="x" type="float" flags="256"/>
+		<element name="y" type="float" flags="256"/>
+		<element name="width" type="float" flags="256"/>
+		<element name="height" type="float" flags="256"/>
+		<element name="newFromXYWH" function="true" type="Rectangle">
+			<arguments>
+				<argument name="x" type="float"/>
+				<argument name="y" type="float"/>
+				<argument name="width" type="float"/>
+				<argument name="height" type="float"/>
+			</arguments>
+		</element>
+	</type>
+	<type name="Shader" context="Framsticks Theater">
+<description><![CDATA[Shader object]]></description>
+		<element name="new" function="true" type="Shader">
+			<arguments>
+				<argument name="flags" type="integer"/>
+			</arguments>
+		</element>
+		<element name="vertex" type="string" flags="256"/>
+		<element name="fragment" type="string" flags="256"/>
+	</type>
+	<type name="Sharing" context="Framsticks Theater">
+		<element name="service" type="integer" min="0" max="4"/>
+		<element name="message" type="string"/>
+		<element name="url" type="string"/>
+		<element name="attach_file" type="string"/>
+		<element name="addScreenshot" function="true" type="void"><arguments/></element>
+		<element name="removeImage" function="true" type="void"><arguments/></element>
+		<element name="select" function="true" type="void">
+			<arguments>
+				<argument name="prompt" type="string"/>
+				<argument name="function" type="Object"/>
+			</arguments>
+		</element>
+		<element name="execute" function="true" type="void"><arguments/></element>
+	</type>
+	<type name="ShowManager" context="Framsticks Theater">
 		<element name="show" type="string"/>
-		<element name="showlog" type="integer" min="0" max="1"/>
-		<element name="switchmode" type="integer" min="0" max="2"/>
-		<element name="switchshows" type="string">
+		<element name="name" type="string" flags="50"/>
+		<element name="info" type="string" flags="50"/>
+		<element name="dispinfo" type="integer" min="0" max="2" flags="2"/>
+		<element name="userspeed" type="integer" min="0" max="5" default="3" flags="2"/>
+		<element name="showlog" type="integer" min="0" max="1" flags="2"/>
+		<element name="code" type="string" flags="16418"/>
+		<element name="expdef" type="string" flags="34"/>
+		<element name="reload" function="true" flags="2"/>
+		<element name="dummy" function="true" flags="2">
+			<description><![CDATA[This is the empty item in the Theater's menu]]></description>
+		</element>
+		<element name="about" function="true" flags="34"/>
+		<element name="regname" type="string" flags="35"/>
+		<element name="prev_show" type="string" flags="35"/>
+		<element name="mode" type="integer" min="0" max="2" flags="35"/>
+		<element name="switchmode" type="integer" min="0" max="3" flags="32"/>
+		<element name="switchtime" type="integer" min="0" max="9999" flags="32">
+			<description><![CDATA[time between switching (seconds)]]></description>
+		</element>
+		<element name="switchshows" type="string" flags="32">
 			<description><![CDATA[names of the shows participating in automatic switching (comma separated). Use * as a wildcard.]]></description>
 		</element>
-		<element name="switchtime" type="integer" min="0" max="9999">
-			<description><![CDATA[time between switching (seconds)]]></description>
-		</element>
-		<element name="userspeed" type="integer" min="0" max="5" default="3"/>
-		<element name="about" function="true"/>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="dummy" function="true">
-			<description><![CDATA[This is the empty item in the Theater's menu]]></description>
-		</element>
-		<element name="reload" function="true"/>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
-	</type>
-	<type name="SimStatsCharts" context="Command line interface">
+		<element name="includeshows" type="string" flags="32">
+			<description><![CDATA[names of shows included in the show menu. Use * as a wildcard.]]></description>
+		</element>
+		<element name="excludeshows" type="string" flags="32">
+			<description><![CDATA[names of shows excluded from the show menu. Use * as a wildcard.]]></description>
+		</element>
+		<element name="openfilename" type="string" flags="33">
+			<description><![CDATA[Filename to be opened in onAppOpenFile()]]></description>
+		</element>
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
+	</type>
+	<type name="ShowParams" context="Framsticks Theater">
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
+	</type>
+	<type name="SimStatsCharts" context="Framsticks Theater">
 <description><![CDATA[Manages charts for monitoring simulator statistics.
 This class has no corresponding static object. If you want to use it, you have to create an object or get a reference to the existing object.]]></description>
-		<element name="selected" type="integer"/>
-		<element name="add" function="true"/>
-		<element name="createChart" function="true"/>
-		<element name="removeAll" function="true"/>
-		<element name="resetAll" function="true">
+		<element name="selected" type="integer" flags="258"/>
+		<element name="sscAddSelected" function="true" flags="256"/>
+		<element name="add" function="true" flags="288"/>
+		<element name="removeAll" function="true" flags="256"/>
+		<element name="resetAll" function="true" flags="256">
 			<description><![CDATA[Removes all data from the chart windows.]]></description>
 		</element>
-		<element name="sscAddSelected" function="true"/>
-	</type>
-	<type name="TrackingCam" context="Command line interface">
+		<element name="createChart" function="true" flags="288"/>
+	</type>
+	<type name="TrackingCam" context="Framsticks Theater">
 <description><![CDATA[Camera object with the automatic target tracking ability.]]></description>
-		<element name="cam_change" type="integer" min="0" max="5" default="3"/>
-		<element name="cam_chspeed" type="float" min="0.1" max="10" default="1"/>
-		<element name="cam_dir" type="float" min="0" max="360" default="30"/>
+		<element name="cam_tracking" type="integer" min="0" max="3" default="1"/>
+		<element name="cam_trspeed" type="float" min="0.1" max="10" default="5.0"/>
 		<element name="cam_distrac" type="integer" min="0" max="1" default="0">
 			<description><![CDATA[Suspend automatic tracking when the camera is moved manually]]></description>
-		</element>
-		<element name="cam_h" type="float" min="0" max="360" default="45">
-			<description><![CDATA[0=side view, 90=top view]]></description>
 		</element>
 		<element name="cam_restrac" type="integer" min="0" max="100" default="10">
@@ -5721,12 +7032,17 @@
 (0 to never restore automatic tracking)]]></description>
 		</element>
-		<element name="cam_tracking" type="integer" min="0" max="3" default="1"/>
-		<element name="cam_trspeed" type="float" min="0.1" max="10" default="5"/>
-		<element name="cam_zoom" type="float" min="0.2" max="3" default="0.8"/>
 		<element name="cam_restore" function="true" type="void">
 			<description><![CDATA[Update camera position and restore automatic tracking]]></description>
 <arguments/></element>
-		<element name="moveTarget" function="true" type="void">
-			<description><![CDATA[notify about the target location/size change]]></description>
+		<element name="cam_world" type="integer" min="0" max="1" default="1"/>
+		<element name="cam_change" type="integer" min="0" max="5" default="2"/>
+		<element name="cam_chspeed" type="float" min="0.1" max="10" default="1.0"/>
+		<element name="cam_zoom" type="float" min="0.2" max="3" default="0.8"/>
+		<element name="cam_dir" type="float" min="0" max="-1" default="30.0"/>
+		<element name="cam_h" type="float" min="-90" max="90" default="45.0">
+			<description><![CDATA[0=side view, 90=top view]]></description>
+		</element>
+		<element name="setTarget" function="true" type="void" flags="32">
+			<description><![CDATA[select a new target for the camera]]></description>
 			<arguments>
 				<argument name="location x" type="float"/>
@@ -5736,6 +7052,6 @@
 			</arguments>
 		</element>
-		<element name="setTarget" function="true" type="void">
-			<description><![CDATA[select a new target for the camera]]></description>
+		<element name="moveTarget" function="true" type="void" flags="32">
+			<description><![CDATA[notify about the target location/size change]]></description>
 			<arguments>
 				<argument name="location x" type="float"/>
@@ -5745,5 +7061,5 @@
 			</arguments>
 		</element>
-		<element name="setViewDir" function="true" type="void">
+		<element name="setViewDir" function="true" type="void" flags="32">
 			<description><![CDATA[heading: 0..360, height: -90..+90]]></description>
 			<arguments>
@@ -5752,47 +7068,75 @@
 			</arguments>
 		</element>
-	</type>
-	<type name="VisualStyle" context="Command line interface">
-		<element name="changedProperty" type="integer"/>
-		<element name="changedPropertyId" type="string"/>
-		<element name="code" type="string"/>
-		<element name="info" type="string"/>
-		<element name="modelpan" type="integer" min="0" max="3">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="name" type="string"/>
-		<element name="neurons" type="integer" min="0" max="1"/>
-		<element name="shownames" type="integer" min="0" max="1">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="smooth" type="integer" min="0" max="1"/>
-		<element name="style" type="string"/>
-		<element name="tex" type="integer" min="0" max="2"/>
-		<element name="worldpan" type="integer" min="0" max="3">
-			<description><![CDATA[]]></description>
-		</element>
-		<element name="add" function="true"/>
-		<element name="addGroup" function="true"/>
-		<element name="clear" function="true"/>
-		<element name="rebuild" function="true"/>
-		<element name="remove" function="true"/>
-		<element name="removeGroup" function="true"/>
-		<element name="streload" function="true"/>
-	</type>
-	<type name="Window" context="Command line interface">
+		<element name="setOrient" function="true" type="void" flags="32">
+			<arguments>
+				<argument type="Orient"/>
+			</arguments>
+		</element>
+		<element name="interacting" type="integer" min="0" max="2" flags="35"/>
+		<element name="tick" function="true" type="void" flags="32">
+			<description><![CDATA[Display-less command line scripts can use tick() to advance time between frames]]></description>
+			<arguments>
+				<argument name="time span" type="float"/>
+			</arguments>
+		</element>
+	</type>
+	<type name="VisualStyle" context="Framsticks Theater">
+		<element name="style" type="string" default="standard"/>
+		<element name="name" type="string" flags="19"/>
+		<element name="info" type="string" flags="19"/>
+		<element name="code" type="string" flags="16419"/>
+		<element name="streload" function="true" flags="2"/>
+		<element name="rebuild" function="true" flags="34"/>
+		<element name="tex" type="integer" min="0" max="2" default="1"/>
+		<element name="smooth" type="integer" min="0" max="1" default="1"/>
+		<element name="neurons" type="integer" min="0" max="1" default="1"/>
+		<element name="clear" function="true" flags="34"/>
+		<element name="add" function="true" flags="34"/>
+		<element name="remove" function="true" flags="34"/>
+		<element name="addGroup" function="true" flags="34"/>
+		<element name="removeGroup" function="true" flags="34"/>
+		<element name="changedProperty" type="integer" flags="35"/>
+		<element name="changedPropertyId" type="string" flags="35"/>
+		<element name="worldpan" type="integer" min="0" max="3" default="2" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="worldbgcolor" type="integer" min="0" max="16777215" default="16764040" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="hideworld" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[Can be useful for screenshots]]></description>
+		</element>
+		<element name="modelpan" type="integer" min="0" max="3" default="1" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="bgcolor" type="integer" min="0" max="16777215" default="16764040" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="bbox" type="integer" min="0" max="1" default="1" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="joint_width" type="integer" min="10" max="150" default="100" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="shadows" type="integer" min="0" max="1" default="1" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="axes" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="shownames" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[]]></description>
+		</element>
+		<element name="symmetryplane" type="integer" min="0" max="1" default="0" flags="192">
+			<description><![CDATA[Displays a guess of the symmetry plane (may take a long time to compue for complex bodies).
+Use scripting and the ModelSymmetry class to compute symmetry accurately.
+Details of the symmetry estimation procedure are described in http://www.framsticks.com/node/808]]></description>
+		</element>
+	</type>
+	<type name="Window" context="Framsticks Theater">
 <description><![CDATA[Window object, used in the Framsticks Theater application.
 This class has no corresponding static object. If you want to use it, you have to create an object or get a reference to the existing object.
  See also: GLDisplay]]></description>
-		<element name="backcolor" type="integer">
-			<description><![CDATA[format: 0xAABBGGRR (alpha,blue,green,red)]]></description>
-		</element>
-		<element name="client" type="Object">
-			<description><![CDATA[what is displayed in the window]]></description>
-		</element>
-		<element name="pos_x" type="integer"/>
-		<element name="pos_y" type="integer"/>
-		<element name="size_x" type="integer"/>
-		<element name="size_y" type="integer"/>
-		<element name="style" type="integer">
+		<element name="style" type="integer" flags="256">
 			<description><![CDATA[bitfield:
 1 - border
@@ -5802,5 +7146,15 @@
 16 - resizable]]></description>
 		</element>
-		<element name="title" type="string"/>
+		<element name="title" type="string" flags="256"/>
+		<element name="backcolor" type="integer" flags="256">
+			<description><![CDATA[format: 0xAABBGGRR (alpha,blue,green,red)]]></description>
+		</element>
+		<element name="pos_x" type="integer" flags="256"/>
+		<element name="pos_y" type="integer" flags="256"/>
+		<element name="size_x" type="integer" flags="256"/>
+		<element name="size_y" type="integer" flags="256"/>
+		<element name="client" type="Object" flags="256">
+			<description><![CDATA[what is displayed in the window]]></description>
+		</element>
 	</type>
 </framscript>
Index: java/Framclipse/com.framsticks.framclipse/res/framscript.xsl
===================================================================
--- java/Framclipse/com.framsticks.framclipse/res/framscript.xsl	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/res/framscript.xsl	(revision 440)
@@ -10,4 +10,5 @@
 <xsl:template match="framscript">
   <h1>Framscript Objects</h1>
+  <b>These objects can be used in many <a href="framscontext.xml">contexts and files</a>.<br/><br/><br/></b>
   <xsl:apply-templates select="//framscript/type"/>
 </xsl:template>
@@ -25,5 +26,5 @@
 
 <xsl:template match="element">
-  <li><b><xsl:value-of select="@name"/></b> - 
+  <li><xsl:choose><xsl:when test="@deprecated='true'"><strike><xsl:value-of select="@name"/></strike></xsl:when><xsl:otherwise><b><xsl:value-of select="@name"/></b></xsl:otherwise></xsl:choose> - 
    <xsl:if test="@function='true'">
     function <xsl:if test="@type!=''">returning <xsl:value-of select="@type"/></xsl:if>
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScript.xtext
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScript.xtext	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScript.xtext	(revision 440)
@@ -1,3 +1,3 @@
-grammar com.framsticks.framclipse.FramScript with org.eclipse.xtext.common.Terminals
+grammar com.framsticks.framclipse.FramScript with org.eclipse.xtext.common.Terminals hidden(SL_COMMENT, ML_COMMENT, WS)
 
 import "http://www.eclipse.org/emf/2002/Ecore" as ecore
@@ -54,24 +54,26 @@
 	'prop:'
 	headers += PropertyHeader*
-	'id:' name=ID 
+	'id:' name=ID
 	headers += PropertyHeader+
 	;
-	
+
 State :
-	'state:' 
+	'state:'
 	headers += PropertyHeader*
-	'id:' name=ID 
+	'id:' name=ID
 	headers += PropertyHeader+
 	;
-	
+
 Include : {Include}
-	code=Code?
-	(properties+=Property |
-	states+=State)*
+	(
+		code=Code?
+		(properties+=Property |
+		states+=State)*
+	) | {Block} statements+=Statement+
 ;
-	
+
 Header :
-	name=ID value=HEADER_VALUE ;
-	
+	name=HEADER_ID value=HEADER_VALUE ;
+
 NeuroHeader returns Header :
 {IntHeader}		name=('prefinputs:' | 'prefoutput:' | 'preflocation:' | 'vhints:') intValue=IntValue |
@@ -79,32 +81,33 @@
 {IconHeader}	name='icon:~' icon=Icon '~' |
 				Header ;
-				
-Icon : 
+
+Icon :
 	INT (',' INT)+ ;
-	
+
 PropertyHeader returns Header :
 	TypeHeader |
 	FlagsHeader |
 	Header ;
-	
+
 ShowHeader returns Header :
-	name='expdef:' value=ID |
+	name='expdef:' importURI=ID |
 	Header ;
-	
+
 FlagsHeader returns Header :
 {IntHeader}	name='flags:' intValue=INT ;
-	
+
 TypeHeader :
-	name='type:' type=PropertyType ;
-	
+	name=TYPE_HEADER type=PropertyType ;
+
+// This terminal is defined separately for use with FramScriptAuxiliaryLexer.
+terminal TYPE_HEADER : 'type:';
+
 PropertyType :
-	name=ID (min=Number (max=Number default=Number?)? enums+=ENUM_LITERAL* )? ;
-	
-terminal ENUM_LITERAL :
-	'~' !('~'|'\r'|'\n')+ ;
-
-Number :
-	'-'? (INT | DOUBLE) ;
-	
+	name=ID (min=Number max=Number default=(Number|HEADER_VALUE)? enums+=ENUM_LITERAL* )? ;
+
+Number : IntNumber | DoubleNumber ;
+IntNumber : '-'? INT ;
+DoubleNumber : '-'? DOUBLE ;
+
 CodeSection returns Code :
 	'code:~' Code '~' ;
@@ -123,12 +126,21 @@
 IncludeDeclaration :
 	'@include' importURI=STRING ;
-	
+
+/*
+ * For some reason, the '#include' keyword is not matched.
+ * It is possible it has been overshadowed by SL_COMMENT,
+ * despite the order in which the two have been defined.
+ * This has been worked around in FramScriptAuxiliaryLexer.
+ */
 PropertyIncludeDeclaration :
-	'#include' importURI=STRING ;
-	
+	PROP_INCLUDE importURI=STRING ;
+
+// keyword separated for use in FramScriptAuxiliaryLexer
+terminal PROP_INCLUDE : '#include' ;
+
 Block :
-{Block}	'{' statements+=Statement* '}' ;
-	
-Statement :	
+	'{' statements+=Statement+ '}' ;
+
+Statement :
 	( VariableDeclarationStatement |
 	ExpressionStatement |
@@ -145,4 +157,5 @@
 	WhileStatement |
 	ForStatement |
+	ForEachStatement |
 {EmptyStatement} ';' ;
 
@@ -154,9 +167,16 @@
 	
 IfStatement :
-	'if' '(' condition=Expression ')' if=Statement ('else' else=Statement)? ;
-	
-ForStatement : 
-	'for' '(' init=Assignment? ';' condition=Expression? ';' step=Assignment? ')' body=Statement ;
-	
+	'if' '(' condition=Expression ')' if=Statement (=>'else' else=Statement)? ;
+
+ForStatement :
+	'for' '(' (init=Assignment | init=VariableDeclarationStatement)? ';' condition=Expression? ';' step=Assignment? ')' body=Statement ;
+
+ForEachStatement :
+	'for' '(' (decl=Iterator|ref=[VariableDeclaration]) 'in' colection=Expression ')' body=Statement ;
+
+Iterator returns VariableDeclaration :
+	'var' name=ID
+;
+
 WhileStatement :
 	'while' '(' condition=Expression ')' body=Statement ;
@@ -182,6 +202,6 @@
 SwitchStatement :
 	'switch' condition=ParExpression '{' labels+=SwitchGroup* '}' ;
-	
-SwitchGroup : 
+
+SwitchGroup :
 	label=SwitchLabel body=SwitchBlock ;
 	
@@ -206,62 +226,85 @@
 
 Expression :
-	UnaryExpression ({Expression.left=current} op=Operator right=Expression)? | 
+	UnaryExpression ({Expression.left=current} op=Operator right=Expression)? |
 	WildcardExpression ;
-	
-UnaryExpression  :
+
+UnaryExpression :
 	QualifiedExpression2 ({UnaryExpression.arg=current} op = IncrementOperator)? |
 	op = (IncrementOperator | UnaryOperator) arg = QualifiedExpression2 |
+	FunctionLiteral |
 	Literal ;
-	
+
 QualifiedExpression2 returns QualifiedExpression :
 	QualifiedExpression |
 	(PropertyAccess|StateAccess) ({QualifiedExpression.parent=current}'.' child=QualifiedExpression )? ;
-	
+
 QualifiedExpression :
-	ArrayElementExpression ({QualifiedExpression.parent=current}'.' child=QualifiedExpression )? ;
-	
+	MemberAccess ({QualifiedExpression.parent=current}'.' child=QualifiedExpression )? ;
+
+MemberAccess returns QualifiedExpression:
+	ArrayElementExpression ( {MemberAccess.left=current} '.[' child=Expression ']')? ;
+
 ArrayElementExpression :
 	TerminalExpression ({ArrayElementExpression.array=current} ('[' indexes+=Expression ']')+ )? ;
- 
+
 TerminalExpression:
+				Cast |
+				TypeOf |
 				Invocation |
 				Array |
-				Vector | 
+				Vector |
+				Dictionary |
 {VariableRef} 	var=[VariableDeclaration];
- 				
+
+Cast :
+	type=('int'|'float'|'string') '(' expression=Expression ')' ;
+
+TypeOf :
+	'typeof' '(' expression=Expression ')' ;
+
 Invocation :
 	function=[Function] '(' (args+=Expression (',' args+=Expression)*)? ')' ;
-	
+
 WildcardExpression :
 	value=ID '.*' ;
-	
+
 PropertyAccess returns QualifiedExpression :
-	('Fields.'|'ExpParams.'|'ShowParams.'|'VisParams.') property=[Property] ;
-	
+{PropertyAccess}	('Fields'|'ExpParams'|'ShowParams'|'VisParams') ('.*' | =>('.' property=[Property]) | '.[' (=>property=[Property|STRING] | child=Expression ) ']')? ;
+
 StateAccess returns QualifiedExpression :
-	'ExpState.' state=[State] ;
-	
+{StateAccess}	'ExpState' (".*" | =>('.' state=[State]) | '.[' (=>state=[State|STRING] | child=Expression ) ']')? ;
+
+FunctionLiteral:
+	'function' function=[Function] ;
+
 Literal:
-{IntLiteral}	value=IntValue | 
-{DoubleLiteral}	value=DoubleValue | 
-{StringLiteral}	value=STRING | 
-{HexLiteral}	value=HEX | 
+{IntLiteral}	value=IntValue |
+{DoubleLiteral}	value=DoubleValue |
+{StringLiteral}	value=STRING |
+{RawStringLiteral}	value=ML_STRING |
+{HexLiteral}	value=HEX |
 {NullLiteral}	'null' ;
 
 Array :
-	'[' elements+=Expression (',' elements+=Expression)* ']' ;
+{Array}	'[' (elements+=Expression (',' elements+=Expression)*)? ']' ;
 
 Vector  :
 	'(' elements+=Expression (',' elements+=Expression)* ')' ;
 
-Operator : 
-	'+' | '-' | '*'| '/' | 
+Dictionary :
+{Dictionary}	'{' ( keys+=DictKey values+=Expression (',' keys+=DictKey values+=Expression)* )? '}' ;
+
+DictKey :
+	STRING ':' ;
+
+Operator :
+	'+' | '-' | '*'| '/' |
 	'&'| '|' | '%' |
 	'==' | '!=' | '>=' | '<=' | '<' | '>' |
 	'&&' | '||' ;
-	
+
 UnaryOperator :
-	'!' | '+' | '-' | 'typeof';
-	
+	'!' | '+' | '-';
+
 IncrementOperator :
 	'++' | '--' ;
@@ -272,17 +315,51 @@
 DoubleValue hidden() :
 	('+'|'-')? DOUBLE ;
-	
-terminal DOUBLE : 
+
+terminal DOUBLE :
 	('0'..'9')*'.'('0'..'9')+ ('e' INT)? |
 	INT 'e' INT ;
-	
-terminal HEX : 
+
+terminal ENUM_LITERAL :
+	'~' !('~'|'\r'|'\n')+ ;
+
+terminal HEX :
 	'0x' (('0'..'9')|('a'..'f')|('A'..'F'))+ ;
-	
-terminal HEADER_VALUE : 
-	':' !('~'|' '|'\t'|'\r'|'\n') !('\n'|'\r')* ('\r'? '\n') |
-	':~' -> '~'('\r'? '\n') 
-	;
-	
-terminal SL_COMMENT : ('//' | '# ')  !('\n'|'\r')* ('\r'? '\n')?;
-
+
+terminal ML_STRING :
+	'"""' -> '"""' |
+	"'''" -> "'''"
+;
+
+terminal SL_COMMENT : ('//' | '#') -> NL ;
+
+terminal HEADER_ID :
+	(
+		'name' |
+		'longname' |
+		'description' |
+		'group' |
+		'help' |
+		'info' |
+		'neurons'
+	) ':'
+;
+
+/*
+ * This rule should not match anything,
+ * so expect an error when generating the artifacts.
+ * If it is not there, something went wrong.
+ * This rule is here just to make Xtext generate a constant
+ * to be used in a custom lexer (FramScriptAuriliaryLexer),
+ * which takes context into account,
+ * so it is able to recognise HEADER_VALUE
+ * without conflicting with Framscript code syntax.
+ * It should match the following rules,
+ * but only when preceded with HEADER_ID:
+ *	'~' NL ('\\~'|!'~')* '~' NL | -> NL,
+ * where NL is defined as: '\r' '\n'? | '\n',
+ * The final NL is not matched, but it is a part of context.
+ * This token is also emitted for the default value in PropertyType.
+ */
+terminal HEADER_VALUE : 'name:';
+
+terminal fragment NL : '\r' '\n'? | '\n' ;
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptAuxiliaryLexer.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptAuxiliaryLexer.java	(revision 440)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptAuxiliaryLexer.java	(revision 440)
@@ -0,0 +1,240 @@
+package com.framsticks.framclipse;
+
+import org.antlr.runtime.CharStream;
+import org.antlr.runtime.RecognitionException;
+import org.antlr.runtime.Token;
+
+import com.framsticks.framclipse.parser.antlr.internal.InternalFramScriptLexer;
+
+public class FramScriptAuxiliaryLexer extends InternalFramScriptLexer {
+
+	private static final int FLG_MULTILINE = 0x1;
+	private static final int FLG_TYPE_IS_NUMERIC = 0x2;	// if raised, the default value should be analysed with internal lexer
+	private static final int FLG_TYPE_IS_STRING = 0x4;	// if raised, the max value can be omitted and should be 0
+	private static final int CTX_NONE = 0;
+	private static final int CTX_TYPE = 1;
+	private static final int CTX_TYPE_ID = 2;
+	private static final int CTX_TYPE_MIN = 3;
+	private static final int CTX_TYPE_MAX = 4;
+	private static final int CTX_TYPE_DEFAULT = 5;
+
+	private int context = CTX_NONE;
+	private int flags = 0;
+	private Token previous = Token.INVALID_TOKEN;
+
+	private void checkML() {
+		setFlag(FLG_MULTILINE, next() == '~');
+	}
+
+	private boolean isSet(int flag) {
+		return (flags & flag) != 0;
+	}
+
+	private void setFlag(int flag, boolean state) {
+		if (state)
+			flags |= flag;
+		else
+			flags &= ~flag;
+	}
+
+	private void setState(int tokenType) {
+		state.token = null;
+		state.channel = Token.DEFAULT_CHANNEL;
+		state.tokenStartCharIndex = input.index();
+		state.tokenStartCharPositionInLine = input.getCharPositionInLine();
+		state.tokenStartLine = input.getLine();
+		state.text = null;
+		state.type = tokenType;
+	}
+
+	char next() {
+		return next(1);
+	}
+
+	char next(int i) {
+		return (char)input.LA(i);
+	}
+
+	void consumeUntilAny(String term) {
+		term += (char)CharStream.EOF;
+		while (term.indexOf(next()) == -1)
+			matchAny();
+	}
+
+	@Override
+	public Token nextToken() {
+		switch (previous.getType()) {
+		case RULE_HEADER_ID:
+			setState(RULE_HEADER_VALUE);
+			checkML();
+			mHEADER_VALUE();
+			return previous = emit();
+		case RULE_TYPE_HEADER:
+			checkML();
+			context = CTX_TYPE;
+			if (isSet(FLG_MULTILINE)) {
+				setState(RULE_WS);	// any ignored token
+				matchAny();	// consume '~'
+				return previous = emit();
+			}
+			break;
+		case RULE_WS:
+			if (context == CTX_TYPE_MIN) {
+				if (isSet(FLG_TYPE_IS_STRING)) {
+					if (!Character.isDigit(next()) && next() != '-') {	// if string length is omitted
+						if (isSet(FLG_MULTILINE))
+							matchAny();	// ignore expected '~'
+						setState(RULE_INT);
+						state.text = "0";	// pretend the max value is 0
+						return previous = emit();
+					}
+				}
+			}
+			if (previous.getText().indexOf('\n') != -1 ||
+					previous.getText().indexOf('\r') != -1) {
+				if (!isSet(FLG_MULTILINE)) {
+					context = CTX_NONE;
+				}
+				// workaround for '#include'
+				if (willMatch("#include")) {
+					setState(RULE_PROP_INCLUDE);
+					try {
+						mRULE_PROP_INCLUDE();
+					} catch (RecognitionException e) {
+						reportError(e);
+					}
+					return previous = emit();
+				}
+				if (!isSet(FLG_MULTILINE)) {
+					break;
+				}
+			}
+			if (context == CTX_TYPE_MAX) {
+				if (isSet(FLG_MULTILINE)) {
+					context = CTX_TYPE_DEFAULT;
+				} else {
+					context = CTX_NONE;
+				}
+				if (isSet(FLG_TYPE_IS_NUMERIC)) {
+					if (isSet(FLG_MULTILINE) && !Character.isDigit(next())
+							&& next() != '-') {	// if default value is omitted
+						previous = aux_ENUM_LITERAL();
+						if (previous != null)
+							return previous;
+					}
+					break;
+				} else {
+					setState(RULE_HEADER_VALUE);
+					mRULE_TYPE_HEADER_VALUE();
+					return previous = emit();
+				}
+			} else if (context == CTX_TYPE_DEFAULT) {
+				previous = aux_ENUM_LITERAL();
+				if (previous != null)
+					return previous;
+			}
+			break;
+		case RULE_ID:
+			if (context == CTX_TYPE) {
+				if ("df".indexOf(previous.getText().charAt(0)) == -1) {
+					setFlag(FLG_TYPE_IS_NUMERIC, false);
+					setFlag(FLG_TYPE_IS_STRING, previous.getText().charAt(0) == (int)'s');
+				} else {
+					setFlag(FLG_TYPE_IS_NUMERIC, true);
+				}
+				context = CTX_TYPE_ID;
+				break;
+			}
+			context = CTX_NONE;
+			break;
+		case RULE_HEADER_VALUE:
+		case RULE_ENUM_LITERAL:
+			if (context == CTX_TYPE_DEFAULT) {
+				previous = aux_ENUM_LITERAL();
+				if (previous != null)
+					return previous;
+			}
+			context = CTX_NONE;
+			break;
+		case RULE_DOUBLE:
+		case RULE_INT:
+			if (context == CTX_TYPE_DEFAULT) {
+				break;	// avoid changing context
+			} else if (context == CTX_TYPE_ID) {
+				context = CTX_TYPE_MIN;
+				break;
+			} else if (context == CTX_TYPE_MIN) {
+				context = CTX_TYPE_MAX;
+				break;
+			}
+			context = CTX_NONE;
+			break;
+		default:
+			if ("-".equals(previous.getText()) ||
+					"+".equals(previous.getText())) {
+				break;
+			}
+			context = CTX_NONE;
+		case RULE_SL_COMMENT:
+			break;
+		}
+		return previous = super.nextToken();
+	}
+
+	private boolean willMatch(String string) {
+		for (int i = 0; i < string.length(); ++i) {
+			if (next(i+1) != string.charAt(i))
+				return false;
+		}
+		return true;
+	}
+
+	private Token aux_ENUM_LITERAL() {
+		// CTX_TYPE_DEFAULT assumes raised FLG_MULTILINE
+		if (next() == '~') {
+			setState(RULE_WS);	// any ignored token
+			matchAny();
+			context = CTX_NONE;
+			return emit();
+		} else if (next() == '\\' && next(2) == '~') {
+			matchAny();	// not assigned to any terminal
+			setState(RULE_ENUM_LITERAL);
+			matchAny();	// consume '~'
+			mRULE_TYPE_HEADER_VALUE();
+			return emit();
+		}
+		return null;
+	}
+	
+	private void mRULE_TYPE_HEADER_VALUE() {
+		if (isSet(FLG_MULTILINE)) {
+			do {
+				consumeUntilAny("\\~");
+				if (next() == '\\' && next(2) != '~') {
+					matchAny();
+					continue;
+				}
+			} while (false);
+		} else {
+			consumeUntilAny("~\r\n");
+		}
+	}
+
+	private void mHEADER_VALUE() {
+		if (isSet(FLG_MULTILINE)) {
+			matchAny();	// consume '~'
+			do {
+				consumeUntilAny("\\~");
+				if (next() == '\\') {
+					matchAny();
+					if (next() == '~')
+						matchAny();
+					continue;
+				}
+			} while (false);
+			matchAny();
+		} else {
+			consumeUntilAny("\r\n");
+		}
+	}
+}
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptRuntimeModule.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptRuntimeModule.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptRuntimeModule.java	(revision 440)
@@ -16,8 +16,9 @@
 import com.framsticks.framclipse.script.context.Framscontext;
 import com.framsticks.framclipse.script.model.Framscript;
+import com.google.inject.Binder;
 import com.thoughtworks.xstream.XStream;
 
 /**
- * Use this class to register components to be used within the IDE.
+ * Use this class to register components to be used at runtime / without the Equinox extension registry.
  */
 public class FramScriptRuntimeModule extends com.framsticks.framclipse.AbstractFramScriptRuntimeModule {
@@ -56,3 +57,10 @@
 	}
 
+	@Override
+	public void configureRuntimeLexer(Binder binder) {
+		binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class)
+                        .annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME))
+                        .to(FramScriptAuxiliaryLexer.class);
+	}
+
 }
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptValueConverterService.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptValueConverterService.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptValueConverterService.java	(revision 440)
@@ -18,13 +18,26 @@
 			protected String internalToValue(String s, INode node)
 					throws ValueConverterException {
-				if (s.startsWith(":~")) {
-					return s.substring(2, s.lastIndexOf('~')).trim();
-				} else {
-					return s.substring(1).trim();
+				String r = s;
+				if (s.startsWith("~")) {
+					r = s.substring(1, s.lastIndexOf('~'));
 				}
+				return r.trim().replaceAll("\\~", "~");
 			}
 
 		};
 	}
-	
+
+	@ValueConverter(rule = "ML_STRING")
+	public IValueConverter<String> ML_STRING() {
+
+		return new AbstractToStringConverter<String>() {
+
+			@Override
+			protected String internalToValue(String s, INode node)
+					throws ValueConverterException {
+				return s.substring(3, s.length()-3);
+			}
+
+		};
+	}
 }
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/GenerateFramScript.mwe2
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/GenerateFramScript.mwe2	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/GenerateFramScript.mwe2	(revision 440)
@@ -80,6 +80,6 @@
 			// Java-based API for validation
 			fragment = validation.JavaValidatorFragment auto-inject {
-			//	composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
-			//	composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
+				composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
+				composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
 			}
 
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/formatting/FramScriptFormatter.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/formatting/FramScriptFormatter.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/formatting/FramScriptFormatter.java	(revision 440)
@@ -17,22 +17,15 @@
 
 /**
- * This class contains custom formatting description.
+ * This class contains custom formatting declarations.
  * 
- * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#formatting
- * on how and when to use it
+ * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#formatting
+ * on how and when to use it.
  * 
- * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an
- * example
+ * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example
  */
 public class FramScriptFormatter extends AbstractDeclarativeFormatter {
-	
-	@Override
-	protected FramScriptGrammarAccess getGrammarAccess() {
-		return (FramScriptGrammarAccess) super.getGrammarAccess();
-	}
-
 	@Override
 	protected void configureFormatting(FormattingConfig c) {
-		FramScriptGrammarAccess f = getGrammarAccess();
+		FramScriptGrammarAccess f = (FramScriptGrammarAccess) getGrammarAccess();
 		
 		//Headers
@@ -68,5 +61,5 @@
 		c.setNoSpace().before(f.getFlagsHeaderAccess().getIntValueAssignment_2());
 		
-		c.setNoSpace().after(f.getTypeHeaderAccess().getNameTypeKeyword_0_0());
+		c.setNoSpace().after(f.getTypeHeaderAccess().getNameTYPE_HEADERTerminalRuleCall_0_0());
 		c.setLinewrap().after(f.getTypeHeaderAccess().getTypeAssignment_1());
 		
@@ -94,9 +87,9 @@
 		// BlockIndentation
 		BlockElements block = f.getBlockAccess();
-		c.setIndentation(block.getLeftCurlyBracketKeyword_1(), 
-				block.getRightCurlyBracketKeyword_3());
-		c.setLinewrap().before(block.getLeftCurlyBracketKeyword_1());
-		c.setLinewrap().after(block.getLeftCurlyBracketKeyword_1());
-		c.setLinewrap().after(block.getRightCurlyBracketKeyword_3());
+		c.setIndentation(block.getLeftCurlyBracketKeyword_0(),
+				block.getRightCurlyBracketKeyword_2());
+		c.setLinewrap().before(block.getLeftCurlyBracketKeyword_0());
+		c.setLinewrap().after(block.getLeftCurlyBracketKeyword_0());
+		c.setLinewrap().after(block.getRightCurlyBracketKeyword_2());
 
 		// Param
@@ -104,5 +97,6 @@
 		c.setNoLinewrap().around(fullStop);
 		c.setNoSpace().around(fullStop);
-		c.setNoSpace().after(f.getPropertyAccessAccess().getAlternatives_0());
+		c.setNoSpace().after(f.getPropertyAccessAccess().getAlternatives_1());
+		c.setNoSpace().after(f.getPropertyAccessAccess().getAlternatives_2());
 		
 		// Invocation
@@ -117,7 +111,7 @@
 		
 		//Arrays
-		c.setNoSpace().after(f.getArrayAccess().getLeftSquareBracketKeyword_0());
+		c.setNoSpace().after(f.getArrayAccess().getLeftSquareBracketKeyword_1());
 		c.setNoSpace().before(f.getArrayAccess().getRightSquareBracketKeyword_3());
-		c.setNoSpace().before(f.getArrayAccess().getCommaKeyword_2_0());
+		c.setNoSpace().before(f.getArrayAccess().getCommaKeyword_2_1_0());
 		
 		// Unary expression
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescription.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescription.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescription.java	(revision 440)
@@ -13,4 +13,5 @@
 import com.framsticks.framclipse.framScript.State;
 import com.framsticks.framclipse.framScript.VariableDeclaration;
+import com.framsticks.framclipse.framScript.VariableDeclarations;
 import com.google.common.base.Predicate;
 import com.google.common.collect.Iterables;
@@ -19,7 +20,10 @@
 public class FramScriptResourceDescription extends DefaultResourceDescription {
 
+	private Resource resource;
+
 	public FramScriptResourceDescription(Resource resource,
 			IDefaultResourceDescriptionStrategy resourceDescriptionStrategy) {
 		super(resource, resourceDescriptionStrategy);
+		this.resource = resource;
 	}
 
@@ -49,5 +53,9 @@
 		if (input instanceof VariableDeclaration) {
 			VariableDeclaration dec = (VariableDeclaration) input;
-			return dec.eContainer().eContainer() instanceof Code;
+			EObject decs = dec.eContainer();
+			return decs instanceof VariableDeclarations &&
+					(decs.eContainer() instanceof Code ||
+							"inc".equals(resource.getURI().fileExtension()) &&
+							decs.eContainer().eContainer() == null);
 		}
 		return false;
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/scoping/FramScriptImportUriResolver.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/scoping/FramScriptImportUriResolver.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/scoping/FramScriptImportUriResolver.java	(revision 440)
@@ -8,12 +8,12 @@
 public class FramScriptImportUriResolver extends ImportUriResolver {
 	@Override
-	public String apply(EObject from) {
+	public String resolve(EObject from) {
 		if (from instanceof Header) {
 			Header header = (Header) from;
 			if (header.getName().equals("expdef:")) {
-				return header.getValue() + ".expdef";
+				return header.getImportURI() + ".expdef";
 			}
 		}
-		return super.apply(from);
+		return super.resolve(from);
 	}
 }
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/scoping/FramScriptScopeProvider.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/scoping/FramScriptScopeProvider.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/scoping/FramScriptScopeProvider.java	(revision 440)
@@ -20,7 +20,10 @@
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
 import org.eclipse.xtext.resource.EObjectDescription;
 import org.eclipse.xtext.resource.IEObjectDescription;
+import org.eclipse.xtext.resource.IResourceDescription;
+import org.eclipse.xtext.scoping.IGlobalScopeProvider;
 import org.eclipse.xtext.scoping.IScope;
 import org.eclipse.xtext.scoping.Scopes;
@@ -30,17 +33,25 @@
 import com.framsticks.framclipse.framScript.Block;
 import com.framsticks.framclipse.framScript.Code;
+import com.framsticks.framclipse.framScript.Expdef;
+import com.framsticks.framclipse.framScript.ForEachStatement;
+import com.framsticks.framclipse.framScript.ForStatement;
 import com.framsticks.framclipse.framScript.FramScriptFactory;
 import com.framsticks.framclipse.framScript.Function;
 import com.framsticks.framclipse.framScript.GotoStatment;
+import com.framsticks.framclipse.framScript.Header;
+import com.framsticks.framclipse.framScript.IncludeDeclaration;
 import com.framsticks.framclipse.framScript.Invocation;
 import com.framsticks.framclipse.framScript.LabeledStatement;
 import com.framsticks.framclipse.framScript.Model;
+import com.framsticks.framclipse.framScript.PropertyIncludeDeclaration;
 import com.framsticks.framclipse.framScript.ProposableFunctionImpl;
 import com.framsticks.framclipse.framScript.ProposableVariableDeclarationImpl;
 import com.framsticks.framclipse.framScript.QualifiedExpression;
+import com.framsticks.framclipse.framScript.Show;
 import com.framsticks.framclipse.framScript.Statement;
 import com.framsticks.framclipse.framScript.VariableDeclaration;
 import com.framsticks.framclipse.framScript.VariableDeclarations;
 import com.framsticks.framclipse.framScript.VariableRef;
+import com.framsticks.framclipse.resource.FramScriptResourceDescriptionManager;
 import com.framsticks.framclipse.script.ConstantProvider;
 import com.framsticks.framclipse.script.ExpressionTraverser;
@@ -54,20 +65,27 @@
  * This class contains custom scoping description.
  * 
- * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#scoping
- * on how and when to use it 
- *
+ * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
+ * on how and when to use it.
  */
 public class FramScriptScopeProvider extends AbstractDeclarativeScopeProvider {
-	
+
 	private final ConstantProvider provider;
-	
+
 	private final ExpressionTraverser traverser;
-	
+
+	@Inject
+	private IGlobalScopeProvider globalScopeProvider;
+
+	@Inject
+	private FramScriptResourceDescriptionManager descriptionManager;
+
 	private Resource resource;
-	
+
 	private Map<String, IScope> typesScopes = Maps.newHashMap();
 	private Map<Type, IScope> functionScopes = Maps.newHashMap();
 	private Map<Type, IScope> fieldScopes = Maps.newHashMap();
-	
+
+	private FramScriptImportUriResolver resolver = new FramScriptImportUriResolver();
+
 	@Inject
 	public FramScriptScopeProvider(ConstantProvider provider, ExpressionTraverser traverser) {
@@ -77,5 +95,72 @@
 		initTypes();
 	}
-	
+
+	@Override
+	public IScope getScope(EObject context, EReference reference) {
+		if (reference.getEContainingClass().getName().equals("VariableRef") &&
+				reference.getName().equals("var")) {
+			if (context instanceof VariableRef) {
+				QualifiedExpression parent = getParent((VariableRef) context);
+				if (parent != null) {
+					return getScope(parent, reference);
+				}
+				EObject object = context;
+				while (object != null && !(object.eContainer() instanceof Block ||
+						object.eContainer() instanceof ForStatement ||
+						object.eContainer() instanceof ForEachStatement)) {
+					object = object.eContainer();
+				}
+				Statement statement = (Statement) object;
+				EObject blockOrFor = object.eContainer();
+
+				if (blockOrFor instanceof Block) {
+					Block block = (Block) blockOrFor;
+					return Scopes.scopeFor(precedingDeclarations(block, statement),
+							nextValidScope(block, reference));
+				} else
+					return getScope(blockOrFor, reference);
+			} else if (context.eContainer() instanceof Block) {
+				Block block = (Block) context.eContainer();
+				List<VariableDeclaration> vars = precedingDeclarations(block, (Statement)context);
+				IScope outerScope = Scopes.scopeFor(vars, nextValidScope(block, reference));
+				if (context instanceof Block) {
+					return outerScope;
+				}
+				return new SimpleScope(outerScope,
+						super.getScope(context, reference).getAllElements());
+			}
+		}
+		return super.getScope(context, reference);
+	}
+
+	private IScope nextValidScope(EObject context, EReference ref) {
+		if (ref.getEContainingClass().getName().equals("VariableRef") &&
+				ref.getName().equals("var")) {
+			if (context instanceof Block) {
+				EObject parent = context.eContainer();
+				if (parent == null) {	// may happen in .inc files.
+					return scope_VariableRef_var((Model)context, ref);
+				}
+				if (!(parent instanceof Block)) {
+					return getScope(parent, ref);
+				}
+			}
+		}
+		return getScope(context, ref);
+	}
+
+	private List<VariableDeclaration> precedingDeclarations(Block block, Statement statement){
+		List<VariableDeclaration> vars = Lists.newArrayList();
+		for (Statement stmt : block.getStatements()) {
+			// Everything after the statement is out of scope.
+			if (stmt == statement) {
+				break;
+			} else if (stmt instanceof VariableDeclarations) {
+				vars.addAll(((VariableDeclarations) stmt).getVars());
+			}
+		}
+		return vars;
+	}
+
 	protected void initTypes() {
 		List<Function> allFunctions = Lists.newArrayList();
@@ -116,6 +201,8 @@
 			scope = scope_Invocation_function(getFunction(inv), ref);
 		}
-		scope = filterByArgumentsCount(scope, inv.getArgs().size());
-		return scope;
+		Show show = getShow(inv);
+		IScope showScope = show == null ? IScope.NULLSCOPE :
+			new SimpleScope(filterByArgumentsCount(getScope(show, ref), inv.getArgs().size()));
+		return new SimpleScope(showScope, filterByArgumentsCount(scope, inv.getArgs().size()));
 	}
 
@@ -132,5 +219,12 @@
 	}
 
-	private IScope filterByArgumentsCount(IScope scope, int size) {
+	protected IScope scope_Invocation_function(Show show, EReference ref) {
+		return addAliases(new SimpleScope(showExpdefIncludes(show, ref)));
+	}
+
+	/*
+	 * Make sure scope contains only function descriptions.
+	 */
+	private List<IEObjectDescription> filterByArgumentsCount(IScope scope, int size) {
 		List<IEObjectDescription> filtered = Lists.newArrayList();
 		for (IEObjectDescription desc : scope.getAllElements()) {
@@ -140,7 +234,7 @@
 			}
 		}
-		return new SimpleScope(filtered);
-	}
-	
+		return filtered;
+	}
+
 	private IScope addAliases(IScope scope) {
 		Iterable<IEObjectDescription> contents = scope.getAllElements();
@@ -155,29 +249,50 @@
 	}
 
-	protected IScope scope_VariableRef_var(VariableRef var, EReference ref) {
-		QualifiedExpression parent = getParent(var);
-		if (parent != null) {
-			return scope_VariableRef_var(parent, ref);
-		} else {
-			return scope_VariableRef_var(getBlock(var), ref);
-		}
-	}
-
 	protected IScope scope_VariableRef_var(QualifiedExpression var, EReference ref) {
 		Type type = traverser.getLastType(var);
 		IScope scope = fieldScopes.get(type);
-		return scope != null ? scope : IScope.NULLSCOPE;
-	}
-	
+		return new SimpleScope(nextValidScope(var.eContainer(), ref),
+				scope != null ? scope.getAllElements() : new ArrayList<IEObjectDescription>());
+	}
+
 	protected IScope scope_VariableRef_var(Block block, EReference ref) {
+		// Scope for Blocks is constructed earlier in getScope, so we stop here.
+		return IScope.NULLSCOPE;
+	}
+
+	protected IScope scope_VariableRef_var(ForStatement fs, EReference ref) {
 		List<VariableDeclaration> vars = Lists.newArrayList();
-		for (Statement stmt : block.getStatements()) {
-			if (stmt instanceof VariableDeclarations) {
-				vars.addAll(((VariableDeclarations) stmt).getVars());
-			}
-		}
-		return Scopes.scopeFor(vars, getScope(block.eContainer(), ref));
-	}
-	
+		Statement init = fs.getInit();
+		if (init instanceof VariableDeclarations) {
+			vars.addAll(((VariableDeclarations)init).getVars());
+		}
+		return Scopes.scopeFor(vars, getScope(fs.eContainer(), ref));
+	}
+
+	protected IScope scope_VariableRef_var(ForEachStatement fes, EReference ref) {
+		List<VariableDeclaration> vars = Lists.newArrayList();
+		if (fes.getDecl() == null)
+			return getScope(fes.eContainer(), ref);
+		else {
+			vars.add(fes.getDecl());
+			return Scopes.scopeFor(vars, getScope(fes.eContainer(), ref));
+		}
+	}
+
+	/*
+	 * Blocks are handled specially in getScope,
+	 * and scope_VariableRef_var(Block, EReference) returns IScope.NULLSCOPE,
+	 * which breaks the chain of scopes,
+	 * so we have to ensure each unspecified scope_VariableRef_var call
+	 * is redirected to getScope in this class, instead of super.getScope.
+	 */
+	protected IScope scope_VariableRef_var(EObject ctx, EReference ref) {
+		EObject parent = ctx.eContainer();
+		if (parent == null)
+			return IScope.NULLSCOPE;
+		else
+			return getScope(parent, ref);
+	}
+
 	protected IScope scope_VariableRef_var(Function f, EReference ref) {
 		List<VariableDeclaration> vars = Lists.newArrayList();
@@ -185,5 +300,5 @@
 		return Scopes.scopeFor(vars, getScope(f.eContainer(), ref));
 	}
-	
+
 	protected IScope scope_VariableRef_var(Code code, EReference ref) {
 		List<VariableDeclaration> vars = Lists.newArrayList();
@@ -193,9 +308,69 @@
 		return Scopes.scopeFor(vars, getScope(code.eContainer(), ref));
 	}
-	
+
+	private List<IEObjectDescription> showExpdefIncludes(Show show, EReference ref) {
+		ArrayList<IEObjectDescription> result = Lists.newArrayList();
+		// Get expdef header
+		Header expdefHeader= null;
+		for (Header h : show.getHeaders()) {
+			if ("expdef:".equals(h.getName())) {
+					expdefHeader = h;
+					break;
+			}
+		}
+		if (expdefHeader == null)
+			return result;
+		// Find resource by name
+		ResourceSet resourceSet = show.eResource().getResourceSet();
+		String expdefFile = resolver.resolve(expdefHeader);
+		Resource expdefResource = findResourceByName(resourceSet, expdefFile);
+		if (expdefResource == null)
+			return result;
+		// Mine include directives
+		ArrayList<String> included = Lists.newArrayList();
+		Expdef expdef = (Expdef) expdefResource.getContents().get(0);
+		for (PropertyIncludeDeclaration pid : expdef.getPropertyImports())
+			included.add(pid.getImportURI());
+		for (IncludeDeclaration id : expdef.getCode().getIncludes())
+			included.add(id.getImportURI());
+		// Get globals
+		for (String filename : included) {
+			Resource includedResource = findResourceByName(resourceSet, filename);
+			if (includedResource == null) {
+				String showURI = show.eResource().getURI().toString();
+				URI includeURI = URI.createURI(showURI.subSequence(
+						0, showURI.lastIndexOf("/")+1) + filename);
+				includedResource = resourceSet.getResource(
+						includeURI, true);
+				if (includedResource == null)
+					continue;
+			}
+			IResourceDescription resourceDescription =
+					descriptionManager.getResourceDescription(includedResource);
+			result.addAll(Lists.newArrayList(resourceDescription.getExportedObjectsByType(ref.getEReferenceType())));
+		}
+		return result;
+	}
+
+	private Resource findResourceByName(ResourceSet resourceSet,
+			String filename) {
+		for (Resource res : resourceSet.getResources()) {
+			if (res.getURI().toString().endsWith("/" + filename)) {
+				return res;
+			}
+		}
+		return null;
+	}
+
 	protected IScope scope_VariableRef_var(Model model, EReference ref) {
-//		IScope outerScope = delegateGetScope(model, ref).getOuterScope();
-		IScope types = typesScopes.get(getExtension(model));
-		return new SimpleScope(types.getAllElements());
+		IScope outerScope = globalScopeProvider.getScope(model.eResource(), ref, null);
+		if (model instanceof Show) {
+			outerScope = new SimpleScope(outerScope, showExpdefIncludes((Show)model, ref));
+		}
+		String ext = getExtension(model);
+		if ("inc".equals(ext))	// There is no description for .inc in XML,
+			ext = "script";	// so we pretend it is a .script.
+		IScope types = typesScopes.get(ext);
+		return new SimpleScope(outerScope, types.getAllElements());
 	}
 
@@ -211,5 +386,13 @@
 		return Scopes.scopeFor(labels);
 	}
-	
+
+	protected IScope scope_Property(Show show, EReference ref) {
+		return new SimpleScope(delegateGetScope(show, ref), showExpdefIncludes(show, ref));
+	}
+
+	protected IScope scope_State(Show show, EReference ref) {
+		return new SimpleScope(delegateGetScope(show, ref), showExpdefIncludes(show, ref));
+	}
+
 	private Function createFunction(Element element) {
 		Function function = new ProposableFunctionImpl(element);
@@ -233,5 +416,5 @@
 		return global;
 	}
-	
+
 	private VariableDeclaration createVariableDeclaration(String name) {
 		VariableDeclaration var = FramScriptFactory.eINSTANCE.createVariableDeclaration();
@@ -240,10 +423,10 @@
 		return var;
 	}
-	
+
 	private QualifiedExpression getParent(QualifiedExpression expr) {
 		EStructuralFeature feature = expr.eContainingFeature();
 		if (feature.equals(QUALIFIED_EXPRESSION__CHILD)) {
 			return (QualifiedExpression) expr.eContainer();
-		} else if (feature.equals(QUALIFIED_EXPRESSION__PARENT) 
+		} else if (feature.equals(QUALIFIED_EXPRESSION__PARENT)
 				|| feature.equals(ARRAY_ELEMENT_EXPRESSION__ARRAY)) {
 			return getParent((QualifiedExpression) expr.eContainer());
@@ -252,12 +435,5 @@
 		}
 	}
-	
-	private Block getBlock(EObject object) {
-		while (object != null && !(object instanceof Block)) {
-			object = object.eContainer();
-		}
-		return (Block) object;
-	}
-	
+
 	private Function getFunction(EObject object) {
 		while (object != null && !(object instanceof Function)) {
@@ -266,8 +442,15 @@
 		return (Function) object;
 	}
-	
+
+	private Show getShow(EObject object) {
+		while (object != null && !(object instanceof Show)) {
+			object = object.eContainer();
+		}
+		return (Show) object;
+	}
+
 	private String getExtension(EObject object) {
 		return object.eResource().getURI().fileExtension();
 	}
-	
+
 }
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/script/XMLConstantProvider.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/script/XMLConstantProvider.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/script/XMLConstantProvider.java	(revision 440)
@@ -85,5 +85,5 @@
 		for (File file : framscontext.getFiles()) {
 			String ext = file.getPattern();
-			ext = ext.substring(ext.indexOf('.') + 1, ext.length());
+			ext = ext.substring(ext.lastIndexOf('.') + 1, ext.length());
 			if (file.getCode() != null) {
 				for (Context context : file.getCode().getContexts()) {
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/script/model/Element.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/script/model/Element.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/script/model/Element.java	(revision 440)
@@ -21,5 +21,5 @@
 	@XStreamAlias("default")
 	@XStreamAsAttribute
-	private Double def;
+	private String def;
 
 	private String description;
@@ -47,5 +47,5 @@
 	}
 
-	public Double getDef() {
+	public String getDef() {
 		return def;
 	}
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/validation/FramScriptJavaValidator.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/validation/FramScriptJavaValidator.java	(revision 438)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/validation/FramScriptJavaValidator.java	(revision 440)
@@ -1,6 +1,19 @@
+/*
+ * generated by Xtext
+ */
 package com.framsticks.framclipse.validation;
 
+/**
+ * This class contains custom validation rules.
+ *
+ * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation
+ */
+public class FramScriptJavaValidator extends com.framsticks.framclipse.validation.AbstractFramScriptJavaValidator {
 
-public class FramScriptJavaValidator extends AbstractFramScriptJavaValidator {
-
+//	@Check
+//	public void checkGreetingStartsWithCapital(Greeting greeting) {
+//		if (!Character.isUpperCase(greeting.getName().charAt(0))) {
+//			warning("Name should start with a capital", MyDslPackage.Literals.GREETING__NAME);
+//		}
+//	}
 }
