OpenKingdoms
============

An engine for Total Annihilation: Kingdoms. It plays your own copy of
the game. No game content is included here and none ever will be.


What you need
-------------

A copy of Total Annihilation: Kingdoms, from GOG or from the discs. The
engine reads the .hpi archives that install puts on your disk.


Running it
----------

Windows:  OpenKingdoms.exe
macOS:    ./OpenKingdoms
Linux:    ./OpenKingdoms

The first time it starts it looks for your copy of the game in the usual
places. If it cannot find one it prints what to do. You can name the
folder yourself in any of these ways:

  OpenKingdoms --game-dir "C:\GOG Games\Total Annihilation Kingdoms"

  set TAK_GAME_DIR=C:\GOG Games\Total Annihilation Kingdoms
  export TAK_GAME_DIR="$HOME/Games/Total Annihilation Kingdoms"

  or put the game in a folder called "game" beside OpenKingdoms

The folder is remembered after the first run, so this is asked once.

Run OpenKingdoms --help for the rest of the flags.


macOS
-----

This build is not signed by Apple, so the first run is refused with a
message about an unidentified developer. Clear the download flag once:

  xattr -dr com.apple.quarantine OpenKingdoms

Then open it as usual.


Linux
-----

If the file is not executable after unpacking:

  chmod +x OpenKingdoms

The SDL library it needs ships beside the binary, so nothing has to be
installed.


The 3D view, experimental
-------------------------

In any battle press V. The same battle is drawn in 3D under a camera
you can move. Press V again for the classic view. Nothing about the
game changes, only how it is drawn, and a player in the 3D view can
play a match against a player in the classic one.

  Q and E          orbit the camera
  R and F          tilt it
  Z and X, wheel   zoom
  Middle drag      orbit and tilt
  Home             back to the classic angle over the same spot
  WASD, arrows, screen edges   scroll, as always

Units, buildings, terrain, water, trees and the fog are drawn, and so
are shots, explosions, beams and spell effects. Shadows and health
bars are not yet. If V
does nothing, the game says why over the play area: the 3D view needs
OpenGL and this machine could not provide it.

This is the first look at a much larger piece of work. What you think
of it is worth an issue, at the address at the end of this file.


Your own models
---------------

A glTF 2.0 model from Blender, put in a models3d folder inside your
game folder and named after a unit's object name, is drawn by the 3D
view in place of the shipped one:

  Total Annihilation Kingdoms/
    models3d/
      aralode.glb          the Aramon lodestone

A loose .3do model in an objects3d folder there stands in for the
shipped one in both views, which is how a model mod for the original
game arrives. docs/CUSTOM_MODELS.md in the source tree says what a
model should hold.


Multiplayer
-----------

Multiplayer, then type the server address and press Enter. The address
is remembered after the first time.

A room holds players whose builds agree on arithmetic, so this build
plays with other copies of itself. A game hosted by a different platform
is listed and greyed, with the reason, rather than hidden. Every
platform's maths library rounds a sine its own way, which is enough to
pull two machines apart over a match.


Where your files go
-------------------

Saved games and settings live with your account, not in this folder:

  Windows:  %APPDATA%\OpenKingdoms\OpenKingdoms
  macOS:    ~/Library/Application Support/OpenKingdoms/OpenKingdoms
  Linux:    ~/.local/share/OpenKingdoms/OpenKingdoms


Reporting a problem
-------------------

github.com/OpenKingdoms/OpenKingdoms/issues

Say which archive you downloaded and what the window printed when it
started. The version line on the main menu is the one to quote.
