Index: /java/FramclipsePlugin/src/main/resources/framscript.xml
===================================================================
--- /java/FramclipsePlugin/src/main/resources/framscript.xml	(revision 416)
+++ /java/FramclipsePlugin/src/main/resources/framscript.xml	(revision 417)
@@ -6,5 +6,5 @@
 		<element name="name" type="string"/>
 		<element name="info" type="string"/>
-		<element name="code" type="string"/>
+		<element name="code" type="string" flags="16384"/>
 		<element name="neurons" type="string"/>
 	</type>
@@ -30,5 +30,5 @@
 		<element name="name" type="string" flags="19"/>
 		<element name="info" type="string" flags="19"/>
-		<element name="code" type="string" flags="35"/>
+		<element name="code" type="string" flags="16419"/>
 		<element name="streload" function="true" flags="2"/>
 		<element name="rebuild" function="true" flags="34"/>
@@ -45,5 +45,5 @@
 		<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="34"/>
+		<element name="code" type="string" flags="16418"/>
 		<element name="expdef" type="string" flags="34"/>
 		<element name="reload" function="true" flags="2"/>
@@ -68,4 +68,7 @@
 			<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">
@@ -73,5 +76,5 @@
 		<element name="longname" type="string"/>
 		<element name="description" type="string"/>
-		<element name="code" type="string"/>
+		<element name="code" type="string" flags="16384"/>
 		<element name="prefinputs" type="integer"/>
 		<element name="prefoutput" type="integer" min="0" max="1"/>
@@ -82,5 +85,5 @@
 	<type name="script" context="script file">
 		<element name="name" type="string"/>
-		<element name="code" type="string"/>
+		<element name="code" type="string" flags="16384"/>
 		<element name="help" type="string"/>
 		<element name="group" type="string"/>
@@ -126,5 +129,6 @@
 		<element name="gnum" type="integer"/>
 		<element name="buildproblems" type="integer" flags="34"/>
-		<element name="energ0" type="float"/>
+		<element name="energ0" type="float" deprecated="true" flags="8226"/>
+		<element name="energy0" type="float"/>
 		<element name="idleen" type="float"/>
 		<element name="energy" type="float"/>
@@ -293,6 +297,10 @@
 			</arguments>
 		</element>
-		<element name="selfmask" type="integer" min="0" max="2147483647" default="0" flags="32"/>
-		<element name="othermask" type="integer" min="0" max="2147483647" default="0" flags="32"/>
+		<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>
@@ -399,5 +407,5 @@
 		</element>
 		<element name="gnum" type="integer"/>
-		<element name="energ0" type="float"/>
+		<element name="energy0" type="float"/>
 		<element name="idleen" type="float"/>
 		<element name="energy" type="float"/>
@@ -440,17 +448,31 @@
 			<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"/>
-		<element name="othermask" type="integer" min="0" max="2147483647" default="0" flags="32"/>
+		<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 (the sequence of elements is not preserved).
-Example:
-var d=Dictionary.new(); d.set("name","John"); d.set("age",44);
-var i;
-for(i=0;i<d.size;i++) Simulator.print(d.getKey(i)+" is "+d.get(i));]]></description>
+<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"/>
@@ -458,4 +480,6 @@
 		</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"/>
@@ -463,4 +487,5 @@
 		</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"/>
@@ -468,4 +493,6 @@
 		</element>
 		<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"/>
@@ -473,11 +500,13 @@
 			</arguments>
 		</element>
-		<element name="find" function="true" type="string" flags="256">
-			<description><![CDATA[returns the element key or null if not found]]></description>
+		<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"><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"/>
 	</type>
@@ -610,5 +639,9 @@
 	</type>
 	<type name="GenePool" context="Global context">
