One loop with a stopwatch
Where Astra wrote a new program for every change, Opus kept one and kept rewriting it: 26 revisions of main on seed 1, 17 of master on seed 2, 8 of main on seed 3, with helper modules for mazes, cactus, dinosaurs and crops alongside. It checked in about every three minutes, and made over 240 tool calls per seed, more than twice Astra’s count.
By the second hour that program had settled into one shape on every seed: a loop that works through mixed crops, pumpkins, cactus, mazes and dinosaurs in turn, every phase split across the drones. And it timed them. Seed 2’s final version prints how long each phase took on every pass:
while True:
t = get_time()
change_hat(Hats.Straw_Hat)
for i in range(2):
lib.par(poly.poly_cols, lib.chunks())
t1 = get_time()
for i in range(5):
if num_items(Items.Carrot) > 3000:
lib.pumpkin_cycle()
t2 = get_time()
if num_items(Items.Pumpkin) > 3000:
cact.cactus_cycle()
t3 = get_time()
mazes(6)
t4 = get_time()
if num_items(Items.Cactus) > 20000:
set_world_size(10)
dino.dino_cycle(250)
set_world_size(n0)
t5 = get_time()
print(t1 - t, t2 - t1, t3 - t2, t4 - t3, t5 - t4)Seed 2's main loop: five phases, each timed, with the dinosaur run on a temporarily shrunk field.
Those numbers decided what Opus worked on next. On seed 1 at 1h22m:
Timing shows mazes take 161s vs. mixed 12s. …
It wrote a smarter maze solver that searched with a memory of walls, tried it, judged it slower once its own computing time was counted, and went back to the simple one. On seed 2 at 2h16m the timings pointed at the dinosaur instead, and it ran that phase less often. This habit, measuring a phase, then fixing or demoting the slowest, recurs on every seed.
Plants next to the plants they like
The game’s Polyculture upgrade multiplies a crop’s yield when its preferred companion is planted where the game asks. Opus is the only model in either campaign whose code ever calls get_companion. Its crop worker plants what the square needs, asks the plant where its companion should go, and remembers that request for the square concerned:
if e != want:
if e != None:
harvest()
put(want)
req[x * n + y] = None
comp = get_companion()
if comp != None:
t, pos = comp
cx, cy = pos
if cx >= x0 and cx < x1:
req[cx * n + cy] = tAfter planting, ask for the companion and note where it should go, so the drone plants it when it gets there.
On seed 1, a one-minute test of this program brought in 818,448 wood and 268,577 carrots, and added 1.45 points by itself. Curiously, seed 1 had owned the first Polyculture level since 1h33m and only planted for it at 2h43m, after buying two more levels; on seeds 2 and 3 it built the companion program within ten minutes of the unlock.
Polyculture’s higher levels are paid in bones: 10,000, then 50,000, 250,000 and 1.25 million. That is what tied the slow dinosaur phase to the crop farm.
Gold for drones
Mazes turn weird substance into gold, and gold buys drones. Opus found mazes 40 to 52 minutes in on every seed, and drones followed: it had 32 in the air by 3h57m on seed 1 and by 4h27m at the latest, where Sol and Astra peaked at sixteen. On seed 2 it wrote a parallel solver in which drones split up at forks:
… I'm running mazes until I can afford 16 drones.
Not every idea worked. On seed 1 it gave each drone its own small maze, and learned that harvesting one treasure clears every maze on the field: that test burned 1,956 weird substance. It went back to one shared maze, reused, with every drone hunting the treasure.
The trade-off shows in the scores. Opus spent its weird substance on mazes and produced about a million or less of it on every seed, against Sol’s 36 to 262 million; Sol gains 1.5 to 2.6 points there. Opus’s gold, 3 to 9 million against Sol’s few hundred thousand, wins back 0.6 to 1.5.
Two kinds of stall
On seed 3 at 1h03m, Opus switched from a dinosaur run straight to a pumpkin program and ten minutes produced 1,082 pumpkins. It spotted why on its own:
The dinosaur hat was left on when I switched programs, so pumpkin farming stalled for 10 minutes. …
It’s the same slip Astra made on seed 1; Opus named it at once and made the master loop put the straw hat on at the start of every pass.
The other stall came from buying a bigger field mid-run, which clears the farm. At 2h13m on seed 3 the maze solver kept looping on the emptied field and ten minutes passed with nothing produced. At the next expansion, at 3h01m, Opus checked after one minute, found the same problem and restarted; after that it stopped the program before expanding. Its end-of-run summary counts both stalls at ten minutes each, which the record doesn’t bear out: the second cost under two.
Making the dinosaur pay
Bones come from a dinosaur dragging a growing tail round the field, paid out when the hat comes off, and the longer the tail the more each run is worth. Opus’s dinosaur followed a loop around the whole field with safe shortcuts towards each apple, which got slow as fields grew. On seed 2, at 3h56m, it tried something different: shrink the farm to 10×10 just for the dinosaur, then restore it.
That run made 150,544 bones in 205 seconds, and it became part of every pass (lines 32 to 35 of the loop above). Sol arrived at the same idea on its own seeds.
On seed 3 the approach was a long run on the full 22×22 field instead, which left the rest of the farm idle for twenty minutes. Opus expected about 870,000 bones and banked 658,952, then immediately spent 1.25 million on the last Polyculture level. The next stint of the main loop added 5.5 points, more than any later stint on that seed.
What decided the score
The crops scored about the same for Opus and Sol: hundreds of millions to billions of hay, wood and carrots, eight to nine points each. The difference was the rest. On seed 1, Opus made 9 million gold to Sol’s 296,000 and 4 million bones to 101,000, and won by almost four points. Seed 2 is the instructive one, where two quite different farms reached nearly the same score:
All three Opus seeds landed between 75.45 and 75.65, the steadiest result in the field, at $4.73 to $6.19 a run, about ten times Sol’s cost, for results ranging from 0.3 points behind Sol to 3.8 ahead.