Index: /experiments/frams/deathmatch/data/scripts/deathmatch-utils.inc
===================================================================
--- /experiments/frams/deathmatch/data/scripts/deathmatch-utils.inc	(revision 630)
+++ /experiments/frams/deathmatch/data/scripts/deathmatch-utils.inc	(revision 631)
@@ -56,6 +56,6 @@
   for (i = 0; i < array.size; i++)
   {
-    if (array.get(i) != null)
-      if (array.get(i).get(column) == value) return i;
+    if (array[i] != null)
+      if (array[i][column] == value) return i;
   }
   return -1;
Index: /experiments/frams/deathmatch/data/scripts/deathmatch.expdef
===================================================================
--- /experiments/frams/deathmatch/data/scripts/deathmatch.expdef	(revision 630)
+++ /experiments/frams/deathmatch/data/scripts/deathmatch.expdef	(revision 631)
@@ -184,5 +184,5 @@
     levelNumber = ExpProperties.level;
 
-  var level = levels.get(levelNumber);
+  var level = levels[levelNumber];
   Simulator.print("Level #" + (levelNumber + 1) + ": " + level[0]);
 
@@ -205,6 +205,6 @@
   food.name = "HP Box";
   food.idleen = ExpProperties.hpBoxIdleEnergy;
-  food.energ0 = ExpProperties.hpBoxStartingEnergy;
-  food.energy = food.energ0;
+  food.energy0 = ExpProperties.hpBoxStartingEnergy;
+  food.energy = food.energy0;
   food.nnenabled = 0;
 }
@@ -219,6 +219,6 @@
   weapon.name = "Weapon Box";
   weapon.idleen = ExpProperties.upgradeBoxIdleEnergy;
-  weapon.energ0 = ExpProperties.upgradeBoxStartingEnergy;
-  weapon.energy = weapon.energ0;
+  weapon.energy0 = ExpProperties.upgradeBoxStartingEnergy;
+  weapon.energy = weapon.energy0;
   weapon.nnenabled = 0;
 }
@@ -241,9 +241,15 @@
       break;
     default:
-	  cr.user1 = [0.0, 0.0]; //attack cooldown (0), bonus damage (1)
-	  cr.user2 = [0,0,0,0,0,0]; //kills (0), assists (1), total damage dealt (2), total damage received (3), HP boxes collected (4), Upgrade boxes collected (5)
-	  cr.user3 = []; //who dealt damage to this creature
-	  cr.energ0 = ExpProperties.creatureStartingEnergy;
-	  cr.energy = cr.energ0;
+      cr.data->cooldown=0.0;
+      cr.data->bonusdamage=0.0;
+      cr.data->kills=0;
+      cr.data->assists=0;
+      cr.data->damagedealt=0;
+      cr.data->damagereceived=0;
+      cr.data->hpcollected=0;
+      cr.data->upgradecollected=0;
+      cr.data->damagefrom=[]; //who dealt damage to this creature
+      cr.energy0 = ExpProperties.creatureStartingEnergy;
+      cr.energy = cr.energy0;
       place_inTeamSpot(cr);
       break;
