Ultimate Universe Third Party Development Kit for 1.60 May 11, 1993 ====================================================== Ultimate Universe Copyright (C) 1993, TopherSoft Engineering I have had a lot of fun over the years developing Ultimate Universe. And a lot of people have contributed a lot of very good ideas and suggestions to making this an enjoyable program. With that in mind I am releasing the file structures to the various game files in the hopes that some person or persons may wish to create add ons in the form of Additional Daily Suppliments or Editors or what not. I am also pretty easy to reach by phone and don't mind answering questions. My number is 508-693-7396. This number is a Searchlight BBS running at 14400 bps. All information herein applies to version 1.60. Ultimate Universe is written in BC++ 3.1 using only the C aspect of the compiler. The file formats will be displayed as C structures. This text file contains: The Structures for GALAXY.UU, LINK.UU, PORT.UU, PLANET.UU, SPY.UU, TALLY.UU, CUBE.UU, DEVICE.UU & SHIP.UU. A routine for staying compatable with FILE.DIR. A routine for accessing CONFIG.UU and what it means. Details on Ultimate Universe Interactive (UUI) activation. ============================================================================== /*************** * * GALAXY.UU * ***************/ The Galaxy File contains most of the information about things contained in the galaxy. It contains one record for each sector of the universe. It also contains an opening zeroth sector record which contains the following data: Record Zero: GALAXY.PORTER : Contains the Sector the Ultimate Unifier is in. GALAXY.WARP_SHIELD : The Age of the Universe in Days. GALAXY.ORM : The Current Maximum Number of Sectors. On additional records each sector is it's own record number. Galaxy's structure is as follows: typedef struct begin int SECTOR; : The Sector Number (and Record Number) LOBJ FIGHT; : NUM is the number of Attack Drones : OWN is the owner's record number if PRG is 2 team's record number : PRG the programming mode LOBJ MINE; : NUM is the number of Sector Mines : OWN is the owner's record number if PRG is 2 team's record number : PRG the programming mode long PORT; : The file offset in the PORT.UU file for the port in this sector. Zero if none. long PLANET; : The file offset in the PLANET.UU file for the planet in this sector. Zero if none. char PLANET_ID; : owner's record number. : Set to 50 for independent : Set to 53-55 for Meanderer thru Destroyer. char REPLICATOR; : Mine Replicator. Mine Count is increased by MINE.NUM/REPLICATOR. int PORTER; : Sector Destination of Teleport Satellite long PORTER_CLOAK; : Cloaking Energy of Teleport Satellite int WARP_SHIELD; : Ergs of Warp Shielding char DAMPER; : Owner Id of Sector Damper char LAST_SHIP; : Owner Id of Last Ship in Sector int ORM; : ORM Link Sector Number char BLACKHOLE; : 1 = Holographic Black Hole : 2 = Wandering Black Hole : 3 = Man made Black Hole char CABAL_REPORT; : Whether the Cabal in this Sector have been reported. char DECOY; : Ship ID of Holographic Ship Decoy long DECOY2; : File offset for Holographic Planet Decoy long DECOY_FIGHT; : Drone display for Holographic Ship Decoy char MESSAGE_BEACON;: 1 = yes there is a message for this sector. char SPY_WARD; : Number of Spy Wards. char HOMING_TRAP; : If set to 127 an open trap is waiting to grab a Ship ID. If set to 0 no homing trap. Else it is set to a Ship ID. int PLATFORM; : Number of Platform Device Bay Missiles. char ASNARE; : Ship Id of Autopilot Snare Owner char TRIPWIRE; : Ship Id of Passage Tripwire Owner. char FLASHWIRE; : Ship Id of Flashwire Owner. int REFLECT; : Sector to Display Sector As. (See Sector Reflector) char TOLLSTATION; : Ship Id of owner of Tollstation. long TOLLFEE; : Amount to Charge for safe passage. long TOLLCOFFER; : Total Amount Currently Collected. char TOLLTYPE; : Type of Tollstation. char NAGATOR; : Ship Id of Owner of Overspace Navigation Nagator char POPPER; : Ship Id of owner of Sector Popper. char SETTINGS; : obsolete, not used. char LINKSUPPRESSER;: Ship Id of owner of Warp Link Suppressor. char DELACOOS; : Ship Id of owner of Delacoos Drive Disruptor. char MADNESS; : Level of Space Madness Virus Present. char EXPLODE_DECOY; : Id Explosive Decoy is Copying Uses DECOY_FIGHT for number of drones. char MINE_LAUNCHER; : Mines/MINE_LAUNCHER are launched into another Sector during Event. int MINE_DESTINATION; : This is the Sector the Mines are Launched to. If Zero destination is random. char DAMPER_TRIPWIRE; : Id of Owner of Tripwire int HYPER_THIEF; : Cube Number of Hyper Thief char HYPERSWAP_TRIGGER;: Owner ID of Hyperswap Trigger char TOLLTEAM; : 1 = team tollbooth, zero otherwise. char SNITCH; : Ship ID Snitch is logged on. char SNITCH_LIMITED; : 1 if Limited, zero otherwise. char DIM_CATAPULT; : Not yet used. char misc4; int misc5; long misc6; float misc7; end FILE1; typedef struct begin long NUM; char OWN; char PRG; end LOBJ; ============================================================================== /**************** * * LINK.UU * ****************/ The Galaxya file simply contains the eight potential warp links that each sector has. A value of zero indicates no warp link. A sector number is the sector number that this sector is warp linked to. A negative value is a phantom link indicating that a sector (the absolute value of the that number) used to be connected to that sector. LINK.UU's structure is as follows: typedef struct begin int LINK[8]; end FILE1A; ============================================================================== /*************** * * PORT.UU * ***************/ The Port File contains information about the port in a sector. The first record is a dummy blank record and the second record is the Procurator. If there is a port in a sector the field GALAXY.PORT will contain the offset to the port record, such that: "fseek(portstream, GALAXY.PORT, 0)" will position the record pointer at the the start of the port record. If GALAXY.PORT is zero then no port exists. The structure of the port file is as follows: typedef struct begin char NAME[30]; : The name of the port. char TYPE; : The type of the port 1 - sells Ore, 2 - Organics, etc. 11 - Sol, 12 - Mars, etc. 21 - Procurator. long TRADE[5]; : The number of units of cargo available for buying or selling per type of cargo. float RATES[5]; : The current rate for one unit of cargo per type. char SELL[5]; : Obsolete, no longer in use. long SWAP; : Used for Procurator Movement. int misc1; : for future use. char MADNESS; : Level of Space Madness Virus Present. long COFFER; : Not used yet (for franchise) long misc2; long misc3; char misc4; float misc5; end FILE6; ============================================================================= /*************** * 1 = Wanderer * PLANET.UU 2 = Watcher * 3 = Destroyer ***************/ The Planet File contains information about the planet in a sector. The first record is a dummy blank record. The first thru third records contain the Taakian Wandering planets (Record 1 = Meanderer, 2 = Watcher, 3 = Destroyer). If there is a planet in a sector the field GALAXY.PLANET will contain the offset to the planet record, such that: "fseek(planetstream, GALAXY.PLANET, 0)" will position the record pointer at the the start of the planet record. If GALAXY.PLANET is zero then no planet exists. There is no way to trace from the Planet file what sector the planet is in. The structure of the planet file is as follows: typedef struct begin char NAME[30]; : The Name of the Planet char SETTINGS; : Each bit has meaning : bit 0 on = Planetary Defenses on. : bit 1 on = Team Member may land. : bit 2 on = Devices 1st Defense Strategy : bit 3 on = Shuttle Warp Shielding to Surface. : bit 4 on = Planet infected by Organics virus. : bit 5 on = Major Cabal Planet long CARGO[12]; : Amount of cargo per catagory. long PRODUCTION[12]; : Amount of production per catagory. int DEVICE; : Device ID of Planetary Device. int DEVICE_VAR; : Variable 1 for Planetary Device. int DEVICE_VAR2; : Variable 2 for Planetary Device. int HYPERSECTOR; : Sector Planet will return to from Hyper storage. char HYPERID; : Hyper Storage Refernce Number. char MADNESS; : Level of Space Madness Virus Prsent. char TYPE; : Planet Type. 0 = Breeder. 1 = Warrior. int misc2; : for future use. long misc3; long misc4; long misc5; long misc6; end FILE7; ============================================================================== DEVICE.UU typedef struct begin char NAME[34]; : Name of Device long COST; : Price of Device int ID; : Device Number int VAR; : Device Variable 1 int VAR2; : Device Variable 2 int USE; : Is this a Usable Device? 0 = No, 1 = Yes. unsigned char : Amounts Available for Purchase by Dimension. AMT[10]; end FILE3; ============================================================================== SPY.UU The Spy file contains scant information about the detection of Attack Drones, Sector Mines and Planets in a given sector. Just like the GALAXY file there is one record for each sector and a dummy zeroth record. If any field is non zero it means that that object has been located by the Spies. The spy structure is as follows: typedef struct begin char FIGHT; : Owner ID of Attack Drones (+56 for Team Ownership). char MINE; : Owner ID of Sector Mines (+56 for Team Ownership). char PLANET; : Owner ID of Planet. end SPYFORM; ============================================================================== CUBE.UU The Cube file contains the information of the contents of the Hyper Cubes & Swaps. Record zero is a dummy record, records 1 thru MAXPLAYER are the Team Cubes and any records after that are pointed to by record numbers stored in varaible 1 of the Hyperdevice. Number of Device Bays in the cube is held in the Hyper Device not the file. The structure of the Cube File is as follows: typedef struct begin int OWNER; : Owner ID of Hyper Cube. : Not really used may be incorrect in some situations. int DEVICE[20]; : Device ID per bay. int VAR[20]; : Device variable 1 per bay. int VAR2[20]; : Device variable 2 per bay. char NAME[20]; : Name of the Cube (For HyperSwaps). end CUBEFORM; ============================================================================== The Tally File is sort of a nothing file but with a lot of functions it's use can speed up applications. This file is simply a one character mark indicating whether there are Attack Drones, Sector Mines or Planets in a Sector. This file contains a dummy zeroth record and then one character for each sector. typedef struct begin char MARK; : If Mark equals 1 there are Attack Drones or Sector Mines or a Planet in this sector. end TALLYFORM; ============================================================================== /********************** * * * SHIP.UU * * * **********************/ As it's name implies the ship file contains all the information about the condition and components of a ship. Like the GALAXY file this file contains a dummy zeroth record. In the zeroth record: SHIP.TODAY contains the maximum number of players (MAXPLAYER). SHIP.SDAMAGE contains the file format version number. To date that is '0' for pre-140 file format and '140' for version 140 file format. '160' for version 160 file format. Three extra records exist at the end of the file. These are mostly used to house the names of the computer antagonists. Record Number MAXPLAYER: contains the Federation. Record Number MAXPLAYER+1: contains the Cabal. Record Number MAXPLAYER+2: contains the Anti-Establings. None of the information below (except Name) applies to those records. The structure of the Ship file is as follows: typedef struct begin char NAME[38]; : The name of the ship. char TODAY; : Number of sessions used that day. int SECTOR; : The sector the ship is in. : Set to Zero indictates a dead ship. char ID; : Owner ID and record number. char TEAM; : Team ID ship belongs to. Zero means no team. int DAYS; : Number of days the ship has survived. int CARGO[5]; : Amount of cargo units per type long ITEM[13]; : Amounts of supplies per item. : See below for a list of items. int DEVICE[32]; : Device ID per device bay. int DEVICE_VAR[32]; : Device Variable 1 per device bay. int DEVICE_VAR2[32]; : Device Variable 2 per device bay. int BOARDNO; : Registration Number of Game ship was created under. : This is zero for unregistered versions. : May vary from Game ID number if ship is Imported. int COUNT; : A unique number when combined with BOARDNO that : can differentate that ship from all other ships : anywhere. char PLAYER[25]; : The Players login name. : Set to NULL indictates a free area to create a : new ship. char BAYS; : The number of device bays. long SECONDS; : Number of seconds remaining that day. char INACTIVE; : Number of days on inactivity. char DIMENSION; : Dimension the Ship is currently in. long FINES; : Amount of Federation Fines accrued. long DEBT; : Amount of Federation Debt accrued. int SDAMAGE; : Number of seconds of sensor damage. long MINES_KILLED; : Number of Cabal Sector Mines destroyed. long CABAL_KILLED; : Number of Cabal Attack Drones destroyed. char FED_HOSTILE; : Set to non zero if ship has been declared an : enemy of the Federation. char COMPUTER; : Set to non zero if ship's computer is damaged. char MADNESS; : Indicts Level of Space Madness Virus Present. int IMPORT; : Importation Copy Number; char EXPERT_LEVEL; : Toggle (0 or 1) sets expert display mode. long FIRST_DEVICE; : The maximum amount for free device at port 6. : Set to zero after use. long SESSION; : The amount seconds left in the current session. char ENHANCEMENT; : Number of Ship Enhancement. A=1, B=2, etc. int TO_UPS; : Number of Device ordered thru U.P.S. int SENSORS[8]; : Device Numbers of Devices in Forward Sensor Array long misc; long misc1; long misc2; long misc3; long misc4; end FILE2; Following is a break down of the Cargo and Item arrays: CARGO[0] = ore CARGO[1] = organics CARGO[2] = equipment CARGO[3] = power CARGO[4] = water ITEM[0] = credits ITEM[1] = fuel units ITEM[2] = cargo holds ITEM[3] = attack drones ITEM[4] = sector mines ITEM[5] = cloaking energy ITEM[6] = anticloaking energy ITEM[7] = plasma warps ITEM[8] = gate warps ITEM[9] = flash warps ITEM[10] = genesis devices ITEM[11] = planetary probes ITEM[12] = for future use ============================================================================== File.DIR contains the filenames and paths to most of the Ultimate Universe files. While it is rare that any sysop or home user changes these it is best to make sure that any third party application has respect for FILE.DIR. Following is a routine showing how FILE.DIR is used: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ extern char pfn[100]; extern int current_universe; void get_path(int fd) { FILE *stream; int fx = 0; static char fname[32][13], fdir[32][60]; if(!fd) { if((stream=_fsopen("FILE.DIR","rt",SH_DENYNO))==NULL) { perror("Can't Locate FILE.DIR"); exit(22); } while(TRUE) { if((fscanf(stream,"%s %s",fname[fx] ,fdir[fx]))==EOF) break; if(fname[fx++][0]=='~') break; } fclose(stream); return; } strcpy(pfn, fdir[fd]); strcat(pfn, fname[fd]); if(fd<=14) { char conv[12] = {"U123456789"}; for(fx=0;pfn[fx]!=NULL;fx++) ; pfn[fx] = conv[current_universe]; pfn[++fx] = NULL; } { ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ get_path should be initialized with "get_path(0)" once before the routine is initially used. Each file has a unique "fd" which can be defines as follows: #define Bank 1 #define Config 2 #define Flea 3 #define Galaxy 4 #define Hitlist 5 #define Link 6 #define Mbeacon 7 #define Newpaper 8 #define Planet 9 #define Port 10 #define Rank 11 #define Spy 12 #define Tally 13 #define UPS 14 #define Warzine 15 #define Bbs 16 #define Count 17 #define Cube 18 #define Device 19 #define History 20 #define Id 21 #define ImportCheck 22 #define Macro 23 #define Portname 24 #define Radio 25 #define Ship 26 #define Team 27 #define What 28 #define Words 29 #define WordsIndex 30 So a call of "get_path(Ship)" would leave string array "pfn" containing the full path and file name leading to the Ship file. The name or location of the file should never be assumed. current_universe points to the active dimension. The active dimension is important to selecting the proper file. Remember that Shareware versions deal strictly with Dimension 0. The presence of a dimension can be determined by checking for the existance of CONFIG.Ux where 'x' is the number of the dimension (or 'U' if dimension 0). ============================================================================== CONFIG.UU contains all the variables that can be configured by CONFIG.EXE. The format of the Configuration file is as follows: typedef struct begin char VAR[30]; : an identifier string for the variable. long VAL; : the contents of the variable. end CONFORM; There are well over 100 variables and I will lay them out below. If you wish to add a variable to CONFIG for use in your application, let me know and I may consider adding it to CONFIG.EXE. A routine for reading a Config variable would look like this: long get_config(char *SEARCH) begin int confg; CONFORM CONFIG; long VALUE = 0L; get_path(Config); if((confg=open(pfn,O_RDWR|O_BINARY,S_IWRITE|S_IREAD))==-1) filerror(pfn,1); while(VALUE == 0L) begin if((read(confg, &CONFIG, sizeof(CONFIG)))<1) break; if(strcmp(CONFIG.VAR,SEARCH)==0) begin VALUE = CONFIG.VAL; break; end end close(confg); return(VALUE); end *ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ *³ Version & RegNum will be filled in by the game itself. ³ *ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 160 * The version number 1 * 0 = B&W, 1 = Color 1 * 0 = Remote Viewing Disabled * 1 = Remote Viewing Player Selectable * 2 = Remote Viewing Enabled 75 * Minutes Player is Allowed to Play * With BBS set above 0 sets Maximum Playing Time * to the Lower of MINUTES and Time Left on the * Board.