Casazium Tank Command
=====================

A small real-time-strategy prototype. Four tanks against four, on procedurally
generated terrain. Every map comes from a seed shown in the top-left, so F5
gives you a brand new one.

The other side is played by an AI. It advances, picks targets, and shoots back.
If you sit still you will lose.

Pick the file for your machine:

  CasaziumTankCommand.app      macOS  (Intel and Apple Silicon)
  CasaziumTankCommand.exe      Windows 64-bit
  CasaziumTankCommand.x86_64   Linux 64-bit

Nothing to install, and it writes nothing outside its own folder.

The window opens sized to your display rather than at a fixed size, so it
should be neither a postage stamp on a large monitor nor bigger than a small
laptop screen. Resize it freely; the interface scales with it.


BEFORE EACH ROUND: DEPLOY
-------------------------

Every round opens with your tanks waiting to be placed. Nothing moves, no
clock runs and nobody shoots until you say so.

  Right-click        put the selected tanks there, in your own half
  SPACE              begin the round (during deployment only)

Where you start is the most consequential decision in a round - the first
exchange usually settles it - so it is now yours to make rather than a spawn
formation. Use the ridges.


CONTROLS
--------

  Left-drag          select units with a box
  Left-click         select one unit; hold Shift to add or remove
  Right-click ground move there - the group spreads into a formation
  Right-click enemy  attack it. A standing order: your turrets track that
                     tank and keep firing until it dies or you order otherwise
  F                  shell the spot under the cursor. The gun holds until it
                     is actually lined up, so there is a pause before it fires
  X                  stop, and cancel any attack order. The tank goes back to
                     firing at whatever is nearest, rather than holding fire
  R                  next round (or a new match, once one is won)
  G                  difficulty: cycles Easy, Normal, Hard. The current
                     one is shown on the status line, and it sticks
                     across rounds

  W A S D / arrows   pan the camera
  Q / E              rotate
  Mouse wheel        zoom
  Middle-drag        grab the ground and drag it
  F5                 generate a new map
  F2                 toggle edge scrolling - when on, putting the mouse
                     near a screen edge pans the camera that way


HOW A MATCH WORKS
-----------------

A round ends when one side is wiped out, or after three minutes, in which case
the side with more health left takes it. First to three rounds wins the match.
Press R to play the next one.

Your tanks shoot back on their own. A tank with nothing else to do picks the
nearest enemy it has a clear line to and engages it, so you are never standing
there with loaded guns while being shot at. Your own orders always win: attack
something with right-click and your tanks stick to it, and X calls them off.
Earlier versions did not do this, and the opening of every round was an ambush
you had to have read the controls to survive.

Tanks do not come back. Guns are accurate but not perfect - roughly a third of
shots land at fighting range - so an engagement takes a while and either side
can lose it. Losing the first exchange usually loses the round, so where you
are before the shooting starts matters more than what you do once it has. Use
the terrain, and try not to meet all four of them at once in the open.


THINGS TO TRY
-------------

  Use the hills. Shells fly flat, so a ridge genuinely blocks them - your tanks
  and theirs both hold fire when there is no clear line. Roughly half the long
  sightlines on a typical map are blocked by terrain.

  Remember that a ridge now hides as well as shields. You only see enemies your
  own tanks have a clear line to; the rest of the map may as well be empty.
  When a tank you were watching breaks line of sight it leaves a faint marker
  where you last saw it, which fades as the information gets older. That marker
  is a memory, not a contact - it is where the tank WAS, and a good opponent
  will not still be there.

  The other side plays by the same rule. It cannot see your tanks through a
  hill either, and it remembers where it last saw you and goes to look. Sitting
  still behind a ridge is a real option for the first time.

  Pick your own targets. Left to themselves your tanks each shoot whatever is
  nearest, which is not obviously wrong - concentrating four guns on one enemy
  was measured over a hundred matches and did not win a single comparison. If
  you find something that beats it, that is a real discovery and not a trick
  you were supposed to know.

  Attack a moving tank with right-click. The gun leads the target, aiming where
  it is going rather than where it is - but the turret traverses at about the
  speed a real one did, so a tank that gets onto your flank is a serious
  problem. Keep your front toward trouble.

  Shell a spot you cannot see with F. Nothing stops you firing blind over a
  rise - it just will not be aimed for you.

  Shoot through your own tanks. Shells pass through friendly hulls on purpose.

  Three hits destroy a tank, and reloading takes about two seconds.

  Change the difficulty with G if the fight is going badly, or too well. The
  three settings change what the other side can DO - how straight it shoots,
  how often it rethinks, and how far out it will open fire - and never what it
  can see. Easy is a genuine handicap: against a player who does nothing at
  all, Easy lands 8% of its shots and Normal lands 22%.

  Listen. Guns, impacts and explosions are positional - a tank firing across
  the field sounds like it is across the field. The sounds are generated by
  the game rather than recorded, so there are no audio files in here at all.

  Watch the AI fight itself, if you are comfortable with a terminal. Run the
  game with --ai-vs-ai after a bare -- and both sides are played by the
  computer while you spectate. Add --green and --red to set each side's
  difficulty separately (easy, normal or hard), --seed to pick a map, or
  --promo to play a whole match start to finish with the camera following the
  fight and nothing to press:

    macOS    "CasaziumTankCommand.app/Contents/MacOS/Casazium Tank Command" -- --ai-vs-ai
    Linux    ./CasaziumTankCommand.x86_64 -- --ai-vs-ai
    Windows  CasaziumTankCommand.exe -- --ai-vs-ai


MACOS: "cannot be opened because the developer cannot be verified"
-----------------------------------------------------------------

macOS says this about any app not signed by a registered Apple developer.
Signing properly requires a paid Apple developer account. The app is fine - it
just cannot prove who made it.

Two ways past it:

  Right-click (or Control-click) CasaziumTankCommand.app, choose Open, then Open again in
  the dialog. You only need to do this the first time.

  Or, in Terminal:   xattr -cr /path/to/CasaziumTankCommand.app


LINUX
-----

If it will not start, mark it executable:   chmod +x CasaziumTankCommand.x86_64


KNOWN LIMITS
------------

  The AI is simple. It heads for the nearest enemy, closes until it has a
  clear line, and fires. It does not scout, flank or retreat, and it will not
  surprise you twice.

  It also will not sit and stare at a hill any more. Until this version a tank
  with no clear shot would advance to a fixed distance, find the ridge still in
  the way, and then hold there for the rest of the round - which at the harder
  settings, where it stops further out, could mean a whole match of both sides
  standing still.

  There is no menu and no multiplayer yet.

  Ghost markers show a last known position only. They do not show which way a
  tank was heading, or how long ago it was seen beyond a slow fade.

  Quit with Cmd-Q, Alt-F4, or by closing the window.
