Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canopy · Siege

Watch it in your browser →

A settlement under a solar canopy, and the machines that come for it. It runs itself. There is nothing to play — no cursor, no units to select, no build menu. You sit and watch, and the only decisions you get to make are where to point the camera.

Machines inside the wire

This is a fork of canopy, which is a serious tool for working out whether a dappled agrivoltaic canopy can make a piece of desert habitable. All of that is still here and still running underneath: the form-found tensile membrane, the module dither, the full-day insolation model, the water balance, the planting. What has been added on top is everyone who lives there, and a reason to worry about them.

The connection between the two halves is the point. The array that shades the crops is the array that runs the guns. Life support, water treatment and the pumps draw first, off the same budget; the lasers and the EMP come out of whatever is left in the battery. Lose homes and you lose the modules over them, so the generation drops, so the night gets harder. It is one economy, and you can watch it tighten.

What happens

The loop runs forever, at whatever speed you set.

Quiet. People come out. They farm the ground between the houses, haul water, stand around in doorways, go indoors, come out again. If the last wave left holes they patch them; if it left rubble they rebuild it; if the wire is thin they walk out and lay more mines. Families arrive while it is calm, up to what the standing homes will hold.

A quiet morning

Inbound. Cruisers on the horizon. About two thirds of the settlement pick up rifles and take window posts, choosing the wall the trouble is coming from. The rest get indoors and stay away from the glass.

Under attack. Walkers come in on foot and cruisers come in overhead and drop more. Flyers circle and strafe. The wire slows the walkers while they cut it, the mines take whatever stands on them, and the mast laser fires when there is charge to fire it. When five or more machines are packed inside the block, the town spends most of the battery on an EMP and drops them where they stand.

The machines close right in rather than trading shots from the desert. They shoot people, they shoot walls, walls come open, buildings catch, and once there is a hole in a house they walk into it and hold it.

Night

All clear. Fires get put out, breaches get patched, the dead are left where they fell for a while, and the rebuilding starts. Then it is quiet again.

The morning after

If everyone dies, the machines finish the block and leave, and survivors move back in during the next quiet spell. The simulation is not winnable and not losable. It just keeps going.

What is actually being modelled

Honestly: the town is modelled properly and the war is not.

Everything inherited from canopy is unchanged and still computed — the minimal-surface form finding, the day-long insolation integral behind the shading, the water index, the species fit that decides what grows where. The array's nameplate capacity is whatever the modules on the canopy actually add up to, and the instantaneous generation is that capacity times the real solar elevation for the site and date. At night it is zero, and the battery is all there is.

The combat is a game. Hitscan with a distance-and-cover roll, tracers as pure visuals, hit points, no ballistics, no line-of-sight tests against geometry, no real pathfinding — units steer toward a goal and sidestep a wall if they are about to walk into one. Standing at a window is worth a 70% reduction in incoming accuracy because that number made the fights feel right, not because it came from anywhere.

The numbers that are load-bearing:

Life support 1.2 kW per person
Water pumping / treatment 60 kW
Irrigation 70 kW, scaled by how much of the town is standing
Battery bank 2.2 × array nameplate, in kWh
Laser shot 14 kWh
EMP burst 260 kWh

A full day of clear desert sun only just covers a full day of living. That is deliberate.

Watching it

  • Director cuts between whatever is worth looking at every ten seconds or so — a firefight, a burning house, a crowd in the fields. This is the default and it is the way to watch it.
  • Overview, Street and Free are fixed cameras; Free is the only one you can drag.
  • 1× / 3× / 8× and Pause. At 1× a simulated day takes about three and a half minutes, so waves and nights land at a watchable pace.
  • Send the next wave if you do not want to wait.
  • Town design at the bottom of the panel is the whole of the original tool, folded away. Change the grid, the canopy shape, the module coverage, the site, the season — the settlement rehouses itself around whatever you build, and the power budget changes with it. Turn coverage down and the crops fail; turn it up and the battery fills but the ground goes dark.

The panel

The block from outside

Running it

Open index.html. No build step, no server. Libraries load from CDN with pinned local copies in vendor/ as an offline fallback.

npm install
npx playwright install chromium
cd test
node suite.cjs                  # 86 checks
node shots.cjs ../media         # regenerate the README images
node render.cjs ../index.html /tmp/x

The suite is the parent project's 73 checks — the form-finding maths, the solar model, the sun map, every control — plus 13 for the siege. The siege ones are directional rather than exact, because the sim is stochastic: a wave puts machines on the field, people take window posts, machines can be killed, walls get blown open, waves resolve instead of deadlocking, nothing ends up at a NaN position after four waves, the battery stays inside its bank, the settlement is never left empty, and a razed town puts itself back up.

Three of the parent's tests needed updating rather than fixing, because this fork deliberately runs a 24-hour clock instead of the parent's dawn-to-dusk slider, and runs it continuously rather than on demand.

Differences from the parent

  • A whole-day clock, running by itself, about nine seconds to the simulated hour.
  • Moonlight. The parent had no reason to care what the site looked like at 2am; a siege that runs through the night does, so once the sun is down there is a dim cold key from overhead and a lifted ambient. The array still generates nothing — it just means you can see.
  • siege.js, which is all of the above and touches nothing in index.html except through a small window.WORLD interface.

Licence

MIT — see LICENSE. vendor/ contains three.js, OrbitControls and Delaunator, each under its own MIT licence.

About

A settlement under a solar canopy and the machines that come for it. An autonomous simulation - nobody plays it. Fork of williamsharkey/canopy.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages