source: experiments/frams/deathmatch/data/scripts/deathmatch.expdef @ 570

Last change on this file since 570 was 537, checked in by Maciej Komosinski, 8 years ago

ExpParams? -> ExpProperties? (compatibility with v5.x)

File size: 21.8 KB
RevLine 
[231]1expdef:
2name:Deathmatch
3info:~
4This experiment simulates a team deathmatch. It means that framstick creatures are grouped in teams and the basic rule is: "My team vs WORLD!".
5
6The basic battle rules and collectibles are implemented. Statistics for the battle are saved to text files in CSV format: creatures.txt, teams.txt.
7
8For more information, see  http://www.framsticks.com/deathmatch
9~
10code:~
11
12//Author: Mateusz Cicheñski @ Poznan University of Technology, 2012
13
14@include "deathmatch-utils.inc"
15@include "deathmatch-levels.inc"
16
17global idleSimulationSteps;
18global battleNumber;
19global teams;
20
21function onExpDefLoad()
22{
23  idleSimulationSteps = 0;
24  battleNumber = 0;
25  initLevels();
26  initPopulations();
27 
[233]28  Shapes.set("1p_weaponbox","""//0
29p:-0.5, -0.5, -0.5
30p: 0.5, -0.5, -0.5
31p: 0.5, 0.5, -0.5
32p: -0.5, 0.5, -0.5
33p:-0.5, -0.5, 0.5
34p:0.5, -0.5, 0.5
35p:0.5, 0.5, 0.5
36p:-0.5, 0.5, 0.5
37j: 0,1
38j: 1,2
39j: 2,3
40j: 3,0
41j: 4,5
42j: 5,6
43j: 6,7
44j: 7,4
45j: 0,4
46j: 1,5
47j: 2,6
48j: 3,7""", 0x0FAA0F);
[231]49 
[233]50  Shapes.set("1p_hpbox","""//0
51p:-0.5, -0.5, -0.5
52p: 0.5, -0.5, -0.5
53p: 0.5, 0.5, -0.5
54p: -0.5, 0.5, -0.5
55p:-0.5, -0.5, 0.5
56p:0.5, -0.5, 0.5
57p:0.5, 0.5, 0.5
58p:-0.5, 0.5, 0.5
59j: 0,1
60j: 1,2
61j: 2,3
62j: 3,0
63j: 4,5
64j: 5,6
65j: 6,7
66j: 7,4
67j: 0,4
68j: 1,5
69j: 2,6
70j: 3,7""", 0xAA0F0F);
[231]71}
72
73function initPopulations()
74{
75  //clear anything in populations
76  Populations.clear();
77 
78  //add Food population (group 0)
[233]79  var p=Populations[0];
80  p.name = "Food";
81  p.nnsim = 0;
82  p.enableperf = 0;
83  p.death = 1;
84  p.energy = 1;
85  p.selfmask = 0x20002;
86  p.othermask = 0x10002;
[231]87 
88  //add Weapon Upgrade population (group 1)
[233]89  p=Populations.addGroup("Upgrades");
90  p.nnsim = 0;
91  p.enableperf = 0;
92  p.death = 1;
93  p.energy = 1;
94  p.selfmask = 0x20002;
95  p.othermask = 0x10002;
[231]96
97  //add Teams populations (group above 2)
98  var i = 0;
[480]99  teams = ExpProperties.teamCount;
[233]100  if (teams == 1)
101        teams = GenePools[0].size;
[231]102  for (i = 0; i < teams; i++)
103  {
[233]104    p=Populations.addGroup("Team "+i);
105    p.nnsim = 1;
106    p.enableperf = 1;
107    p.death = 0;
108    p.energy = 1;
109    p.selfmask = 0x50001;
110    p.othermask = 0x60001;
[231]111  }
112 
113  //Collisions on 32 bit mask:
114  // standard - rebound creatures => if lower bits 0xFFFF
115  // custom - custom function handler => if higher bits 0xFFFF0000
116  //Collisions map:
117  // Food vs Food = 0x20002 & 0x10002 = 2 - standard
118  // Upgrades vs Upgrades = 0x20002 & 0x10002 = 2 - standard
119  // Team X vs Team X = 0x50001 & 0x60001 = 0x40001 - standard + custom
120  // Team X vs Team Y = 0x50001 & 0x60001 = 0x40001 - standard + custom
121  // Food vs Upgrades = 0x20002 & 0x10002 = 2 - standard
122  // Food vs Team X = 0x20002 & 0x60001 = 0x20000 || 0x50001 & 0x10002 = 0x10000 - custom
123  // Upgrades vs Team X = 0x20002 & 0x60001 = 0x20000 || 0x50001 & 0x10002 = 0x10000 - custom
124}
125
126function initCreatures()
127{
[233]128  for (var i = 0; i < Populations.size - 2; i++)
[231]129  {
[480]130        for (var j = 0; j < ExpProperties.teamSize; j++)
[231]131        {
[233]132          var g; //Genotype object
[480]133          if (ExpProperties.teamCount != 1)
[233]134            g = GenePools[0].random();
[231]135          else
[233]136            g = GenePools[0][i];
137          Populations[i+2].add(g).name = "Member " + j;
[231]138        }
139  }
140}
141
142function onExpInit()
143{
144  battleNumber = 0;
145  initAll();
146}
147
148function initAll()
149{
150  idleSimulationSteps = 0;
151  battleNumber += 1;
152  initLevel();
153  initPopulations();
154  initCreatures();
155  initFiles();
156  writeTeamStatistics();
157}
158
159function initFiles()
160{
161  var f=File.createDirect("creatures"+battleNumber+".txt","Creature statistics");
162  f.writeString("#Creature name; Team; Kills; Assists; Total damage dealt; Total damage received; HP boxes collected; Upgrade boxes collected; Lifespan\n");
163  f.close();
164 
165  var s = "#Time interval; ";
[233]166  for (var i = 0; i < Populations.size - 2; i++)
[231]167  {
168    s += "Team " + i + "; ";
169        s += "Team members; ";
170  }
171  s += "Total energy\n";
172 
173  var f=File.createDirect("teams"+battleNumber+".txt","Teams statistics");
174  f.writeString(s);
175  f.close();
176}
177
178function initLevel()
179{
180  var levelNumber;
[480]181  if (ExpProperties.level == -1)
[231]182    levelNumber = Math.random(levels.size);
183  else
[480]184    levelNumber = ExpProperties.level;
[231]185
186  var level = levels.get(levelNumber);
187  Simulator.print("Level #" + (levelNumber + 1) + ": " + level[0]);
188
189  World.wrldbnd = level[2];
190  World.wrldsiz = level[1];
191  World.wrldwat = -1;
192  World.wrldtyp = level[3];
193  World.wrldmap = level[4];
194
195  World.wrldchg();
196}
197
198function tryCreateHPBox()
199{
[480]200  if (Populations[0].size >= ExpProperties.hpBoxTotalCount) return;
[231]201 
[480]202  if (Math.rnd01 > ExpProperties.hpBoxProbability) return;
[231]203 
[233]204  var food = Populations[0].add("//0\nm:Vstyle=hpbox\np:");
[231]205  food.name = "HP Box";
[480]206  food.idleen = ExpProperties.hpBoxIdleEnergy;
207  food.energ0 = ExpProperties.hpBoxStartingEnergy;
[231]208  food.energy = food.energ0;
209  food.nnenabled = 0;
210}
211
212function tryCreateUpgradeBox()
213{
[480]214  if (Populations[1].size >= ExpProperties.upgradeBoxTotalCount) return;
[231]215 
[480]216  if (Math.rnd01 > ExpProperties.upgradeBoxProbability) return;
[231]217 
[233]218  var weapon = Populations[1].add("//0\nm:Vstyle=weaponbox\np:");
[231]219  weapon.name = "Weapon Box";
[480]220  weapon.idleen = ExpProperties.upgradeBoxIdleEnergy;
221  weapon.energ0 = ExpProperties.upgradeBoxStartingEnergy;
[231]222  weapon.energy = weapon.energ0;
223  weapon.nnenabled = 0;
224}
225
226//handle creature placement in the world
[233]227function onBorn(cr)
[231]228{
229  // place newly born creature
230  var retry = 20; //try 20 times
231  var placed_ok = 0;
232  while (retry-- && !placed_ok)
233  {
[233]234    switch (cr.population.index)
[231]235    {
236    case 0: //food placement
[233]237      place_centerhead(cr);
[231]238      break;
239    case 1: //upgrade placement
[233]240      place_centerhead(cr);
[231]241      break;
242    default:
[233]243          cr.user1 = [0.0, 0.0]; //attack cooldown (0), bonus damage (1)
244          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)
245          cr.user3 = []; //who dealt damage to this creature
[480]246          cr.energ0 = ExpProperties.creatureStartingEnergy;
[233]247          cr.energy = cr.energ0;
248      place_inTeamSpot(cr);
[231]249      break;
250    }
251
[233]252    if (!cr.boundingBoxCollisions(0))
253      {placed_ok=1; break;}
[231]254  }
255  if (!placed_ok)
256    print("onBorn() could not avoid collisions.");
257}
258
259//place creature in random spot and make it head center of the map
[233]260function place_centerhead(cr)
[231]261{
262  var x, y, z;
[233]263  x = (World.wrldsiz - cr.size_x) * Math.rnd01 - cr.size_x / 2;
264  y = (World.wrldsiz - cr.size_y) * Math.rnd01 - cr.size_y / 2;
[231]265  z = WorldMap.getHeight(x, y);
266
267  var hx = 0.0 + (World.wrldsiz / 2) - x;
268  var hy = 0.0 + (World.wrldsiz / 2) - y;
269  var alpha_rad = vectorsAngle([1.0, 0.0], [hx, hy]);
270
[233]271  cr.rotate(0, 0, alpha_rad);
272  cr.moveAbs(x, y, z - 0.999);
[231]273 
274  print("Creature placed in [" + x +" " + y + " " + z);
275
276  return ;
277}
278
279//Place creature in correct team spot (valid for Team creatures only)
280//Creatures are placed in circle with random rotation (commented out: heading center of the map) in their respective team groups
[233]281function place_inTeamSpot(cr)
[231]282{
[233]283  var radius = 360.00 * (cr.population.index - 1) / teams;
[231]284
285  var x, y, z;
[480]286  x = (ExpProperties.teamSpawningAreaSize) * Math.rnd01 - cr.size_x / 2 - ExpProperties.teamSpawningAreaSize/2;
287  y = (ExpProperties.teamSpawningAreaSize) * Math.rnd01 - cr.size_y / 2 - ExpProperties.teamSpawningAreaSize/2;
[231]288 
289  //vector of length half the world size minus spawning area size
[480]290  var vect = [0.0 + World.wrldsiz/2 - ExpProperties.teamSpawningAreaSize/2 - 1.0, 0.0];
[231]291  vect = rotateVector(vect, radius);
292 
293  //translate creature by given vector
294  //then translate by halfworld (as it is the center of the world
295  //and the positions were calculated for point [0,0]
296  x = x + vect[0] + World.wrldsiz/2;
297  y = y + vect[1] + World.wrldsiz/2;
298
299  z = WorldMap.getHeight(x, y);
300 
301  var alpha_rad = 360.0 * Math.rnd01; //random rotation
302 
303  //this would rotate creatures so that they would face the world center:
304  //var hx = 0.0 + (World.wrldsiz / 2) - x;
305  //var hy = 0.0 + (World.wrldsiz / 2) - y;
306  //var alpha_rad = vectorsAngle([1.0, 0.0], [hx, hy]);
307 
[233]308  cr.rotate(0, 0, alpha_rad);
[231]309  //place it mid-air
[233]310  cr.moveAbs(x, y, z);
[231]311
312  return ;
313}
314
315// ////////////////////////////////
316// Simulation steps
317
318function onStep()
319
320  idleSimulationSteps += 1;
321  tryCreateHPBox();
322  tryCreateUpgradeBox();
323 
324  lowerCooldownCounters();
325  applySuddenDeathModifier();
326
327  clearDeadCreatures();
328  checkGameState();
329}
330
331function writeTeamStatistics()
332{
333  var s = "" + Simulator.time + "; ";
334  var total = 0.0;
[233]335  for (var i = 2; i < Populations.size; i++)
[231]336  {
[233]337    var pop=Populations[i];
338    var sum = 0.0;
339    for (var cr in pop)
340      sum += cr.energy;
[231]341    s += "" + sum + "; ";
[233]342    s += "" + pop.size + "; ";
343    total += sum;
[231]344  }
345  if (total < 0) total == 0;
346  s += "" + total + "\n";
347 
348  var f=File.appendDirect("teams"+battleNumber+".txt","Teams statistics");
349  f.writeString(s);
350  f.close();
351}
352
353function clearDeadCreatures()
354{
[233]355  for (var i = 2; i < Populations.size; i++)
[231]356  {
[233]357    var pop=Populations[i];
358    for (var j = 0; j < pop.size; j++)
359      {
360      var cr=pop[j];
361      if (cr.energy <= 0) {pop.kill(cr); j--;}
362      }
[231]363  }
364}
365
366function applySuddenDeathModifier()
367{
[480]368  if (idleSimulationSteps < ExpProperties.stagnationInterval) return;
[231]369
[233]370  for (var i = 2; i < Populations.size; i++)
371    for (var cr in Populations[i])
[480]372      cr.energy -= ExpProperties.stagnationHealthReduce;
[231]373}
[233]374
[231]375function lowerCooldownCounters()
376{
[233]377  for (var i = 2; i < Populations.size; i++)
[231]378  {
[233]379    var pop=Populations[i];
380        for (var cr in pop)
[231]381        {
[233]382          if (cr.user1 != null)
[231]383          {
[233]384            if (cr.user1[0] > 0) cr.user1[0]=cr.user1[0] - 1;
385            if (cr.user1[0] < 0) cr.user1[0]=0.0;
[480]386            if (cr.user1[1] > 0) cr.user1[1]=cr.user1[1] - ExpProperties.upgradeBoxDecay;
[233]387            if (cr.user1[1] < 0) cr.user1[1]=0.0;
[231]388          }
389        }
390  }
391}
392
393function checkGameState()
394{
395  var alivePop = 0;
[233]396  for (var i = 2; i < Populations.size; i++)
397    if (Populations[i].size > 0) alivePop += 1;
[231]398 
399  if (alivePop == 0 && Simulator.time <= 1)
400  {
401    onExpInit(); //do initialization for user, because he forgot to do so
402        return;
403  }
404 
405  if (alivePop <= 1)
406  {
[233]407    for (var i = 2; i < Populations.size; i++)
[231]408    {
[233]409      var pop=Populations[i];
410          if (pop.size > 0)
[231]411          {
[233]412            Simulator.print("Battle is OVER! The winner is: " + pop.name);
[231]413               
414                //write stats of last living creatures
415                var f=File.appendDirect("creatures"+battleNumber+".txt","Creature statistics");
[233]416                for (var cr in pop)
[231]417                {
418                  //f.writeString("Creature name; Team; Kills; Assists; Total damage dealt; Total damage received; HP boxes collected; Upgrade boxes collected; Lifespan");
[233]419                  if (cr.user2 != null)
420                    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");
[231]421                }
422
423                f.close();
424          }
425    }
426        if (alivePop == 0) Simulator.print("Battle is OVER! Total annihilation!");
427       
428        Simulator.stop();
429  }
430}
431
432function print(msg)
433{
[480]434  if (ExpProperties.debug)
[231]435    Simulator.print(msg);
436}
437
438function stop(msg)
439{
440  Simulator.print(msg);
441  Simulator.stop();
442}
443
444// ////////////////////////////
445// Collisions
446
447//function executed on any Creature collission
448function onTeam0CrCollision, onTeam1CrCollision, onTeam2CrCollision, onTeam3CrCollision, onTeam4CrCollision, onTeam5CrCollision, onTeam6CrCollision, onTeam7CrCollision, onTeam8CrCollision, onTeam9CrCollision()
449{
450  var c1 = CrCollision.Creature1;
451  var c2 = CrCollision.Creature2;
452 
453  if (c1 == null) stop("2");
454  if (c2 == null) stop("2");
455 
456  if (c1.energy <= 0 || c2.energy <= 0)
457  {
458    //collision with already killed creature (chain resolution)
459        print("onCrCollision called with less than 2 Creatures");
460        return ;
461  }
462 
[233]463  if (c1.population == null || c2.population == null)
[231]464  {
465    //collision of creature without a group
466        print("onCrCollision called for creature without group, ignoring");
467        return ;
468  }
469 
470  //first condition should never occur, but who knows?
[233]471  if (c1.population.index < 2 || c2.population.index < 2)
[231]472  {
473    //collision with HP Box and Upgrades are handled separately
474        print("onCrCollision called for population 0 or 1, ignoring");
475        return ;
476  }
477 
478  idleSimulationSteps = 0;
479 
480  var kill_c1 = 0;
481  var kill_c2 = 0;
482  var dice1 = 0;
483  var dice2 = 0;
484  var changed = 0;
[480]485  for (var i = 0; i < ExpProperties.diceCount; i++)
[231]486  {
[480]487    dice1 = dice1 + Math.random(ExpProperties.diceSides) + 1;
488        dice2 = dice2 + Math.random(ExpProperties.diceSides) + 1;
[231]489  }
[480]490  var energy1 = 0.0 + ExpProperties.creatureDamage * dice1;
491  var energy2 = 0.0 + ExpProperties.creatureDamage * dice2;
492  energy1 += ExpProperties.upgradeMultiplier * c1.user1.get(1);
493  energy2 += ExpProperties.upgradeMultiplier * c2.user1.get(1);
[233]494  if (c1.population == c2.population)
[231]495  {
[480]496    energy1 = ExpProperties.friendlyFireDamageMultiplier * energy1;
497        energy2 = ExpProperties.friendlyFireDamageMultiplier * energy2;
[231]498  }
499 
500  if (c1.user1 == null) stop("3");
501  if (c1.user2 == null) stop("3");
502  if (c1.user3 == null) stop("3");
503  if (c2.user1 == null) stop("3");
504  if (c2.user2 == null) stop("3");
505  if (c2.user2 == null) stop("3");
506 
[233]507  if (c2.user1[0] <= 0 && energy2 > 0)
[231]508  {
509    changed = 1;
510 
511    c1.energy = c1.energy - energy2;
512        if (c1.energy < 0) c1.energy = 0;
[480]513    print(c2.name + " [" + c2.population.name + "] rolled " + dice2 + " and dealt " + energy2 + " [+" + (ExpProperties.upgradeMultiplier * c2.user1[1]) +" bonus] damage to " + c1.name + " [" + c1.population.name + "]");
514        c2.user1.set(0, ExpProperties.attackCooldown);
[233]515        c2.user2.set(2, c2.user2[2] + energy1);
516        c1.user2.set(3, c1.user2[3] + energy1);
517        var vect = [c2.uid,c2.name];
[231]518        var arrindex = arrayContains(c1.user3, 0, c2.uid);
519        if (arrindex != -1)
520        {
[233]521          vect.add(energy2 + c1.user3[arrindex][2]);
522          c1.user3[arrindex]=vect;
[231]523        }
524        else
525        {
526          vect.add(energy2);
527          if (c1.user3 == null) c1.user3 = Vector.new();
528          c1.user3.add(vect);
529          if (c1.energy > 0)
[233]530            c2.user2[1] = c2.user2[1] + 1; //increase assists statistic
[231]531        }
532        if (c1.energy <= 0)
533        {
[233]534          c2.user2[0] = c2.user2[0] + 1; //increase kills statistic
[231]535          kill_c1 = 1;
536        }
537  }
538 
[233]539  if (c1.user1[0] <= 0 && energy1 > 0)
[231]540  {
541    changed = 1;
542       
543    c2.energy = c2.energy - energy1;
544        if (c2.energy < 0) c2.energy = 0;
[480]545    print(c1.name + " [" + c1.population.name + "] rolled " + dice1 + " and dealt " + energy1 + " [+" + (ExpProperties.upgradeMultiplier * c1.user1[1]) +" bonus] damage to " + c2.name + " [" + c2.population.name + "]");
546    c1.user1[0] = ExpProperties.attackCooldown;
[233]547        c1.user2[2] = c1.user2[2] + energy1;
548        c2.user2[3] = c2.user2[3] + energy1;
[231]549        var vect = Vector.new();
550        vect.add(c1.uid);
551        vect.add(c1.name);
552        var arrindex = arrayContains(c2.user3, 0, c1.uid);
553        if (arrindex != -1)
554        {
[233]555          vect.add(energy1 + c2.user3[arrindex][2]);
556          c2.user3[arrindex] = vect;
[231]557        }
558        else
559        {
560          vect.add(energy1);
561          if (c2.user3 == null) c2.user3 = Vector.new();
562          c2.user3.add(vect);
563          if (c2.energy > 0)
564          {
[233]565        c1.user2[1] = c1.user2[1] + 1; //increase assists statistic
[231]566          }
567        }
568        if (c2.energy <= 0)
569        {
[233]570          c1.user2[0] = c1.user2[0] + 1; //increase kills statistic
[231]571          kill_c2 = 1;
572        }
573  }
574 
575  if (changed == 1)
576  {
577    writeTeamStatistics();
578  }
579 
580  //resolve kills
581  if (kill_c1 == 1)
[233]582    c1.population.kill(c1);
[231]583  if (kill_c2 == 1)
[233]584    c2.population.kill(c2);
[231]585}
586
587//function executed on collision with Food population group
588function onFoodCollision()
589{
[480]590  if (ExpProperties.pickupNotStagnation == 1) idleSimulationSteps = 0;
[231]591
592  //collect HP Box (by eating it :D)
[233]593  print(Collision.Creature2.name + " [" + Collision.Creature2.population.name + "] picked a HP box");
594  Collision.Creature2.user2[4] = Collision.Creature2.user2[4] + 1;
595  Collision.Creature1.energy_m += Collision.Creature1.energy;
596  Collision.Creature2.energy_p += Collision.Creature1.energy;
[231]597 
598  //kill HP Box
[233]599  Collision.Creature1.population.kill(Collision.Creature1);
[231]600 
601  writeTeamStatistics();
602}
603
604//function executed on collision with Upgrade population group
605function onUpgradesCollision()
606{
[480]607  if (ExpProperties.pickupNotStagnation == 1) idleSimulationSteps = 0;
[231]608
609  //collect Upgrade Box (by eating it :D)
[233]610  print(Collision.Creature2.name + " [" + Collision.Creature2.population.name + "] picked an upgrade box");
611  Collision.Creature2.user2[5] = Collision.Creature2.user2[5] + 1;
612  Collision.Creature1.energy_m += Collision.Creature1.energy;
613  Collision.Creature2.user1[1] = Collision.Creature2.user1[1] + Collision.Creature1.energy;
[231]614 
615  //kill Upgrade Box
[233]616  Collision.Creature1.population.kill(Collision.Creature1);
[231]617 
618  writeTeamStatistics();
619}
620
621//function executed on Creature death
622//TODO: implement some statistics for dieing creature
[233]623function onDied(cr)
[231]624{
625  //ignore death of hp boxes and upgrades
[233]626  if (cr.population.index < 2)
[231]627   return ;
628
[233]629  print(cr.name + " was killed");
630  for (var dam in cr.user3)
631    print(dam[1] + " dealt " + dam[2] + " damage");
[231]632 
633  var f=File.appendDirect("creatures"+battleNumber+".txt","Creature statistics");
634  //f.writeString("Creature name; Team; Kills; Assists; Total damage dealt; Total damage received; HP boxes collected; Upgrade boxes collected; Lifespan");
[233]635  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");
[231]636  f.close();
637 
638  writeTeamStatistics();
639}
640
641// ////////////////////////////
[537]642// ExpProperties setters
[231]643
644//reinit populations on change
[480]645function ExpProperties_teamCount_set()
[231]646{
647  initPopulations();
648}
649
[480]650function ExpProperties_level_set()
[231]651{
652  initLevel();
653}
654~
655
656# ################################
657# Team
658
[480]659property:
[231]660id:teamCount
661name:Number of teams in Deathmatch
662type:d 1 10 1
663group:Team
664help:If set to 1, the number of teams will be equal to the number of genotypes in gene pool.
665
[480]666property:
[231]667id:teamSize
668name:Number of creatures per team
669type:d 1 10 5
670group:Team
671
[480]672property:
[231]673id:teamSpawningAreaSize
674name:Spawning area size for team
675type:f 10 30 20
676group:Team
677
[480]678property:
[231]679id:creatureStartingEnergy
680name:Starting energy of creature
681type:f 0 1000 300
682group:Team
683help:Base starting energy level for each creature in teams
684
685# ################################
686# Attack parameters
687
[480]688property:
[231]689id:diceSides
690name:Number of sides of dices
691type:f 1 10 1
692group:Attack rules
693
[480]694property:
[231]695id:diceCount
696name:Number of dices to roll per attack
697type:f 0 10 5
698group:Attack rules
699
[480]700property:
[231]701id:creatureDamage
702name:Basic damage multiplied by result of dice roll
703type:f 0 100 10
704group:Attack rules
705
[480]706property:
[231]707id:friendlyFireDamageMultiplier
708name:Multiplier of energy taken when Creatures of the same team collide
709type:f 0 1 0.0
710group:Attack rules
711help:Set to 0 for no friendly fire, set to 1 if full damage should be dealt when interacting with team member
712
[480]713property:
[231]714id:attackCooldown
715name:Number of simulation steps between two consecutive attacks of a creature
716type:f 100 10000 1000
717group:Attack rules
718help:Set this to 100 to nearly instantly resolve battles
719
720# ################################
721# Collectibles - HP Boxes & Upgrades
722
[480]723property:
[231]724id:pickupNotStagnation
725name:Collectible pick-up resets stagnation counter?
726type:d 0 1 1
727help:If set to true picking up an item will restart counting towards stagnation, effects in longer battles.
728
[480]729property:
[231]730id:hpBoxStartingEnergy
731name:Starting energy of HP Box
732type:f 0 1000 100
733group:Collectibles
734help:Base starting energy level for HP Box
735
[480]736property:
[231]737id:hpBoxIdleEnergy
738name:Amount of energy lost by HP Box
739type:f 0 10 0.00
740group:Collectibles
741help:How much energy HP Box looses each step (0 - it will not disappear)
742
[480]743property:
[231]744id:hpBoxProbability
745name:Probablity that new HP Box will spawn
746type:f 0 1 0.0005
747group:Collectibles
748help:Probability of HP Box appearing each step of simulation
749
[480]750property:
[231]751id:hpBoxTotalCount
752name:Maximum number of HP Boxes on the field
753type:d 0 20 10
754group:Collectibles
755help:The total number of HP Boxes on the field will never exceed this number
756
[480]757property:
[231]758id:upgradeBoxStartingEnergy
759name:Starting energy of Upgrade Box
760type:f 0 1000 500
761group:Collectibles
762help:Base starting energy level for Upgrade Box
763
[480]764property:
[231]765id:upgradeBoxIdleEnergy
766name:Amount of energy lost by Upgrade Box
767type:f 0 10 0.00
768group:Collectibles
769help:How much energy Upgrade Box looses each step (0 - it will not disappear)
770
[480]771property:
[231]772id:upgradeBoxProbability
773name:Probablity that new Upgrade Box will spawn
774type:f 0 1 0.0005
775group:Collectibles
776help:Probability of Upgrade Box appearing each step of simulation
777
[480]778property:
[231]779id:upgradeBoxTotalCount
780name:Maximum number of Upgrade Boxes on the field
781type:d 0 20 10
782group:Collectibles
783help:The total number of Upgrade Boxes on the field will never exceed this number
784
[480]785property:
[231]786id:upgradeBoxDecay
787name:How fast upgrade boost fades from creature
788type:f 0 10 0.1
789group:Collectibles
790help:Each step creature damage bonus will be decreased by given amount until it reaches 0
791
[480]792property:
[231]793id:upgradeMultiplier
794name:Multiplier of bonus damage
795type:f 0 1 0.1
796group:Collectibles
797help:Value of collected bonus multiplied by this variable is taken as bonus damage
798
799# ################################
800# Other
801
[480]802property:
[231]803id:level
804name:Level
805type:d -1 2 0
806help:Number of a level to battle (-1 is random)
807
[480]808property:
[231]809id:stagnationInterval
810name:Number of idle simulation steps before Sudden Death
811type:d 0 10000 5000
812help:If no combat occurs during given number of steps, the Sudden Death mode is turned on (0 = Sudden Death all the time)
813
[480]814property:
[231]815id:stagnationHealthReduce
816name:Sudden Death health reduce
817type:f 0 100 0.1
818help:If Suddent Death is turned on, creatures will lose given amount of HP each simulation step
819
[480]820property:
[231]821id:debug
822name:Show additional debug messages
823type:d 0 1 0
824
Note: See TracBrowser for help on using the repository browser.