home *** CD-ROM | disk | FTP | other *** search
/ !Zone: S!Zone / SZONE.BIN / tools / scedit / sc2000.txt < prev    next >
Text File  |  1994-06-14  |  10KB  |  229 lines

  1. Un-Official SC2000.DAT File Specifications                      
  2. By George White - Compuserve ID: 71511,1072 
  3.           Internet:      71511.1072@compuserve.com
  4.  
  5.  
  6. INTRODUCTION
  7. This file will try to describe the SC2000.DAT file that comes with the DOS 
  8. version of Simcity 2000. The SC2000.DAT file contains the text, music, 
  9. sound and graphics for Simcity 2000. My purpose for publishing these 
  10. specifications is to allow programmers much better than I to code utilities 
  11. that will allow me to import my own buildings, sounds and music into the 
  12. SC2000.DAT file. 
  13.  
  14. I have uploaded a program to the Compuserve Gamers Forum Strategy 
  15. Library called SCEDIT.ZIP. This is my attempt at a program that browses 
  16. the SC2000.DAT file and displays some of the items in the file. The next 
  17. version will attempt to import into the file. 
  18.  
  19. My vision is that people will create tools to import buildings into the 
  20. SC2000.DAT file and then people will start uploading buildings (The White 
  21. House, Yankees's Stadium, McDonald's, World Trade Center) that others 
  22. can use in their Simcity 2000 game. 
  23.  
  24. Maxis will not provide the format of the SC2000.DAT file so I have tried to 
  25. figure it out myself. These specifications are not totally complete and I am 
  26. still trying to figure out some areas of the file. If you figure out something 
  27. about the file please let me know and I will update these specs with the new 
  28. information and give you credit! 
  29.  
  30. This file is NOT supported by Maxis and they had nothing to do with it. 
  31. Please don't ask them questions about these specifications! If you plan on 
  32. changing bytes in the SC2000.DAT file make sure to back up the file first. 
  33. Some changes in the SC2000.DAT file fill cause Simcity 2000 to crash! If 
  34. you are having problems with Simcity 2000 after modifying SC2000.DAT 
  35. don't call Maxis!! Restore the original SC2000.DAT or re-install the game 
  36. to see if your problems go away!
  37.  
  38. Please direct any questions or corrections about this file to me at the above 
  39. Compuserve or Internet address. If you write a utility for SC2000 please let 
  40. me know. Thanks!
  41.  
  42.  
  43. -SPECIFICATIONS
  44.  
  45. *HEADER
  46. The start of the SC2000.DAT file contains 400 names and pointers into the 
  47. rest of the SC2000 file. The format of each of these 400 entries are:
  48.  
  49. 12 bytes text - Name of entry
  50. 4 byte integer - Offset to start of entry in SC2000 file
  51.  
  52. Entry 1 is 'MINE.PAL' and its offset is hex 'F0 18 00 00' or reversed      
  53. '00 00 18 F0' which converts to 6384 bytes into SC2000.DAT. Byte 6384 is 
  54. where the MINE.PAL section starts in the SC2000.DAT file. 
  55.  
  56. There is no information on the length of each area. The only way to 
  57. determine it is by finding out where the next section starts and then 
  58. calculating the length.
  59.  
  60. The next 399 entries in the header are the same format. Below I will 
  61. describe each of the entry types and how to decode them.
  62.  
  63. HEADER ENTRIES DESCRIPTIONS
  64.  
  65.  *.FNT SECTIONS
  66. All sections that are named *.FNT are the fonts used by SC2000 in the 
  67. newspapers and other various text. I don't know the format of .FNT files 
  68. and didnÆt really want to change the fonts anyway.
  69.  
  70.  *.VOC SECTIONS
  71. These sections are all Sound files. These are soundblaster VOC files that 
  72. can be played by various utilities on the market. You can extract these 
  73. whole sections to a DOS file and play them like any other VOC file. These 
  74. contain sounds like the wind and air traffic. 
  75.  
  76.  
  77.  
  78.  *.XMI SECTIONS
  79. These sections are all music files. The XMI files are what creates the Music 
  80. in SC2000. XMI is a enhanced version of the MIDI format developed by 
  81. Miles Design.. You can find a utility to play and create XMI files in the 
  82. Gamers forum under the Game Design library. The MIDPAK/DIGPAK 
  83. programmers toolkit from John W. Ratcliff is located there. The file is 
  84. named DMKIT.ZIP. Read the documentation with the toolkit for more 
  85. information about the XMI format.
  86.  
  87.  TXT* SECTIONS
  88. These sections are text used by SC2000. They contain help and other 
  89. information. These sections do not contain the newspaper data.
  90.  
  91.  MINE.PAL
  92. This is the Palette for the game. This section is 768 bytes long and contains 
  93. 256 3 byte sections for each color (256 * 3 = 768). These 3 bytes are RGB 
  94. values in the order of Red, Green and Blue. If you modify the bytes in this 
  95. section you will change the colors of Simcity 2000. 
  96.  
  97.  ROADPAL.RAW
  98. This section must have something to do with the palette for the road but I 
  99. haven't figured it out yet. If you do please let me know.
  100.  
  101.  RAW SECTIONS
  102. Most of the *.RAW sections are graphics. I will describe how to display the 
  103. RAW graphics and then will describe the other RAW areas.
  104.  
  105.  
  106.  
  107.  *.RAW GRAPHICS
  108. The first byte of the section is the height and the second byte is the width. 
  109. The data that follows is the color data. The color data is one byte per pixel. 
  110. The byte contains a number that points to a color in the Palette (loaded from 
  111. MINE.PAL). You just read the color data and display it until you reach the 
  112. end of the row (based on the width) and continue on the next row. All of the 
  113. raw pictures are square.
  114.  
  115. I have had some problem with the PERSON? RAW sections because they 
  116. don't follow the same height and width format as the others. I also have had 
  117. problems with the PAPER*.RAW sections that are the newspaper pictures. 
  118. If you figure out the format please let me know.
  119.  
  120.  OTHER RAW SECTIONS
  121. CUR.RAW - This is the game cursor. I haven't tried to determine the 
  122. format.
  123.  
  124.  CULT?.RAW - These two files are used for the palette animation. Simcity 
  125. 2000 uses palette shifting to make things look like their moving. It appears 
  126. that the palette numbers above 150 are used for palette shifting. For 
  127. example, the smoke from the factories appear to move but the colors that 
  128. make up the smoke just change colors to make the appearance of movement. 
  129. The cars also use palette shifting. The water pumps also use palette shifting.
  130.  
  131. CULT1.RAW and CULT2.RAW contain the colors (in RGB Format) that 
  132. are used to replace the colors on the map to make things move. You can 
  133. replace these colors in these two sections to see some weird results. If 
  134. someone can determine the exact purpose of each color and what color it 
  135. replaces in the palette, please let me know. To build our own buildings it 
  136. would be very helpful to know which colors we could use for animation.
  137.  
  138.  PPDT????..RAW - These sections contain the newspaper stories. The 
  139. format is still a mystery to me. I have determined that it is using a token 
  140. replacement type format but am still working on the exact format. 
  141.  
  142.  
  143.  
  144.  1000.RAW to 2200.RAW and STR1000.RAW to STR2200.RAW - These 
  145. sections contain the building and areas names. I don't know the exact 
  146. difference between the STR* and the Non-STR* versions but they seem to 
  147. contain almost the same data. The format is:
  148.  
  149. 1st Byte of section - The number of names that follows.
  150. For each of the names:
  151. 1 byte for the length of the name followed by the actual name.
  152.  
  153.  GM.AD and GM.OPL SECTIONS
  154. These are the MIDI patches used to play the XMI files. They map 
  155. instruments for each sound card. I don't know the format of these.
  156.  
  157.  USER.DAT SECTION
  158. This contains your name and business that you entered when you first 
  159. started the game after installation.
  160.  
  161.  BUILDING GRAHPICS SECTIONS - (LARGE.HED, LARGE.DAT, 
  162.  SMALL.HED, SMALL.DAT, OTHER.HED, OTHER.DAT)
  163. The *.HED sections are header files that point into the graphics stored in the 
  164. *.DAT files. LARGE.DAT stores the large building graphics that are visible 
  165. when SC2000 is zoomed in. SMALL.DAT stores the small and medium 
  166. sized graphics that are visible at all other times. The OTHER.DAT section 
  167. stores other graphics and some of the Medium sized graphics. All of the 
  168. *.HED and *.DAT files are in the same format. I will describe each below.
  169.  
  170.  *.HED SECTIONS
  171. These sections point to the building graphics located in the matching *.DAT 
  172. file. The format of this section contains many 8 byte segments as follows:
  173.  
  174. 4 byte integer - Offset into *.dat file (See DAT graphic format below)
  175. 1 byte integer - Height of building
  176. 1 byte integer - Width of building
  177. 2 bytes    - contains hex 'FFFF'
  178.  
  179. The header file for LARGE.DAT contains pointers for 500 graphics. The 
  180. header file for SMALL.DAT contains pointers for 1000 graphics, the small 
  181. graphics and the medium graphics. 
  182.  
  183. Some of the header segments contain hex 'FF' in all 8 bytes. These of 
  184. course are not used.
  185.  
  186.  
  187.  *.DAT SECTIONS
  188. The offset from the *.HED section is used to find the start of the graphic in 
  189. this section. Once the offset is found the format of the graphic is as follows:
  190.  
  191. (This occurs for each row of the building. The details are below)
  192. Byte 1  - Hex '10' - Info Identifier
  193. Byte 2  - 1 Byte  - Info Data
  194. Byte 3  - Hex '04' - Left Offset Identifier
  195. Byte 4  - 1 Byte - Left Offset
  196. Byte 5  - Hex '0C' - Number Of Pixels Identifier
  197. Byte 6  - 1 byte - Number Of Pixels Of Color Data
  198. Byte 7+ - Color Data    
  199.  
  200. INFO DATA: There is one of these identifiers per row on the graphic. This 
  201. info data is calculated using the following formula:
  202.  
  203.  If total_of_hex04_sections = total_of_hex0C_sections then
  204.     info_data = (total_color_bytes + 1) + (total_of_hex04_sections * 4) 
  205.  else
  206.     info_data = (total_color_bytes + 1) + (total_of_hex04_sections * 4) + 2
  207.  end if
  208.  
  209. I don't know why this info data is needed but if you change it the re-paint of 
  210. the graphics is messed up. If someone figures this out please let me know.
  211.  
  212. Everytime you hit one of these Hex '10' sections you should start a new row 
  213. of the graphic.
  214.  
  215. LEFT OFFSET: This is the offset from the left of the picture before you 
  216. start placing color pixels for this row. If this '04' section is missing then 
  217. there is no offset for this row. You can have more than one of these sections 
  218. per row if the graphic has æholesÆ in the middle that will let the graphics 
  219. behind this one show through.
  220.  
  221. NUMBER OF PIXELS: This number is how tells how many bytes of color 
  222. data follow. There can be more than one of these per row if there is more 
  223. than one offset per row. 
  224.  
  225. COLOR DATA - This is one byte for each pixel. The number of bytes is 
  226. stored in the NUMBER OF PIXELS field. This is a number that points into 
  227. the palette (See MINE.PAL Above).
  228.  
  229.