Commit Graph
4 Commits
Author SHA1 Message Date
jcoffey-dev 6c388f5bc4 Convoy intent, coasts in support, and what a disrupted convoy is
122 of 139 movement cases now.

Intent, which decides whether two units swapping bounce or sail past each
other: an army goes by convoy if it was ordered to, or if its own power gave
a legal convoy order for that move. Somebody else's fleets offering a route
is not intent however good the route, and your own fleet offering from a sea
it could never do it from is not intent either, because that was not an
order. Once intent exists any ordered route may carry it, foreign or not.

A convoy order is only an order if water could actually carry that army past
that fleet, which is a question about the map and is now asked.

Support is given to a province, not to a coast of one: a fleet in Marseilles
may support an attack on the north coast of Spain although it could never
sail there. And a support is only as legal as the move underneath it.

Two bugs of my own. Convoy routing could not start from or arrive at a
province with two coasts, because the fleet graph has no bare entry for one
-- there is no 'bul', only 'bul/ec' and 'bul/sc' -- so an army boarding in
Bulgaria found no sea and stayed home. And I had read 'disrupted' as the
escort being sunk when it means the army not arriving; in Pandin's Paradox
the fleet survives and the army still does not get there.
2026-09-09 06:19:45 -07:00
jcoffey-dev b41cf1c210 Run the published test cases, and fix what they found
tools/datc.py turns the Diplomacy Adjudicator Test Cases into a fixture: the
orders and their annotated outcomes, not the document's prose. 139 movement
cases run; 107 pass.

Three real faults so far, none of which the hand-written cases had caught:

Orders were never validated. An illegal order has to be refused and the unit
left holding -- still standing there, still in everybody's way -- and a fleet
told to go to Spain has to be told which coast when both are reachable.
There is now a validation pass, and ordering another country's unit is
refused without disturbing the order its owner actually gave.

The paradox rule did not terminate. Settling only what was already in the
dependency cycle resolves nothing in a real paradox, so the resolver asked
the same question forever -- Pandin's Paradox was a stack overflow rather
than an answer. It now restarts the whole resolution with the convoyed army
held still, which is inelegant and provably finite: each restart forces one
more army to stand, and there are only so many armies.

A held army kept its path. Szykman's rule stops the army; it has to stop the
army's weight too, or the paradox re-forms on the next pass and the restart
never converges.
2026-09-09 00:36:39 -07:00
jcoffey-dev 601b961c88 Retreats and the winter
Movement is the part everybody thinks about and it is not the part that
decides the game. 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.

Four things are closed to a retreat: anywhere unreachable, anywhere occupied,
the province the attacker came from, and any province two units bounced out
of -- that last is the one people forget, since a bounce leaves a province
empty and closed rather than empty and open. The exception is an attacker who
arrived by convoy: it never marched through the ground between, so there is
nothing to stop the loser falling back that way. Two units retreating to the
same province destroy each other, there being no support in this phase and
nothing to break the tie with.

Ownership changes only in the autumn and only by standing on a centre. A
centre you walked through in the spring is not yours; one you walked away
from stays yours until somebody else stands on it, which is why a power with
no units can still hold centres.

Civil disorder removes what is furthest from home, fleets first, then
alphabetically -- arbitrary in the last step on purpose, so that two
adjudicators never disagree about a game nobody is playing.
2026-09-09 00:27:07 -07:00
jcoffey-dev ec3b5143c7 The adjudicator
Kruijswijk's resolver: work each order out from the others, and when that
turns out to be circular -- which it genuinely can be, this game has real
paradoxes in it -- guess, check whether both guesses agree, and fall back to
a stated rule when they do not. A ring of units all moving into each other
all move. A convoy paradox is settled by Szykman's rule, which is a
convention rather than a deduction and is written down as one.

Four strengths do the work: attack, hold, defend and prevent. A move has to
beat the right one of them strictly, so an unsupported attack never takes a
supported province and a tie is always a bounce.

Worth noting what falls out rather than being written down. A unit cannot
drive out a countryman, so a move against one has attack strength zero, so it
cuts no support -- which is why a power cannot cut its own support. That is a
consequence of Calhamer's rule, not a separate one, and the comment says so
where the zero is returned.

Twenty-one cases, all written out in full so a reader can check them by hand.
2026-09-09 00:24:14 -07:00