TWdb (Trade Wars database) v0.3 - 23 Sep 93 Copyright © 1993 by James M. McKinney, Jr. This program is being written to aid those Amiga users who love to play the on-line BBS game, Trade Wars 2002. We have been without a basic utility of this type for some time. The only thing I have ever seen was an old version of TWView ported over from MessyDOS. I knew we could do a lot better than that. After a lot of looking, I decided to write my own. I have taken ideas from TWView, TWHelp, TWAssist, TWExplorer, and some more I'm sure, and tweaked and improved them (I hope) into what you see now. I was hesitant to even start this thing with the pending release of Trade Wars v2.0. But when the release date slipped over a year behind and folks that have played the beta version of 2.0 reported that it was terrible, I figured that v1.03 still has quite a bit of life left in it. TWdb uses capture files to build its database from. You get these while online in the game. The most important of these are the Computer Interrogation Mode (CIM) files. These give you your explored universe and the port status of all known ports. If you don't know how to capture files, (CIM or otherwise), talk to a friend or drop me some email. I don't want to get into all that in these docs since the comm program you're using makes a great deal of difference. I may include a script for Terminus if I get it done. I was working on improving its capabilites, but Terminus lacks some functions I needed, so I put that project on hold. It will capture the files needed by TWdb quite well though. If it's not in this archive, I guess I didn't get it finished. TWdb is currently still under development as you will find out. All of the major functions are here except for graphics. I got the database related stuff done and decided to release a version to get some feedback from users. TWdb is still undergoing a great many changes. A list of some of them is at the end of this document. Read them before you send me a great idea or complaint. I originally started this thing just for my own use, but gradually started adding stuff that my friends asked for and/or mentioned. It is aiding my game play quite a bit these days, so I thought I would release this very early version and see what kind of response I get. This whole thing is written entirely in Amiga E and is my first project with this language. (I like it a lot. I wish the upgrade would show up soon. I could use floating point support and would like to break this monster up into smaller pieces. The source code is over 80k now. Gets a little tough to navigate in the editor sometimes. :-) Now for some legal stuff. (I hate this part of docs.) TWdb is freely distributable. The author retains all rights and privilges. TWdb may NOT be sold for profit in any way, shape, or form. It may be distrubuted on disk software collections as long as those collections are not sold for profit. After all, I wrote this thing. No one else has any right to make money off it if I'm not. Also, the author is in no way responsible and can not be held liable for any losses or damage that may occur while you are using this software. Enough of this boring stuff. Let's get on with the real docs. 1. Installation: TWdb will run from anywhere. It doesn't use anything but the normal system libraries (so far). The only thing it expects is that the data and capture files reside in the same directory as itself. It should run in a 512k Amiga with no trouble, but I have not tested it. (I don't know anyone who still has only 512k.) I wouldn't recommend trying to multitask it with your comm program in only 512k though. TWdb gulps down about 300k when it's doing the distance routines, so you might run out of memory. Anyone with 1 meg or more should have no problems at all. 2. Main Menu: Pretty simple. You're confronted with three choices: 1 - Create new database 2 - Database maintenance 3 - Interrogate database 1 & 2 - The first two selections are basically the same except for the routine that loads the database from disk, so I will combine their descriptions. You will be first be prompted for a name. I usually use the BBS name. TWdb then clears memory and sets up an array for a normal 1000 sector game. If you are doing maintenance, the program will load the database from disk. TWdb will then display the first maintenance menu which is for loading text capture files of game information. I will now cover the rules of file names. I have been very strict in this version about what the files names must be. The program will not load your capture files if they are not named correctly. The naming rules are: .TWdbf - The database that TWdb creates and maintains. You don't have to worry about this one. All you need to provide is the name. .sct - The CIM sector capture file. .prt - The CIM port capture file. .ftr - Deployed fighter capture file. .min - Deployed mine capture file. .sta - Game status capture file. .msl - Major space lane capture file. Once again, if your file names are not named according to these rules, the program will abort. Check the example files included. If you have any problems loading your capture files, make sure they contain the same information as the examples. Now, on with the menu selections and their descriptions. Database maintenance menu: 1 - Load ALL database information. This selection attempts to read all your capture files except for the space lane file. 2 - Load all information EXCEPT sectors. This one saves time by skipping the sector file. Use this when you have no new explored sectors or you have already explored the entire universe. 3 - Load CIM sector information. Reads in the CIM sector capture file. 4 - Load CIM port information. As above but for the ports. 5 - Load deployed fighter information. As above. 6 - Load deployed mine information. (Yawn...) 7 - Load game status information. Reads the status file for the stardock location (if any). 8 - Load the major space lane capture file. Don't want to get caught sticking any fighters or mines in the Fed's territory. Make sure you have already input the StarDock and Class 0 port locations before you do this. The spacelanes will be erased later if you don't. 9 - Input manual data. Takes you to the second maintenance menu. Q - Quit to main menu. Nuff said. Database maintenance menu 2: 1 - StarDock location. Allows you to input the sector number of the StarDock. For use in games where the StarDock location is not displayed in the status screen. This option will erase the spacelanes. (Some sysops like to move the StarDock during the course of the game.) 2 - Class 0 port locations. Same as above except for the Class 0 ports. (You don't have to input sector 1. It's marked automatically.) 3 - (Un)Mark Avoid sectors. Toggles avoid sectors on and off. 4 - Fighter locations. Allows you to input the locations of fighters. You can input your own fighters here, but loading the capture file is much easier. 5 - Mine locations. Pretty much the same as fighters. 6 - Ferrengal's location. Here you input the location of the Ferrengi Empire. (Note that this is not necessarily where Ferrengal is at. My corp tends to capture Ferrengal pretty early in the game and do away with it.) You can also input the fighters, mines, and mark it as an avoid if you wish. 7 - Planet locations. Input where planets are and how many. 8 - "Busted" locations. Mark the ports and dates where you got nailed. 9 - Edit a sector. From here you can change anything about any sector in the database. You can also screw up your database in a big way. Use with extreme caution. You should almost never have any reason to use this function. I have only used it to set up test sectors in my databases during development of TWdb. During normal game play, I only use it to delete ports that are destroyed. It's use is pretty straightforward, so I won't describe it in detail. Main menu selection 3 - Interrogate a database: This is where you get your "intel" from your database. You will be promted for a name and then will be presented with the Interrogation menu. It has three selections as follows: 1 - Ports 2 - Sectors 3 - Graphics (not yet implemented) Port interrogation menu: 1 - Paired ports. Finds adjacent trading pairs in the three types or a combined list of all. You will be prompted for the desired output device. your choices are, screen, printer, file, or to abort the procedure. If you choose file, a file called .PAIRS will be created in the TWdb directory. Next you will be given the option of how you would like the output sorted. It can be sorted by the sector number, by the distance from a sector that you input, or by trading factor. The program will now send the list of pairs to the selected output. 2 - Evil pairs. Finds pairs of ports which you can steal from one port and sell at an adjacent port. This is most useful in games that use AEdit to disable the "steal/sell" loop. Otherwise works the same as the regular pairs. File output name is .EPAIRS. 3 - Busiest ports. Gives you a list of ports that have been heavily traded. You can pick ports traded below 75%, below 50%, or below 25%. Useful for finding out where your competition is doing business. Also makes it very easy to spot when someone is using the "Megaholds" bug. File output name is .BUSY. 4 - Class 8 ports. A simple list of all the class 8's. Has the usual sorting and output options. File output name is .CLASS8. 5 - HFS ports. Gives a listing of the ports where you can buy holds, fighters, and shields, and the distance to and from those ports. File output name is .CLASS0. 6 - Blocked ports. Gives a list of ports that you know about that you can no longer obtain trading information on. This usually means your rivals have placed fighters in the sector and now you know where they live so you can "pay them a visit". It can also mean that someone has destroyed the port and you will have to go and edit the sector and delete the port. Same output and sorting options as the rest. File output name is .BLOCK. 7 - Closest ports. First lets you choose what kind of port to look for. Buying or selling fuel, organics, or equipment, or no preference are your options. Otherwise has the usual sorting and output options. You will be given a list of the FIVE closest ports meeting your desired criteria. File output name is .CLOSEST. 8 - Lonely ports. This option will give you a list of ports located in dead-end sectors and have no adjacent port. These ports have a higher chance of giving you easy experience ports just for porting. Same old output and sort options. File output name is .LONELY. 9 - "Busted" ports. Prints a list of the ports where you've been caught doing evil deeds. They are sorted by date. Output options as usual. File output name is .BUSTED. Q - Quit to previous menu Sector Interrogation menu: 1 - Sector lists. This gives you a sub-menu of lists. You can get the following lists: 1 - Unexplored. Lists the sectors you haven't been to, probed, or holo scanned yet. Output options are the same as the ports. File output name is .UNEXPLORED. 2 - Explored. Pretty much the opposite of the above. File ouput name is .EXPLORED. 3 - Unknown. Lists the sectors that you don't know the location of. These can be tunnels you haven't been down and such. Note that "orphan" sectors will show up here as well. These are sectors that BIGBANG failed to attach to the rest of the universe. File output name is .UNKNOWN. 4 - Avoids. Lists your avoid sectors. File output name is .AVOIDS. 5 - Major Space Lanes. Lists the sectors that are located in the major space lanes. File output name is .MAJORSL. 2 - One-way and trap sectors. Finds one-way warps and identifes the ones that may be used as "traps". These are sectors that have a one-way warp into them and only one warp out. If the trap sector is blocked with mines or fighters, aliens and Feds will caught in the trap. They will remain there until they are killed or, in the Feds case, until a player trys to attack another player in FedSpace. Ferrengi caught in the trap may try to fight their way out depending on the strenght of the trap. 3 - Tunnels. This finds tunnels of both the branched and straight types. The number of branches does not matter. The only reason I put this in here is because all the other utilities seem to have this. This means that all sorts of suckers are going to be hiding in these death traps. I love it when someone trys to live in an area of space that only has one exit. 4 - Hubs. This finds sectors that have two or more dead-end sectors adjacent to them. These often turn into great areas to live in if the entrances are few and can be controlled. 5 - Distance between sectors. Calculates the KNOWN distance to and from a pair of sectors. Note that the distance may change (shorten) as you explore more space. I can only calculate the paths that you know about. 6 - Roam the universe. This is a neat function that was actually very easy to do. This lets you roam around the universe just like you were in the game. Here again I can only show you what you already know about. This is good for mapping out areas and just "checking things out". It will also show you if a sector has any "backdoors" (one-way warps into the sector). Graphic Interrogation menu: Sorry folks, but I haven't even started on this part yet. I haven't decided just how to display this stuff. The maps are pretty damned hard to draw because of the way the universe is connected. The fact that I don't have much experience at programming graphics just compounds the problem. I'm willing to listen to any suggestions or hints if you have them. Well, that pretty much covers it (yeah, right). I have quite a few improvements and additions planned for TWdb. I hope to be posting regular updates. As you can see, the version number is very low. I have a long way to go before v1.0. Here is a list of some of the things I have in mind (in no particular order): - Do the graphics - Put a REAL interface on this sucker (Intuition) - Improve the capture file handling -- Allow the captures to all be in one file -- Not be so picky about the structure of the capture file - Improve the error handling -- Don't exit the program when a non-fatal error occurs - Intergrate another player's database - Summary of changes that occur during capture file updates - Warning when fighters/mines are deployed in space lanes - A general game information summary - An additional method for finding unused ports - Finding clusters of unexplored sectors - Finding closest unexplored sectors - Track other player's information - Figure out a faster way to read the capture files - Add a planetary database - Go really wild and make a term program out of it with real-time database updating (dream) Please feel free to let me know if there are any really good things you would like to see TWdb do. Known bugs: Absolutely, postively none except for... - Bust date not displayed on edit sector screen after it is entered - Jury still out on the proper way to handle bust dates. Some folks feel that the "last busted" name that the port keeps is cleared after 14 calendar days. Others think that it is tied to the days the game has been running. I tested this on a home game and had bust names still in the Trade Wars database over 40 days no matter which way you count it! The players were able to port without getting busted again though. Haven't gotten back to testing that one yet. I am currently using 14 calendar days since it is the safer of the two theories. I need to move the routine that clears the bust dates though. They are currently only cleared if you enter the bust date entry screen. - "From" distances not being printed in closest ports routine. That's should do it. Suggestions and help (flames >Nil:) will reach me at the following addresses: Internet - mckinnej@emh.kadena.af.mil FIDO - 6:733/13.2 Snail - Jim McKinney PSC 80 Box 15642 APO AP 96367-5642 I am currently in the US Air Force stationed on Okinawa, Japan. My addresses will change in March of 1994. To what, I don't know yet. I hope it's something fairly warm :-). A note on FIDO mail. I currently get Amiga Programming, Amy Tech, Amiga CDROM, and Amiga Point. I can receive netmail, but replying to it is a problem. Since our net is way out here in the ocean, all our netmail is sent as crashmail. This extra cost is passed to the user sending the netmail. If you send me netmail, make sure you send me your snail-mail address if you want to be certain of a reply. If your message is important enough, I will respond netmail. You could always post a public message to me in the programming echo. Internet is the best way of all to reach me. Please use it if you can. Hope you get some use out of this thing.