Files
great-powers/README.md
T
jcoffey-dev 73f33ec408 Support was asking the wrong question
The rule is that the supporting unit must be able to reach the province the
supported unit is going *to*, not the province it is standing in. The board
offered the other set -- units standing next door -- so Vienna could not
support Venice into Tyrolia, which is an ordinary order: Vienna and Tyrolia
touch, Vienna and Venice do not. There was no way to write it at all.

It was wrong in the other direction too. Support to hold was offered for
units the supporter could not have reached, the order was written, and the
adjudicator turned it into a hold after submission without saying so.

This was a rules question living in a component, so it moves to the rules:
src/game/targets.ts, and eight tests instead of a closure.

The rest of the stiffness was that a stray click threw away a half-written
order. You picked Support, picked the unit to help, missed the destination
by a province, and the whole thing silently became a fresh move somewhere
else. A two-part order now stands its ground and sounds a refusal; clicking
the unit giving the order backs out of it, and any other unit of yours still
switches straight over, which is what makes writing a page of orders quick.

And the unit picked to support -- or to carry -- is marked on the board, in
a different colour from the unit giving the order. Without it the second
half of every support is written blind: you click a unit, every highlight on
the map changes, and nothing says which one you chose.
2026-09-09 09:19:10 -07:00

278 lines
14 KiB
Markdown

