Documentation (heh!) for the trade wars viewer programs Last revision: 6/27/91 by woody Abstract: ________ The game Trade Wars is a delightful mix of economic strategy, exploration, and military conquest. For the first two to succeed, however, requires a good working knowledge of the universe. Unfortunately, keeping all the information about which sectors you've visited, which are ports, and which is connected to which can be a nightmare. These two programs, "Convert" and "InfoViewer" should help to make keeping that information straight a little easier, and increase your enjoyment of the game. The first program, "Convert", creates a data base of explored sectors, warps for each sector, if it is a port or not, and if a port, what it is selling. It is able to use the "interrogation" mode of your crai, to enable fairly rapid and simple collection of data about the universe. The second, "InfoViewer", allows you to look at that data base in a variety of ways, from visual graphing of the data to asking questions about nearby ports and so on. The third, "Offline", performs various inquiry tasks. One option, "Control", is especially good if you have a map of our sectors handy. You specify your militarized perimeter, and one spot that is inside your controlled territories. It then maps out all the sectors that can warp to your controlled area without going through your militarized perimeter. (If you find that one can get from a spacelane to the heart of your colonies without passing through a perimeter, something is wrong...) Another, "Dead End Count", allows you to analyze the locations of "tunnels", long chains of sectors with only one way in and one way out, that you can use for easily defensible sectors. Yet another "Traffic Analysis", allows you to identify the high traffic areas in your explored sectors, so that you can post guards to find out where people are traveling. What you need to run the programs: ---------------------------------- To create the data base, you need to be in a terminal program that allows ascii uploads and ascii captures. The best situation is one that allows you to do them simultaneously, i.e. capture input while uploading a file. Second best is to have a large scrollback buffer, that allows you to take pieces out of the scrollback and append them to a file. There are two versions of the programs, one for DOS machines and another for Macs. (Source code available if anyone wants to port it to the Amiga or something. Should only require minor changes to file I/O and graphics.) If you are running the DOS version, you will need the device drivers (.BGI files) suitable for your machine. HOW TO CREATE AND MAINTAIN THE ORIGINAL DATA BASE: -------------------------------------------------- There are two methods to develop the data base. Which you use depends on (i) how good you are at flinging files about and (ii) how much new information you are trying to collect. If you just want to find out about a few sectors, use the "old" method. If you want to collect a full set of data, use the "new" computer interrogation mode. In both modes, you should should turn ansi off at least for the duration of the transfer. Do this with from the main computer menu. Here is the "old" method. First, log into the game, and invoke the computer. Tell the computer you want the known universe report, by hitting K. Now start an ascii download. If you have explored more than half the universe, tell the computer that you want unexplored sectors by hitting U and return. The computer will list your unexplored sectors. If you have explored less than half, tell the computer you want explored sectors by hitting E and return. The computer will list your known sectors. If you've explored a lot of sectors, there may be a [PAUSE] in the listing; just hit the space bar and go on past it. (Its okay if it shows up in your ascii download.) When the listing is finished, turn off the download. Your captured file must contain the line that says "You have explored the following sectors:" or "You have NOT explored the following sectors:" and at least one blank line after the sectors. (A little more before or after is okay too.) Now shift from your terminal program to the program "Convert". At the first prompt, it is asking for your initial data base. If you've already developed a data base, and are just updating it, give the name of your old base; if you don't have an existing data base, just hit a return. Next, it will ask if it should be reading a list of explored sectors, a log of inter-warp and port information, and so on. Choose option 1. Next, it will ask for your "Explored Sectors" or "Unexplored Sectors" file. Next, it will ask you to come up with the name of a file to generate: use anything you like here, but be careful that you don't accidentally overwrite something you want to keep. (The program is smart enough to ask if you really mean to clobber a file.) The last question the program will ask you is if you want an update on your ports: this will add a request for update for every port. The program maintains information about current trading levels for each known in the game; this will freshen that information to the current data. It probably isn't needed very often, but once in a while to update things it is useful. (I generally use that only if I've lots of time to play around: I refresh the "interesting" ports by using an upload from the "Examine" program.) What this step will do is create a file that you can upload to generate lots of printouts. Essentially, what it does is create a file with I and R for every new sector. The nice thing is that this will interface well with the Crai on board your ship... Now back to Tradewars. You are probably still in Computer mode; if not, get there. What you want to do is upload the contents of the file you just generated with the convert program into the Crai on your ship. If you can do that while doing an ascii download, start the download and then start the upload. Otherwise, you may have to start the upload and then capture the results later from your scrollback buffer. In any case, your captured file should contain all the I reports (sector nnn has warps to : xxx - yyy - zzz etc) and all the R reports (Commerce report for ...). There will be lots of "I have no record of a port in that sector."'s: that is okay -- had to find out if there was a port there or not. If there are a couple of ports that you are trying to keep track of, you can also call up a port report on them and store that in the downloaded file: just make sure that when you hit your R you don't just carriage return but explicitly type in the sector number. Back to the "Convert" program. Again, tell the program your old data file (or hit return to start fresh) and this time we are in part 2. Tell it the name of the ascii download you just captured, and the name you want to use for your database. The program will generate the data base. Here is the "new" method. First you have to get into computer interrogation mode. To do this, you need to send ascii characters 200 through 205 to the Crai. There is a file "on.txt" included with this package -- just do an ascii upload of on.txt, and you will see a : appear. Alternatively, if you are on an IBM, you can hold down the alt key, then type 200, release, hold down alt, type 201, release, etc. Now that you are in interrogation mode, start an ascii capture; I recommend using an extension of .SCT. Type I, and the computer will immediately begin spewing out sector numbers and warps. When that finishes, stop the capture, and start another capture, this type using an extention of .PRT. Type R, and the computer will begin spewing out port information. When that finishes, stop the capture and run the program Convert. There are two new options in convert: option 8, which parses the .SCT report you prepared, and option 9 which parses the .PRT report. Invoke them, then exit Convert and your data base is complete. This "new" method does not identify class 0 ports, nor does it identify the star dock (as the old method did from logs). That information is not available from interrogation mode, so you will have to add it manually using the edit mode of convert. STRUCTURE OF THE DATA BASE ========= == === ==== ==== The database is in plain text, so you can examine it yourself if you like. Information is divided into several categories. First, are the lines ::Tradewars Data file:: SpaceDock is 200 or whatever the corresponding sector is if you have visited the space dock, or possibly SpaceDock is 0 if you haven't visited the space dock sector. Next is a line of the form 7 <- number of notes where the integer represents how many "Notes" you've stored for the game. A note has the form 13 Don't Go Near This Sector!!!! i.e. a sector number, and a short bit of text. You can add or delete notes in the "Examine" program, as well as display those sectors for which you've recorded notes. Next is a line of the form 105 <- number of Port Infos followed by lines of the form 120 3000 3280 -2530 100 32 100 The first integer is the sector number for the port; next are the levels for the three goods "Fuel Ore", "Organics", and "Equipment". A positive number means that the port is selling the stuff, and a negative number means the port is buying up to that much of the stuff. (Remember that the larger the magnitude of the number, the better the price you get -- ports are more willing to stretch when the numbers are higher!) The last three numbers are percentages of maximum use: a value of 100 means the port is fully refreshed for that good, 0 means they are all sold out or not interested in buying anything. A special note: if a port doesn't show up on the R report, but has port information stored for it, the previous sales levels are preserved, but the port usages are all set to zero. This allows you to identify ports that have been captured by the Ferrengi or opposing players. The sectors are in no special order (actually, in order of appearance from the logs over time) but there must be as many lines as specified in the <- number of Port Infos... Next is a line of the form Sector data starts here... followed by lines of the form 1 6 2 3 4 5 6 7 8 2 ... Here, for example, is a report for sector 1: it has six warps, to positions 2 through 7, a port code of 8 (which actually corresponds to class 0) and an "etc" code of 2. A "Port Code" corresponds to -1, if the sector is not a port, 0 through 7 based upon a three bit representation of selling or buying (for example, sector 120 is selling Ore, selling Organics, and buying Equipment, so its port code would be 1 * 1 + 1 * 2 + 0 * 4 = 3; don't worry about it, the program handles figuring out port codes and so on). The "etc" code tells about various pieces of information, again depending on bit representation: currently the codes in use are NoteExists = 1; IsPort = 2; HasFighters= 4; SpaceLane = 8; Stardock = 128; but others will probably follow. (Note that the Stardock is also a port; so its etc code is 128 + 2 = 130; if a random port had a note attached, its code would be 2 + 1 = 3.) HOW TO USE THE DATA BASE VIEWER --- -- --- --- ---- ---- ------ Its pretty well impossible to draw a decent map with all 1000 sectors, so the data base viewer doesn't try to do that. Run "Examine", and tell it the name of your data base. You will be presented with a list of options. In version 0.88, you get to choose from the following list: Choose one of dd note usiest ports elete note Closest place to buy ighters, shields, and holds Note nformation ength of path between two sectors earest port

aired ports uit Nearest ectors ranswarp menu Nearest nexplored sectors iew space in graphic format Here is what the commands will do: dd note elete note Note nformation These manage the notes that you may have stored on your universe. Typical notes might be "enemy base here!", "great trading spot", "Fedspace", or whatever. Option "A" will add a note to a sector, option "D" will delete a note from a sector, and option "I" will present you with a list of the notes you've made, sorted by distance from a current sector. usiest ports This will offer a display of your ports, sorted by usage. First to appear will be all class 0 ports, and any ports with a usage field of 0. (In particular, any port that has been previously scanned, but for which you can not now obtain a scan will appear here.) Then will occur all ports sorted by fraction of maximum use. Closest place to buy ighters, shields, and holds Invoke this option, and you will be asked for your current sector. The computer will then display the path from that sector to any place it knows of to buy fighters: if the only class 0 port you know is Terra, that is the only one it will display, but if you know the others, it will display a shortest path to that sector. ength of path between two sectors You specify two sectors, and it will tell you the shortest way it knows of to get between those two sectors. Note that this may NOT be the actual shortest path, if there are sectors you have not yet explored that might give you a better route. It gives you the shortest path YOU'VE EXPLORED between those two sectors. earest port Nearest ectors Nearest nexplored sectors These displays will give you information about what is close to your current position. Information displayed includes if the sector has been explored, any notes, if its a port, its status (SSB for example, means selling Ore, selling Organics, and buying Equipment) and levels of production. If you ask for the "Nearest Port" report, only ports are listed. I find the "Nearest Unexplored sectors" report VERY useful for exploration purposes: I can just head toward the nearest unexplored sector easily this way.

aired ports This is one of my favorites. What it does is go through the data base and find ports that are adjacent (i.e. you can warp between them using normal space in one turn) and are compatible (i.e. at port A you can buy a good that is sold at port B, and you can sell a good that is bought at port B). You can be selective (greedy) and only specify ports that are compatible in the very profitable Organic-Equipment trade, or ask for all compatible pairs. The program offers you the opportunity to have the results sent to a text file, which you can then print later (if you can't run the program simultaneously with your terminal emulator, you can get hard copy of the "hot sectors") and you can have the results sent to a text file that are compatible for upload (i.e. part 2 of the "Convert" program so you can keep an eye on trading levels at these critical ports). Displayed to the screen is an integer "factor" -- this number is based upon levels of goods available in the critical trades, and will give a rough estimate of how good a deal you are going to get. ranswarp menu This drops down to a submenu that deals with locations of deployed fighters and using a transwarp drive. Most submenu items are pretty obvious: you specify where you have deployed fighters, or tell the data base that some #%!%@$ has shot up your deployed fighters, or list the places the data base knows you've deployed your fighters. The only thing that needs mentioning is the shortest route submenu item: you specify where you are, and where you want to go. It figures out, based upon where your fighters are located, the fastest route to get there (using a transwarp jump and then normal autopilot). It may say to transwarp to your current sector -- that just means the shortest route lies through normal space. iew space in graphic format Viewing the data will attempt a graphic display on your screen of space: you tell it about how many rows across and columns up and down of sectors to use (maximums are given in the program: hit a return, and you get a default value that is about 3/4 of maximum); you tell it the base sector you want in the center of the screen (has to be a sector you've visited!); and you tell it how large a radius to display (all sectors it is aware of no more than that distance away from your base sector). It will try to display the collection of warps that make up space. Ordinary, visited sectors are displayed as circles, ports as rectangles. (Unexplored sectors just have their numbers floating in space, and if you have color are in yellow.) Lines between sectors means there is a warp connecting one with the other. Dashed lines means that you don't know if the warp is two way or not: if one end of the sector is unexplored, you will have a dashed line. If both ends are explored, then the warp really is one way! (Try graphing around the StarDock and around the class 0 ports.) Don't try to graph too many sectors at once: the screen gets too busy, and you won't be able to tell what connects to what. Note: dit data base This allows you to go in an mark a sector as unexplored, create or destroy a port, and define the location of the star dock. You might want to do the former if you think something has gone wrong with your data; the next because someone has either shot up a star port or built one. You might need to tell the data base where the star dock is located if your sysop has redefined the name of the port where stardock is located; the program looks for "StarGate Alpha" -- and if its not there, or been moved, the program won't find it and you will have to tell it directly. -- has been moved to the Convert program. FEEDBACK ________ Best place for info is 415-376-1554; leave mail to number 1. ACKNOWLEDGEMENTS ________________ Thanks, of course, to the Martins for such a great game! COPYRIGHT AND LICENSING STUFF ----------------------------- Copyright 1991 by Robert Weaver. All Rights Reserved. You may not distribute this for any fee beyond reasonable costs of distribution. Permission is granted to distribute this document and the related executables and source code provided this notice is preserved, and anyone you give the executable has the ability to obtain this documentation and the accompanying source.