<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>maxis archivos - Nobody comes after the last</title>
	<atom:link href="https://blog.krusher.net/en/tag/maxis-en/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Because someone had to think of the fishes</description>
	<lastBuildDate>Tue, 17 Sep 2024 08:42:15 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.krusher.net/wp-content/uploads/2016/02/cropped-detras-del-ultimo-no-va-nadie-icon-32x32.jpg</url>
	<title>maxis archivos - Nobody comes after the last</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Sid Meier&#8217;s SimGolf &#8211; Retroview</title>
		<link>https://blog.krusher.net/en/2018/07/sid-meiers-simgolf-retroview/</link>
					<comments>https://blog.krusher.net/en/2018/07/sid-meiers-simgolf-retroview/#respond</comments>
		
		<dc:creator><![CDATA[Krusher]]></dc:creator>
		<pubDate>Sun, 29 Jul 2018 22:28:34 +0000</pubDate>
				<category><![CDATA[Review]]></category>
		<category><![CDATA[Videogames]]></category>
		<category><![CDATA[electronic arts]]></category>
		<category><![CDATA[Firaxis]]></category>
		<category><![CDATA[golf]]></category>
		<category><![CDATA[maxis]]></category>
		<category><![CDATA[sid meier]]></category>
		<category><![CDATA[simgolf]]></category>
		<guid isPermaLink="false">https://blog.krusher.net/?p=2106</guid>

					<description><![CDATA[<p>Since early 90s and until the end of that decade there were two undisputed giants making strategy and management video games in the PC world: Maxis and MicroProse. These two companies are behind a practical grand total of the best strategy games, &#8220;five minutes/turns more&#8221; style: SimCity (1989), SimCity 2000 (1993), Los Sims (2000), Civilization (1991), X-Com: &#8230; <a href="https://blog.krusher.net/en/2018/07/sid-meiers-simgolf-retroview/" class="more-link">Continue reading<span class="screen-reader-text"> "Sid Meier&#8217;s SimGolf &#8211; Retroview"</span></a></p>
<p>La entrada <a href="https://blog.krusher.net/en/2018/07/sid-meiers-simgolf-retroview/">Sid Meier&#8217;s SimGolf &#8211; Retroview</a> se publicó primero en <a href="https://blog.krusher.net/en">Nobody comes after the last</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Since early 90s and until the end of that decade there were two undisputed giants making strategy and management video games in the PC world: <strong>Maxis</strong> and <strong>MicroProse</strong>. These two companies are behind a practical grand total of the best strategy games, &#8220;five minutes/turns more&#8221; style: <strong>SimCity</strong> (1989), <strong>SimCity 2000</strong> (1993), <strong>Los Sims</strong> (2000), <strong>Civilization</strong> (1991), <strong>X-Com: Enemy Unknown</strong> (1994)&#8230;</p>
<p><a href="https://blog.krusher.net/2018/07/sid-meiers-simgolf-retroanalisis/ "><img fetchpriority="high" decoding="async" class="aligncenter wp-image-2099 size-full" src="https://blog.krusher.net/wp-content/uploads/2018/07/simgolf-ddunvn.jpg" alt="" width="900" height="347" srcset="https://blog.krusher.net/wp-content/uploads/2018/07/simgolf-ddunvn.jpg 900w, https://blog.krusher.net/wp-content/uploads/2018/07/simgolf-ddunvn-300x116.jpg 300w, https://blog.krusher.net/wp-content/uploads/2018/07/simgolf-ddunvn-768x296.jpg 768w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p><strong>MicroProse</strong> (at a later stage, good old pal Sid Meier founded <strong>Firaxis</strong>) and <strong>Maxis</strong> had a fundamentally opposed nature: the first offered reflexive, long, deep and slow paced products, while <strong>Will Wright</strong>&#8216;s company designed kind of humorous games of a certain fantasy fashion. I am excited to imagine what could come out of this joint venture.</p>
<p><span id="more-2106"></span></p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2018/07/003.jpg" data-rel="lightbox-gallery-We2LHZdC" data-rl_title="" data-rl_caption="" title=""><img decoding="async" class="aligncenter wp-image-2096 size-full" src="https://blog.krusher.net/wp-content/uploads/2018/07/003.jpg" alt="" width="800" height="600" srcset="https://blog.krusher.net/wp-content/uploads/2018/07/003.jpg 800w, https://blog.krusher.net/wp-content/uploads/2018/07/003-300x225.jpg 300w, https://blog.krusher.net/wp-content/uploads/2018/07/003-768x576.jpg 768w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>It was 2002 when <strong>Sid Meier&#8217;s SimGolf</strong> came out, produced by <strong>Electronic Arts</strong> in a time in which the company was engulfing other myth-enshrouded companies. The result is a surprising mix of company management with the loaded people&#8217;s sport. Again surprisingly, despite bearing the name of the <strong>Civilization</strong> saga creator, it is a game not of an excessive complexity, straightforward enough for everyone to play with the funny touches of a Sims game. Everything in a very visual interface, with a golf playability part in the style of role playing games. (you aim and I&#8217;ll shoot)</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2018/07/9PV3P.png" data-rel="lightbox-gallery-We2LHZdC" data-rl_title="" data-rl_caption="" title=""><img decoding="async" class="aligncenter wp-image-2092 size-full" src="https://blog.krusher.net/wp-content/uploads/2018/07/9PV3P.png" alt="" width="800" height="600" srcset="https://blog.krusher.net/wp-content/uploads/2018/07/9PV3P.png 800w, https://blog.krusher.net/wp-content/uploads/2018/07/9PV3P-300x225.png 300w, https://blog.krusher.net/wp-content/uploads/2018/07/9PV3P-768x576.png 768w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>The player has inherited a sum of money which would use to buy a plot of land to make his dream come true: design and build a golf course worthy of the SGA (Sim Golf Association) and winning the million-dollar prize. Everything while juggling budgets so posh people will continue burninig  simolleons in the 18 course. The way to do this is rather simple: we decie the distance between the tee and the green, we add the fairway and decide the difficulty of the hole with hazards and break. Everything while managing club facilities to make our guests stay more enjoyable, as well as the club staff of gardeners and &#8220;refreshment&#8221; sellers who will walk our paths.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2018/07/sim-golf-02.jpg" data-rel="lightbox-gallery-We2LHZdC" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter wp-image-2098 size-full" src="https://blog.krusher.net/wp-content/uploads/2018/07/sim-golf-02.jpg" alt="" width="800" height="600" srcset="https://blog.krusher.net/wp-content/uploads/2018/07/sim-golf-02.jpg 800w, https://blog.krusher.net/wp-content/uploads/2018/07/sim-golf-02-300x225.jpg 300w, https://blog.krusher.net/wp-content/uploads/2018/07/sim-golf-02-768x576.jpg 768w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>Technology used is not a wonder, even considering it is more than 15 years old at the moment of writing. Its 2D graphics are pleasant and music is very appropriate for the game, but there are very few settings and you can&#8217;t even change the 800&#215;600 pixel resolution. You can&#8217;t barely change the difficulty, which is not explained at all throughout the game, so it&#8217;s unknown to me how does it work or what does it do. It is not possible to expand or mod anything, and does not have any multiplayer capabilities. Its interface is also a nuisance (suddenly it&#8217;s your turn to hit the ball, but you are clicking elsewhere to edit a green, so you hit a homerun with the darn ball). It would be acceptable for an early 90s game, but for it sure downplay a 21st century product in an absurd way.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2018/07/SimGolfB_zps87fbe1e8.jpg" data-rel="lightbox-gallery-We2LHZdC" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter wp-image-2095 size-full" src="https://blog.krusher.net/wp-content/uploads/2018/07/SimGolfB_zps87fbe1e8.jpg" alt="" width="800" height="600" srcset="https://blog.krusher.net/wp-content/uploads/2018/07/SimGolfB_zps87fbe1e8.jpg 800w, https://blog.krusher.net/wp-content/uploads/2018/07/SimGolfB_zps87fbe1e8-300x225.jpg 300w, https://blog.krusher.net/wp-content/uploads/2018/07/SimGolfB_zps87fbe1e8-768x576.jpg 768w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>It is true that it has many negative technical points, but the playability is so fun it makes you forget (partially at least) these aspects. It&#8217;s not only joyful to build the holes, it&#8217;s very gratifying to watch these old fogies trying to carry the blessed-be ball to the hole. That and watching them dropping the simoleons when finishing, whose quantity depends on how fun was the hole itself. We can see them chatting, having &#8220;histories&#8221; like &#8220;my goldfish is ill&#8221; or &#8220;I saw an UFO&#8221; (literally). We have to manage the beverage distribution so they don&#8217;t get dry, give them electric carts and deterring them to slack so they play fluidly.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2018/07/TULMK.png" data-rel="lightbox-gallery-We2LHZdC" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter wp-image-2094 size-full" src="https://blog.krusher.net/wp-content/uploads/2018/07/TULMK.png" alt="" width="800" height="600" srcset="https://blog.krusher.net/wp-content/uploads/2018/07/TULMK.png 800w, https://blog.krusher.net/wp-content/uploads/2018/07/TULMK-300x225.png 300w, https://blog.krusher.net/wp-content/uploads/2018/07/TULMK-768x576.png 768w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>A very fun aspect of the game is the sound. Fitting in a CD is no problem for having many funny sound effects, with multiple details (as playing classical notes in each click building the fairway) or playing Hanna Barbera effects. Musical effects, even when they aren&#8217;t a hit, give some colour and contribute to the general ambient of the 90s rich celebrities. Part of its charm is actually the imagenierie of this subculture like the sims-like cartoons.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2018/07/zKoUN.png" data-rel="lightbox-gallery-We2LHZdC" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter wp-image-2093 size-full" src="https://blog.krusher.net/wp-content/uploads/2018/07/zKoUN.png" alt="" width="800" height="600" srcset="https://blog.krusher.net/wp-content/uploads/2018/07/zKoUN.png 800w, https://blog.krusher.net/wp-content/uploads/2018/07/zKoUN-300x225.png 300w, https://blog.krusher.net/wp-content/uploads/2018/07/zKoUN-768x576.png 768w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>The sporty part of the game complements perfectly the management end, and it&#8217;s all the unenforced we like. Of course the vital objective of the main character is to win the course tournament, but we can ignore it completely and just concentrate being a mogul. If we like to play the sport there&#8217;s no hurry either, and doesn&#8217;t need any special dexterity. In fact it is more in the like of japanese role playing games: the character has some statistics (dive, irons, hook/slice etc.) and we&#8217;ll just indicate him the hits to be done. Depending on our abilities the shot would be more or less successful. In the long run we will be able to get better on every aspect of the sports and win the tournament. Well, or get utterly thrashed.</p>
<p>The reception of this launch was colder than a mother-in-law hug. It wasn&#8217;t big on news, and people was more worried praising (or giving criticisms) the Sims games, or shooting in some <strong>Grand Theft Auto</strong>. In any case critics gave mostly positive scores to the game&#8230; and player critic was mostly non-existant. As a curious note there was another launch titled <strong>SimGolf</strong> programmed by <strong>Maxis</strong> in 1996, which received even less attention. Was this game a second attempt? Beats me.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2018/07/pc-63076-11447279623.jpg" data-rel="lightbox-gallery-We2LHZdC" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter wp-image-2097 size-full" src="https://blog.krusher.net/wp-content/uploads/2018/07/pc-63076-11447279623.jpg" alt="" width="800" height="600" srcset="https://blog.krusher.net/wp-content/uploads/2018/07/pc-63076-11447279623.jpg 800w, https://blog.krusher.net/wp-content/uploads/2018/07/pc-63076-11447279623-300x225.jpg 300w, https://blog.krusher.net/wp-content/uploads/2018/07/pc-63076-11447279623-768x576.jpg 768w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>Playing nowadays <strong>Sim Meier&#8217;s SimGolf</strong> is still a fun experience. Graphics are not severely outdated and the only real downsides are the technical problems or the out of date interface, which can be ignored with not a lot of effort thanks to the fun factor. Well, unless you use Windows 10: the damn DRM exploited an operating system flaw that was corrected in Windows 10 and it&#8217;s no longer possible to play it &#8220;legally&#8221; in this operating system. (Hint: it will work if updated to 1.02 version and properly cracked thanks to the <strong>MyTH</strong> crack scene group)</p>
<p>This is yet another game to add to my &#8220;deserves and remake and won&#8217;t have&#8221; list. Too bad it ran mostly unnoticed, since <strong>Electronic Arts</strong> will never do something similar again. In golf games we recently had <strong>Golf Story</strong> (<strong>Sidebar Games</strong>, 2017) in <strong>Nintendo Switch</strong>, and in the business management gameplay it could be compared to <strong>Theme Hospital</strong> (<strong>Bullfrog</strong>, 1997). There&#8217;s no big deal after even after all these years.</p>
<p>&nbsp;</p>
<p>La entrada <a href="https://blog.krusher.net/en/2018/07/sid-meiers-simgolf-retroview/">Sid Meier&#8217;s SimGolf &#8211; Retroview</a> se publicó primero en <a href="https://blog.krusher.net/en">Nobody comes after the last</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.krusher.net/en/2018/07/sid-meiers-simgolf-retroview/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Taking Sim City 2000 into pieces</title>
		<link>https://blog.krusher.net/en/2017/12/taking-sim-city-2000-into-pieces/</link>
					<comments>https://blog.krusher.net/en/2017/12/taking-sim-city-2000-into-pieces/#comments</comments>
		
		<dc:creator><![CDATA[Krusher]]></dc:creator>
		<pubDate>Sat, 09 Dec 2017 23:15:00 +0000</pubDate>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Videogames]]></category>
		<category><![CDATA[maxis]]></category>
		<category><![CDATA[sim city 2000]]></category>
		<guid isPermaLink="false">https://blog.krusher.net/?p=1766</guid>

					<description><![CDATA[<p>SimCity 2000 (Maxis, 1993) is one of my superfavourite games, ever. I&#8217;ve been playing it for 20 years and it&#8217;s partially responsible of my terrible grades at high school. I have always liked modifying games, but so far I haven&#8217;t been serious about decoding the data files of this city simulator. And I have found &#8230; <a href="https://blog.krusher.net/en/2017/12/taking-sim-city-2000-into-pieces/" class="more-link">Continue reading<span class="screen-reader-text"> "Taking Sim City 2000 into pieces"</span></a></p>
<p>La entrada <a href="https://blog.krusher.net/en/2017/12/taking-sim-city-2000-into-pieces/">Taking Sim City 2000 into pieces</a> se publicó primero en <a href="https://blog.krusher.net/en">Nobody comes after the last</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>SimCity 2000</strong> (<strong>Maxis</strong>, 1993) is one of my superfavourite games, ever. I&#8217;ve been playing it for 20 years and it&#8217;s partially responsible of my terrible grades at high school. I have always liked modifying games, but so far I haven&#8217;t been serious about decoding the data files of this city simulator. And I have found some quite interesting things!</p>
<p>There were ports in a great number of platforms, from the <strong>Macintosh</strong> (the original) to <strong>GameBoy Advance</strong>, but my favourite is <strong>MS-DOS</strong>, and it&#8217;s what this article is about. There are two interesting files: the executable (SC2000.EXE) and the data file (SC2000.DAT). Unfortunately, <strong>Windows</strong> version didn&#8217;t came out in Spanish (my mother language), and <em>Network Edition</em> version works awfully bad (and it is available only in English).<span id="more-1766"></span></p>
<h2>SC2000.EXE</h2>
<p>The game executable does not seem to have many resources, but it does have some interface texts. In the hexadecimal editor we can see some fixed-width labels.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe.png" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1526" src="https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe-1024x435.png" alt="" width="840" height="357" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe-1024x435.png 1024w, https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe-300x127.png 300w, https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe-768x326.png 768w, https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe.png 1090w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>There are some texts representing variable-width labels, too. There are also some embedded files, in which for example game scenarios are described.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe2.png" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1527" src="https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe2-1024x435.png" alt="" width="840" height="357" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe2-1024x435.png 1024w, https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe2-300x127.png 300w, https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe2-768x326.png 768w, https://blog.krusher.net/wp-content/uploads/2017/06/Sc2000-cadenasexe2.png 1090w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>At the moment disassembling an executable from the early 90s is not one of my specialities, and thus I have not find out much. Pointers are not evident in the executable, so I left it alone. But the most interesting is the data files we are describing down below.</p>
<h2>SC2000.DAT</h2>
<p>This is the main data file. It does not have a header, but a short look in the hexadecimal editor throw some hints about its structure.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000.dat_.png" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1528" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000.dat_-1024x435.png" alt="" width="840" height="357" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000.dat_-1024x435.png 1024w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000.dat_-300x127.png 300w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000.dat_-768x326.png 768w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000.dat_.png 1090w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>It turns out that from byte 0 the first we can find is 16-byte blocks that describe files contained in the pack. The first field is evident: 12 bytes with the file name (8 + 3 characters of the <strong>MS-DOS</strong> file with the period). If there is leftover space, the rest of the bytes are 00h.</p>
<p>The other two bytes are not so evident, but it turns out that the game is originary from <strong>Macintosh</strong>, which at that time used <strong>Motorola</strong> processors. These processors, unlike <strong>Intel</strong>&#8216;s, are <em>Little-Endian</em> (being <strong>Intel</strong> <em>Big-Indian</em>). This means that numbers with more than one byte are stored ordered from the least significant byte to the most significant, instead of the &#8220;natural&#8221; ordering. This is thus a 32 bit unsigned integer in <em>little-endian</em> format, which codifies the offset of the file just before.</p>
<p>I owe the happy idea about the offset to <a href="http://www.brettlajzer.com/36" target="_blank" rel="noopener noreferrer">Brett Lajzer</a>, an Albany software engineer that began researching this file before me. I wrote him to swap information and advised me about this point, which he didn&#8217;t finally describe in his article.</p>
<p>Unpacking and packing, knowing this, is relatively simple. I&#8217;ve written a small Java program that makes this operation easy:</p>
<pre class="brush: java; title: ; notranslate">
package sce2000;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

import org.apache.commons.io.FileUtils;

public class Sce2000 {
	
	public static final String SC2000DAT = &quot;G:\\dos\\sce2000\\sc2000.dat&quot;;
	public static final int NUMFILES = 399;
	
	public static class Filestrut implements Serializable {
		private static final long serialVersionUID = 1L;
		public String filename;
		public int offset;
		public int targetOffset;
	}

	public static void main(String&#x5B;] args) throws IOException, ClassNotFoundException {
		
		if (args.length == 0) {
			info();
		} else if (&quot;x&quot;.equals(args&#x5B;0])) {
			extract();
		} else if (&quot;c&quot;.equals(args&#x5B;0])) {
			create();
		} else {
			info();
		}

	}
	
	public static void info() {
		System.out.println(&quot;Usage: x to eXtract or c to Create (after eXtract) + sc2000.dat file&quot;);
	}

	public static void create() throws IOException, ClassNotFoundException {
		
		File sc2000dat = new File(SC2000DAT);
		File metafile = new File(SC2000DAT + &quot;!/meta&quot;);
		ObjectInputStream ois = new ObjectInputStream(new FileInputStream(metafile));
		List&lt;Filestrut&gt; files = (List&lt;Filestrut&gt;) ois.readObject();
		
		List&lt;Byte&gt; targetFile = new ArrayList&lt;Byte&gt;();

		for (Filestrut file : files) {
			byte&#x5B;] fileNameBytes = file.filename.getBytes(StandardCharsets.US_ASCII);
			for (Byte myByte : fileNameBytes) {
				targetFile.add(myByte);
			}
			for (int i = 0; i &lt; 16 - fileNameBytes.length; i++) {
				targetFile.add((byte) 0);
			}
			//sourceFile.length();
		}
		
		int i = 0;
		for (Filestrut file : files) {
			byte&#x5B;] binary = Files.readAllBytes(Paths.get(SC2000DAT + &quot;!/&quot; + file.filename));
			int fileOffset = targetFile.size();
			for (Byte myByte : binary) {
				targetFile.add(myByte);
			}
			int filePointer = 12 + (16 * i);
			
			byte&#x5B;] offsetBytes = fromInt(fileOffset);
			targetFile.set(filePointer, offsetBytes&#x5B;0]);
			targetFile.set(filePointer + 1, offsetBytes&#x5B;1]);
			targetFile.set(filePointer + 2, offsetBytes&#x5B;2]);
			targetFile.set(filePointer + 3, offsetBytes&#x5B;3]);
			
			i++;
		}
		
		byte&#x5B;] binaryFile = new byte&#x5B;targetFile.size()];
		for (i = 0; i &lt; targetFile.size(); i++) {
			binaryFile&#x5B;i] = targetFile.get(i);
		}
		
		FileUtils.writeByteArrayToFile(sc2000dat, binaryFile);

		
		System.out.println();
		
	}
		

	public static void extract() throws IOException {
		
		Path sc2000dat = Paths.get(SC2000DAT);
		byte&#x5B;] data = Files.readAllBytes(sc2000dat);
		
		int vector = 0;
		List&lt;Filestrut&gt; files = new ArrayList&lt;Filestrut&gt;();
		for (int i = 0; i &lt; NUMFILES; i++) {
			
			Filestrut currfile = new Filestrut();
			
			currfile.filename =  convertFilename(Arrays.copyOfRange(data, vector, vector + 12));
			vector += 12;
			
			currfile.offset = fromByteArray(Arrays.copyOfRange(data, vector, vector + 4));
			vector += 4;
			
			System.out.println(&quot;Found file &quot; + currfile.filename + &quot; at &quot; + currfile.offset);
			
			files.add(currfile);
			
		}
		
		File dir = new File(SC2000DAT + &quot;!&quot;);
		if (dir.exists()) {
			FileUtils.deleteDirectory(dir);
		}
		
		dir.mkdir();
		
		Iterator&lt;Filestrut&gt; fileIt = files.iterator();
		
		Filestrut file = fileIt.next();
		Filestrut fileNext = null;
		
		boolean stop = false;
		while (!stop) {
			
			File extracted = new File(SC2000DAT + &quot;!/&quot; + file.filename);
			
			int init = file.offset;
			int end = -1;
			if (fileIt.hasNext()) {
				fileNext = fileIt.next();
				end = fileNext.offset;
			} else {
				end = data.length;
				stop = true;
			}

			System.out.println(&quot;Writing: &quot; + extracted.getAbsolutePath());
			FileUtils.writeByteArrayToFile(extracted, Arrays.copyOfRange(data, init, end));
			
			file = fileNext;
			
		}
		
		File metafile = new File(SC2000DAT + &quot;!/meta&quot;);
		
		ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(metafile));
		oos.writeObject(files);
		oos.close();
		
		System.out.println(&quot;OK!&quot;);
	}
	
	public static byte&#x5B;] fromInt(int number) {
		byte&#x5B;] bytes = ByteBuffer.allocate(4).putInt(number).array();
		swapEndianess(bytes);
		return bytes;
	}
	
	public static void swapEndianess(byte &#x5B;] bytes) {
		byte temp1 = bytes&#x5B;0];
		byte temp2 = bytes&#x5B;1];
		bytes&#x5B;0] = bytes&#x5B;3];
		bytes&#x5B;1] = bytes&#x5B;2];
		bytes&#x5B;2] = temp2;
		bytes&#x5B;3] = temp1;
	}
	
	public static int fromByteArray(byte&#x5B;] bytes) {
		// Change endianness
		swapEndianess(bytes);
		return ByteBuffer.wrap(bytes).getInt();
	}
	
	public static String convertFilename(byte&#x5B;] data) {
	    StringBuilder sb = new StringBuilder(data.length);
	    for (int i = 0; i &lt; data.length; ++ i) {
	        if (data&#x5B;i] &lt; 0) { 
	        	throw new IllegalArgumentException();
	        }
	        if (data&#x5B;i] == 0) {
	        	break;
	        }
	        sb.append((char) data&#x5B;i]);
	    }
	    return sb.toString();
	}


}
</pre>
<p>This program has been done quick and dirty and it&#8217;s not what we would say optimized. I indulged myself loading the whole files in memory as the complete DAT file is few megabytes big. Also it has the file count and DAT path hardcoded in the code. Making it better and more efficient is left as an exercise to the reader.</p>
<p>Why in Java? It&#8217;s not the most appropriate for handling binaries, and not having unsigned types support doesn&#8217;t precisely help. I simply did it in Java and not in C because it&#8217;s the language I use for a living, and the one I&#8217;m the most fluent with. Also I&#8217;ve not programmed anything in C for 10 years. 🙂</p>
<p>Using the above code (or any other the intrepid reader can code) we can see the following file types:</p>
<ul>
<li>RAW, as the header-less image files.</li>
<li>PAL, as the colour palette used in the game.</li>
<li>Text files, some as TXT* without an extension and others with RAW extension.</li>
<li>XMI, with the music.</li>
<li>VOC, with the sound effect files.</li>
<li>FNT, with the typography files.</li>
<li>Etc, etc&#8230;</li>
</ul>
<p>Let&#8217;s talk about them a bit one by one.</p>
<h2>VOC files</h2>
<p>The game sound files are stored in VOC files. Well, that&#8217;s one is easy, as it&#8217;s not a common file format but broadly supported on many sound edition programs. It&#8217;s a format by Creative Labs that chiefly stores PCM and ADPCM coded audio, although sometimes has been used for other encodings.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-vocs.jpg" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1531" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-vocs-1024x560.jpg" alt="" width="840" height="459" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-vocs-1024x560.jpg 1024w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-vocs-300x164.jpg 300w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-vocs-768x420.jpg 768w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-vocs-1200x656.jpg 1200w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-vocs.jpg 1920w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>It can be perfectly open and saved with Adobe Audition. The sampling frequency varies from one file to another, but is recognized without many problems.</p>
<h2>Text files</h2>
<p>There are three kinds of text file types. The most simple are TXT* files without an extension, being * a number. They can be directly opened with <strong>Notepad++</strong> and be edited without problems.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-txt.jpg" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1532" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-txt.jpg" alt="" width="787" height="496" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-txt.jpg 787w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-txt-300x189.jpg 300w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-txt-768x484.jpg 768w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>Well, not quite. Encoding is not ASCII, nor UNICODE because it wasn&#8217;t common at the time. Which one, then? Well, being the game was programmed for Macintosh, encoding is <a href="https://en.wikipedia.org/wiki/Mac_OS_Roman" target="_blank" rel="noopener">Macintosh Roman</a>. This is a problem because <strong>Notepad++</strong> does not support it. <a href="https://notepad-plus-plus.org/community/topic/11052/mac-encoding" target="_blank" rel="noopener">It&#8217;s been asked for</a>, but seems not the priority, so you might want to convert it somehow to edit it more comfortably.</p>
<p><strong>Addendum</strong>: It supports it after all! The option was buried in the menus: <strong>Encoding</strong> &gt; <strong>Character Sets</strong> &gt; <strong>Cyrillic</strong> &gt; <strong>Macintosh.</strong></p>
<p>Other text files are STR*.RAW and *.RAW, being * a number. Their format is not so nice.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-str.jpg" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1533" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-str-1024x435.jpg" alt="" width="840" height="357" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-str-1024x435.jpg 1024w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-str-300x127.jpg 300w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-str-768x326.jpg 768w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-str.jpg 1090w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>So the first byte is always 00h, and the second seems to store the string count in the text. Strings, unlike in C, aren&#8217;t coded terminated in 00h. They are stored preceeded by its length, coded in 1 byte. Ideally we could use an utility software for this, which could easily be coded. (but I don&#8217;t feel like to)</p>
<p>The third text file kind correspond only to PPDT1003.RAW file, which has one of the funniest characteristics in all <strong>SimCity 2000</strong>: the newspapers.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-periodicos.png" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1534" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-periodicos-1024x435.png" alt="" width="840" height="357" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-periodicos-1024x435.png 1024w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-periodicos-300x127.png 300w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-periodicos-768x326.png 768w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-periodicos.png 1090w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>Unfortunately this format is a nightmare. It begins with a term dictionary separated by 00h, and then a clump of texts used to generate the articles. This custom encoding is variable-width (for an example, 5C96h represent the ñ character) and uses the previously defined terms, and of course placeholders for article subjects. These articles are procedurally generated, and an article denouncing the disappearance of an animal had as the main protagonist a cat or a rhinoceros, owned by mrs. Dwight or mr. Martínez.</p>
<p>Back in the day we had editors like <a href="https://www.romhacking.net/utilities/217/" target="_blank" rel="noopener noreferrer">Thingy</a>, which supported TBL files. You could specify a term dictionary there and easily edit files like this. Anyway, it would only be of use if we could keep the string length, and even then we would need to decipher the preceding number (and its encoding) so we could properly edit it.</p>
<p><strong>Addendum</strong>: It seems the pointers for the newspaper texts are in the PPDT1004.RAW file. They consist in blocks of 4 bytes in big-endian. What a mess.</p>
<h2>Image files</h2>
<p>Excluding some text files (described in above), RAW files store the images used in the game interface. Buildings and other elements are in some DAT files that would be out of the scope of this article, because they can be edited much more easily with the <strong>SimCity Urban Renewal Kit</strong> (SCURK), a tool included in some later versions which could edit cities &#8220;by hand&#8221; and modify the graphical aspect of the buildings.</p>
<p>Now about the files in question, these RAW files are 8 bit (256 colours) bitmaps with a 4 byte header. It doesn&#8217;t seem to be relevant information about resolution or colours, but for that matter we have another file, MINE.PAL, which specifies the colour palette used throughout the game. It&#8217;s not a Microsoft Palette file as the extension suggest, but a raw palette ACT type. Interestingly, it&#8217;s the preferred format used in <strong>Adobe Photoshop</strong>.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-efecto2000.png" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1539" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-efecto2000-1024x462.png" alt="" width="840" height="379" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-efecto2000-1024x462.png 1024w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-efecto2000-300x135.png 300w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-efecto2000-768x347.png 768w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-efecto2000.png 1170w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>So for the resolution, there seems not to be an easy way to find it out simply looking at the file. The most easy method is factorizing the number (minus 4 bytes) in two factors, something <strong>Photoshop</strong> could help us with when opening the file, at least in the most modern version. By the file name we can more or less tell what&#8217;s the file for, and in case we have played (you really should!) the game, you could more or less recognize its width/height ratio. Some are easy: the title screen (TITLE.RAW) is a 640&#215;480 image. All the images use the same palette, as the game only uses the same 256 colours all of the time.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-rwa.png" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1538" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-rwa.png" alt="" width="369" height="477" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-rwa.png 369w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-rwa-232x300.png 232w" sizes="auto, (max-width: 369px) 85vw, 369px" /></a></p>
<p>I always use the same technique editing 8 bit indexed colour images: I convert them to 24 bit colour (plus 8 bit alpha channel) and I edit them comfortably. After that, before saving them, I change them to indexed color loading again the game palette. Surprisingly enough, saving the files in <em>Adobe RAW</em> format, the game loads it right, because <strong>Photoshop</strong> would allow us to preserve the 4 byte header. What a relief!</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-guardarraw.png" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1540" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-guardarraw.png" alt="" width="946" height="653" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-guardarraw.png 946w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-guardarraw-300x207.png 300w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-guardarraw-768x530.png 768w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>Please note: needless to say this RAW format has anything to do with raw image formats the nowadays digital cameras uses.</p>
<h2>XMI files</h2>
<p>Game music tracks are stored in the <a href="http://www.vgmpf.com/Wiki/index.php/XMI" target="_blank" rel="noopener">XMI</a> files. Tis format supports many tracks per file, but this seems not the case. The structure is very different from MIDI files, but they do about the same: store musical notes and events. It can be played in Windows easily with <a href="http://www.foobar2000.org/components/view/foo_midi" target="_blank" rel="noopener">Foobar2000</a>, and it is possible to <a href="http://www.vgmpf.com/Wiki/index.php/XMI#Converters" target="_blank" rel="noopener">convert MIDI to XML</a> (and vice versa). <a href="https://github.com/stascorp/MIDIPLEX" target="_blank" rel="noopener">MIDIPLEX</a> seems to be able to do it from <strong>Windows</strong>, but no compiled binaries are offered so I did it with older tools with <strong>MS-DOS</strong>, using <strong>DOSBox</strong>. Anyway, the very SimCity 2000 will need <strong>DOSBox</strong> to work in modern systems.</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-xmi.png" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1542" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-xmi.png" alt="" width="642" height="427" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-xmi.png 642w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-xmi-300x200.png 300w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<h2>FNT files</h2>
<p>They are presumed to be the game typographies, to judge from the numbers and the extension they come with. It seems not the same format that Windows uses (bitmap FNT), so I&#8217;ve been unable to open the files with any editor.</p>
<h2>Others</h2>
<p>Other files present in the package are General MIDI sources for OPL chipsets, some indexes and headers for the building graphic sets&#8230; anything very interesting when modifying the game. Everything else seems to be embedded in the executable file, something it&#8217;s out of my reach at the moment.</p>
<h2>In Windows</h2>
<p>On a point of information, the <strong>Windows</strong> version can be modified much more easily. The image and sound resources are present in WAV and BMP format, which are much less obscure as the previously described. The rest of the resources are embedded in the game executable, but with a resource editor they can be extracted and modified with ease, and in more accessible format than their <strong>MS-DOS</strong> counterparts. (I use <a href="http://www.angusj.com/resourcehacker/" target="_blank" rel="noopener">Resource Hacker</a>, which is free and works quite well)</p>
<p><a href="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-reshack.png" data-rel="lightbox-gallery-h2tG5QxV" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1541" src="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-reshack.png" alt="" width="846" height="631" srcset="https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-reshack.png 846w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-reshack-300x224.png 300w, https://blog.krusher.net/wp-content/uploads/2017/06/sc2000-reshack-768x573.png 768w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>Newspapers, however, seems to have the same calamitous format than the <strong>MS-DOS</strong> version. It&#8217;s a pity, because it would be very interesting to translate this version to Spanish.</p>
<p>So this is where I leave it. I hope it&#8217;s been educative, although after all this time there seems to be little interest modifying this game. I&#8217;ve always wanted to meddle with this game and create my own mod, <em>Sim City 2000 effect</em>, a bit mischievous, but maybe that&#8217;ll be in another time.</p>
<p>La entrada <a href="https://blog.krusher.net/en/2017/12/taking-sim-city-2000-into-pieces/">Taking Sim City 2000 into pieces</a> se publicó primero en <a href="https://blog.krusher.net/en">Nobody comes after the last</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.krusher.net/en/2017/12/taking-sim-city-2000-into-pieces/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
