-
Notifications
You must be signed in to change notification settings - Fork 4
The Ruby Adjudicator File Format
Like every badass project, the Ruby Adjudicator has its own file format. Stuff needs to be stored, and we need a format to store them in.
Well, we are a Ruby Adjudicator, so naturally, we need to store two things: Diplomacy game state (ie. area ownerships and unit placement), and Diplomacy orders (ie. where we have the illusion that our units will go next). Everything will be stored in a custom text format, because why not, right?*
In this here game, we have a map, divided into areas, some of which are also supply centers ( SCs ). Some areas are in land, some are out in the sea.
In each area, there can be one (and only one) unit at a time. Units (and areas) belong to a power. Sometimes, just to separate the plebeians from the patricians (gratuitous Ancient Rome reference for absolutely no reason), we will refer to the nationality of a unit, while areas might have an owner (both refer to the power who controls the thing in question). Expect to be mocked if you don't use the lingo, you have been warned.
State is expressed with a space-delimited list of power states:
<one-power's-state> <another-power's-state> <as-you-might-guess,-a-third-power's-state>
A power state consists of the name of the power, followed by a comma-delimited list of units, followed by a comma-delimited list of areas owned, delimited by a colon and a pipe, respectively:
<power-name>:<unit>,<aaand-unit>|<area-abbr>,<oh-lord-another-area-abbr>,<etc>,<etc>,<enough.>
- A unit consists of a type shorthand (A for army, F for fleet), followed immediately by an area abbreviation, and optionally by a dislodgement
- An area abbreviation consists of single area abbreviation (science)
- A dislodgement consists of an asterisk (*) followed by an area abbreviation (denoting where the move that dislodged this unit originated from)
Any and all who do not observe the aforementioned rules will be scoffed and ignored by our parser. They are free to write their own.
France's starting position
France:APar,FBre,AMar|Par,Bre,Mar,Gas,Pic,Bur
I'm sorry Austria, you are fucked
Italy:ATyr,AVen,FIon|Ven,Apu,Tus,Pie,Rom,Nap Austria:FAlb,ASer,ABud|Bud,Boh,Gal,Vie,Tri,Tyr
Notice how even though Italy has a unit in Tyrolia, it still belongs to Austria. Notice also how sea areas (Ion) are never controlled by anyone. This is not enforced by the parser, but circumventing it is FROWNED UPON. You have been warned twice, now. Watch it.
Russia has no units
Russia:|War,Mos,Sev
England dislodged France in Belgium
England:ABel,FNth,FEng|Bel France:ABel*Lon
England's dislodging move came from London.
Orders come in seven different flavours, each with their own format.
<Unit type><Unit area abbrv>-<Destination area abbrv>
ASwe-Nor
FSpa(sc)-Mar
ALon-Bel
<Unit type><Unit area abbrv>S<Supported unit type><Source area abbrv>-<Destination area abbrv>
FSkaSASwe-Nor
APorSFMAO-Spa(sc)
FHolSALon-Bel
<Unit type><Unit area abbrv>H
FDenH
ANAfH
FConH
<Unit type><Unit area abbrv>S<Supported unit type><Supported area abbrv>H
AKieSFDenH
FTunSANAfH
FGreSFConH
<Unit type><Unit area abbrv>C<Convoyed unit type><Source area abbrv>-<Destination area abbrv>
FEngCALon-Bel
FMAOCASyr-StP
<Unit type><Unit area abbrv>(B|D)
ABudB
FTriB
ANAfD
<Unit type><Unit area abbrv>*<Destination area abbrv>
ASwe*Nor
FSpa(sc)*Mar
ALon*Bel
* Also because this was mainly developed to write Cucumber tests, and it was convenient for that.