In three lines

  • A 64×64 m tutorial island with five body stats (health, food, water, energy, warmth), where people and the AI live by the same rules
  • Fruit never grows back, so the island’s food alone cannot last 30 days. In the records, of 204 lives that never caught a fish, 0 survived
  • The rules changed twice: fishing became a little easier to discover, and the sea became far more dangerous

One island, one rules file

The tutorial island from above: forest and spring in the middle, a rocky hill to the north-east, and fishing-spot rings in the water that only viewers can see

Made by HSL — the tutorial island. The rings in the water are hidden fishing spots only viewers can see

  • The map is generated by code. The same seed always gives the same island
  • It has a north-east hill, a spring to the west, a starting beach and a cave hidden behind the hill
  • All the rules live in one rules.json, and the 3D viewer (human play) and the training simulator read the same file
  • So hunger moves at the same speed whether I am playing or the AI is training
ObjectCountGives
Palm93 coconuts each (food 12, water 10)
Bush74 berries each (food 8)
Tree161 wood per 4 hits
Rock91 stone per 2 hits
Grass121 fiber
Driftwood61 wood

maps/tutorial.json, rules.json (as of 11/5)

Five stats that keep falling

  • One step is 0.5 seconds, a day is 240 steps, and 80 of those are night
  • Food, water and energy fall even standing still, and faster on the move
  • Warmth falls at night. Inside the cave it stays warm
  • At 0 food or water, health drains. At 0 health, it is over
  • A life lasts at most 30 days
"drainPerStep": { "food": 0.14, "water": 0.23, "energy": 0.17 },
"moveExtra":    { "food": 0.04, "water": 0.04, "energy": 0.08 },
"swimExtra":    { "energy": 0.25, "warmth": 1.5 },
"deepSwimExtra": { "energy": 6 },
"damagePerStep": { "starving": 0.35, "thirsty": 0.6, "cold": 0.3, "exhausted": 0.2 },
"drink": { "spring": 30 },
"craft": { "spear": { "wood": 1, "stone": 1 } }

Part of rules.json (as of 11/5)

Fruit never grows back

  • At first, fruit grew back on a timer
  • In the first training run the AI hit the 10-day cap of the time within 8 minutes. A habit of eating coconuts and napping was enough
  • So I changed it. Coconuts do not grow that fast: once eaten, they are gone
  • All the island’s food adds up to 548 food, or 628 with the 80 you start with
  • Awake, you lose 34 to 43 a day. Even sleeping through every night it is about 28, so 30 days need over 840
  • On paper, the island’s food alone lasts a little over two weeks. The records came out the same way

Line chart of fruit left and islands still alive by day. Fruit is nearly gone around day 18, and the share of islands alive falls sharply between days 16 and 19

Made by HSL — attempt 11,000’s brain, 512 islands, 11/2 (lastday_v3.log)

  • Islands still alive fell from 465 on day 16 to 289 on day 19

So I hid fishing spots

  • Three fishing spots are hidden in the water around the island. The AI cannot see them and only finds out by stabbing
  • One wood and one stone make a spear, and stabbing water can catch a fish (food 20)
  • The three spots restock at different rates. Using all three gives up to 120 food a day, enough for 30 days
SpotWhereRestock per dayCap
RichNorth-east3 fish6 fish
FairWest2 fish4 fish
PoorSouth (near the start)1 fish2 fish

maps/tutorial.json

  • In the 11/2 records, fishing decided life and death. Of 308 lives that caught a fish, 260 lasted 30 days; of 204 that never did, 0 did

The sea is not an invisible wall

  • At first deep water was simply blocked, which makes the sea a wall
  • So I let the castaway go in and made running out of energy there mean drowning. Before training, 79% of the AI’s lives ended in the sea (part 1)
  • But once trained, the 10/29 rules made the sea too safe. Watching a finished video, swimming carried little risk, and it even slept on the water
  • On 11/2 I made three changes and retrained Peppo from scratch
Rule10/2911/2
Warmth lost in water (per step)0.31.5
Extra energy lost in deep water (per step)0.66
Time in deep water from starting energy (90)About 8 hoursAbout 1.4 hours
Sleeping in waterBanned in deep water onlyBanned in shallow water too

rules.json _water2 (11/2)

A crate washes up once a day

  • Once a day, at a random time, a crate washes up somewhere on the coast
  • If nobody opens it within 2 hours (20 steps), the sea takes it back
  • Inside is a can (food 30) or a net. A net raises the catch chance from 35% to 60%
  • It is there to reward walking around the island

How the AI sees

Diagram of 24 rays fanning across 200 degrees in front of the character, with a 12 m range

Made by HSL — the AI’s 24 rays, 12 m range

  • The AI does not see pixels. 24 rays sweep the 200 degrees in front of it and report what lies within 12 m, plus the distance to water and the spring
  • Add its five stats, the bag, the time, its heading, what is directly ahead and a few flags, and the input is 369 numbers
  • It has 13 actions: forward and back, turning, moving diagonally, gather/drink/stab (E), eat, sleep, make a spear, and doing nothing. That count includes eat berry and eat coconut, added for the memory experiment (part 4), which only act separately under that experiment’s rules

I lowered the difficulty once

  • Even 60 minutes of training never learned to fish. From attempt 10,000 on, no life in the stage evaluations caught a fish
  • Making a spear, facing the water at a hidden spot, stabbing and a 35% roll all had to line up, so even a lucky success almost never happened
  • So I kept the spots hidden and changed two things
  • The spot radius went from 3 m to 4.5 m
  • Shallow water away from any spot can now give a fish at 5%. The spots are still 7 times better
  • That alone did not solve it. After the change, the share of lives that fished peaked at 7.1% in a 15-minute run (part 3), and it only reached 75 to 94% per seed with a new brain (part 4)

If I did it again

  • Having the viewer and simulator read one rules file was the right call. The two could never drift apart when a rule changed
  • Do the food math before building the map. I started with regrowing fruit and threw away one island that was too easy
  • Re-check danger rules with video of the trained AI. A high early drowning rate fooled me into thinking the sea was dangerous enough
  • Next part: choosing a reinforcement-learning algorithm