Changeset 717


Ignore:
Timestamp:
11/22/17 04:27:49 (7 years ago)
Author:
sz
Message:

Framsticks 5.0rc12 update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/Framclipse/com.framsticks.framclipse/res/framscript.xml

    r699 r717  
    3737                <element name="neurons" type="integer" min="0" max="1" default="1"/>
    3838                <element name="dust" type="integer" min="0" max="1" default="1"/>
     39                <element name="energy" type="integer" min="0" max="1" default="1"/>
    3940        </type>
    4041        <type name="show" context="show file">
     
    401402  recipient.energy += amount;
    402403  this.energy -= amount;
    403 }]]></description>
     404}
     405
     406Calling 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);
     408is equivalent to:
     409        Collision.Creature1.transferEnergyToPart(Collision.Part1, Collision.Creature2, Collision.Part2, e);
     410When 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>
    404412                        <arguments>
    405413                                <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".
     419See 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"/>
    406424                                <argument name="requested_amount_of_energy" type="float"/>
    407425                        </arguments>
     
    628646                                <argument type="untyped"/>
    629647                        </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>
    630680                </element>
    631681        </type>
     
    33463396                        <description><![CDATA[Removes custom display settings that might have been defined by various scripts (expdef or show).]]></description>
    33473397                </element>
    3348                 <element name="mode" type="integer" min="0" max="2">
     3398                <element name="mode" type="integer" min="0" max="2" default="2">
    33493399                        <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>
    33503400                </element>
     
    34503500        32 - new groups will be created for imported genepools and populations
    34513501        64 - allow switching to a different expdef while importing parameters (4)
     3502        256 - creatures
    34523503
    34533504The 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>
     
    34803531        32 - population settings
    34813532        64 - do autosave
     3533        256 - creatures
    34823534- selected genepool, -1 means all genepools
    34833535- selected population, -1 means all populations]]></description>
     
    35633615                </element>
    35643616                <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>
    35653620                <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>
    35703623                <element name="resetToDefaults" function="true" type="void">
    35713624                        <description><![CDATA[Clears groups and loads default values for simulator parameters, then calls onExpDefLoad() of the current experiment definition.]]></description>
     
    36383691                        <description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description>
    36393692                </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>
    36403696                <element name="signals" type="WorldSignals" flags="35"/>
    36413697                <element name="odeshape" type="integer" min="0" max="1"/>
     
    46344690        32 - new groups will be created for imported genepools and populations
    46354691        64 - allow switching to a different expdef while importing parameters (4)
     4692        256 - creatures
    46364693
    46374694The 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>
     
    46644721        32 - population settings
    46654722        64 - do autosave
     4723        256 - creatures
    46664724- selected genepool, -1 means all genepools
    46674725- selected population, -1 means all populations]]></description>
     
    47474805                </element>
    47484806                <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>
    47494810                <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>
    47544813                <element name="resetToDefaults" function="true" type="void">
    47554814                        <description><![CDATA[Clears groups and loads default values for simulator parameters, then calls onExpDefLoad() of the current experiment definition.]]></description>
     
    53185377                        <description><![CDATA[Number of neural network simulation steps in each physics simulation step]]></description>
    53195378                </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>
    53205382                <element name="signals" type="WorldSignals" flags="35"/>
    53215383        </type>
     
    60726134  recipient.energy += amount;
    60736135  this.energy -= amount;
    6074 }]]></description>
     6136}
     6137
     6138Calling 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);
     6140is equivalent to:
     6141        Collision.Creature1.transferEnergyToPart(Collision.Part1, Collision.Creature2, Collision.Part2, e);
     6142When 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>
    60756144                        <arguments>
    60766145                                <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".
     6151See 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"/>
    60776156                                <argument name="requested_amount_of_energy" type="float"/>
    60786157                        </arguments>
     
    64876566                <element name="neurons" type="integer" min="0" max="1" default="1"/>
    64886567                <element name="dust" type="integer" min="0" max="1" default="1"/>
     6568                <element name="energy" type="integer" min="0" max="1" default="1"/>
    64896569                <element name="clear" function="true" flags="34"/>
    64906570                <element name="add" function="true" flags="34"/>
     
    65686648                <element name="nnspeed" type="float" min="0" max="1000" default="1.0">
    65696649                        <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>
    65706653                </element>
    65716654                <element name="signals" type="WorldSignals" flags="35"/>
     
    68726955Bits 2-16 are not implemented in the old Framsticks Theater application.]]></description>
    68736956                </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">
    68756958                        <description><![CDATA[Bit field:
    687669591 - background/panorama
     
    687869614 - creatures
    687969628 - dust (particles)
     696316 - energy transfers (particles)
    68806964Not implemented in the old Framsticks Theater application.]]></description>
    68816965                </element>
     
    70417125                <element name="KEY_MENU" type="integer" flags="1"/>
    70427126                <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"/>
    70437129                <element name="SHARING_HTML" type="string" flags="1"/>
    70447130                <element name="top_left" type="Element" flags="1"/>
     
    71537239                <element name="autorepeat" type="integer" min="0" max="1"/>
    71547240                <element name="style" type="integer"/>
     7241                <element name="feedback" type="integer"/>
    71557242                <element name="userdata" type="untyped"/>
    71567243                <element name="visible" type="integer" min="0" max="1"/>
     
    75127599                <element name="neurons" type="integer" min="0" max="1" default="1"/>
    75137600                <element name="dust" type="integer" min="0" max="1" default="1"/>
     7601                <element name="energy" type="integer" min="0" max="1" default="1"/>
    75147602                <element name="clear" function="true" flags="34"/>
    75157603                <element name="add" function="true" flags="34"/>
Note: See TracChangeset for help on using the changeset viewer.