-<description><![CDATA[GenePool objects are accessed by GenePools[index], or Genotype.genepool and created by GenePools.addGroup(). Usage of the static GenePool object is no longer recommended. See also: 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"/>
@@ -616,6 +649,9 @@
 			<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" flags="3">
-			<description><![CDATA[Takes into account the Genotype.instances field (which may give the total number of instances depending on the experiment definition).]]></description>
+		<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">
@@ -639,7 +675,7 @@
 		</element>
 		<element name="findGeno" function="true" type="integer" deprecated="true" flags="8226">
-			<description><![CDATA[Finds the Genotype matching the supplied Geno object.
-returns genotype index or -1 if not found.
-Deprecated. Use the more versatile find() instead of this function.]]></description>
+			<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"/>
@@ -647,6 +683,6 @@
 		</element>
 		<element name="findGenotype" function="true" type="Genotype" flags="34">
-			<description><![CDATA[Finds the Genotype matching the supplied Genotype object, Geno object, or genotype string.
-returns genotype object or null if not found.]]></description>
+			<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"/>
@@ -661,5 +697,5 @@
 			<description><![CDATA[Creates a new Genotype from the supplied Geno object.
 Returns the created Genotype.
-Deprecated. Use the more versatile add() instead of this function.]]></description>
+Deprecated. Use the more versatile GenePool.add() instead of this function.]]></description>
 			<arguments>
 				<argument type="Geno"/>
@@ -668,5 +704,5 @@
 		<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 add() instead of this function.]]></description>
+Deprecated. Use the more versatile GenePool.add() instead of this function.]]></description>
 			<arguments>
 				<argument name="genotype" type="Geno"/>
@@ -674,6 +710,6 @@
 		</element>
 		<element name="createFromString" function="true" type="Genotype" deprecated="true" flags="8226">
-			<description><![CDATA[Uses the supplied string argument
-Deprecated. Use the more versatile add() instead of this function.]]></description>
+			<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"/>
@@ -742,8 +778,8 @@
 <arguments/></element>
 		<element name="mergeInstances" function="true" type="void" flags="34">
-			<description><![CDATA[Merge instances of the same genotype]]></description>
+			<description><![CDATA[Merges instances of the same genotype.]]></description>
 <arguments/></element>
 		<element name="splitInstances" function="true" type="void" flags="34">
-			<description><![CDATA[Split genotype instances]]></description>
+			<description><![CDATA[Splits genotype instances.]]></description>
 <arguments/></element>
 		<element name="iterator" type="Object" flags="291"/>
@@ -766,19 +802,25 @@
 			</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.
-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>
+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>
@@ -861,8 +903,10 @@
 		</element>
 		<element name="findGenotype" function="true" type="integer" deprecated="true" flags="8226">
-			<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>
+			<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 matching the selected creature.]]></description>
+			<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">
@@ -1460,6 +1504,9 @@
 			<description><![CDATA[Genotype format]]></description>
 		</element>
-		<element name="genotype" type="string" flags="257"/>
-		<element name="isValid" type="integer" min="0" max="1" flags="257"/>
+		<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"/>
+		<element name="is_valid" type="integer" min="-1" max="1" default="-1" flags="256"/>
 		<element name="getConverted" function="true" type="Geno" flags="256">
 			<arguments>
@@ -1496,5 +1543,7 @@
 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"/>
+		<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>
@@ -1505,17 +1554,20 @@
 http://www.framsticks.com/node/890]]></description>
 		</element>
-		<element name="energ0" type="float" flags="3"/>
-		<element name="strsiz" type="float" flags="35"/>
-		<element name="strjoints" type="float" flags="35"/>
-		<element name="nnsiz" type="float" flags="35"/>
-		<element name="nncon" type="float" flags="35"/>
-		<element name="numparts" type="float" flags="3"/>
-		<element name="numjoints" type="float" flags="3"/>
-		<element name="numneurons" type="float" flags="3"/>
-		<element name="numconnections" type="float" flags="3"/>
+		<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" flags="32"/>
-		<element name="instances" type="integer" flags="2">
+		<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>
@@ -1541,5 +1593,6 @@
 		<element name="user3" type="untyped"/>
 		<element name="mutate" function="true" type="void"><arguments/></element>
