1 | class: |
---|
2 | id:Population |
---|
3 | |
---|
4 | prop: |
---|
5 | id:index |
---|
6 | name:group index |
---|
7 | type:d |
---|
8 | flags:35 |
---|
9 | |
---|
10 | prop: |
---|
11 | id:name |
---|
12 | name:Group name |
---|
13 | type:s |
---|
14 | |
---|
15 | prop: |
---|
16 | id:size |
---|
17 | name:Number of creatures |
---|
18 | type:d |
---|
19 | flags:3 |
---|
20 | |
---|
21 | prop: |
---|
22 | id:energy |
---|
23 | name:Energy calculation |
---|
24 | type:d 0 1 1 |
---|
25 | help:If turned off, creature's energy will be constant. |
---|
26 | |
---|
27 | prop: |
---|
28 | id:death |
---|
29 | name:Death |
---|
30 | type:d 0 1 1 |
---|
31 | help:Do creatures die when no energy? |
---|
32 | |
---|
33 | prop: |
---|
34 | id:nnsim |
---|
35 | name:Neural net simulation |
---|
36 | type:d 0 2 1 ~Off~Immediate~After stabilization |
---|
37 | help:Stabilization means no significant movement during a specified period of time. |
---|
38 | |
---|
39 | prop: |
---|
40 | id:perfperiod |
---|
41 | name:Performance sampling period |
---|
42 | type:d 0 1000000 100 |
---|
43 | help:Defines how often onUpdate() events are called. Also used to compute partial performance of creatures (distance, speed, etc.) and to determine stabilization. |
---|
44 | |
---|
45 | prop: |
---|
46 | id:stabilperiod |
---|
47 | name:Sampling period while waiting |
---|
48 | type:d 0 1000000 100 |
---|
49 | help:"Performance sampling period" for the stabilization phase. |
---|
50 | |
---|
51 | prop: |
---|
52 | id:killnostable |
---|
53 | name:Kill if no stabilization after |
---|
54 | type:d 0 10000000 1000000 |
---|
55 | help:Creatures that fail to stabilize after the specified waiting period (e.g. because they are continuously rolling) will be killed. 0 disables this feature. |
---|
56 | |
---|
57 | prop: |
---|
58 | id:stabledist |
---|
59 | name:Allowed distance to be stable |
---|
60 | type:f 0 1 0.01 |
---|
61 | help:A creature is considered stabilized when its center of gravity stays within the specified distance after the "Sampling period while waiting" has elapsed. |
---|
62 | |
---|
63 | prop: |
---|
64 | id:enableperf |
---|
65 | name:Performance calculation |
---|
66 | type:d 0 2 1 ~Off~Immediate~After stabilization |
---|
67 | help:Stabilization means no significant movement during a specified period of time. |
---|
68 | |
---|
69 | prop: |
---|
70 | id:colmask |
---|
71 | name:Collision mask (deprecated) |
---|
72 | type:db 0 65535 0 |
---|
73 | flags:32 |
---|
74 | help:DEPRECATED. You should use selfmask and othermask (these masks are also much easier to understand than the old colmask field). |
---|
75 | |
---|
76 | prop: |
---|
77 | id:selfmask |
---|
78 | name:Collision mask (self) |
---|
79 | type:db 0 2147483647 0 |
---|
80 | flags:32 |
---|
81 | help:~ |
---|
82 | Collisions between objects can be handled in two ways: |
---|
83 | - standard 'mechanical' collision (simple 'rebound' effect) |
---|
84 | - special script handler (On[GROUPNAME]Collision function) |
---|
85 | |
---|
86 | In the script handler function, use the Collision object to access the two colliding parts of two creatures. |
---|
87 | The first part in the Collision object (i.e. Collision.Creature1) always concerns the creature that belongs to [GROUPNAME]. |
---|
88 | The handler is called once for each creature that collides with the creature from [GROUPNAME]. |
---|
89 | |
---|
90 | Collision masks determine which one will be used (none and both are also possible). On each collision, selfmask and othermask of the colliding objects are logically ANDed. 16 lower bits (0xffff) enable the standard handler. 16 higher bits (0xffff0000) enable the custom handler. |
---|
91 | Examples: |
---|
92 | |
---|
93 | 1.With one group, all possible combinations of the collision handlers are as follows: |
---|
94 | - ignore collisions (e.g. selfmask=othermask=0) |
---|
95 | - use standard handling (e.g. selfmask=othermask=1) |
---|
96 | - use custom handling (e.g. selfmask=othermask=0x10000) |
---|
97 | - use standard and custom handling (e.g. selfmask=othermask=0x10001) |
---|
98 | |
---|
99 | 2.Two groups yield more interesting cases. Let us consider the 'standard.expdef' setting: |
---|
100 | Creatures: selfmask=0x10001, othermask=0x20001 |
---|
101 | Food colmask = selfmask=0x20002, othermask=0x10002 |
---|
102 | There are three possible scenarios: |
---|
103 | - creature and creature: collision value = 0x10001 & 0x20001 = 1 -> Standard handling will be used (1 is one of the lower 16 bits) |
---|
104 | - food and food: collision value = 0x20002 & 0x10002 = 2 -> As above. |
---|
105 | - creature and food: collision value = (0x10001 & 0x10002) or (0x20002 & 0x20001) = 0x10000 or 0x20000 -> Custom handling will be used (higher 16 bits). |
---|
106 | ~ |
---|
107 | |
---|
108 | prop: |
---|
109 | id:othermask |
---|
110 | name:Collision mask (other) |
---|
111 | type:db 0 2147483647 0 |
---|
112 | flags:32 |
---|
113 | help:See selfmask. |
---|
114 | |
---|
115 | prop: |
---|
116 | id:bodysim |
---|
117 | name:Body simulation |
---|
118 | type:d 0 1 1 |
---|
119 | help:Enable/disable physical body simulation. This is the initial value of Creature.bodysim for all objects created in this group. For details, see the documentation of Creature.bodysim. |
---|
120 | |
---|
121 | prop: |
---|
122 | id:selfcol |
---|
123 | name:Detect self-collisions |
---|
124 | type:d 0 1 0 |
---|
125 | help:Detect collisions within creature bodies (only applicable for the ODE simulation engine). This is the initial value of Creature.selfcol for all objects created in this group. If enabled, creatures with self-colliding genotypes are not born, and others will have their sticks collide during lifespan. |
---|
126 | |
---|
127 | prop: |
---|
128 | id:em_stat |
---|
129 | name:Muscle static work |
---|
130 | type:f 0 1 0 |
---|
131 | help:~ |
---|
132 | Energy requirements for a muscle |
---|
133 | resisting an external force~ |
---|
134 | |
---|
135 | prop: |
---|
136 | id:em_dyn |
---|
137 | name:Muscle dynamic work |
---|
138 | type:f 0 1 0 |
---|
139 | help:~ |
---|
140 | Energy requirements for a muscle |
---|
141 | moving a stick~ |
---|
142 | |
---|
143 | prop: |
---|
144 | id:en_assim |
---|
145 | name:Assimilation productivity |
---|
146 | type:f 0 1 0 |
---|
147 | help:~ |
---|
148 | Maximal energy gain produced by a vertical specialized stick. |
---|
149 | Horizontal specialized sticks get half of this value.~ |
---|
150 | |
---|
151 | prop: |
---|
152 | id:createFromGenotype |
---|
153 | name: |
---|
154 | type:p oCreature() |
---|
155 | flags:34 |
---|
156 | help:Uses the selected Genotype object |
---|
157 | |
---|
158 | prop: |
---|
159 | id:createFromString |
---|
160 | name: |
---|
161 | type:p oCreature(s genotype) |
---|
162 | flags:34 |
---|
163 | help:Uses the supplied string argument |
---|
164 | |
---|
165 | prop: |
---|
166 | id:createFromGeno |
---|
167 | name: |
---|
168 | type:p oCreature(oGeno) |
---|
169 | flags:34 |
---|
170 | help:Uses the supplied Geno object |
---|
171 | |
---|
172 | prop: |
---|
173 | id:findUID |
---|
174 | name:find creature by UID |
---|
175 | type:p d(s uid) |
---|
176 | flags:34 |
---|
177 | |
---|
178 | prop: |
---|
179 | id:get |
---|
180 | name:get creature object |
---|
181 | type:p oCreature(d index) |
---|
182 | flags:34 |
---|
183 | |
---|
184 | prop: |
---|
185 | id:senseCreaturesProperty |
---|
186 | name:senseCreaturesProperty |
---|
187 | type:p f(f x,f y,f z,s propertyname,oCreature exclude) |
---|
188 | flags:34 |
---|
189 | help:~ |
---|
190 | arguments: |
---|
191 | - x,y,z (sensor position) |
---|
192 | - property (name, name[index] or Class:id). name[index] can be used for Vector objects inside the user fields, eg "user2[10]" |
---|
193 | - exclude (creature object) |
---|
194 | works like a smell sensor for a given property (for all creatures in this group except "exclude"). |
---|
195 | The following function reproduces the "classic" framsticks "S" sensor: |
---|
196 | function smellReceptorValue(x,y,z,exclude) |
---|
197 | { |
---|
198 | var i,s=0; for(i=0;i<Populations.size;i++) |
---|
199 | s+=Populations[0].senseCreaturesProperty(x,y,z,"energy",exclude); |
---|
200 | return s; |
---|
201 | }~ |
---|
202 | |
---|
203 | prop: |
---|
204 | id:findCreatureAt |
---|
205 | name: |
---|
206 | type:p oCreature(oVector point,oVector vector) |
---|
207 | flags:34 |
---|
208 | |
---|
209 | prop: |
---|
210 | id:delete |
---|
211 | name: |
---|
212 | type:p(d creature index) |
---|
213 | flags:34 |
---|
214 | help:delete creature |
---|
215 | |
---|
216 | prop: |
---|
217 | id:kill |
---|
218 | name: |
---|
219 | type:p(d creature index) |
---|
220 | flags:34 |
---|
221 | help:kill creature |
---|
222 | |
---|
223 | prop: |
---|
224 | id:creatures |
---|
225 | name:Creatures |
---|
226 | type:l Creature uid |
---|
227 | |
---|
228 | prop: |
---|
229 | id:creatures_changed |
---|
230 | name:creatures list changed |
---|
231 | type:e ListChange |
---|
232 | |
---|