home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / twbf015.zip / readme.txt < prev    next >
Text File  |  2000-02-18  |  64KB  |  1,393 lines

  1.                README for Tradewars 2002 bubble finder v0.15
  2.  
  3.  
  4.                   Contents ..........................  1
  5.  
  6.                I. Legal Stuff .......................  2
  7.  
  8.               II. Overview ..........................  2
  9.     
  10.              III. Getting Sector Data ...............  3
  11.  
  12.               IV. Running the Program ...............  6
  13.  
  14.                V. Output ............................  11
  15.  
  16.               VI. Limitations .......................  14
  17.  
  18.              VII. Performance .......................  14
  19.  
  20.             VIII. Notes on Program Behavior .........  14
  21.  
  22.               IX. How it Works ......................  16
  23.                                                        
  24.                X. Compiling the Program .............  17 
  25.  
  26.               XI. Author Information ................  18
  27.  
  28.              XII. History ...........................  18
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                    Page 1
  59. I. Legal Stuff
  60.  
  61. This program is provided free of charge, and I'm not liable for any damage 
  62. it may do, nor do I guarantee any level of functionality.  You know the 
  63. drill.
  64.  
  65. If you make any modifications, I require that you make an effort to contact 
  66. me before distributing the modified form.  
  67.  
  68. ================================================================================
  69.  
  70. II. Overview
  71.  
  72. If you don't play the BBS online door game Tradewars 2002, then you'll find 
  73. this particular program quite useless indeed.
  74.  
  75. If you do play, however, you may find it extremely useful.  
  76.  
  77. You may still, however, not be sure what a "bubble" in the game is.  
  78.  
  79. If you've been playing for any amount of time, you've probably come to 
  80. realize what a tunnel is, specifically, an arrangement of sectors something 
  81. like this:
  82.  
  83. 3343
  84.      \
  85. 2231 - 556 - 783 - 3259 - 895
  86.      /
  87. 1011
  88.  
  89. In this case, 895 would be a dead-end sector.  Only one way in, and one 
  90. way out.  The more sectors like 783 and 3259 between it and 556, the better.
  91.  
  92. The helper program that I use, Trade Wars Helper version 8.8, is able to 
  93. find tunnels like the above, but it's not able to handle something like 
  94. this:
  95.  
  96. 3343               4490
  97.      \              |
  98. 2231 - 556 - 783 - 3259 - 895
  99.      /              |
  100. 1011               2333
  101.  
  102. TW Helper would report the above as three one-sector tunnels, whereas in 
  103. reality is is a 5-sector bubble, with the entrance at 556.
  104.  
  105. There are two other helper programs that I know of out there, entitled TWar 
  106. and TWATS.  TWar claims to be able to find "tunnels" with non-sequential 
  107. sectors (which apparently covers the above), and TWATS claims to be able to 
  108. find large bubbles.  And for all I know, they both do the job very nicely 
  109. indeed.  But the evaluation versions are too crippled to test this feature, 
  110. and I see no compelling reason to pay for either one, since they appear to 
  111. do nothing that TW Helper doesn't do as well or better.  
  112.  
  113. Except for the bubble finding, of course.  After spending about 5 seconds 
  114. deciding that TW Helper's /I and /G commands together would take too much 
  115.  
  116.                                    Page 2
  117. time, I set out to write a program that would find bubbles automatically.
  118.  
  119. It was quite a learning experience, and it's still possible that there's 
  120. more that I haven't thought of which will make it into a future version.
  121.  
  122. Something new to the program is finding bubbles with more than one 
  123. entrance.  Something like the following:
  124.  
  125.  
  126. 3343               4490                            3234
  127.      \              |                            /
  128. 2231 - 556 - 783 - 3259 - 895 - 443 - 559 - 1235 - 4454
  129.      /              |               \            \
  130. 1011               2333               990 - 784    1903
  131.  
  132. The entrances in the above would be 556 and 1235.  It shouldn't take much 
  133. imagination to see how more entrances would fit in.
  134.  
  135. See notes on program behavior for caveats with multiple-entrance bubbles.
  136.  
  137. New to versions 0.13 and later is the ability to use CIM course plot
  138. captures, which is what helper programs use to do zero-turn mapping.  What
  139. these captures provide is the route between one sector and another.  For
  140. each sector in the route, it tells us two things:
  141.  
  142.     1)  The sector in question has an outwarp to the next sector in the
  143.         route.
  144.  
  145.     2)  The sector in question has an inwarp from the previous sector in
  146.         the route.
  147.  
  148. With enough course plots, you can get complete information about a sector
  149. without exploring it.
  150.  
  151. See the notes on program behavior for the potential downside to this
  152. ability (which is why it can be avoided altogether or disabled).
  153.  
  154. ================================================================================
  155.  
  156. III. Getting Sector Data
  157.  
  158. The program has four types of input:
  159.  
  160.     1) Binary database.
  161.     2) CIM course plot session capture.
  162.     3) CIM sector information.
  163.     4) CIM port information.
  164.  
  165. You can use any one of the above, or any combination of them.  They are
  166. read in the order listed above, so that the most accurate information is
  167. read last.  The binary database, of course, is created by a previous run of
  168. the program, which used any of the CIM captures for input.
  169.  
  170. Details on the different files:
  171.  
  172. 1) Binary database - this file is created by TWBFind, if you specify a
  173.  
  174.                                    Page 3
  175. binary file name on the command line.  The data is written after reading in
  176. any data from the other two file formats.  The file consists of 16 bytes of
  177. data for every sector.  There are two bytes each for the maximum of six
  178. outwarps, an explored byte, and three reserved bytes. A typical hex editor
  179. will show you one sector per line, with a smily face in the first column
  180. from the left indicating that it's explored.
  181.  
  182. 2)  CIM course plot session capture - this file is created by you, using
  183. your communications program with a script.  How exactly you do this will
  184. vary, of course.  In your comm script, you'll want to enter CIM mode (see
  185. below), and plot various courses, which will show how sectors are
  186. connected.  Plots are done by pressing "F", then entering the start and end
  187. sectors.
  188.  
  189. The more plots, the more information.  The only way to get all information
  190. without exploring is to plot a course from each sector to every other
  191. sector, and back again.  In a universe with just 1000 sectors, this means
  192. 998,000 plots.  With 5000 sectors, it's 24,990,000 plots.  And with 20,000
  193. sectors, you'd need to do 399,960,000 plots.  Needless to say, doing all
  194. those plots would be time consuming.  So time consuming, in fact, that
  195. actually exploring the universe would take considerably less time.
  196.  
  197. So, what you're looking for is a way to get a lot of warp information in
  198. relatively few course plots.  The simplest way to do this is by using a
  199. simple algorithm that picks two sectors, and plots a course in both
  200. directions, where every sector is covered at least once.
  201.  
  202. Here are a few methods in the form [begin condition]; [cycle activity];
  203. [end condition] <cycles required>, where S is the number of sectors in the
  204. universe, N is the current sector during the cycle (Nb is the begin, Ne is
  205. the end, when two sector values are required), and B is the base sector for
  206. the first method:
  207.  
  208.     Level - N=S; B to N, N to B1; N=N-1 <S*2-2>
  209.  
  210.     Var   - N=S; N to N-1, N-1 to N; N=N-2 <S>
  211.  
  212.     Fold  - Nb=1, Ne=S; Nb to Ne, Ne to Nb; Nb=Nb+1, Ne=Ne-1 <S>
  213.  
  214.     Split - Nb=1, Ne=S/2+1; Nb to Ne, Ne to Nb; Nb=Nb+1, Ne=Ne+1 <S>
  215.  
  216. So the Level method, with a base sector of 1, would be 1 to 5000, 5000 to
  217. 1, 1 to 4999, 4999 to 1, etc.
  218.  
  219. The Var method would be 5000 to 4999, 4999 to 5000, 4998 to 4997, 4997 to
  220. 4998, etc.
  221.  
  222. The Fold method would be 1 to 5000, 5000 to 1, 2 to 4999, 4999 to 2, etc.
  223.  
  224. The Split method would be 1 to 2501, 2501 to 1, 2 to 2502, 2502 to 2, etc.
  225.  
  226. The least effective of the above four methods is Level, even though it does
  227. twice as many plots as the others (and hence, takes twice as long to
  228. performa as the others).
  229.  
  230. The other three methods are essentially identical in effectiveness, but
  231.  
  232.                                    Page 4
  233. will vary from universe to universe.  They are not, however identical in
  234. which warps they find, only in how many.  They will each find warps that
  235. the others did not.
  236.  
  237. I gathered ZTM data from two test universes, one 5000 sectors, and one
  238. 20,000 sectors.  I then used a program to analyze their effectiveness, and
  239. generate a chart.  The chart, followed by an explanation:
  240.  
  241.           /---------------------------------------\
  242.           |             5,000 Sectors             |
  243.           |---------------------------------------|
  244.           |  Warps  | % Total | Bubbles | % Error |
  245. /---------|---------|---------|---------|---------|
  246. | Actual  |  13489  | 100.00  |  62/0   |   0.00  |
  247. |  Level  |   9756  |  72.33  |  27/377 | 664.52  |
  248. |    Var  |  12971  |  96.16  |  56/39  |  72.58  |
  249. |   Fold  |  12956  |  96.05  |  55/41  |  77.42  |
  250. |  Split  |  12952  |  96.02  |  54/39  |  75.81  |
  251. |     LV  |  13291  |  98.53  |  58/16  |  32.26  |
  252. |     LF  |  13285  |  98.49  |  59/13  |  25.81  |
  253. |     LS  |  13253  |  98.25  |  58/18  |  35.48  |
  254. |     VF  |  13395  |  99.30  |  57/5   |  16.13  |
  255. |     VS  |  13385  |  99.23  |  57/10  |  24.19  |
  256. |     FS  |  13386  |  99.24  |  57/9   |  22.58  |
  257. |    LVF  |  13443  |  99.66  |  59/3   |   9.68  |
  258. |    LVS  |  13444  |  99.67  |  59/5   |  12.90  |
  259. |    LFS  |  13440  |  99.64  |  59/3   |   9.68  |
  260. |    VFS  |  13448  |  99.70  |  57/5   |  16.13  |
  261. |   LVFS  |  13467  |  99.84  |  59/2   |   8.06  |
  262. \-------------------------------------------------/
  263.  
  264.           /---------------------------------------\
  265.           |            20,000 Sectors             |
  266.           |---------------------------------------|
  267.           |  Warps  | % Total | Bubbles | % Error |
  268. /---------|---------|---------|---------|---------|
  269. | Actual  |  53835  | 100.00  | 200/0   |   0.00  |
  270. |  Level  |  38789  |  72.05  |  46/738 | 446.00  |
  271. |    Var  |  52162  |  96.89  | 188/150 |  81.00  |
  272. |   Fold  |  52155  |  96.88  | 188/147 |  79.50  |
  273. |  Split  |  52191  |  96.95  | 194/145 |  75.50  |
  274. |     LV  |  53125  |  98.68  | 192/59  |  33.50  |
  275. |     LF  |  53116  |  98.66  | 193/46  |  26.50  |
  276. |     LS  |  53084  |  98.60  | 196/55  |  29.50  |
  277. |     VF  |  53503  |  99.38  | 193/18  |  12.50  |
  278. |     VS  |  53492  |  99.36  | 196/28  |  16.00  |
  279. |     FS  |  53486  |  99.35  | 196/22  |  13.00  |
  280. |    LVF  |  53637  |  99.63  | 194/11  |   8.50  |
  281. |    LVS  |  53633  |  99.62  | 196/10  |   7.00  |
  282. |    LFS  |  53628  |  99.62  | 196/9   |   6.50  |
  283. |    VFS  |  53683  |  99.72  | 196/4   |   4.00  |
  284. |   LVFS  |  53722  |  99.79  | 196/4   |   4.00  |
  285. \-------------------------------------------------/
  286.  
  287. The first column indicates how the information was acquired.  The actual
  288. information is from a complete CIM sector listing.  The combinations of the
  289.  
  290.                                    Page 5
  291. various ZTM methods are indicated by the first letter of their names in a
  292. string, so LVS is a combination of Level, Var, and Split.
  293.  
  294. The warps column shows how many warps are in the universe, and were found
  295. by the various methods, along with their combinations.  The bubbles column
  296. shows the result of a /MIN:3 /MAX:25 /TUNNEL run of TWBFind.  The format is
  297. valid/invalid.  The percent error for bubbles is the number of valid
  298. bubbles not found, plus the number of invalid bubbles found, divided by the
  299. actual number of valid bubbles.
  300.  
  301. You can clearly see that the Level method is fairly useless by itself, and
  302. that the other three methods do indeed have the same basic level of
  303. effectiveness.
  304.  
  305. You can also see that the best results are achieved by combining several of
  306. the methods.  While the Level method alone is fairly poor, it does augment
  307. the other methods fairly well.
  308.  
  309. You'll usually get good results by using Var, Fold, and Split together.
  310. Though as the 5000-sector universe shows, the Level method can sometimes
  311. provide a significant amount of additional information.
  312.  
  313. 3)  CIM sector information - this file is also created by you, but is just
  314. a simple capture of what the game spits out.  To make this file, turn the
  315. capture mode of your comm program on, enter CIM mode (see below), and press
  316. "I".  After the scrolling display of sector information has stopped, stop
  317. the capture.  That capture file can be used as is by TWBFind.
  318.  
  319. 4)  CIM port information - this is a capture of port information, which can
  320. be made by pressing "R" in CIM.
  321.  
  322. To enter CIM mode in Tradewars 2002, go to the ship computer, and enter the
  323. following sequence, using your numeric keypad (on the right side of the
  324. keyboard):
  325.  
  326. ALT-200
  327. ALT-201
  328. ALT-202
  329. ALT-203
  330. ALT-204
  331. ALT-205
  332.  
  333. If you didn't mess up, you'll be met with a plain looking ":" for a prompt.
  334.  
  335. Note that with some later versions of TW2002, you don't need to be at the
  336. ship computer prompt, and can also just press "^" to enter CIM.
  337.  
  338. From here, you can enter the CIM commands necessary to get data.
  339.  
  340. ================================================================================
  341.  
  342. IV. Running the Program
  343.  
  344. Once you've exported the sector data from the game, you're ready to run the 
  345. program. 
  346.  
  347.  
  348.                                    Page 6
  349. The options are available by simply running the program without parameters, 
  350. or with /h or /?, and are as follows:
  351.  
  352. /avoidunex - avoid unexplored sectors when finding bubbles
  353. /bench - report bubble search time
  354. /bogus - find bogus bubbles (one-way sectors in)
  355. /eatmem - eat up memory to increase speed during search
  356. /noexpset - don't set as explored any non-binary input
  357. /q - suppress progress output, and only report results
  358. /warps - display total warps, and number added by input files
  359. /tunnel - use only one bubble route from primary entrance
  360. /update - update binary database only - no bubble search
  361. /ports - show ports in bubble report
  362. /fromsd - calculate distance from stardock
  363. /fromc0 - calculate distance from class 0 ports
  364. /fromterra - calculate distance from Terra
  365. /from:# - calculate distance from sector
  366. /min:# - minimum number of sectors in bubble; default 5
  367. /max:# - maximum number of sectors in bubble; default 50
  368. /maxent:# - maximum number of entrances for bubbles (1 to 50); default 1
  369. /entmult:# - ent multiplier for min bubble size (2.0 to 1000.0); default 2.0
  370. /unisize:# - number of sectors in universe (100 to 65535); default 1000
  371. /maxbub:# - reserve storage for bubbles (1 to 4.3 billion); default 1024
  372. /stardock:# - specify stardock sector
  373. /class0:# - specify second or third class 0 sector
  374. /zap:# - remove port from binary data (destroyed, etc.)
  375. /pclass:# - priority class (1 to 4); default=2
  376. /pdelta:# - priority delta (0 to 31); default=0
  377. /sectfile:<filename> - CIM sector data file
  378. /plotfile:<filename> - capture of CIM course plots (zero-turn mapping)
  379. /binfile:<filename> - binary sector database file
  380. /auxbinfile:<filename> - second binary database to combine info with
  381. /portfile:<filename> - CIM port data file
  382. /outfile:<filename> - report file; default 'bubbles.lst'
  383. /cimoutfile:<filename> - write CIM-style data to file
  384.  
  385. Detailed explanations:
  386.  
  387. Option /avoidunex -  This tells the program to consider all unexplored
  388. sectors to be unreliable, whether or not any outwarps are defined for them
  389. (from CIM course plots).  The default behavior is to consider a sector's
  390. information to be reliable for the purposes of finding bubbles, if it has
  391. at least one outwarp defined.  This is to utilize CIM course plot data for
  392. zero-turn mapping.  Since you can store this information in a binary
  393. database, this option allows you to do only bubble searches with explored
  394. sectors, to get more accurate results (searches based on zero-turn mapping
  395. data are potentially unreliable - depending on what methods you use).
  396.  
  397. Option /bench -   When this is used, the program will time the bubble search
  398. (and only the bubble searchf), and report how long it took.
  399.  
  400. Option /bogus -   Use this switch to find only bogus bubbles, which appear
  401. good from the inside, but have a one-way sector leading into them from
  402. behind the entrance.  This data will be useful for finding enemies who
  403. weren't very careful about checking their bubble.  Those with the one-way
  404. entrance far back in the bubble will be especially good, since the
  405.  
  406.                                    Page 7
  407. least-defended planets will likely be in those "safer" sectors.  When this
  408. option is used, *only* bogus bubbles will be found and reported.  The
  409. bubble data file will clearly mark them as such.
  410.  
  411. Option /eatmem -  This switch tells the program to use fixed-length arrays
  412. for bubble data, rather than dynamically extended ones.  That is, instead
  413. of expanding the arrays as necessary to add new sectors and entrances,
  414. enough space to accomodate the maximum number of sectors and entrances for
  415. the current search is allocated when the bubble is initialized.  This makes
  416. the search operation faster, at the expense of requiring more memory during
  417. operation.  With /M3 /X100 /E4 /Z3 on a 5000-sector universe (502 potential
  418. bubbles, 172 actual), the result is 116KB more memory required, with a 20%
  419. increase in speed.  This option should be used cautiously with the DOS
  420. version.
  421.  
  422. Option /noexpset -  This tells the program to treat all forms of non-binary
  423. input as unreliable - sectors are not marked as explored, even though a CIM
  424. sector file would normally imply this.  This is for the possibility of
  425. someone providing you with a CIM sector display, which doesn't match what
  426. you've actually explored.  This allows the /avoidunex option to function
  427. normally.
  428.  
  429. Option /q -  This sets quiet mode, which suppresses iterative progress
  430. displays (things which have a ':' followed by a sector count, for example).
  431. Instead, a simple string is printed to show what's being done.
  432.  
  433. Option /warps -  This tells the program to display the number of known warps
  434. after reading each input file, and for all other than the normal binary
  435. file, a count of how many warps were added is also printed.  This is
  436. primarily useful for keeping track of how effective various ZTM algorithms
  437. are.
  438.  
  439. Option /tunnel -  When this option is used, the program doesn't consider all
  440. combinations of the bubble entrance's warps as either ways back to the
  441. universe, or parts of the potential bubble.  Instead, it will consider only 
  442. one warp at a time as part of the potential bubble, with all other sectors 
  443. as ways back to the universe.  This reduces the number of iterations, 
  444. decreasing runtime, and also prevents the situation described in the second 
  445. note on program operation.
  446.  
  447. Option /update -  Use this to avoid doing a bubble search, and only update
  448. the specified binary sector database with new information, from either a
  449. standard CIM sector info file, a CIM course plot capture, or a CIM port
  450. info file.
  451.  
  452. Option /ports -  With this option, the program will show any known ports in
  453. the sector list of the bubble output.  If both the binary file and a CIM
  454. port file are used as input, the program will check for ports read from the
  455. former, but not the latter.  Any such ports, which are either blocked or
  456. destroyed, will be listed with a '*' next to them.  This may be an
  457. indication that an enemy has moved into a bubble and deployed fighters.
  458.  
  459. Option /fromsd -  This tells the program to calculate the distance between
  460. the bubble's primary entrance and Stardock, in both directions.  If the
  461. location of Stardock isn't know, this option is ignored.  Stardock's
  462. location is specified by the /stardock option, and also kept track of in
  463.  
  464.                                    Page 8
  465. the binary database.
  466.  
  467. Option /fromc0 -  This tells the program to calculate the distance between
  468. the bubble's primary entrance and any known class 0 ports (not including
  469. sector 1 - see /fromterra).  The location of class 0 ports is specified by
  470. the /class0 option, and also kept track of in the binary database.
  471.  
  472. Option /fromterra -  This tells the program to calculate the distance
  473. between the bubble's primary entrance and Terra (assumed to be sector 1).
  474.  
  475. Option /from:# -  This allows you to specify a specific sector for distance
  476. calculation.  The distances calculated will be between this sector and the
  477. bubble's primary entrance.
  478.  
  479. Option /min:# -  This specifies the minimum number of sectors that a bubble
  480. must contain to be saved and reported.  When dead ends have been reached 
  481. while traversing the potential bubble, if the number of sectors found 
  482. (minus the number of entrances) is less than this number, the bubble is 
  483. scrapped.  The default value is 5 sectors.
  484.  
  485. Option /max:# -  This specifies the maximum number of sectors to traverse
  486. while searching for a bubble, before giving up and assuming that it's a
  487. lost cause.  If the number of sectors in a bubble (not counting the
  488. entrances) exceeds this number before all dead ends are reached, the
  489. potential bubble is scrapped.  The larger the number, the more potential
  490. bubbles you can find, but the longer the program takes to run.  Using the
  491. default will probably be fine for any standard game.  With Gold games, you
  492. should try a larger number, with multiple entrances, to find the bubble
  493. structures that the Gold-enabled Big Bang can be configured to create.  The
  494. largest such structure can be up to 19900 sectors, in a 20000-sector
  495. universe with one bubble allowed, so consider that when choosing this
  496. number in a Gold game. The default value is 50 sectors.
  497.  
  498. Option /maxent:# -  This specifies the number of entrances that the bubble
  499. may have.  There's no theoretical limit (that's less than the number of
  500. sectors, anyway), but practicality prompted me to put in a somewhat 
  501. arbitrary limit of 50 entrances.  This will allow one to locate the large 
  502. bubble structures in Gold games, which can have many entrances.  The 
  503. default value is 1 entrance.
  504.  
  505. Option /entmult:# -  This specifies how many sectors a bubble must contain
  506. relative to the number of entrances for it to be saved.  If the current
  507. bubble can be saved with 3 entrances, for example, and the value for this
  508. option is set to 3, then the bubble must have at least nine non-entrance
  509. sectors to actually be saved.  The default and minimum value is 2.  The
  510. maximum value is 1000 (which would, say, require 3000 sectors for a
  511. 3-entrance bubble). Fractional numbers are allowed, so you can specify 2.5,
  512. 7.2, etc.
  513.  
  514. Option /unisize:# -  This specifies the number of sectors in the universe.
  515. Here is where the amount of storage set aside for sector information is
  516. determined. If the CIM file contains information for a sector number
  517. greater than this value, the program will abort.  The maximum value that
  518. the DOS version will support is 16382.  The OS/2 and DPMI versions support
  519. up to 65535 sectors (currently, TW Gold supports only 20000 sectors).  The
  520. default value is 1000 sectors.
  521.  
  522.                                    Page 9
  523.  
  524. Option /maxbub:# -  Use this to specify a maximum number of bubbles other
  525. than the default of 1024.  This number represents the maximum number of
  526. potential bubbles that will be found before the search is terminated, and
  527. those found trimmed and reported.  How much memory is reserved depends on
  528. the memory model of your system.  The included executables all use 4 bytes
  529. to store a memory pointer, so the default value reserves 4KB of memory.  A
  530. 64-bit flat addressing model would reserve 8 bytes per bubble, or 8KB of
  531. memory. Memory-constrained DOS systems may want to specify a value lower
  532. than 1024 here, to maximize the amount of memory available for the search.
  533. For a search with a 5000-sector universe using /M3, with all else default,
  534. 256 would be a safe value (which uses 3KB of memory less than the default).
  535.  
  536. Option /stardock:# -  Use this to specify the Stardock sector for the
  537. universe.  It will be saved if you specify a binary file.  If you make a
  538. mistake, just use this option again, and the location of Stardock will be
  539. updated in the binary file.
  540.  
  541. Option /class0:# -  Us this to specify the location of a class 0 port.
  542. This option can be used twice on the same command line.  It overrides any
  543. class 0 ports stored in the binary database.
  544.  
  545. Option /zap:# -  Use this to remove ports from the binary database.  You'd
  546. want to do this when a port is destroyed, or permanently blocked (by an
  547. ally, or an extremely powerful enemy, etc.).  This option can be used any
  548. number of times on the same command line.
  549.  
  550. Option /pclass:# -  This is specific to the OS/2 version, and specifies the
  551. priority class that the program runs in while searching for bubbles.  
  552. Allowable values are integers from 1 to 4, where 1 denotes idle-class, 2 
  553. denotes standard class, 3 denotes time-critical class, and 4 denotes 
  554. foreground-server class.  The order of precedence, from lowest priority to 
  555. highest, is 1-2-4-3.  This is only put into effect after the sector 
  556. information has been loaded, and the bubble search has begun.  The idea 
  557. here was to be able to run the program at idle priority in the background 
  558. for a long search (for very large bubbles), while doing other things.  If 
  559. you specify a value of 3, which is the highest priority, then a timeslice 
  560. will be forfeited every 100 sectors, to allow you the chance to abort it 
  561. (otherwise, keyboard input won't be processed in a timely fashion).  The 
  562. result is that the program will run somewhat slower at time-critical 
  563. priority than otherwise, unless there are other high-priority programs that 
  564. are being unfriendly to the CPU.  The default value is 2.
  565.  
  566. Option /pdelta:# -  This is specific to the OS/2 version, and specifies the
  567. priority delta value.  This is a subdivision of the priority class, with 
  568. valid values from 0 to 31.  Giving a value above 0 will put the priority
  569. slightly above other such programs, making this program run somewhat faster
  570. if other CPU-intensive tasks are running.  The default value is 0.
  571.  
  572. Option /sectfile:<filename> -  This specifies the name of the file which
  573. contains the CIM data capture.  Either this option, or one of the following
  574. two options must be used.
  575.  
  576. Option /plotfile:<filename> -  This specifies the name of the CIM course
  577. plot file, which is a capture of any number of course plots you made with a
  578. comm program script.  This is useful for finding potential bubbles before
  579.  
  580.                                    Page 10
  581. actually exploring, to get a head start in the game.
  582.  
  583. Option /binfile:<filename> -  This specifies the name of the binary
  584. database file, which will be created after reading other sector information
  585. in, and read from if it exists beforehand.  This is always optional, though
  586. it's a good idea to use.  If no database exists, and you don't specify
  587. other methods of reading sector information, the program will abort with an
  588. error.
  589.  
  590. Option /auxbinfile:<filename> -  This specifies the name of an auxiliary
  591. binary database file, which will have its contents read in, combined with
  592. existing data, and written out to the primary binary database file.  That
  593. is, if you use it as it was designed.  Since it's easier to deal with this
  594. way, you can also use this simply as an additional input file format,
  595. without specifying a binary database to which changes should be made.  The
  596. main usage you should have for this is in combination with the /U switch,
  597. to combine two databases from different sources (CIM sector data, one or
  598. more CIM course plots).
  599.  
  600. Option /portfile:<filename> -  This specifies the name of a CIM port info
  601. file.  This is entirely optional, but you must use this to acquire port
  602. information if you want meangingful output with the /ports option.  The
  603. ports are stored in the binary file, but you won't see indications of
  604. blocked ports without using this.
  605.  
  606. Option /outfile:<filename> -  This specifies the name of the file which the
  607. found bubbles will be written to.  The specified file will be overwritten
  608. if it exists.  You may also use anything which the operating system can
  609. handle as a file, such as a named pipe, communications port, network
  610. printer name, etc.  The default is "bubbles.lst".
  611.  
  612. Option /cimoutfile:<filename> -  This specifies the name of a file to which
  613. CIM-style sector information will be written.  If you have another helper
  614. program which doesn't know how to deal with ZTM info (course plots), you
  615. can read them in with this program, and output a format that the other
  616. helper knows how to read.
  617.  
  618. There is no space between the switch and the option data, so assuming a 
  619. sector data file of "sectors.txt", you might do the following:
  620.  
  621. twbfind.exe /sectfile:sectors.txt /min:4 /max:20 /unisize:5000
  622.  
  623. This would read in the sector data from "sectors.txt", search for bubbles 
  624. with a minimum of 4 sectors, and a maximum of 20 sectors, then write them 
  625. to "bubbles.lst".
  626.  
  627. =============================================================================
  628.  
  629. V. Output
  630.  
  631. Since all output is accomplished via stream I/O, you can use anything that 
  632. the underlying operating system can open as a file for output.  This 
  633. includes I/O devices, such as LPT1, CON, etc.
  634.  
  635. The format of the output is this:
  636.  
  637.  
  638.                                    Page 11
  639. 12-sector bubble with entrance at 2381.
  640.  
  641. Sectors in bubble:
  642.  4051   4230   3764   2107   847   2524   2657   2683   3579   3759  
  643.  1740   3936  
  644.  
  645. Sector  2381  -     110    1818    4051    4230  
  646. Sector  4051  -  { 2381}  3764  
  647. Sector  4230  -  { 2381}
  648. Sector  3764  -    2107    4051  
  649. Sector  2107  -     847    3764  
  650. Sector   847  -    2107    2524    2657    2683  
  651. Sector  2524  -     847  
  652. Sector  2657  -     847    3579  
  653. Sector  2683  -     847    3759  
  654. Sector  3579  -    1740    2657  
  655. Sector  3759  -    2683    3936  
  656. Sector  1740  -    3579  
  657. Sector  3936  -    3759  
  658.  
  659. --------------------------------------------------------------------------------
  660.  
  661. 11-sector bubble with 2 entrances at:
  662.   4310  3901
  663.  
  664. Sectors in bubble:
  665.  4374   91   1846   4258   4309   3537   3230   919   2314   4505  
  666.  3186  
  667.  
  668. Sector  4310  -  < 3975>   3439    4134    4374  
  669. Sector  4374  -      91    1846    4258    4309  { 4310}
  670. Sector    91  -    4374  
  671. Sector  1846  -    3537    4374  
  672. Sector  4258  -    3230    4374  
  673. Sector  4309  -     919    2314    4374  
  674. Sector  3537  -    1846  
  675. Sector  3230  -    4258    4505  
  676. Sector   919  -    4309  
  677. Sector  2314  -    3186    4309  
  678. Sector  4505  -    3230  
  679. Sector  3186  -    2314  { 3901}
  680. Sector  3901  -  < 3873>    623     660    1545    1969    3186  
  681.  
  682. --------------------------------------------------------------------------------
  683.  
  684. The first line says how many sectors are in the bubble, and if there's one 
  685. entrance, displays that.  If there is more than one entrance, they are 
  686. displayed on the second line, wrapping as needed to additional lines.
  687.  
  688. After that, the sectors in the bubble are displayed, wrapping as needed, in 
  689. summary.
  690.  
  691. The next part is a list of all sector bubbles (including entrances, this 
  692. time), and their warps.
  693.  
  694. Sectors surrounded by <>'s denote one-way in-warps.
  695.  
  696.                                    Page 12
  697.  
  698. Sectors surrounded by ()'s denote one-way out-warps.
  699.  
  700. Sectors surrounded by []'s denote unexplored sectors.
  701.  
  702. Sectors surrounded by {}'s denote bubble entrances.
  703.  
  704. Unembellished sectors are both out- and in-warps.
  705.  
  706. If you use one of the /from* options, the information will appear at the
  707. top of the bubble info, and look like this:
  708.  
  709. Distances:  Terra=2/2  Stardock(2478)=9/9
  710.  
  711. The numbers are in the order of to/from.  So in the above, the distance
  712. from the bubble's primary entrance to Stardock, and back again, is 9 hops.
  713.  
  714. If you use the /ports option, the sector list will look like this:
  715.  
  716. Sector  381         -   3013   4455
  717. Sector 3013  (BSB)  -    381   1425   4925
  718.  
  719. If the port is blocked, there'd be an asterik to the left of the '('.
  720.  
  721. I've determined that properly displaying all the possible bubbles is 
  722. virtually impossible with stream I/O, so a formatted display would require 
  723. drawing a bitmap of sorts.  I might write such a thing, if I can figure out 
  724. how, and use the data above to do it.  Anyone else might want to try the 
  725. same thing.
  726.  
  727. Short of that, drawing on a piece of paper and connecting the lines is 
  728. fairly easy given the above.  Those using TW Helper can do a /G command 
  729. for a sector in the middle of the bubble to get a nice graphical layout.  
  730. TWAR for Windows has a similar mode (currently at alpha level), and TWATS 
  731. may very well have one as well.
  732.  
  733. For the smaller bubbles, that is.  I have found a bubble as large as 198 
  734. sectors, with nine entrances, from a 20000-sector Gold game. Short of a 
  735. graphical scrolling display, getting a visual grip on that one will be 
  736. nearly impossible.
  737.  
  738. Note:  With the new feature of finding potential bubbles based on zero-turn
  739. mapping data (CIM course plots), the bubble display will likely be riddled
  740. with sectors surrounded by []'s, denoting that they are unexplored.  This
  741. is normal, and it does in fact mean that the bubble is potentially
  742. unreliable.  Since those sectors aren't actually explored, the information
  743. about their outwarps is not guaranteed to be complete.  All it takes is one
  744. unknown outwarp to completely kill a bubble.
  745.  
  746. Note:  If you use the /F switch to search for fake bubbles, the first line
  747. will look instead like this:
  748.  
  749. 12-sector bogus bubble with entrance at 2381.
  750.  
  751. When you see that header, there will necessarily be a sector in the bubble
  752. with a warp shown with <>'s around it, denoting the sector number which has
  753.  
  754.                                    Page 13
  755. a one-way warp into the bubble, behind the entrance.
  756.  
  757. =============================================================================
  758.  
  759. VI. Limitations
  760.  
  761. The program was written to accommodate up to 65,535 sectors, since the Gold 
  762. version of TW currently supports up to 20,000.  In the unlikely event that
  763. the game ever exceeds 65,535 sectors, it would not be very difficult to
  764. change datatypes to long integers to increase capacity (to over 4 billion
  765. sectors - though obviously a substantial machine would be required for
  766. this).
  767.  
  768. The 16-bit DOS version has an absolute sector limit of 16382.  Whether it 
  769. will run to completion depends on the available memory, the search 
  770. parameters, and the number of bubbles in the universe matching those 
  771. parameters.
  772.  
  773. The DPMI, OS/2, Linux, and Win32 executables will handle the program design
  774. limits.
  775.  
  776. =============================================================================
  777.  
  778. VII. Performance
  779.  
  780. Over the course of this program's development, I've gained a lot of
  781. experience as a programmer.  As a result, this program is reasonably
  782. efficient by this point, though there's almost certainly room for
  783. improvement here and there.  On fast machines, you won't notice.
  784.  
  785. The program is processor-bound, so your memory and disk subsystems are 
  786. insignificant.  Your video subsystem may also have an impact, especially if 
  787. running in a windowed session of whatever operating system you're using.  
  788. Time the execution with output redirected to nul, and you'll see the 
  789. difference, or use the /Q option, which suppresses most of the output.
  790.  
  791. The greater the maximum number of sectors, of course, the longer it will 
  792. take to run.  The greater the number of entrances to search for, the longer 
  793. it will take to run.  And less obviously, the more information about the
  794. universe you have, the longer it will take to run.
  795.  
  796. The /eatmem option will speed things up by about 20%, at the expense of
  797. some additional memory (on the order of 100KB).  The /tunnel option reduces
  798. the number of bubbles found (see notes on program behavior), but also
  799. speeds things up considerably.
  800.  
  801. ================================================================================
  802.  
  803. VIII. Notes on Program Behavior
  804.  
  805. 1)  The program does consider one-way exits into explored sectors the end of 
  806. a bubble extent.  It's conceivable that such outgoing warps lead to more 
  807. isolated sectors, something like this:
  808.  
  809.              [sector]
  810.                 |
  811.  
  812.                                    Page 14
  813. [entrance] - [sector] - [sector] - [sector] -> [sector] 
  814.                                                   |
  815.                                                [sector] -> [universe]
  816.  
  817. Where -> denotes a one-way warp.  
  818.  
  819. In this case, that section between the two one-way warps would not be 
  820. counted as part of the bubble.  However, provided there were enough such 
  821. sectors for the given parameters, they would be part of a separate bubble 
  822. beginning with the sector after the first one-way warp.  
  823.  
  824. I personally think that since those sectors have no path back into the 
  825. bubble except through the universe, they shouldn't be considered part of it 
  826. anyway.  If they did have a way back into the bubble, they'd be found and 
  827. counted in the first place, because one-way inwarps are added to the 
  828. bubble.
  829.  
  830. 2)  Due to the way the program works, the following is considered a bubble:
  831.  
  832.            [universe]
  833.                |
  834. [sector] - [entrance] - [sector] - [sector] - [sector]
  835.                |
  836.            [universe]
  837.  
  838. Where the first sector is a single dead-end off of the entrance.  I'd 
  839. personally not consider it part of the bubble, but I'll leave that to the 
  840. user to decide.  The issue becomes very complex when considering the 
  841. programmatic exclusion of such constructs.
  842.  
  843. When more than one entrance is tested for, the degree of this convolution 
  844. can increase.  All that can be guaranteed is that all sectors reported as 
  845. in the bubble are isolated from the universe by the entrances.
  846.  
  847. Note:  This is not applicable when using the /t option, which will not 
  848. allow bubble sectors to be separated by the primary entrance.
  849.  
  850. 3)  When using standard CIM sector information, the bubble search bases
  851. whether or not a sector is reliable only on whether or not it's explored.
  852. As a result, the less data you have, the less bubbles you find.  But when
  853. you're using course plot information, the search algorithm has to consider
  854. as reliable any sector which has at least one outwarp defined for it.
  855. Because of this, the opposite effect is true - the less dat, the more
  856. bubbles you find.  The more faulty bubbles, that is.
  857.  
  858. If the search is at a point where only one sector is left to check, and it
  859. has three outwarps defined, all of which lead to dead ends, you'll have a
  860. bubble (provided it meets the search criteria).  But if that sector has an
  861. outwarp that wasn't discovered during the course plot session, it'll be
  862. just another link in the universe.
  863.  
  864. Even more so than usual, you'll need to check the reality of any found
  865. bubbles by exploring all the sectors involved, and using avoids to check
  866. for one-way sectors leading into the bubble.
  867.  
  868. See the section on input file formats for details on how to maximize the
  869.  
  870.                                    Page 15
  871. reliability of your course plots.
  872.  
  873. 4)  The fake bubble option makes a fairly simple change to the existing
  874. algorithm:  Instead of adding one-way inwarps to the bubble, they are
  875. excluded, and the bubble is marked as potentially bogus.  When it comes
  876. time to save the bubble, any which aren't so marked are discarded.  Then if
  877. the bubble has at least one sector with at least one inwarp that is oneway,
  878. and not coming from a sector that's inside the bubble, it's saved.
  879. The nature of the program is to consider as an entrance the sector(s)
  880. having one or more connections to the outside universe.  Some people might
  881. consider the first sector with no connection to the universe, except via
  882. the entrance(s), to be the entrance, where the front-line defenses are
  883. placed.  Some bogus bubbles may have the one-way entrance leading to this
  884. sector, which gives you no advantage if the person has the defenses here. I
  885. myself tend to use that strategy, so that someone doesn't run into my
  886. defense except if plotting a course into my bubble.  If you put your
  887. defenses in the entrance sector(s), someone could run into them with a
  888. normal course plot.  It's because so many people don't care about that, and
  889. put their defenses in the entrance(s) that bubbles are still considered
  890. bogus when the one-way entrance leads to the first non-entrance sector(s).
  891.  
  892. 5)  When calculating the distances from the primary bubble entrance to
  893. another sector, the algorithm used will exactly match the route chosen by
  894. TW, but only if you have complete information about all sectors on the
  895. actual route.  If you're missing warp information, you may have a longer
  896. route than necessary, or simply not be able to find a route at all.  With a
  897. good set of course plots (see the section on input files), the routes will
  898. be accurate about 98% of the time.  If the universe is 100% explored, the
  899. routes will be correct 100% of the time, so long as you don't have avoids
  900. set in the game.
  901.  
  902. =============================================================================
  903.  
  904. IX. How it Works
  905.  
  906. Here's the basic logic of how it works:
  907.  
  908. 1)  For each sector, treat one or more outgoing warps as potential parts of 
  909. a bubble with the current sector as an entrance.  Treat the rest of the 
  910. outgoing warps as the way back to the rest of the universe.
  911.  
  912. 2)  Each possible combination of the situation in 1 should be tested.  The 
  913. number of combinations for N outgoing warps is 2 to the Nth power minus 2 
  914. (the two cases where either all sectors would be potential bubble members, 
  915. or all sectors the way back to the universe).  If the /t option is used, 
  916. then the number of combinations is simply N, as only one outgoing warp is
  917. considered part of the potential bubble.
  918.  
  919. 3)  Put each potential bubble sector into a bubble structure.
  920.  
  921. 4)  Loop through the bubble structure, adding all non-oneway outgoing and 
  922. oneway incoming warps to the end of it (note:  the /f option ignores
  923. one-way incoming warps to find bogus bubbles).  If multiple entrances are
  924. being checked for, then whenever the bubble cursor exceeds the minimum
  925. number of sectors, and the remaining sectors in the bubble do not exceed
  926. the maximum number of entrances, the bubble is added.  This will make for a
  927.  
  928.                                    Page 16
  929. lot of extra bubbles, that are later trimmed out.  The alternative approach
  930. is to do an outer loop for each entrance, which takes hours for two
  931. entrances, and hundreds of thousands of years for five entrances.  This
  932. method takes barely more than single-entrance searches.  Starting with
  933. versions 0.14, the difference is really minimal.  With /E5 /Z5 tacked onto
  934. the end of a /T /X150 search, the run speed increased only by about 5%
  935. (using the /G switch reduces the increase even further).
  936.  
  937. 5)  If the number of sectors in the structure exceed the maximum number of 
  938. bubble sectors to search for, abort this iteration, and go on with the next 
  939. possible bubble structure based on the current sector.
  940.  
  941. 6)  If the end of the bubble structure is reached before the max sectors 
  942. are exceeded, that means dead-ends have been reached at all fronts, and the 
  943. bubble is indeed isolated from the universe by the entrance.  If the number 
  944. of sectors is larger than the minimum sectors indicated, save the bubble.
  945.  
  946. 7)  After all sectors have been processed, go through all the saved 
  947. bubbles, and eliminate any duplicates and those which are part of larger 
  948. bubble structures.
  949.  
  950. 8)  Print out the information (currently in a lame format).
  951.  
  952. ================================================================================
  953.  
  954. X. Compiling the Program
  955.  
  956. The source for the program is included in the 'source.zip' archive.
  957.  
  958. The language is C++, and I've tried to make the program cross-platform, 
  959. though it may or may not be necessary to make some small modifications 
  960. before it will compile for you. 
  961.  
  962. There are a few defines in place that were necessary to make it compile 
  963. under the compilers I've been using.  These may or may not need to be 
  964. removed or altered to allow compilation on other compilers, for other 
  965. platforms.
  966.  
  967. There's nothing sneaky going on, so just compile each .cpp file, and link 
  968. all the objects together as one executable.  I keep separate sources for 
  969. ease of editing.  There are makefiles for all the compilers that I used 
  970. included.
  971.  
  972. The five included executables are:
  973.  
  974. twbfos2.exe  - 32-bit OS/2 VIO executable 
  975. twbfdpmi.exe - 32-bit DPMI executable
  976. twbflin      - 32-bit Linux ELF executable
  977. twbfw32.exe  - 32-bit Win32 console executable
  978. twbfdos.exe  - 16-bit DOS executable (8086 instruction set)
  979.  
  980. The first was compiled with IBM VisualAge C++ 3.08 for OS/2, the second 
  981. with the DJGPP package (a DOS port of GCC), the third with EGCS, the fourth
  982. with Mingw32/EGCS, and the fifth with an old copy of Borland C++ 3.0 for
  983. DOS.
  984.  
  985.  
  986.                                    Page 17
  987. =============================================================================
  988.  
  989. XI. Author Information
  990.  
  991. The "I" all through the rest of this file refers to me, Mike Ruskai, and I 
  992. can be reached via e-mail to thannymeister@yahoo.com, should you have a 
  993. question, suggestion, or problem report.
  994.  
  995. =============================================================================
  996.  
  997. XII. History
  998.  
  999. 10-11-98 - Initial 0.01 release.
  1000.  
  1001. 10-13-98 - Forgot to check one memory allocation pointer, so it would crash 
  1002.            if the allocation failed.  Fixed this.
  1003.  
  1004. 10-17-98 - Reorganized the source, putting stuff from main() into objects,
  1005.            to better facilitate any future expansion efforts.  Altered the
  1006.            output format to report all data concerning the connectivity of
  1007.            the bubble sectors, though it's not formatted to be visually
  1008.            meaningful.  Fixed an obscure glitch that would prevent some
  1009.            bubbles from being reported, due to a false assumption I made
  1010.            earlier.  Release this as version 0.02.
  1011.  
  1012. 10-19-98 - Put a check in for duplicate sector data, so if you accidentally
  1013.            append a sector report to an existing one, instead of 
  1014.            overwriting it, the program will not get screwed up.  Release
  1015.            this as version 0.03.
  1016.  
  1017. 10-20-98 - Fixed the comparisons to properly reflect minimum and maximum 
  1018.            sectors in bubbles.  Version 0.04, just to have a number.
  1019.  
  1020. 10-22-98 - Got a hold of the DJGPP compiler, so we now have a DPMI 
  1021.            executable in the archive, that will handle any amount of 
  1022.            sectors.  A few minor source changes, nothing that affects
  1023.            functionality.  Call this version 0.05.
  1024.  
  1025. 10-23-98 - Fixed stupid memory leak.  The DOS version should work OK with
  1026.            any maximum bubble size value for 5000 sectors, now, though it's 
  1027.            pretty slow doing it.  Made some source changes that should
  1028.            hopefully make it easier to compiler on other platforms.  We'll 
  1029.            call this version 0.06.
  1030.  
  1031. 11-30-98 - Added the ability to abort a search and have all bubbles found 
  1032.            to that point trimmed and saved by pressing the space bar.
  1033.  
  1034.            Added priority control for the OS/2 version.  This makes it 
  1035.            possible to cripple your machine fairly well, by specifying
  1036.            priority class 3 (time critical).  Added a DosSleep() call every
  1037.            100 sectors if that's the case, so that the program can be 
  1038.            aborted.  The effect is that running with time critical will be
  1039.            slower than normal priority, unless you've a lot of 
  1040.            high-priority programs already hogging the system, in which case
  1041.            time critical priority will allow it to run normally.  The given
  1042.            priority is not set until the bubble search commences.  The 
  1043.  
  1044.                                    Page 18
  1045.            loading of warp information, and setting of one-way warps takes
  1046.            place at normal priority.  The idea there is to put a long 
  1047.            search at idle priority, to run in the background (/p1 /d31 is 
  1048.            the recommended setting for this).
  1049.  
  1050.            Added the ability to search for multiple-entrance bubbles.  This
  1051.            was inspired by the feature in TW Gold of explicitly creating
  1052.            bubbles at Big Bang, which could have several entrances.  
  1053.            There's no theoretical limit to the number of entrances that can 
  1054.            be searched for, but I've put an arbitrary limit of 50 on the 
  1055.            program, since anything above that is of extremely dubious 
  1056.            utility.
  1057.  
  1058.            Modified the output format to wrap lines, instead of putting 
  1059.            sectors on one long line.  
  1060.  
  1061. 12-05-98   Gave up on the idea of including a Win32 console executable, 
  1062.            since it (compiled with EGCS using Mingw32) was too bulky and 
  1063.            slow to be of any use.  This is version 0.07.
  1064.  
  1065. 01-08-99   Added the /t option to alter the way bubbles are searched for.
  1066.            Instead of considering all possible combinations of warps as 
  1067.            either ways back to the universe or parts of the potential 
  1068.            bubble, only one warp at a time is considered part of the 
  1069.            potential bubble.  This makes runtime a little bit faster, and 
  1070.            eliminates the possibility of finding bubbles that are split by
  1071.            the primary entrance, as explained in the second note on program 
  1072.            behavior.  This is version 0.08.
  1073.  
  1074. 01-11-99   Changed the way sector data is stored so that the DOS version 
  1075.            now has a sector limit of 16382, instead of 5460.  Version 0.09
  1076.            will be the moniker for this puppy.
  1077.  
  1078. 01-29-99   Replaced iterative loops with memcpy() calls, after realizing 
  1079.            that using the same pointers is not a problem.  This speeds 
  1080.            things up quite a bit when doing large searches.
  1081.  
  1082.            Changed the multiple-entrance support so that it wouldn't bother
  1083.            saving bubbles that didn't have twice as many sectors as the 
  1084.            number of entrances.  Then I added the /z parameter to allow the 
  1085.            user to define the multiplier (minimum is 2, maximum is 1000).  
  1086.            The result, even with just a multiplier of 2, is dramatically 
  1087.            faster multiple-entrance searches, with less garbage bubbles.  
  1088.            Setting this to a value of 10 or more will make sure that only 
  1089.            viable multiple-entrance bubbles are found, such as 20-sector 
  1090.            bubbles with 2 entrances, or 100-sector bubbles with 10 
  1091.            entrances; each being the equivalent of a single-entrance 
  1092.            10-sector bubble in terms of how much is protected per defended 
  1093.            sector.
  1094.  
  1095.            This is version 0.10.
  1096.  
  1097. 03-11-99   Did a bit of optimizing, primarily by inlining small functions.
  1098.  
  1099.            Added file read/write error checking, just in case.
  1100.  
  1101.  
  1102.                                    Page 19
  1103.            This is version 0.11.
  1104.  
  1105. 08-17-99   No real changes.  Just updating the e-mail address.
  1106.  
  1107.            Nevertheless, this is 0.12.
  1108.  
  1109. 01-28-00   At the suggestion of a program user, added the ability to read
  1110.            in data captured by the user, doing CIM course plots.  This
  1111.            allows a pseudo-exploration of the universe for the purpose of
  1112.            finding likely bubbles to be actually explored.  The /W option
  1113.            is used to specify the capture file.
  1114.  
  1115.            Along with this, I added a binary sector database option, which
  1116.            will keep track of the outgoing warps that have been discovered
  1117.            using one or many CIM course plot sessions.  It will also keep
  1118.            track of whether or not the sectors are actually explored.  The
  1119.            /B option is used to specify this file.
  1120.  
  1121.            Added the /U option to allow updating the binary database
  1122.            without performing a bubble search.
  1123.  
  1124.            Added the /A option to use the old program behavior of avoiding
  1125.            unexplored sectors when searching for bubbles.  This allows you
  1126.            to use a binary database containing warp information for
  1127.            unexplored sectors without getting possibly unreliable search
  1128.            results.  Obviously, this is for when you've done actual
  1129.            exploration, and aren't trying to find potential bubbles using
  1130.            CIM course plots.
  1131.  
  1132.            The OS/2 executable is now compatible with only OS/2 Warp and
  1133.            above, because the code is compressed as well as the data.  In
  1134.            the unlikely event that someone with OS/2 2.x wants to run this
  1135.            program, they can uncompress and recompress it using the lxLite
  1136.            utility (use the /c:ver2x switch).
  1137.  
  1138.            Made a few changes necessary to compile a Linux version.  The
  1139.            Linux executable is different from the others in one respect - a
  1140.            keypress (to abort and save whatever bubbles have been found) is
  1141.            only checked for every 50 sectors, because the method of
  1142.            determining whether there's a keypress waiting or not in Linux
  1143.            is very slow.
  1144.  
  1145.            This is version 0.13.
  1146.  
  1147. 02-03-00   Added ability to read a second binary file, for the purposes of
  1148.            combining the information contained in them.  This file is
  1149.            specified with the /C switch.  Though the program will simply
  1150.            treat it as another input file, the intended usage is something
  1151.            like this:
  1152.  
  1153.                 twbfind /n5000 /bgame.dat /cauxdata.dat /u
  1154.  
  1155.            That would read in game.dat, then read in auxdata.dat, and write
  1156.            the information collected from both back to game.dat.  Two
  1157.            conditions will clue you in that the two data files are from
  1158.            different universes:
  1159.  
  1160.                                    Page 20
  1161.  
  1162.                 1)  You get an error saying more than 6 warps were found
  1163.                     for a given sector.
  1164.  
  1165.                 2)  You get an error about an integer being too large while
  1166.                     reading the second binary file.
  1167.  
  1168.            If using the new binary formt (see next comment), the size of
  1169.            the universe is stored at the front of the file, and any
  1170.            difference will be noted immediately.
  1171.  
  1172.            Changed the binary format somewhat, to allow for a 16-byte
  1173.            header at the beginning of the file.  The header contains a
  1174.            64-bit signature, to verify during read that the file is valid;
  1175.            the major and minor version level of the release of TWBFind that
  1176.            created the file, to allow for future changes; the size of the
  1177.            universe; and some reserved space for future additions.  The
  1178.            data itself is also altered a bit (see the options section for
  1179.            the details of how it's stored), to the point where adding the
  1180.            ability to read the old files is too much of a pain.  I created
  1181.            a conversion program, which can be downloaded in a separate
  1182.            archive (twbfcvt.zip), that will convert from the old to the
  1183.            new format.  With the new format, any time you specify an
  1184.            existing binary file as input, you don't need to specify the
  1185.            number of sectors in the universe on the command line (if you
  1186.            do, it will be overridden by the info in the binary file).
  1187.  
  1188.            In a trend that's sure to continue, I ripped off a neat idea
  1189.            from a program called TW Guru (the author of which is nowhere to
  1190.            be found).  If you use the /F switch, you will find fake bubbles
  1191.            instead of real ones.  That is, a bubble which appears kosher
  1192.            from the inside, but has a one-way sector going into it behind
  1193.            the entrance.  This function will be very useful for finding
  1194.            people who aren't scrupulous about checking the validity of the
  1195.            bubble(s) they find.  The best ones have the one-way entrance
  1196.            towards the back, where the least defended planets will likely
  1197.            be.
  1198.  
  1199.            I made two performance enhancements.  The first one was to
  1200.            change the bubbleset from a dynamically expanding array to a
  1201.            fixed-length array, the length of which is determined at run
  1202.            time.  The default length is 1024 bubbles, which is enough for
  1203.            any reasonable search.  This can be overridden with the /R
  1204.            switch.  For the included executables, the memory required is
  1205.            4 bytes per bubble (the size of a memory pointer).  The
  1206.            fixed-length array helps, of course, be preventing the need to
  1207.            allocate new memory, and copy all the bubbles to the new
  1208.            location, each time one was found and added.
  1209.  
  1210.            The second performance enhancement is only in effect when you
  1211.            use the /G switch, which tells the program to gobble up more
  1212.            memory to run faster.  When this is done, new bubble objects
  1213.            don't use dynamically sized arrays, but instead allocate enough
  1214.            memory at initialization to contain the largest allowable
  1215.            bubble (determined by /X and /E).  This negates the need to
  1216.            allocate memory and copy over data when adding sectors and
  1217.  
  1218.                                    Page 21
  1219.            entrances.  With search parameters of /M3 /X100 /E4 /Z3 on a
  1220.            5000-sector universe, the result was an additional 116KB of
  1221.            memory required during operation, and a 20% reduction in search
  1222.            time.  With /T /X25, the increase in memory requirements wasn't
  1223.            detectable, but the run time went down by over 30%, so this
  1224.            option is useful for even small searches on memory-tight
  1225.            machines.
  1226.  
  1227.            The DOS, DPMI, and Linux executables are now compressed with
  1228.            UPX.  This improves on PKLITE and DJP for the first two,
  1229.            respectively.
  1230.  
  1231.            I added a Win32 executable, using Mingw32/EGCS, which has
  1232.            improved quite a bit since I last tried it.  The executable
  1233.            speed is pretty good, even though I can't get rid of the
  1234.            annoying mouse cursor, or even the text cursor (the standard
  1235.            Win32 calls to do the latter simply don't work).  UPX supports
  1236.            PE compression, but a program called EZIP did a much better job
  1237.            (less than half the size of UPX's compressed EXE).  A bug
  1238.            somewhere in Mingw32 package (or perhaps Win95) causes the
  1239.            program to crash when you press CTRL-C (presumably at exit()).
  1240.  
  1241.            This is version 0.14.
  1242.  
  1243. 02-18-00   I was running out of single-letter options, and those that were
  1244.            left didn't match the new options very well, so I redid the
  1245.            parameter system.  All options now have the following form:
  1246.  
  1247.                 </|-><optname>[:<optvalue>]
  1248.  
  1249.            All existing options now have new names.  See the options
  1250.            section for details.
  1251.  
  1252.            Added the /Q option to suppress iterative progress output.
  1253.            Only simple strings will be output to indicate what task is
  1254.            being performed.
  1255.  
  1256.            Added the /BENCH option to keep track of and report how much
  1257.            time the bubble search took.
  1258.  
  1259.            Added the /NOEXPSET option to prevent the program from setting
  1260.            the explored status of any sector while reading in data from
  1261.            any source.  If you're importing the data from a CIM file that
  1262.            was generated by someone else, and therefore doesn't reflect
  1263.            sectors that you've actually explored, this will prevent the
  1264.            program from assuming that the sectors were explored, and
  1265.            storing them as such in the binary database.
  1266.  
  1267.            Added the /WARPS option, to display the total number of
  1268.            warps known after each input file is read, and report on how
  1269.            many new ones were discovered.  Useful for evaluating the
  1270.            effectiveness of ZTM plot algorithms.
  1271.  
  1272.            Added the /CIMOUTFILE:<filename> option, which generates a
  1273.            sector listing in the style of the "I" function in CIM.  When
  1274.            used in conjunction with the /AVOIDUNEX option, only those
  1275.  
  1276.                                    Page 22
  1277.            sectors marked as explored will be written.
  1278.  
  1279.            I added support for storing port information in the binary
  1280.            database file.  Only the type of port is stored, and it's stored
  1281.            in what was a reserved byte, so there's no incompatibility
  1282.            issues (v0.14 databases will just appear to have no ports).
  1283.  
  1284.            Added the /PORTFILE:<filename> option to read a CIM port
  1285.            capture.  Ports are stored in the binary database, if it's
  1286.            specified.
  1287.  
  1288.            Added the /PORTS option to display known ports alonside the
  1289.            sector list in a bubble printout.  When using both a binary
  1290.            database and CIM port file for input, ports which are read
  1291.            from the former, but not the latter, will be marked by an
  1292.            asterik.  These ports are blocked or destroyed, and in the
  1293.            former case may indicate where an enemy has decided to make
  1294.            a new home.
  1295.  
  1296.            Added the /ZAP:# option to specify sectors for which a port
  1297.            should be removed from the database.  You'd use this if a port
  1298.            were destroyed, or is permanently blocked.  This option may be
  1299.            used any number of times on the same command line.
  1300.  
  1301.            Added the /STARDOCK:# option to specify the location of
  1302.            Stardock, which will be stored in the binary database.
  1303.  
  1304.            Added the /CLASS0:# option to specify the location of up to
  1305.            two class 0 ports, which will be stored in the binary database.
  1306.  
  1307.            The previous two new options are for use in conjunction with a
  1308.            new feature, which is to figure out out far the primary entrance
  1309.            of a bubble is from certain sectors.  A standard course plot is
  1310.            done, which will exactly match that of the game, provided you
  1311.            have complete information about the universe.  If your
  1312.            information is complete, you will either get an incorrect figure
  1313.            for the distances, or a question mark, for where a course didn't
  1314.            exist.
  1315.  
  1316.            Added the /FROMSD option to indicate that bubbles should have
  1317.            their distance to and from Stardock calculated.  If the location
  1318.            of Stardock isn't specified (either by the /STARDOCK:# option,
  1319.            or from the binary database), this option will be ignored.
  1320.  
  1321.            Added the /FROMTERRA option for calculating the distance to and
  1322.            from Terra (which is assumed to be sector 1).
  1323.  
  1324.            Added the /FROMC0 option for calculating the distance to and
  1325.            from the known class 0 ports (other than sector 1).  If they
  1326.            aren't specified with the /CLASS0:# option, or in the database,
  1327.            this option is ignored.
  1328.  
  1329.            Added the /FROM:# option for calculating the distance to and
  1330.            from a specific sector.  Only one such sector per run is
  1331.            allowed.  Maybe I'll change this later.
  1332.  
  1333.  
  1334.                                    Page 23
  1335.            Fixed CIM reading in Linux executable (had to put a CR
  1336.            check/strip in).
  1337.  
  1338.            That's enough new stuff for now.  This is version 0.15.
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.                                    Page 25
  1393.