Index: /cpp/frams/Makefile-SDK-files
===================================================================
--- /cpp/frams/Makefile-SDK-files	(revision 472)
+++ /cpp/frams/Makefile-SDK-files	(revision 473)
@@ -25,5 +25,6 @@
 STDOUT_LOGGER_OBJS=common/virtfile/virtfile.o common/loggers/loggertostdout.o common/console.o 
 
-SDK_LIB_OBJS= $(STDOUT_LOGGER_OBJS) $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) $(GEOMETRY_OBJS)
+GENOTYPE_LOADER_OBJS=frams/_demos/genotypeloader.o frams/param/multiparamload.o
+SDK_LIB_OBJS= $(STDOUT_LOGGER_OBJS) $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) $(GEOMETRY_OBJS) $(GENOTYPE_LOADER_OBJS) common/virtfile/stdiofile.o
 
 #### sdk_tests
Index: /cpp/frams/_demos/genotypeloader.cpp
===================================================================
--- /cpp/frams/_demos/genotypeloader.cpp	(revision 472)
+++ /cpp/frams/_demos/genotypeloader.cpp	(revision 473)
@@ -8,8 +8,38 @@
 ParamEntry minigenotype_paramtab[]=
  {
- {"Genotype",1,3,"org",},
+ {"Genotype",1,21,"org",},
+
  {"name",0,0,"Name","s 0 40",FIELD(name),},
  {"genotype",0,0,"Genotype","s 1",FIELD(genotype),},
  {"info",0,0,"Info","s 1",FIELD(info),},
+
+ {"energy0",0,0,"Starting energy","f 0 -1 0",FIELD(energy0),},
+ {"numparts",0,0,"Body parts","d",FIELD(numparts),},
+ {"numjoints",0,0,"Body joints","d",FIELD(numjoints),},
+ {"numneurons",0,0,"Brain size","d",FIELD(numneurons),},
+ {"numconnections",0,0,"Brain connections","d",FIELD(numconnections),},
+
+ {"num",0,0,"Ordinal number","d",FIELD(ordnumber),},
+ {"gnum",0,0,"Generation","d",FIELD(generation),},
+
+ {"instances",0,0,"Instances","d",FIELD(instances),"Copies of this genotype",},
+
+ {"lifespan",0,0,"Life span","f",FIELD(lifespan),"Average life span",},
+ {"velocity",0,0,"Velocity","f",FIELD(velocity),"Average velocity",},
+ {"distance",0,0,"Distance","f",FIELD(distance),},
+ {"vertvel",0,0,"Vertical velocity","f",FIELD(vertvel),},
+ {"vertpos",0,0,"Vertical position","f",FIELD(vertpos),},
+
+ {"user1",0,0,"User field 1","x",FIELD(user1),},
+ {"user2",0,0,"User field 2","x",FIELD(user2),},
+ {"user3",0,0,"User field 3","x",FIELD(user3),},
+
+ {"is_valid",0,0,"Validity","d -1 1 -1",FIELD(is_valid),
+ "0 = invalid genotype\n"
+ "1 = valid genotype\n"
+  "-1 = validity is not known."},
+
+ {"uid",0,0,"#","s",FIELD(uid),"Unique identifier"},
+
  {0,0,0,},
 };
Index: /cpp/frams/_demos/genotypeloader.h
===================================================================
--- /cpp/frams/_demos/genotypeloader.h	(revision 472)
+++ /cpp/frams/_demos/genotypeloader.h	(revision 473)
@@ -9,16 +9,4 @@
 #include <frams/param/multiparamload.h>
 
-/** Helper class, mostly useful with MultiParamLoader
-    or its specialized version: MiniGenotypeLoader.
-    MiniGenotype stores 3 essential fields of the Genotype (name, gene and info)
- */
-class MiniGenotype
-{
-public:
-SString name,genotype,info;
-void clear() {name=""; genotype=""; info="";}
-};
-
-
 /** Defines the association between "org:" object (found in genotype files)
     and the MiniGenotype fields. MiniGenotypeLoader uses this definition
@@ -27,4 +15,17 @@
 extern ParamEntry minigenotype_paramtab[];
 
+/** Helper class, mostly useful with MultiParamLoader
+    or its specialized version: MiniGenotypeLoader.
+    MiniGenotype stores the subset of Genotype fields (the ones normally saved in .gen files)
+ */
+class MiniGenotype
+{
+public:
+SString name,genotype,info,uid;
+double energy0,lifespan,velocity,distance,vertvel,vertpos;
+paInt numparts,numjoints,numneurons,numconnections,ordnumber,generation,instances,is_valid;
+ExtValue user1,user2,user3;
+void clear() {Param p(minigenotype_paramtab,this); p.setDefault();}
+};
 
 /** In most simple cases this is the class you would use to load a series of genotypes from
Index: /cpp/frams/_demos/loader_test.cpp
===================================================================
--- /cpp/frams/_demos/loader_test.cpp	(revision 472)
+++ /cpp/frams/_demos/loader_test.cpp	(revision 473)
@@ -17,6 +17,6 @@
 if (argc<2)
 	{
-	fprintf(stderr,"Arguments: filename [optional: genotype name or index (1-based)]\n"
-	     "If a genotype is indicated (by providing the optional genotype identifier), the program will output the raw genotype, suitable for Framsticks Theater's genotype viewer mode. If the second optional argument is not given, the genotype names from the file will be listed.\n"
+	fprintf(stderr,"Arguments: filename [genotype name or index (1-based) [field name]]\n"
+	     "If a genotype is indicated (by providing the optional genotype identifier), the program will output the raw genotype, suitable for Framsticks Theater's genotype viewer mode. If a genotype and a field name is given, the field value (instead of the raw genotype) is printed. If the second argument is not given, the genotype names from the file will be listed.\n"
 	     "Example: loader_test walking.gen \"Basic Quadruped\" | theater -g -\n"
 		);
@@ -28,4 +28,5 @@
 MiniGenotypeLoader loader(argv[1]);
 const char* selected=(argc<3)?NULL:argv[2];
+const char* field_name=(argc<4)?NULL:argv[3];
 int selected_index=(selected&&isdigit(selected[0]))?atol(selected):0;
 // using char* constructor (passing the file name to open)
@@ -48,5 +49,18 @@
 				continue;
 			}
-		puts(loaded->genotype.c_str());
+		if (field_name)
+			{
+			Param p(minigenotype_paramtab,loaded);
+			int field_index=p.findId(field_name);
+			if (field_index<0)
+				{
+				printf("Field '%s' not found\n",field_name);
+				return 3;
+				}
+			else
+				puts(p.get(field_index).c_str());
+				}
+			else
+				puts(loaded->genotype.c_str());
 		return 0;
 		}
