Changeset 480 for experiments/frams/deathmatch/data
- Timestamp:
- 03/25/16 17:44:20 (9 years ago)
- Location:
- experiments/frams/deathmatch/data/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
experiments/frams/deathmatch/data/scripts/deathmatch-levels.inc
r231 r480 2 2 // 1. global variable levels 3 3 // 2. function initLevels() that initializes levels structure 4 // 3. function nextLevel() that puts into ExpP arams.level variable the value of next level's index (or -1 if random)4 // 3. function nextLevel() that puts into ExpProperties.level variable the value of next level's index (or -1 if random) 5 5 6 6 // descriptions of game levels -
experiments/frams/deathmatch/data/scripts/deathmatch-smellPopulation.neuro
r231 r480 15 15 function go() 16 16 { 17 if (Populations.size> Fields.pop)18 Neuro.state = Populations[ Fields.pop].senseCreaturesProperty(17 if (Populations.size>NeuroProperties.pop) 18 Neuro.state = Populations[NeuroProperties.pop].senseCreaturesProperty( 19 19 Neuro.position_x, Neuro.position_y, Neuro.position_z, 20 20 "energy", Neuro.creature); … … 24 24 ~ 25 25 26 prop :26 property: 27 27 id:pop 28 28 name:population -
experiments/frams/deathmatch/data/scripts/deathmatch.expdef
r233 r480 97 97 //add Teams populations (group above 2) 98 98 var i = 0; 99 teams = ExpP arams.teamCount;99 teams = ExpProperties.teamCount; 100 100 if (teams == 1) 101 101 teams = GenePools[0].size; … … 128 128 for (var i = 0; i < Populations.size - 2; i++) 129 129 { 130 for (var j = 0; j < ExpP arams.teamSize; j++)130 for (var j = 0; j < ExpProperties.teamSize; j++) 131 131 { 132 132 var g; //Genotype object 133 if (ExpP arams.teamCount != 1)133 if (ExpProperties.teamCount != 1) 134 134 g = GenePools[0].random(); 135 135 else … … 179 179 { 180 180 var levelNumber; 181 if (ExpP arams.level == -1)181 if (ExpProperties.level == -1) 182 182 levelNumber = Math.random(levels.size); 183 183 else 184 levelNumber = ExpP arams.level;184 levelNumber = ExpProperties.level; 185 185 186 186 var level = levels.get(levelNumber); … … 198 198 function tryCreateHPBox() 199 199 { 200 if (Populations[0].size >= ExpP arams.hpBoxTotalCount) return;201 202 if (Math.rnd01 > ExpP arams.hpBoxProbability) return;200 if (Populations[0].size >= ExpProperties.hpBoxTotalCount) return; 201 202 if (Math.rnd01 > ExpProperties.hpBoxProbability) return; 203 203 204 204 var food = Populations[0].add("//0\nm:Vstyle=hpbox\np:"); 205 205 food.name = "HP Box"; 206 food.idleen = ExpP arams.hpBoxIdleEnergy;207 food.energ0 = ExpP arams.hpBoxStartingEnergy;206 food.idleen = ExpProperties.hpBoxIdleEnergy; 207 food.energ0 = ExpProperties.hpBoxStartingEnergy; 208 208 food.energy = food.energ0; 209 209 food.nnenabled = 0; … … 212 212 function tryCreateUpgradeBox() 213 213 { 214 if (Populations[1].size >= ExpP arams.upgradeBoxTotalCount) return;215 216 if (Math.rnd01 > ExpP arams.upgradeBoxProbability) return;214 if (Populations[1].size >= ExpProperties.upgradeBoxTotalCount) return; 215 216 if (Math.rnd01 > ExpProperties.upgradeBoxProbability) return; 217 217 218 218 var weapon = Populations[1].add("//0\nm:Vstyle=weaponbox\np:"); 219 219 weapon.name = "Weapon Box"; 220 weapon.idleen = ExpP arams.upgradeBoxIdleEnergy;221 weapon.energ0 = ExpP arams.upgradeBoxStartingEnergy;220 weapon.idleen = ExpProperties.upgradeBoxIdleEnergy; 221 weapon.energ0 = ExpProperties.upgradeBoxStartingEnergy; 222 222 weapon.energy = weapon.energ0; 223 223 weapon.nnenabled = 0; … … 244 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 245 cr.user3 = []; //who dealt damage to this creature 246 cr.energ0 = ExpP arams.creatureStartingEnergy;246 cr.energ0 = ExpProperties.creatureStartingEnergy; 247 247 cr.energy = cr.energ0; 248 248 place_inTeamSpot(cr); … … 284 284 285 285 var x, y, z; 286 x = (ExpP arams.teamSpawningAreaSize) * Math.rnd01 - cr.size_x / 2 - ExpParams.teamSpawningAreaSize/2;287 y = (ExpP arams.teamSpawningAreaSize) * Math.rnd01 - cr.size_y / 2 - ExpParams.teamSpawningAreaSize/2;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; 288 288 289 289 //vector of length half the world size minus spawning area size 290 var vect = [0.0 + World.wrldsiz/2 - ExpP arams.teamSpawningAreaSize/2 - 1.0, 0.0];290 var vect = [0.0 + World.wrldsiz/2 - ExpProperties.teamSpawningAreaSize/2 - 1.0, 0.0]; 291 291 vect = rotateVector(vect, radius); 292 292 … … 366 366 function applySuddenDeathModifier() 367 367 { 368 if (idleSimulationSteps < ExpP arams.stagnationInterval) return;368 if (idleSimulationSteps < ExpProperties.stagnationInterval) return; 369 369 370 370 for (var i = 2; i < Populations.size; i++) 371 371 for (var cr in Populations[i]) 372 cr.energy -= ExpP arams.stagnationHealthReduce;372 cr.energy -= ExpProperties.stagnationHealthReduce; 373 373 } 374 374 … … 384 384 if (cr.user1[0] > 0) cr.user1[0]=cr.user1[0] - 1; 385 385 if (cr.user1[0] < 0) cr.user1[0]=0.0; 386 if (cr.user1[1] > 0) cr.user1[1]=cr.user1[1] - ExpP arams.upgradeBoxDecay;386 if (cr.user1[1] > 0) cr.user1[1]=cr.user1[1] - ExpProperties.upgradeBoxDecay; 387 387 if (cr.user1[1] < 0) cr.user1[1]=0.0; 388 388 } … … 432 432 function print(msg) 433 433 { 434 if (ExpP arams.debug)434 if (ExpProperties.debug) 435 435 Simulator.print(msg); 436 436 } … … 483 483 var dice2 = 0; 484 484 var changed = 0; 485 for (var i = 0; i < ExpP arams.diceCount; i++)486 { 487 dice1 = dice1 + Math.random(ExpP arams.diceSides) + 1;488 dice2 = dice2 + Math.random(ExpP arams.diceSides) + 1;489 } 490 var energy1 = 0.0 + ExpP arams.creatureDamage * dice1;491 var energy2 = 0.0 + ExpP arams.creatureDamage * dice2;492 energy1 += ExpP arams.upgradeMultiplier * c1.user1.get(1);493 energy2 += ExpP arams.upgradeMultiplier * c2.user1.get(1);485 for (var i = 0; i < ExpProperties.diceCount; i++) 486 { 487 dice1 = dice1 + Math.random(ExpProperties.diceSides) + 1; 488 dice2 = dice2 + Math.random(ExpProperties.diceSides) + 1; 489 } 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); 494 494 if (c1.population == c2.population) 495 495 { 496 energy1 = ExpP arams.friendlyFireDamageMultiplier * energy1;497 energy2 = ExpP arams.friendlyFireDamageMultiplier * energy2;496 energy1 = ExpProperties.friendlyFireDamageMultiplier * energy1; 497 energy2 = ExpProperties.friendlyFireDamageMultiplier * energy2; 498 498 } 499 499 … … 511 511 c1.energy = c1.energy - energy2; 512 512 if (c1.energy < 0) c1.energy = 0; 513 print(c2.name + " [" + c2.population.name + "] rolled " + dice2 + " and dealt " + energy2 + " [+" + (ExpP arams.upgradeMultiplier * c2.user1[1]) +" bonus] damage to " + c1.name + " [" + c1.population.name + "]");514 c2.user1.set(0, ExpP arams.attackCooldown);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); 515 515 c2.user2.set(2, c2.user2[2] + energy1); 516 516 c1.user2.set(3, c1.user2[3] + energy1); … … 543 543 c2.energy = c2.energy - energy1; 544 544 if (c2.energy < 0) c2.energy = 0; 545 print(c1.name + " [" + c1.population.name + "] rolled " + dice1 + " and dealt " + energy1 + " [+" + (ExpP arams.upgradeMultiplier * c1.user1[1]) +" bonus] damage to " + c2.name + " [" + c2.population.name + "]");546 c1.user1[0] = ExpP arams.attackCooldown;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; 547 547 c1.user2[2] = c1.user2[2] + energy1; 548 548 c2.user2[3] = c2.user2[3] + energy1; … … 588 588 function onFoodCollision() 589 589 { 590 if (ExpP arams.pickupNotStagnation == 1) idleSimulationSteps = 0;590 if (ExpProperties.pickupNotStagnation == 1) idleSimulationSteps = 0; 591 591 592 592 //collect HP Box (by eating it :D) … … 605 605 function onUpgradesCollision() 606 606 { 607 if (ExpP arams.pickupNotStagnation == 1) idleSimulationSteps = 0;607 if (ExpProperties.pickupNotStagnation == 1) idleSimulationSteps = 0; 608 608 609 609 //collect Upgrade Box (by eating it :D) … … 643 643 644 644 //reinit populations on change 645 function ExpP arams_teamCount_set()645 function ExpProperties_teamCount_set() 646 646 { 647 647 initPopulations(); 648 648 } 649 649 650 function ExpP arams_level_set()650 function ExpProperties_level_set() 651 651 { 652 652 initLevel(); … … 657 657 # Team 658 658 659 prop :659 property: 660 660 id:teamCount 661 661 name:Number of teams in Deathmatch … … 664 664 help:If set to 1, the number of teams will be equal to the number of genotypes in gene pool. 665 665 666 prop :666 property: 667 667 id:teamSize 668 668 name:Number of creatures per team … … 670 670 group:Team 671 671 672 prop :672 property: 673 673 id:teamSpawningAreaSize 674 674 name:Spawning area size for team … … 676 676 group:Team 677 677 678 prop :678 property: 679 679 id:creatureStartingEnergy 680 680 name:Starting energy of creature … … 686 686 # Attack parameters 687 687 688 prop :688 property: 689 689 id:diceSides 690 690 name:Number of sides of dices … … 692 692 group:Attack rules 693 693 694 prop :694 property: 695 695 id:diceCount 696 696 name:Number of dices to roll per attack … … 698 698 group:Attack rules 699 699 700 prop :700 property: 701 701 id:creatureDamage 702 702 name:Basic damage multiplied by result of dice roll … … 704 704 group:Attack rules 705 705 706 prop :706 property: 707 707 id:friendlyFireDamageMultiplier 708 708 name:Multiplier of energy taken when Creatures of the same team collide … … 711 711 help:Set to 0 for no friendly fire, set to 1 if full damage should be dealt when interacting with team member 712 712 713 prop :713 property: 714 714 id:attackCooldown 715 715 name:Number of simulation steps between two consecutive attacks of a creature … … 721 721 # Collectibles - HP Boxes & Upgrades 722 722 723 prop :723 property: 724 724 id:pickupNotStagnation 725 725 name:Collectible pick-up resets stagnation counter? … … 727 727 help:If set to true picking up an item will restart counting towards stagnation, effects in longer battles. 728 728 729 prop :729 property: 730 730 id:hpBoxStartingEnergy 731 731 name:Starting energy of HP Box … … 734 734 help:Base starting energy level for HP Box 735 735 736 prop :736 property: 737 737 id:hpBoxIdleEnergy 738 738 name:Amount of energy lost by HP Box … … 741 741 help:How much energy HP Box looses each step (0 - it will not disappear) 742 742 743 prop :743 property: 744 744 id:hpBoxProbability 745 745 name:Probablity that new HP Box will spawn … … 748 748 help:Probability of HP Box appearing each step of simulation 749 749 750 prop :750 property: 751 751 id:hpBoxTotalCount 752 752 name:Maximum number of HP Boxes on the field … … 755 755 help:The total number of HP Boxes on the field will never exceed this number 756 756 757 prop :757 property: 758 758 id:upgradeBoxStartingEnergy 759 759 name:Starting energy of Upgrade Box … … 762 762 help:Base starting energy level for Upgrade Box 763 763 764 prop :764 property: 765 765 id:upgradeBoxIdleEnergy 766 766 name:Amount of energy lost by Upgrade Box … … 769 769 help:How much energy Upgrade Box looses each step (0 - it will not disappear) 770 770 771 prop :771 property: 772 772 id:upgradeBoxProbability 773 773 name:Probablity that new Upgrade Box will spawn … … 776 776 help:Probability of Upgrade Box appearing each step of simulation 777 777 778 prop :778 property: 779 779 id:upgradeBoxTotalCount 780 780 name:Maximum number of Upgrade Boxes on the field … … 783 783 help:The total number of Upgrade Boxes on the field will never exceed this number 784 784 785 prop :785 property: 786 786 id:upgradeBoxDecay 787 787 name:How fast upgrade boost fades from creature … … 790 790 help:Each step creature damage bonus will be decreased by given amount until it reaches 0 791 791 792 prop :792 property: 793 793 id:upgradeMultiplier 794 794 name:Multiplier of bonus damage … … 800 800 # Other 801 801 802 prop :802 property: 803 803 id:level 804 804 name:Level … … 806 806 help:Number of a level to battle (-1 is random) 807 807 808 prop :808 property: 809 809 id:stagnationInterval 810 810 name:Number of idle simulation steps before Sudden Death … … 812 812 help:If no combat occurs during given number of steps, the Sudden Death mode is turned on (0 = Sudden Death all the time) 813 813 814 prop :814 property: 815 815 id:stagnationHealthReduce 816 816 name:Sudden Death health reduce … … 818 818 help:If Suddent Death is turned on, creatures will lose given amount of HP each simulation step 819 819 820 prop :820 property: 821 821 id:debug 822 822 name:Show additional debug messages
Note: See TracChangeset
for help on using the changeset viewer.