-		<element name="isValid" type="integer" min="0" max="1" flags="35"/>
+		<element name="isValid" type="integer" min="0" max="1" deprecated="true" flags="8227"/>
+		<element name="is_valid" type="integer" min="-1" max="1" default="-1" flags="32"/>
 		<element name="getNormalized" function="true" type="float" flags="35">
 			<arguments>
@@ -1548,5 +1601,5 @@
 		</element>
 		<element name="geno" type="Geno" flags="35">
-			<description><![CDATA[Geno object for this Genotype]]></description>
+			<description><![CDATA[A Geno object for this Genotype]]></description>
 		</element>
 		<element name="uid" type="string" flags="33">
@@ -1599,4 +1652,6 @@
 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">
@@ -1986,7 +2041,4 @@
 http://www.framsticks.com/node/795
 http://www.framsticks.com/node/890]]></description>
-		<element name="simil_method" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[]]></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>
@@ -1995,5 +2047,8 @@
 			<description><![CDATA[]]></description>
 		</element>
-		<element name="simil_neuro" type="float" min="0" max="100" default="0.5">
+		<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>
@@ -2735,5 +2790,7 @@
 	</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>
+<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"/>
@@ -2749,5 +2806,5 @@
 		</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>
+			<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">
@@ -2763,6 +2820,6 @@
 			<description><![CDATA[Stabilization means no significant movement during a specified period of time.]]></description>
 		</element>
-		<element name="colmask" type="integer" min="0" max="65535" default="0" flags="32">
-			<description><![CDATA[DEPRECATED. You should use selfmask and othermask (these masks are also much easier to understand than the old colmask field).]]></description>
+		<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">
@@ -2782,16 +2839,16 @@
 
 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: 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 (the result falls into 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>
@@ -2856,11 +2913,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"/>
@@ -2911,17 +2969,23 @@
 			</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.
+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]);
+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>
@@ -3073,4 +3137,5 @@
 	</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>
@@ -3172,11 +3237,11 @@
 		<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)
+	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>
@@ -3279,7 +3344,5 @@
 			<description><![CDATA[Creatures grown with warnings will not be simulated.]]></description>
 		</element>
-		<element name="importchk" type="integer" min="0" max="1"/>
-		<element name="loadchk" type="integer" min="0" max="1"/>
-		<element name="groupchk" type="integer" min="0" max="1"/>
+		<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">
@@ -3298,4 +3361,5 @@
 		<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>
@@ -3307,4 +3371,7 @@
 			<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="clear" function="true" flags="34"/>
 		<element name="add" function="true" flags="34"/>
@@ -4191,7 +4258,4 @@
    time (t) float 0..6.28319]]></description>
 		</element>
-		<element name="simil_method" type="integer" min="0" max="1" default="0">
-			<description><![CDATA[]]></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>
@@ -4200,5 +4264,8 @@
 			<description><![CDATA[]]></description>
 		</element>
-		<element name="simil_neuro" type="float" min="0" max="100" default="0.5">
+		<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>
@@ -4324,11 +4391,11 @@
 		<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)
+	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>
@@ -4431,7 +4498,5 @@
 			<description><![CDATA[Creatures grown with warnings will not be simulated.]]></description>
 		</element>
-		<element name="importchk" type="integer" min="0" max="1"/>
-		<element name="loadchk" type="integer" min="0" max="1"/>
-		<element name="groupchk" type="integer" min="0" max="1"/>
+		<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">
@@ -4450,4 +4515,5 @@
 		<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>
@@ -4459,4 +4525,7 @@
 			<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>
 	</type>
 	<type name="SlaveSimulators" context="Global context">
@@ -4846,8 +4915,15 @@
 	</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>
+<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"/>
@@ -4858,4 +4934,5 @@
 		</element>
 		<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"/>
@@ -4863,4 +4940,5 @@
 		</element>
 		<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"/>
@@ -5261,5 +5339,7 @@
 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"/>
+		<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>
@@ -5270,17 +5350,20 @@
 http://www.framsticks.com/node/890]]></description>
 		</element>
-		<element name="energ0" type="float" flags="3"/>
-		<element name="strsiz" type="float" flags="35"/>
-		<element name="strjoints" type="float" flags="35"/>
-		<element name="nnsiz" type="float" flags="35"/>
-		<element name="nncon" type="float" flags="35"/>
-		<element name="numparts" type="float" flags="3"/>
-		<element name="numjoints" type="float" flags="3"/>
-		<element name="numneurons" type="float" flags="3"/>
-		<element name="numconnections" type="float" flags="3"/>
+		<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" flags="32"/>
-		<element name="instances" type="integer" flags="2">
+		<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>
@@ -5306,5 +5389,6 @@
 		<element name="user3" type="untyped"/>
 		<element name="mutate" function="true" type="void"><arguments/></element>
-		<element name="isValid" type="integer" min="0" max="1" flags="35"/>
+		<element name="isValid" type="integer" min="0" max="1" deprecated="true" flags="8227"/>
+		<element name="is_valid" type="integer" min="-1" max="1" default="-1" flags="32"/>
 		<element name="getNormalized" function="true" type="float" flags="35">
 			<arguments>
@@ -5313,5 +5397,5 @@
 		</element>
 		<element name="geno" type="Geno" flags="35">
-			<description><![CDATA[Geno object for this Genotype]]></description>
+			<description><![CDATA[A Geno object for this Genotype]]></description>
 		</element>
 		<element name="uid" type="string" flags="33">
@@ -5364,4 +5448,6 @@
 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">
@@ -5384,5 +5470,6 @@
 		<element name="gnum" type="integer"/>
 		<element name="buildproblems" type="integer" flags="34"/>
-		<element name="energ0" type="float"/>
+		<element name="energ0" type="float" deprecated="true" flags="8226"/>
+		<element name="energy0" type="float"/>
 		<element name="idleen" type="float"/>
 		<element name="energy" type="float"/>
@@ -5551,6 +5638,10 @@
 			</arguments>
 		</element>
-		<element name="selfmask" type="integer" min="0" max="2147483647" default="0" flags="32"/>
-		<element name="othermask" type="integer" min="0" max="2147483647" default="0" flags="32"/>
+		<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>
@@ -5954,5 +6045,5 @@
 		<element name="name" type="string" flags="19"/>
 		<element name="info" type="string" flags="19"/>
-		<element name="code" type="string" flags="35"/>
+		<element name="code" type="string" flags="16419"/>
 		<element name="streload" function="true" flags="2"/>
 		<element name="rebuild" function="true" flags="34"/>
@@ -6379,5 +6470,5 @@
 		<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="34"/>
+		<element name="code" type="string" flags="16418"/>
 		<element name="expdef" type="string" flags="34"/>
 		<element name="reload" function="true" flags="2"/>
@@ -6401,4 +6492,7 @@
 		<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"/>
@@ -6448,6 +6542,6 @@
 		<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="360" default="30.0"/>
-		<element name="cam_h" type="float" min="0" max="360" default="45.0">
+		<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>
@@ -6483,4 +6577,10 @@
 		</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="Command line interface">
@@ -6488,5 +6588,5 @@
 		<element name="name" type="string" flags="19"/>
 		<element name="info" type="string" flags="19"/>
-		<element name="code" type="string" flags="35"/>
+		<element name="code" type="string" flags="16419"/>
 		<element name="streload" function="true" flags="2"/>
 		<element name="rebuild" function="true" flags="34"/>
