A solar panel is a loop: how we taught a game about electricity
Electricity in this game is 48 V DC, solved every turn in integers: millivolts, milliamperes, milliwatt-hours, and no floating point anywhere. A solar panel is rated 500 W, with an open-circuit voltage of 49 V and 12.2 A at maximum power. Cables lose voltage by their length. Fuses blow. Overloaded wires explode.
All of which is great, until a player builds the obvious thing: one panel, one cable, one power station. The battery never charges.
The solver was right
A panel has a + terminal on the face it points to and a - terminal on the opposite face. Current needs a loop. With a single cable run, the - face touched nothing, so no current could flow. Real physics, correctly computed, and a completely silent game. The player's view: it does not work. The server's view: it works perfectly, you have built an open circuit.
The fix was not to bend the physics. It was to say so. The energy report now lists findings, and one of them has the code panel_pole_open. The message reads:
panel #12: its - pole touches nothing, so no current flows. A panel is a loop:
its + face and its - face (opposite sides) must both reach the station's PV face
through cables. Run a cable from the - face round to the cable network.
(The panel number is yours.) Two siblings came with it: station_pv_open, for a station PV terminal that nothing reaches, and cable_under_building, for a ground cable hidden under a building, where it touches nothing outside the footprint. And a panel standing directly on a station's PV face now joins the terminal its pole faces.
Both faces, to cable cells
So the rule to remember: run cables from both faces of the panel to the station's PV face. Panels touching end to end are in series, and their voltages add. The charge controller accepts at most 150 V on its input, so three panels in series (147 V open-circuit) pass and four (196 V) do not. Over that limit, something explodes.
The terminals have names
Inside a station, every terminal has an id: pv+, pv-, out+, out-, and for slot contents s<slot>.<pin>. Here is a test plant wiring a battery through a fuse:
link("s"+itoa(battery)+".bat+", "s"+itoa(fuse)+".a")
link("s"+itoa(fuse)+".b", "s1."+itoa(3+pack))
So s2.a is the first side of the fuse or breaker in slot index 2, and s2.b is the other side. Note that the index starts at 0 while the editor's slot numbers start at 1. Yes. We know.
A link joins two terminals of the same pole only: a + never meets a -, and the attempt is refused. That is the one mistake the game will not let you make. The others, over-current with no fuse, a short circuit, over-voltage, are yours, and they explode, with a blast that does not care who owns the structures nearby.
What we learned
A simulation that is correct and mute is worse than one that is wrong, because the player blames themselves for a while and then blames you. The physics is the game. The error message is part of the physics.