]> git.pond.sub.org Git - empserver/commit
autonav: Remove the feature
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 24 Dec 2014 15:33:51 +0000 (16:33 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 28 Feb 2015 15:10:22 +0000 (16:10 +0100)
commit48e656c05742e4c775951e349bd6daf58fdf162a
tree1247239a0fd8e511f6646f5db52cbce933aefcef
parenta4e519c377523415a8997bbd017c788e654f2976
autonav: Remove the feature

The autonavigation feature has issues:

* Autonavigation orders are executed at the update.  Crafty players
  can use them to get around the update window.

* Usability is poor:

  - The order command is overly complex, not least because it can do
    five different things: clear, suspend, resume, declare route, set
    cargo levels.

  - Unlike every other command involving movement, order does not let
    you specify routes, only destination sectors.

  - Setting cargo levels can silently swap start and end point of a
    circular route, because "this keeps the load_it() procedure
    happy".  Maybe it does, but it surely keeps players confused.

  - Setting "start" cargo levels actually sets the "end" levels, and
    vice versa.  Has always been broken that way.

  - Predicting what exactly autonavigation will do at the update isn't
    easy.

* The info pages documenting it amount to almost 400 non-blank lines
  formatted.  They claim only merchant ships can be given orders.
  This is wrong.  Unlikely to be the only error.

* Few players use it, and its workings at the update a fairly opaque.
  Makes it a nice hidey-hole for bugs.  Here are two:

  - Unlike the scuttle command, autonavigation happily scuttles trade
    ships while they're on the trading block.

  - Unlike the load command, autonavigation can load in friendly and
    allied sectors.

* It's more than 700 lines of rather crufty code nobody wants to
  touch.  Thanks to a big effort in Empire 2, it shares code with the
  navigation command.  It still duplicates load code.  The sharing
  complicates fixing the bugs demonstrated by navi-march-test.

Reviewing, fixing and testing this mess isn't worth the opportunity
cost.  Remove it instead.  Drop commands order, qorder and sorder.
Drop ship selectors xstart, xend, ystart, yend, cargostart, cargoend,
amtstart, amtend, autonav.

xdump ship sheds almost half its columns.  struct shpstr shrinks, on
my system from 200 to 160 bytes.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
37 files changed:
include/prototypes.h
include/ship.h
info/Autofish.t [deleted file]
info/Autonav.t [deleted file]
info/Selector.t
info/Trade-ships.t
info/Update-sequence.t
info/mission.t
info/navigate.t
info/order.t [deleted file]
info/qorder.t [deleted file]
info/sail.t
info/sorder.t [deleted file]
info/version.t
src/lib/commands/foll.c
src/lib/commands/orde.c [deleted file]
src/lib/commands/sail.c
src/lib/commands/scut.c
src/lib/commands/vers.c
src/lib/common/nsc.c
src/lib/player/empmod.c
src/lib/subs/unitsub.c
src/lib/update/nav_ship.c [deleted file]
src/lib/update/nav_util.c [deleted file]
src/lib/update/ship.c
tests/actofgod/final.xdump
tests/bridgefall/final.xdump
tests/build/final.xdump
tests/fairland/final.xdump
tests/files/final.xdump
tests/fire/final.xdump
tests/navi-march/final.xdump
tests/retreat/final.xdump
tests/smoke/16/01-1
tests/smoke/fairland.xdump
tests/smoke/final.xdump
tests/smoke/journal.log