# Great Powers
A browser rebuild of the classic seven-power negotiation game: one human
against six computer powers, in one sitting.
Not the name you expect, and [NOTICE.md](NOTICE.md) will make the argument at
length once there is more to notice. The short version is the one the
starship game already made on this site: the rules are free to rebuild, the
trademark and the published artwork are not. "Great Powers" is what those
seven were called at the time.
## What this is, and what it is not
**One human, six computer powers, one sitting.** The original is seven people
over weeks. A hub with no traffic cannot deliver that, and nobody is going to
wait months for six strangers — so the other six are played by the machine
and a game is finished in an evening.
**It still has to be a negotiation game.** A version where you simply write
orders is a good movement puzzle and not this game. So:
- **Both sides open.** Bots approach you with proposals; you approach them.
Neither waits for the other.
- **On real terms.** Offers are concrete and about this turn or the next few
— support this move, keep out of that province, no attack until 1903 — and
are accepted or refused on their merits, not by a die roll.
- **Betrayal is a move, not a bug.** A bot can agree to support you and then
not do it, and so can you. Bots remember who kept their word, tell each
other, and price you accordingly. That is the game.
The press is **structured rather than free text**: typed offers, deterministic
reasoning, and no model anywhere in it. That makes betrayal auditable — you
can read exactly why a power turned on you — and testable, which free text
would not be.
## The look and the sound
**The map is the standard board's geometry, under the same licence as this
project.** The outlines come from the diplomacy engine at
<https://github.com/diplomacy/diplomacy>, which is AGPL-3.0, extracted by
`tools/map.py` into `src/game/board.json`. Every colour and every mark drawn
on it is ours; see [NOTICE.md](NOTICE.md).
Three earlier attempts drew it from scratch and all three were worse.
Dividing the plane by nearest province gives a tidy board that looks nothing
like Europe. Drawing the adjacency graph gives something unimpeachable about
the rules and not a map at all -- circles joined by lines. Fifty-six polygons
placed by eye gives fifty-six islands. Drawing Europe accurately is real work,
somebody did it properly, and they published it under a licence that invites
exactly this.
**Clicking still answers with the rules, not the picture.** A shape cannot say
that a fleet on Spain's north coast may not enter the Gulf of Lyon while one
on the south coast may, because both coasts are the same shape. So selecting a
province lights up exactly where its unit may legally go, taken from the
adjacency graph.
**It gets the whole screen.** The other three games live in a four-by-three
cabinet because the machines they are rebuilding did. This one is not
rebuilding a machine, and seventy-five provinces plus somebody trying to talk
you out of Galicia do not fit in a letterbox. The map takes the viewport.
**The music is not cartoony, and that is the point.** It is 1914: serious,
and intense. The joke of this game is that something charming to look at is
the cruellest thing on the site, and the score is what says so.
**And the turn should be heard.** Orders resolve in silence in every online
version of this game, which is a waste of the one moment anybody cares
about. Armies grinding into each other, guns at sea, a convoy escorting
something across, a unit being built, a unit falling back -- each of those is
a different noise, generated by the synth like everything else on this site.
**The endings get their own.** This game does not end in a win or a loss, it
ends in one of four things, and they do not sound alike:
- **the solo** -- eighteen centres, and the only unambiguous victory there is;
- **elimination** -- your last centre gone, which can happen in 1903 and
leaves you watching;
- **the draw** -- nobody reaches eighteen and the survivors agree to stop.
This is what actually happens most of the time, and it is neither a win nor
a loss, so it cannot borrow either of their tunes;
- **somebody else's solo** -- you are still on the board and it is over
anyway, which is the bleakest of the four and should sound like it.
## The board
Seventy-five provinces, two adjacency graphs — an army walks the land, a
fleet follows the water — and three provinces with two coasts that do not
connect, where a fleet has to say which one it is on.
The topology is a fact about a published game and free to use. The artwork is
not, and there is none here: the map this game draws is generated from the
data, the way the cave game's dodecahedron is.
`npm test` checks the board against itself. The one that earns its keep is
symmetry: an adjacency list this size is typed by hand once and wrong in
three places unless something looks. It found the Skagerrak wired to the
Baltic on the first run — which would have quietly opened a back door into
the Baltic and made Denmark worthless.
## The published test cases
`tools/datc.py` turns the Diplomacy Adjudicator Test Cases into
`src/game/datc.json` -- the orders and their annotated outcomes, not the
document's prose, which is Lucas Kruijswijk's writing. Every one of the 176
published cases is parsed and run.
| Section | | Passing |
| --- | --- | --- |
| 6.A - 6.G | movement | 133 / 139 |
| 6.H | retreating | 18 / 18 |
| 6.I | building | 7 / 7 |
| 6.J | civil disorder | 13 / 13 |
They are the reason this adjudicator is worth trusting: they found that
orders were never validated, that the paradox rule did not terminate, that
civil disorder was measuring the wrong distance, and that five of my own
hand-written cases rested on a support Paris cannot give.
Three cases are excluded rather than failed. 6.A.6, 6.B.10 and 6.B.11 state
their setup in prose -- "Germany has a fleet in London" -- and the fixture is
built from order lines, so it cannot carry a unit nobody ordered.
Six are known deviations, written down so they are not rediscovered as
surprises:
| Case | What it is |
| --- | --- |
| 6.A.5, 6.D.8 | The document distinguishes an `invalid` order from an `illegal` one, and the two cases disagree about whether a unit whose move was refused keeps its hold support. Guessing at the distinction cost four passing cases to buy one, so it is left until it can be read properly. |
| 6.F.22, 6.F.28, 6.F.29 | Second and sixth order paradoxes. The resolver settles them by Szykman's rule and reaches a different answer than the document's. These are positions nobody assembles by accident. |
| 6.G.19 | Whether an unnecessary fleet in a convoy chain signals intent. The document notes this one depends on which edition of the rules is used. |
Sections H, I and J -- retreating and the winter -- have engine code but no
harness yet; their cases are shaped differently and need one.
## The bots
`src/game/evaluate.ts` prices a position and `src/game/bot.ts` plays it.
Everything a power does comes out of two numbers, and they are deliberately
few: when a power turns on you, you are entitled to know what it thought it
was getting and be furious about the price rather than confused by it.
`chooseOrders` returns its reasoning as a list of sentences for exactly that.
Centres are the only thing that counts. Units are how you get them and are
worth nothing in themselves -- a power with eight units and four centres is
losing, and will have four units by the winter.
Two things the tests had to teach it. It garrisons a threatened centre it is
already standing on, because scoring only *moves* had it defending Berlin by
marching the Munich garrison there -- abandoning one centre to save another
of identical value. And it never shoves at its own countryman, which has no
strength at all and is two units wasting a turn on each other.
The price of breaking a promise is **how far this power trusts the partner**,
not how far the partner trusts it. Pricing it the other way round gives a
power that has been lied to four times a high cost of retaliating, because it
has been scrupulous itself and is still well thought of, which is exactly
backwards. An ally who has already betrayed you is worth nothing to protect.
Bots open negotiations rather than only answering them. `propose()` works
from the plan the power has already made: it decides what it wants to do this
turn, notices where that will not work alone, and goes looking for somebody
who could make it work. Help taking something defended, first; then a quiet
border over ground neither of them owns; then peace outright, when a
neighbour is over your centres and your ambitions are elsewhere. Three
approaches a turn at most, because six powers all talking at once is a
mailstorm rather than a negotiation.
Each overture carries what the power actually says, so it can be put in front
of a human as a message rather than as a form.
**A power will offer a quiet border to somebody it is attacking somewhere
else**, and that is deliberate. Germany marching on French Belgium while
suggesting both sides leave Burgundy alone is not a lie and not incoherent: a
promise about Burgundy is a promise about Burgundy, and it will be kept to
the letter by somebody who is robbing you at the same moment. A bot that
refused to make that offer would be playing a politer game than this one. It
will not, however, ask the power it is attacking to *help*, or offer it peace
while the orders say otherwise.
## Giving orders
Clicks on the board, because that is where the question is. Select a unit,
pick a verb, and the provinces the next click will accept light up -- so
nobody writes a move the rules were never going to allow, and nobody has to
learn a notation to find that out.
Everything offered comes from the rules rather than from the map, which is
the same split the map itself is built on. A fleet on the north coast of
Spain is drawn identically to one on the south coast and can go to entirely
different places; no shape can express that, and the highlight has to.
Orders are drawn where they are given: an arrow to where a unit is going, a
dashed line to what a support is holding up, a ring round a unit that is
staying. The list beside the board says the same thing in the rules' own
words, because an arrow cannot tell you that the support you meant for Vienna
is being given to Budapest. Anything the rules will not take is struck
through in the list as it is written, rather than after the turn.
## The turn
`src/game/game.ts` is the loop, and it has no interface attached on purpose:
a whole game can be played out in a test from the opening to whatever end it
finds. That is the only way to answer the question that actually matters
about the bots -- not whether each order looks sensible, but whether seven
powers left alone reach a conclusion.
Spring orders, retreats, autumn orders, retreats, then the winter, which is
the only phase that changes who owns anything.
Before the orders, everybody talks. Computer powers approach each other,
answer on the merits, and what they agree binds that turn and is judged at
the end of it. Approaches to the human are handed back rather than answered
for them.
**The game is called at the end of 1912.** Diplomacy has no clock of its own:
it ends on eighteen centres, or when the players agree to stop -- and
agreeing to stop is a conversation seven computer powers are never going to
have. Left alone they reach a standoff and hold it, which is what a table of
equally cautious players does and is why real games are called.
So: eighteen centres wins outright, and if nobody has them by the end of 1912
the survivors draw. Twelve years is a long evening and a real tournament
length, and **the draw is a proper ending here rather than a failure to
finish** -- it is the commonest way this game actually ends.
Worth saying plainly: seven bots left alone draw. They take centres off each
other now, which they could not do at all before, but none of them breaks
away to a solo. Beating six of them is the game.
## The other two phases
A beaten unit that finds somewhere to stand is a nuisance for years; one that
does not is gone. And the winter is where a good spring turns into a bigger
army, or does not. Both are decisions, and both were being taken *for* the
player while the rest of this was built, which quietly removed half the
consequence of the turn they had just played.
They are offered as places rather than as a notation, for the same reason the
orders are: the rules already know what is allowed, so the interface only
ever offers what is. A beaten unit lists the provinces it may fall back to and
nothing else; the winter lists the home centres that are yours and empty, with
a fleet offered only where a fleet could sit.
The game steps past anything with no decision in it. A retreat phase where
none of your units was thrown out, or a winter where your centres and units
are level, is not a choice -- it is a screen asking you to press Done.
## Writing a support
Support is the order the whole game turns on, and it was the order this
interface was worst at taking.
The rule is that the supporting unit must be able to reach the province the
supported unit is *going to* -- not the province it is standing in. The board
was offering the wrong set: only units standing next door. So Vienna could
not support Venice into Tyrolia, which is a perfectly ordinary order --
Vienna and Tyrolia touch, Vienna and Venice do not -- and there was no way
to say it. It also offered support to hold for units too far away to prop
up, wrote the order anyway, and let the adjudicator quietly turn it into a
hold after the turn was submitted.
That question now lives in `src/game/targets.ts` with the rest of the rules,
where it is eight tests rather than a closure in a component.
The second half was that a stray click threw away a half-written order. You
picked Support, picked the unit to help, missed the destination by a
province, and the whole thing silently became a fresh move somewhere else.
A two-part order now stands its ground and says no; clicking the unit giving
the order takes you back to the start of it. And the unit you picked to
support is marked on the board in a different colour from the unit giving
the order, because otherwise the second half is written blind.
## Still to build
- bots strong enough to solo against each other, not only to draw
- the music, the battle sound, the four endings