#side Garden #author Devon Ordinary autotrophs have a doubletime of 2100 or worse. Centralizing construction in a few cells lets new cells be finished in less than a doubletime. This allows faster growth, theoretically. Garden's Crops sit still and the Gardener syphons their energy away. This is the reverse of Sunflower's approach. Problems: Multiple Gardeners tend to pick the same target, which makes them rather useless. No defense yet. (This is ok in a demo side. I'll make an armed variant.) #color 6c0 #seed 2 1 1 1 1 1 1 #type Crop #color 0f0 #hardware armor 40 solar-cells .4 energy 300 0 ;; That's all. No brain even. #type Gardener #color c30 #hardware energy 200 15 friendly-syphon 4 constructor 2.5 robot-sensor 6 10 processor 10 engine .05 armor 100 solar-cells .02 #code #vector target #var score #var best-score construct: energy 150 constructor-remaining 20 + min > constructor-max-rate 0 ifev constructor-rate! return #start 0 robot-sensor-sees-enemies! 1 robot-sensor-sees-friends! do constructor-type nif 1 type-population 2 type-population / 6 < 1 2 ifev constructor-type! ;energy 100 > 2 1 ifev constructor-type! then construct fire-robot-sensor sync pick^ best-score 0 > if seek^ suck^ 0 friendly-syphon-rate! else construct sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync then forever pick: 0 best-score! do robot-type 1 = if robot-energy robot-distance 20 * - score! score best-score > if robot-position target! score best-score! then then construct next-robot while-loop return seek: friendly-syphon-max-rate friendly-syphon-rate! target position v- angle friendly-syphon-direction! .5 friendly-syphon-distance! do target position target v- unitize v+ seek-location construct target position 1 radius + in-range until-loop 0 engine-power! return suck: target position v- rect-to-polar friendly-syphon-direction! radius - friendly-syphon-distance! do construct friendly-syphoned friendly-syphon-max-rate < until-loop return #end