@@ -261,6 +267,7 @@
 {
   var x, y, z;
-  x = (World.wrldsiz - cr.size_x) * Math.rnd01 - cr.size_x / 2;
-  y = (World.wrldsiz - cr.size_y) * Math.rnd01 - cr.size_y / 2;
+  var size=cr.bboxSize;
+  x = (World.wrldsiz - size.x) * Math.rnd01 - size.x / 2;
+  y = (World.wrldsiz - size.y) * Math.rnd01 - size.y / 2;
   z = WorldMap.getHeight(x, y);
 
@@ -270,5 +277,5 @@
 
   cr.rotate(0, 0, alpha_rad);
-  cr.moveAbs(x, y, z - 0.999);
+  cr.locationSetBboxLow(x, y, z - 0.999);
   
   print("Creature placed in [" + x +" " + y + " " + z);
@@ -284,6 +291,6 @@
 
   var x, y, z;
-  x = (ExpProperties.teamSpawningAreaSize) * Math.rnd01 - cr.size_x / 2 - ExpProperties.teamSpawningAreaSize/2;
-  y = (ExpProperties.teamSpawningAreaSize) * Math.rnd01 - cr.size_y / 2 - ExpProperties.teamSpawningAreaSize/2;
+  x = (ExpProperties.teamSpawningAreaSize) * Math.rnd01 - cr.bboxSize.x / 2 - ExpProperties.teamSpawningAreaSize/2;
+  y = (ExpProperties.teamSpawningAreaSize) * Math.rnd01 - cr.bboxSize.y / 2 - ExpProperties.teamSpawningAreaSize/2;
   
   //vector of length half the world size minus spawning area size
@@ -308,5 +315,5 @@
   cr.rotate(0, 0, alpha_rad);
   //place it mid-air
-  cr.moveAbs(x, y, z);
+  cr.locationSetBboxLow(x, y, z);
 
   return ;
@@ -331,5 +338,5 @@
 function writeTeamStatistics()
 {
-  var s = "" + Simulator.time + "; ";
+  var s = string(Simulator.stepNumber) + "; ";
   var total = 0.0;
   for (var i = 2; i < Populations.size; i++)
@@ -380,10 +387,13 @@
 	for (var cr in pop)
 	{
-	  if (cr.user1 != null)
+	  if (cr.data->cooldown != null)
 	  {
-	    if (cr.user1[0] > 0) cr.user1[0]=cr.user1[0] - 1;
-	    if (cr.user1[0] < 0) cr.user1[0]=0.0;
-	    if (cr.user1[1] > 0) cr.user1[1]=cr.user1[1] - ExpProperties.upgradeBoxDecay;
-	    if (cr.user1[1] < 0) cr.user1[1]=0.0;
+	    if (cr.data->cooldown > 0) cr.data->cooldown-=1;
+	    if (cr.data->cooldown < 0) cr.data->cooldown=0.0;
+	  }
+	  if (cr.data->bonusdamage != null)
+	  {
+	    if (cr.data->bonusdamage > 0) cr.data->bonusdamage-=ExpProperties.upgradeBoxDecay;
+	    if (cr.data->bonusdamage < 0) cr.data->bonusdamage=0.0;
 	  }
 	}
@@ -397,5 +407,5 @@
     if (Populations[i].size > 0) alivePop += 1;
   
-  if (alivePop == 0 && Simulator.time <= 1)
+  if (alivePop == 0 && Simulator.stepNumber <= 1)
   {
     onExpInit(); //do initialization for user, because he forgot to do so
@@ -417,6 +427,6 @@
 		{
 		  //f.writeString("Creature name; Team; Kills; Assists; Total damage dealt; Total damage received; HP boxes collected; Upgrade boxes collected; Lifespan");
-		  if (cr.user2 != null)
-		    f.writeString(cr.name + "; " + pop.name + "; " + cr.user2[0] + "; " + cr.user2[1] + "; " + cr.user2[2] + "; " + cr.user2[3] + "; " + cr.user2[4] + "; " + cr.user2[5] + "; " + cr.lifespan + "\n");
+		  if (cr.data->kills != null)
+		    f.writeString(cr.name + "; " + pop.name + "; " + cr.data->kills + "; " + cr.data->assists + "; " + cr.data->damagedealt + "; " + cr.data->damagereceived + "; " + cr.data->hpcollected + "; " + cr.data->upgradecollected + "; " + cr.lifespan + "\n");
 		}
 
@@ -490,6 +500,6 @@
   var energy1 = 0.0 + ExpProperties.creatureDamage * dice1;
   var energy2 = 0.0 + ExpProperties.creatureDamage * dice2;
-  energy1 += ExpProperties.upgradeMultiplier * c1.user1.get(1);
-  energy2 += ExpProperties.upgradeMultiplier * c2.user1.get(1);
+  energy1 += ExpProperties.upgradeMultiplier * c1.data->bonusdamage;
+  energy2 += ExpProperties.upgradeMultiplier * c2.data->bonusdamage;
   if (c1.population == c2.population)
   {
@@ -498,12 +508,8 @@
   }
   
-  if (c1.user1 == null) stop("3");
-  if (c1.user2 == null) stop("3");
-  if (c1.user3 == null) stop("3");
-  if (c2.user1 == null) stop("3");
-  if (c2.user2 == null) stop("3");
-  if (c2.user2 == null) stop("3");
-  
-  if (c2.user1[0] <= 0 && energy2 > 0)
+  if (c1.data->cooldown == null) stop("3");
+  if (c2.data->cooldown == null) stop("3");
+  
+  if (c2.data->cooldown <= 0 && energy2 > 0)
   {
     changed = 1;
@@ -511,31 +517,31 @@
     c1.energy = c1.energy - energy2;
 	if (c1.energy < 0) c1.energy = 0;
-    print(c2.name + " [" + c2.population.name + "] rolled " + dice2 + " and dealt " + energy2 + " [+" + (ExpProperties.upgradeMultiplier * c2.user1[1]) +" bonus] damage to " + c1.name + " [" + c1.population.name + "]");
-	c2.user1.set(0, ExpProperties.attackCooldown);
-	c2.user2.set(2, c2.user2[2] + energy1);
-	c1.user2.set(3, c1.user2[3] + energy1);
+    print(c2.name + " [" + c2.population.name + "] rolled " + dice2 + " and dealt " + energy2 + " [+" + (ExpProperties.upgradeMultiplier * c2.data->bonusdamage) +" bonus] damage to " + c1.name + " [" + c1.population.name + "]");
+	c2.data->cooldown = ExpProperties.attackCooldown;
+	c2.data->damagedealt += energy1;
+	c1.data->damagereceived += energy1;
 	var vect = [c2.uid,c2.name];
-	var arrindex = arrayContains(c1.user3, 0, c2.uid);
+	var arrindex = arrayContains(c1.data->damagefrom, 0, c2.uid);
 	if (arrindex != -1)
 	{
-	  vect.add(energy2 + c1.user3[arrindex][2]);
-	  c1.user3[arrindex]=vect;
+	  vect.add(energy2 + c1.data->damagefrom[arrindex][2]);
+	  c1.data->damagefrom[arrindex]=vect;
 	}
 	else
 	{
 	  vect.add(energy2);
-	  if (c1.user3 == null) c1.user3 = Vector.new();
-	  c1.user3.add(vect);
+	  if (c1.data->damagefrom == null) c1.data->damagefrom = [];
+	  c1.data->damagefrom.add(vect);
 	  if (c1.energy > 0)
-            c2.user2[1] = c2.user2[1] + 1; //increase assists statistic
+            c2.data->assists += 1; //increase assists statistic
 	}
 	if (c1.energy <= 0)
 	{
-	  c2.user2[0] = c2.user2[0] + 1; //increase kills statistic
+	  c2.data->kills += 1; //increase kills statistic
 	  kill_c1 = 1;
 	}
   }
   
-  if (c1.user1[0] <= 0 && energy1 > 0)
+  if (c1.data->cooldown <= 0 && energy1 > 0)
   {
     changed = 1;
@@ -543,30 +549,30 @@
     c2.energy = c2.energy - energy1;
 	if (c2.energy < 0) c2.energy = 0;
-    print(c1.name + " [" + c1.population.name + "] rolled " + dice1 + " and dealt " + energy1 + " [+" + (ExpProperties.upgradeMultiplier * c1.user1[1]) +" bonus] damage to " + c2.name + " [" + c2.population.name + "]");
-    c1.user1[0] = ExpProperties.attackCooldown;
-	c1.user2[2] = c1.user2[2] + energy1;
-	c2.user2[3] = c2.user2[3] + energy1;
+    print(c1.name + " [" + c1.population.name + "] rolled " + dice1 + " and dealt " + energy1 + " [+" + (ExpProperties.upgradeMultiplier * c1.data->bonusdamage) +" bonus] damage to " + c2.name + " [" + c2.population.name + "]");
+    c1.data->cooldown = ExpProperties.attackCooldown;
+	c1.data->damagedealt += energy1;
+	c2.data->damagereceived += energy1;
 	var vect = Vector.new();
 	vect.add(c1.uid);
 	vect.add(c1.name);
-	var arrindex = arrayContains(c2.user3, 0, c1.uid);
+	var arrindex = arrayContains(c2.data->damagefrom, 0, c1.uid);
 	if (arrindex != -1)
 	{
-	  vect.add(energy1 + c2.user3[arrindex][2]);
-	  c2.user3[arrindex] = vect;
+	  vect.add(energy1 + c2.data->damagefrom[arrindex][2]);
+	  c2.data->damagefrom[arrindex] = vect;
 	}
 	else
 	{
 	  vect.add(energy1);
-	  if (c2.user3 == null) c2.user3 = Vector.new();
-	  c2.user3.add(vect);
+	  if (c2.data->damagefrom == null) c2.data->damagefrom = [];
+	  c2.data->damagefrom.add(vect);
 	  if (c2.energy > 0)
 	  {
-        c1.user2[1] = c1.user2[1] + 1; //increase assists statistic
+        c1.data->assists += 1; //increase assists statistic
 	  }
 	}
 	if (c2.energy <= 0)
 	{
-	  c1.user2[0] = c1.user2[0] + 1; //increase kills statistic
+	  c1.data->kills += 1; //increase kills statistic
 	  kill_c2 = 1;
 	}
@@ -592,7 +598,6 @@
   //collect HP Box (by eating it :D)
   print(Collision.Creature2.name + " [" + Collision.Creature2.population.name + "] picked a HP box");
-  Collision.Creature2.user2[4] = Collision.Creature2.user2[4] + 1;
-  Collision.Creature1.energy_m += Collision.Creature1.energy;
-  Collision.Creature2.energy_p += Collision.Creature1.energy;
+  Collision.Creature2.data->hpcollected += 1; 
+  Collision.Creature1.transferEnergyTo(Collision.Creature2,Collision.Creature1.energy);
   
   //kill HP Box
@@ -609,7 +614,7 @@
   //collect Upgrade Box (by eating it :D)
   print(Collision.Creature2.name + " [" + Collision.Creature2.population.name + "] picked an upgrade box");
-  Collision.Creature2.user2[5] = Collision.Creature2.user2[5] + 1;
-  Collision.Creature1.energy_m += Collision.Creature1.energy;
-  Collision.Creature2.user1[1] = Collision.Creature2.user1[1] + Collision.Creature1.energy;
+  Collision.Creature2.data->upgradecollected += 1;
+  Collision.Creature2.data->bonusdamage += Collision.Creature1.energy;
+  Collision.Creature1.energy = 0;
   
   //kill Upgrade Box
@@ -628,10 +633,10 @@
 
   print(cr.name + " was killed");
-  for (var dam in cr.user3)
+  for (var dam in cr.data->damagefrom)
     print(dam[1] + " dealt " + dam[2] + " damage");
   
   var f=File.appendDirect("creatures"+battleNumber+".txt","Creature statistics");
   //f.writeString("Creature name; Team; Kills; Assists; Total damage dealt; Total damage received; HP boxes collected; Upgrade boxes collected; Lifespan");
-  f.writeString(cr.name + "; " + cr.population.name + "; " + cr.user2[0] + "; " + cr.user2[1] + "; " + cr.user2[2] + "; " + cr.user2[3] + "; " + cr.user2[4] + "; " + cr.user2[5] + "; " + cr.lifespan + "\n");
+  f.writeString(cr.name + "; " + cr.population.name + "; " + cr.data->kills + "; " + cr.data->assists + "; " + cr.data->damagedealt + "; " + cr.data->damagereceived + "; " + cr.data->hpcollected + "; " + cr.data->upgradecollected + "; " + cr.lifespan + "\n");
   f.close();
   
