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>
This commit is contained in:
Markus Armbruster 2014-12-24 16:33:51 +01:00
parent a4e519c377
commit 48e656c057
37 changed files with 306 additions and 1764 deletions

View file

@ -7,12 +7,9 @@ load c 3/4 999
nav 3 6,0
h
nav 3 vh
order 3 des 5,-1 6,0
order 3 level 1 end oil 1
__cmd added -2 -2 0
nav 4 nvh
order 4 des 5,-1 6,0
order 4 level 1 start food 30
order 4 level 1 end food 30
__cmd added -3 -3 0
tran p 0/1/2 11,-1
reco 0 . 11,-1 ujbgh
bomb 1 . stat 11,-1 ujh

View file

@ -1026,7 +1026,7 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
0 -1 -1 4 0 0 0 0 0 0 0 0 0 -1 -1 0 61 0 1 4 63 33 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
/config
config ship
uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet xstart xend ystart yend cargostart(0) cargostart(1) cargostart(2) cargostart(3) cargostart(4) cargostart(5) cargoend(0) cargoend(1) cargoend(2) cargoend(3) cargoend(4) cargoend(5) amtstart(0) amtstart(1) amtstart(2) amtstart(3) amtstart(4) amtstart(5) amtend(0) amtend(1) amtend(2) amtend(3) amtend(4) amtend(5) autonav civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime access mquota path follow name xbuilt ybuilt builder rflags rpath
uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime access mquota path follow name xbuilt ybuilt builder rflags rpath
/config
config plane
uid owner xloc yloc type effic mobil off tech opx opy mission radius wing range ship land harden flags access theta

View file

@ -581,7 +581,7 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
1 4 -14 29 100 127 0 0 0 0 0 0 0 11 -11 650 43 100 1 29 34 0 28 0 0 1 1000 0 0 0 0 0 0 457 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 1 0 0 0 0 0
1 6 -14 10 100 127 0 0 0 0 0 0 0 11 -11 0 89 100 0 10 100 69 0 0 97 1 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 healthy 0 0 1 0 0 0 0 0
1 8 -14 10 100 127 0 0 0 0 0 0 0 11 -11 0 82 100 0 10 96 60 0 0 77 1 1000 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 1 0 0 0 0 0
1 10 -14 12 100 127 0 0 0 0 0 0 0 11 -11 628 50 100 1 12 45 19 13 0 0 1 962 5 200 10 0 1 1 0 870 1 200 200 0 0 0 0 200 10 0 0 0 0 0 0 200 200 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 1 0 0 0 0 0
1 10 -14 12 100 127 0 0 0 0 0 0 0 11 -11 628 50 100 1 12 45 19 13 0 0 1 962 5 200 10 0 1 1 0 0 1 200 200 0 0 0 0 200 10 0 0 0 0 0 0 200 200 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 1 0 0 0 0 0
1 12 -14 28 100 127 0 0 0 0 0 0 0 11 -11 110 -4 100 1 28 0 0 45 11 0 1 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 1 0 0 0 0 0
1 14 -14 28 100 127 0 0 0 0 0 0 0 11 -11 110 -22 100 1 28 0 0 63 46 0 1 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 1 0 0 0 0 0
1 16 -14 25 100 127 0 0 0 0 0 0 0 11 -11 645 7 100 1 25 0 0 100 98 0 1 1000 23 20 0 20 0 0 0 0 0 0 0 1 0 0 0 20 0 20 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
@ -1026,13 +1026,13 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
0 -1 -1 4 0 0 0 0 0 0 0 0 0 -1 -1 0 61 0 1 4 63 33 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
/config
config ship
uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet xstart xend ystart yend cargostart(0) cargostart(1) cargostart(2) cargostart(3) cargostart(4) cargostart(5) cargoend(0) cargoend(1) cargoend(2) cargoend(3) cargoend(4) cargoend(5) amtstart(0) amtstart(1) amtstart(2) amtstart(3) amtstart(4) amtstart(5) amtend(0) amtend(1) amtend(2) amtend(3) amtend(4) amtend(5) autonav civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime access mquota path follow name xbuilt ybuilt builder rflags rpath
0 1 18 -12 6 100 127 0 0 0 0 none 0 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 0 "" 10 -14 1 () ""
1 1 10 -14 2 100 127 0 31 0 0 none 0 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 300 25 0 0 0 0 0 0 0 0 100 100 0 0 healthy 0 0 0 "" 1 "" 10 -14 1 () ""
2 1 10 -14 15 100 127 0 44 0 0 none 0 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 30 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 2 "" 10 -14 1 () ""
3 1 10 -14 8 100 127 0 51 0 0 none 0 "" 11 10 -13 -14 -1 -1 -1 -1 -1 -1 9 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 0 0 0 0 0 4 990 0 0 0 0 0 0 0 0 449 0 0 0 0 healthy 0 0 0 "" 3 "" 10 -14 1 () ""
4 1 11 -13 1 100 127 0 51 0 0 none 0 "" 10 11 -14 -13 8 -1 -1 -1 -1 -1 8 -1 -1 -1 -1 -1 30 0 0 0 0 0 30 0 0 0 0 0 4 300 0 0 0 0 0 0 0 30 0 0 0 0 0 healthy 0 0 0 "" 4 "" 10 -14 1 () ""
49 0 0 0 0 0 0 0 0 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 0 "" 0 0 0 () ""
uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime access mquota path follow name xbuilt ybuilt builder rflags rpath
0 1 18 -12 6 100 127 0 0 0 0 none 0 "" 0 25 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 0 "" 10 -14 1 () ""
1 1 10 -14 2 100 127 0 31 0 0 none 0 "" 300 25 0 0 0 0 0 0 0 0 100 100 0 0 healthy 0 0 0 "" 1 "" 10 -14 1 () ""
2 1 10 -14 15 100 127 0 44 0 0 none 0 "" 30 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 2 "" 10 -14 1 () ""
3 1 11 -13 8 100 127 0 51 0 0 none 0 "" 990 0 0 0 0 0 0 0 0 449 0 0 0 0 healthy 0 0 0 "" 3 "" 10 -14 1 () ""
4 1 11 -13 1 100 127 0 51 0 0 none 0 "" 300 0 0 0 0 0 0 0 900 0 0 0 0 0 healthy 0 0 0 "" 4 "" 10 -14 1 () ""
49 0 0 0 0 0 0 0 0 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 0 "" 0 0 0 () ""
/config
config plane
uid owner xloc yloc type effic mobil off tech opx opy mission radius wing range harden ship land flags access theta

