Changeset 717 for java/Framclipse/com.framsticks.framclipse
- Timestamp:
- 11/22/17 04:27:49 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/Framclipse/com.framsticks.framclipse/res/framscript.xml
r699 r717 37 37 <element name="neurons" type="integer" min="0" max="1" default="1"/> 38 38 <element name="dust" type="integer" min="0" max="1" default="1"/> 39 <element name="energy" type="integer" min="0" max="1" default="1"/> 39 40 </type> 40 41 <type name="show" context="show file"> … … 401 402 recipient.energy += amount; 402 403 this.energy -= amount; 403 }]]></description> 404 } 405 406 Calling this function from inside the collision handler to transfer energy between colliding parts automatically adds the relevant MechPart references, as if transferEnergyToPart was called, i.e. 407 Collision.Creature1.transferEnergyTo(Collision.Creature2, e); 408 is equivalent to: 409 Collision.Creature1.transferEnergyToPart(Collision.Part1, Collision.Creature2, Collision.Part2, e); 410 When this behavior is not intended, explicit nulls in transferEnergyToPart() can be used to avoid associating the energy transfer with the currently colliding parts, like this: 411 Collision.Creature1.transferEnergyToPart(null, Collision.Creature2, null, e);]]></description> 404 412 <arguments> 405 413 <argument name="recipient" type="Creature"/> 414 <argument name="requested_amount_of_energy" type="float"/> 415 </arguments> 416 </element> 417 <element name="transferEnergyToPart" function="true" type="float" flags="32"> 418 <description><![CDATA[Transfer energy between specific parts of two creatures. Part arguments are only used for visualization and can be null, which would mean "the entire creature". 419 See also: transferEnergyTo()]]></description> 420 <arguments> 421 <argument name="source part" type="MechPart"/> 422 <argument name="recipient creature" type="Creature"/> 423 <argument name="recipient part" type="MechPart"/> 406 424 <argument name="requested_amount_of_energy" type="float"/> 407 425 </arguments> … … 628 646 <argument type="untyped"/> 629 647 </arguments> 648 </element> 649 </type> 650 <type name="EnergyParticles" context="Global context"> 651 <element name="lifespan_min" type="integer" min="1" max="100" default="20"> 652 <description><![CDATA[Particle's lifespan is a random number taken from the specified range [min,max]]]></description> 653 </element> 654 <element name="lifespan_max" type="integer" min="1" max="100" default="30"> 655 <description><![CDATA[Particle's lifespan is a random number taken from the specified range [min,max]]]></description> 656 </element> 657 <element name="amount_min" type="float" min="0" max="1000" default="0.5"> 658 <description><![CDATA[A particle is emitted if the amount of energy transferred in a single step exceeds this threshold]]></description> 659 </element> 660 <element name="amount_max" type="float" min="0.01" max="1000" default="5.0"> 661 <description><![CDATA[A maximum amount of energy a single particle can represent. If energy transferred in a single simulation step exceeds this amount, more particles are created.]]></description> 662 </element> 663 <element name="step_maxparticles" type="integer" min="1" max="100" default="5"> 664 <description><![CDATA[Limit the number of particles created in a single step for each energy transfer]]></description> 665 </element> 666 <element name="random_pos" type="float" min="0" max="1" default="0.3"> 667 <description><![CDATA[The amount of random shift used for individual particles (uniform distribution)]]></description> 668 </element> 669 <element name="turn" type="float" min="0" max="1" default="0.15"> 670 <description><![CDATA[Ignore (0) or directly follow (1) the potentially moving target of a particle. Intermediate values create momentum effect as if the target was gradually adjusted.]]></description> 671 </element> 672 <element name="speedup" type="float" min="0" max="1" default="0.05"> 673 <description><![CDATA[Increase particle speed by this factor in each simulation step. This can help reach moving targets (along with "Turn towards target").]]></description> 674 </element> 675 <element name="fade" type="float" min="0" max="1" default="0.9"> 676 <description><![CDATA[Gradually decrease particle size before it disappears when its energy transfer has ended while the particle was on its way. The remaining energy amount is multiplied by this factor in each step. 0 means: disappear immediately, 1 means: don't decrease the size at all. Note that these parameters only concern visualization and the actual energy was already transferred.]]></description> 677 </element> 678 <element name="total_limit" type="integer" min="10" max="10000" default="1000"> 679 <description><![CDATA[Limit the total number of existing energy particles (to save performance)]]></description> 630 680 </element> 631 681 </type> … … 3346 3396 <description><![CDATA[Removes custom display settings that might have been defined by various scripts (expdef or show).]]></description> 3347 3397 </element> 3348 <element name="mode" type="integer" min="0" max="2" >3398 <element name="mode" type="integer" min="0" max="2" default="2"> 3349 3399 <description><![CDATA["Automatic" labels all signal sources in all channels and shows the intensity map of the first channel. This is sufficient for many simple setups, but as the number of signals and channels grows, the display becomes cluttered. In such cases, the experiment definition can define "Custom" signal visualization tailored for the particular experiment.]]></description> 3350 3400 </element> … … 3450 3500 32 - new groups will be created for imported genepools and populations 3451 3501 64 - allow switching to a different expdef while importing parameters (4) 3502 256 - creatures 3452 3503 3453 3504 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> … … 3480 3531 32 - population settings 3481 3532 64 - do autosave 3533 256 - creatures 3482 3534 - selected genepool, -1 means all genepools 3483 3535 - selected population, -1 means all populations]]></description> … … 3563 3615 </element> 3564 3616 <element name="createrr" type="integer" min="0" max="2" default="1"/> 3617 <element name="groupchk" type="integer" min="0" max="1" default="1"> 3618 <description><![CDATA[Warnings will be printed when invalid genotypes are added to a gene pool.]]></description> 3619 </element> 3565 3620 <element name="creatwarnfail" type="integer" min="0" max="1"> 3566 <description><![CDATA[Creatures grown with warnings will not be simulated.]]></description> 3567 </element> 3568 <element name="groupchk" type="integer" min="0" max="1" default="1"/> 3569 <element name="vmdebug" type="integer" min="0" max="1"/> 3621 <description><![CDATA[Creatures grown with warnings will not be simulated. This helps prevent the propagation of faulty genes, because genotypes that cause warnings when interpreted will not reproduce.]]></description> 3622 </element> 3570 3623 <element name="resetToDefaults" function="true" type="void"> 3571 3624 <description><![CDATA[Clears groups and loads default values for simulator parameters, then calls onExpDefLoad() of the current experiment definition.]]></description> … … 3638 3691 <description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description> 3639 3692 </element> 3693 <element name="rndcollisions" type="integer" min="0" max="1" default="1"> 3694 <description><![CDATA[When enabled, custom collision handlers are invoked in random order. This can help remove unfair bias in some experiments - for example where the same collision order in each simulation step would cause some creatures colliding with food to consume energy while other colliding creatures would starve.]]></description> 3695 </element> 3640 3696 <element name="signals" type="WorldSignals" flags="35"/> 3641 3697 <element name="odeshape" type="integer" min="0" max="1"/> … … 4634 4690 32 - new groups will be created for imported genepools and populations 4635 4691 64 - allow switching to a different expdef while importing parameters (4) 4692 256 - creatures 4636 4693 4637 4694 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> … … 4664 4721 32 - population settings 4665 4722 64 - do autosave 4723 256 - creatures 4666 4724 - selected genepool, -1 means all genepools 4667 4725 - selected population, -1 means all populations]]></description> … … 4747 4805 </element> 4748 4806 <element name="createrr" type="integer" min="0" max="2" default="1"/> 4807 <element name="groupchk" type="integer" min="0" max="1" default="1"> 4808 <description><![CDATA[Warnings will be printed when invalid genotypes are added to a gene pool.]]></description> 4809 </element> 4749 4810 <element name="creatwarnfail" type="integer" min="0" max="1"> 4750 <description><![CDATA[Creatures grown with warnings will not be simulated.]]></description> 4751 </element> 4752 <element name="groupchk" type="integer" min="0" max="1" default="1"/> 4753 <element name="vmdebug" type="integer" min="0" max="1"/> 4811 <description><![CDATA[Creatures grown with warnings will not be simulated. This helps prevent the propagation of faulty genes, because genotypes that cause warnings when interpreted will not reproduce.]]></description> 4812 </element> 4754 4813 <element name="resetToDefaults" function="true" type="void"> 4755 4814 <description><![CDATA[Clears groups and loads default values for simulator parameters, then calls onExpDefLoad() of the current experiment definition.]]></description> … … 5318 5377 <description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description> 5319 5378 </element> 5379 <element name="rndcollisions" type="integer" min="0" max="1" default="1"> 5380 <description><![CDATA[When enabled, custom collision handlers are invoked in random order. This can help remove unfair bias in some experiments - for example where the same collision order in each simulation step would cause some creatures colliding with food to consume energy while other colliding creatures would starve.]]></description> 5381 </element> 5320 5382 <element name="signals" type="WorldSignals" flags="35"/> 5321 5383 </type> … … 6072 6134 recipient.energy += amount; 6073 6135 this.energy -= amount; 6074 }]]></description> 6136 } 6137 6138 Calling this function from inside the collision handler to transfer energy between colliding parts automatically adds the relevant MechPart references, as if transferEnergyToPart was called, i.e. 6139 Collision.Creature1.transferEnergyTo(Collision.Creature2, e); 6140 is equivalent to: 6141 Collision.Creature1.transferEnergyToPart(Collision.Part1, Collision.Creature2, Collision.Part2, e); 6142 When this behavior is not intended, explicit nulls in transferEnergyToPart() can be used to avoid associating the energy transfer with the currently colliding parts, like this: 6143 Collision.Creature1.transferEnergyToPart(null, Collision.Creature2, null, e);]]></description> 6075 6144 <arguments> 6076 6145 <argument name="recipient" type="Creature"/> 6146 <argument name="requested_amount_of_energy" type="float"/> 6147 </arguments> 6148 </element> 6149 <element name="transferEnergyToPart" function="true" type="float" flags="32"> 6150 <description><![CDATA[Transfer energy between specific parts of two creatures. Part arguments are only used for visualization and can be null, which would mean "the entire creature". 6151 See also: transferEnergyTo()]]></description> 6152 <arguments> 6153 <argument name="source part" type="MechPart"/> 6154 <argument name="recipient creature" type="Creature"/> 6155 <argument name="recipient part" type="MechPart"/> 6077 6156 <argument name="requested_amount_of_energy" type="float"/> 6078 6157 </arguments> … … 6487 6566 <element name="neurons" type="integer" min="0" max="1" default="1"/> 6488 6567 <element name="dust" type="integer" min="0" max="1" default="1"/> 6568 <element name="energy" type="integer" min="0" max="1" default="1"/> 6489 6569 <element name="clear" function="true" flags="34"/> 6490 6570 <element name="add" function="true" flags="34"/> … … 6568 6648 <element name="nnspeed" type="float" min="0" max="1000" default="1.0"> 6569 6649 <description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description> 6650 </element> 6651 <element name="rndcollisions" type="integer" min="0" max="1" default="1"> 6652 <description><![CDATA[When enabled, custom collision handlers are invoked in random order. This can help remove unfair bias in some experiments - for example where the same collision order in each simulation step would cause some creatures colliding with food to consume energy while other colliding creatures would starve.]]></description> 6570 6653 </element> 6571 6654 <element name="signals" type="WorldSignals" flags="35"/> … … 6872 6955 Bits 2-16 are not implemented in the old Framsticks Theater application.]]></description> 6873 6956 </element> 6874 <element name="world_visibility" type="integer" min="0" max=" 15" default="15">6957 <element name="world_visibility" type="integer" min="0" max="31" default="31"> 6875 6958 <description><![CDATA[Bit field: 6876 6959 1 - background/panorama … … 6878 6961 4 - creatures 6879 6962 8 - dust (particles) 6963 16 - energy transfers (particles) 6880 6964 Not implemented in the old Framsticks Theater application.]]></description> 6881 6965 </element> … … 7041 7125 <element name="KEY_MENU" type="integer" flags="1"/> 7042 7126 <element name="KEY_SEARCH" type="integer" flags="1"/> 7127 <element name="KEY_LEFT" type="integer" flags="1"/> 7128 <element name="KEY_RIGHT" type="integer" flags="1"/> 7043 7129 <element name="SHARING_HTML" type="string" flags="1"/> 7044 7130 <element name="top_left" type="Element" flags="1"/> … … 7153 7239 <element name="autorepeat" type="integer" min="0" max="1"/> 7154 7240 <element name="style" type="integer"/> 7241 <element name="feedback" type="integer"/> 7155 7242 <element name="userdata" type="untyped"/> 7156 7243 <element name="visible" type="integer" min="0" max="1"/> … … 7512 7599 <element name="neurons" type="integer" min="0" max="1" default="1"/> 7513 7600 <element name="dust" type="integer" min="0" max="1" default="1"/> 7601 <element name="energy" type="integer" min="0" max="1" default="1"/> 7514 7602 <element name="clear" function="true" flags="34"/> 7515 7603 <element name="add" function="true" flags="34"/>
Note: See TracChangeset
for help on using the changeset viewer.