View file

@ -211,15 +211,6 @@
Play#0 output Play#0 1 "mission" 6 0 0 34
Play#0 output Play#0 1 "radius" 6 0 0 -1
Play#0 output Play#0 1 "fleet" 13 0 1 -1
Play#0 output Play#0 1 "xstart" 9 0 0 -1
Play#0 output Play#0 1 "xend" 9 0 0 -1
Play#0 output Play#0 1 "ystart" 10 0 0 -1
Play#0 output Play#0 1 "yend" 10 0 0 -1
Play#0 output Play#0 1 "cargostart" 4 0 6 16
Play#0 output Play#0 1 "cargoend" 4 0 6 16
Play#0 output Play#0 1 "amtstart" 6 0 6 -1
Play#0 output Play#0 1 "amtend" 6 0 6 -1
Play#0 output Play#0 1 "autonav" 5 0 0 -1
Play#0 output Play#0 1 "civil" 6 0 0 -1
Play#0 output Play#0 1 "milit" 6 0 0 -1
Play#0 output Play#0 1 "shell" 6 0 0 -1
@ -246,7 +237,7 @@
Play#0 output Play#0 1 "builder" 5 1 0 8
Play#0 output Play#0 1 "rflags" 8 8 0 46
Play#0 output Play#0 1 "rpath" 13 0 10 -1
Play#0 output Play#0 1 /49
Play#0 output Play#0 1 /40
Play#0 output Play#0 6 0 640
Play#0 input xdump meta plane
Play#0 command xdump
@ -1366,15 +1357,6 @@
Play#2 output Play#2 1 "mission" 6 0 0 34
Play#2 output Play#2 1 "radius" 6 0 0 -1
Play#2 output Play#2 1 "fleet" 13 0 1 -1
Play#2 output Play#2 1 "xstart" 9 0 0 -1
Play#2 output Play#2 1 "xend" 9 0 0 -1
Play#2 output Play#2 1 "ystart" 10 0 0 -1
Play#2 output Play#2 1 "yend" 10 0 0 -1
Play#2 output Play#2 1 "cargostart" 4 0 6 16
Play#2 output Play#2 1 "cargoend" 4 0 6 16
Play#2 output Play#2 1 "amtstart" 6 0 6 -1
Play#2 output Play#2 1 "amtend" 6 0 6 -1
Play#2 output Play#2 1 "autonav" 5 0 0 -1
Play#2 output Play#2 1 "civil" 6 0 0 -1
Play#2 output Play#2 1 "milit" 6 0 0 -1
Play#2 output Play#2 1 "shell" 6 0 0 -1
@ -1396,7 +1378,7 @@
Play#2 output Play#2 1 "name" 13 0 24 -1
Play#2 output Play#2 1 "rflags" 8 8 0 46
Play#2 output Play#2 1 "rpath" 13 0 10 -1
Play#2 output Play#2 1 /44
Play#2 output Play#2 1 /35
Play#2 output Play#2 6 0 636
Play#2 input xdump meta plane
Play#2 command xdump
@ -14508,13 +14490,8 @@
Play#1 output Play#1 1 [oil:88] od oil derrick (#3) @ 6,0 0% sea
Play#1 output Play#1 1 od oil derrick (#3) stopped at 6,0
Play#1 output Play#1 6 0 632
Play#1 input order 3 des 5,-1 6,0
Play#1 command order
Play#1 output Play#1 1 A circular order has been accepted.
Play#1 output Play#1 6 0 631
Play#1 input order 3 level 1 end oil 1
Play#1 command order
Play#1 output Play#1 1 Order set
Play#1 input __cmd added -2 -2 0
Play#1 command __cmd
Play#1 output Play#1 6 0 630
Play#1 input nav 4 nvh
Play#1 command navigate
@ -14522,17 +14499,8 @@
Play#1 output Play#1 1 [fert:84] ft fishing trawler (#4) @ 6,0 0% sea
Play#1 output Play#1 1 ft fishing trawler (#4) stopped at 6,0
Play#1 output Play#1 6 0 629
Play#1 input order 4 des 5,-1 6,0
Play#1 command order
Play#1 output Play#1 1 A circular order has been accepted.
Play#1 output Play#1 6 0 628
Play#1 input order 4 level 1 start food 30
Play#1 command order
Play#1 output Play#1 1 Order Set
Play#1 output Play#1 6 0 627
Play#1 input order 4 level 1 end food 30
Play#1 command order
Play#1 output Play#1 1 Order set
Play#1 input __cmd added -3 -3 0
Play#1 command __cmd
Play#1 output Play#1 6 0 626
Play#1 input tran p 0/1/2 11,-1
Play#1 command transport
@ -15574,11 +15542,11 @@
Play#0 input xdump ship *
Play#0 command xdump
Play#0 output Play#0 1 XDUMP ship 0
Play#0 output Play#0 1 0 1 18 -12 6 100 127 0 0 0 0 0 0 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "" 0 "" 10 -14 1 0 ""
Play#0 output Play#0 1 1 1 10 -14 2 100 127 0 31 0 0 0 0 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 300 25 0 0 0 0 0 0 0 0 100 100 0 0 0 0 0 0 "" 1 "" 10 -14 1 0 ""
Play#0 output Play#0 1 2 1 10 -14 15 100 127 0 44 0 0 0 0 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "" 2 "" 10 -14 1 0 ""
Play#0 output Play#0 1 3 1 10 -14 8 100 127 0 51 0 0 0 0 "" 11 10 -13 -14 -1 -1 -1 -1 -1 -1 9 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 0 0 0 0 0 4 990 0 0 0 0 0 0 0 0 449 0 0 0 0 0 0 0 0 "" 3 "" 10 -14 1 0 ""
Play#0 output Play#0 1 4 1 11 -13 1 100 127 0 51 0 0 0 0 "" 10 11 -14 -13 8 -1 -1 -1 -1 -1 8 -1 -1 -1 -1 -1 30 0 0 0 0 0 30 0 0 0 0 0 4 300 0 0 0 0 0 0 0 30 0 0 0 0 0 0 0 0 0 "" 4 "" 10 -14 1 0 ""
Play#0 output Play#0 1 0 1 18 -12 6 100 127 0 0 0 0 0 0 "" 0 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "" 0 "" 10 -14 1 0 ""
Play#0 output Play#0 1 1 1 10 -14 2 100 127 0 31 0 0 0 0 "" 300 25 0 0 0 0 0 0 0 0 100 100 0 0 0 0 0 0 "" 1 "" 10 -14 1 0 ""
Play#0 output Play#0 1 2 1 10 -14 15 100 127 0 44 0 0 0 0 "" 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "" 2 "" 10 -14 1 0 ""
Play#0 output Play#0 1 3 1 11 -13 8 100 127 0 51 0 0 0 0 "" 990 0 0 0 0 0 0 0 0 449 0 0 0 0 0 0 0 0 "" 3 "" 10 -14 1 0 ""
Play#0 output Play#0 1 4 1 11 -13 1 100 127 0 51 0 0 0 0 "" 300 0 0 0 0 0 0 0 900 0 0 0 0 0 0 0 0 0 "" 4 "" 10 -14 1 0 ""
Play#0 output Play#0 1 /5
Play#0 output Play#0 6 0 640
Play#0 input xdump plane *
@ -16329,11 +16297,11 @@
Play#1 input xdump ship *
Play#1 command xdump
Play#1 output Play#1 1 XDUMP ship 0
Play#1 output Play#1 1 0 1 13 1 6 100 127 0 0 -5 13 0 0 "" -5 -5 13 13 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "" 0 "" 0 ""
Play#1 output Play#1 1 1 1 5 -1 2 100 127 0 31 -5 13 0 0 "" -5 -5 13 13 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 300 25 0 0 0 0 0 0 0 0 100 100 0 0 0 0 "" 1 "" 0 ""
Play#1 output Play#1 1 2 1 5 -1 15 100 127 0 44 -5 13 0 0 "" -5 -5 13 13 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "" 2 "" 0 ""
Play#1 output Play#1 1 3 1 5 -1 8 100 127 0 51 -5 13 0 0 "" 6 5 0 -1 -1 -1 -1 -1 -1 -1 9 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 0 0 0 0 0 4 990 0 0 0 0 0 0 0 0 449 0 0 0 0 0 0 "" 3 "" 0 ""
Play#1 output Play#1 1 4 1 6 0 1 100 127 0 51 -5 13 0 0 "" 5 6 -1 0 8 -1 -1 -1 -1 -1 8 -1 -1 -1 -1 -1 30 0 0 0 0 0 30 0 0 0 0 0 4 300 0 0 0 0 0 0 0 30 0 0 0 0 0 0 0 "" 4 "" 0 ""
Play#1 output Play#1 1 0 1 13 1 6 100 127 0 0 -5 13 0 0 "" 0 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "" 0 "" 0 ""
Play#1 output Play#1 1 1 1 5 -1 2 100 127 0 31 -5 13 0 0 "" 300 25 0 0 0 0 0 0 0 0 100 100 0 0 0 0 "" 1 "" 0 ""
Play#1 output Play#1 1 2 1 5 -1 15 100 127 0 44 -5 13 0 0 "" 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "" 2 "" 0 ""
Play#1 output Play#1 1 3 1 6 0 8 100 127 0 51 -5 13 0 0 "" 990 0 0 0 0 0 0 0 0 449 0 0 0 0 0 0 "" 3 "" 0 ""
Play#1 output Play#1 1 4 1 6 0 1 100 127 0 51 -5 13 0 0 "" 300 0 0 0 0 0 0 0 900 0 0 0 0 0 0 0 "" 4 "" 0 ""
Play#1 output Play#1 1 /5
Play#1 output Play#1 6 0 640
Play#1 input xdump plane *