<?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>Project Dollhouse</title>
	<atom:link href="http://afr0games.com/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://afr0games.com/wordpress</link>
	<description>The Sims Online, powered by XNA</description>
	<lastBuildDate>Sun, 29 Apr 2012 16:28:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Currently working on: SimAntics</title>
		<link>http://afr0games.com/wordpress/?p=75</link>
		<comments>http://afr0games.com/wordpress/?p=75#comments</comments>
		<pubDate>Sun, 29 Apr 2012 16:28:37 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=75</guid>
		<description><![CDATA[So, since the last update, I have been working on adding normal transformation and normal blending. I still haven&#8217;t been able to figure out correct bone placement and rotation, so for the time being I&#8217;ve put it aside to work &#8230; <a href="http://afr0games.com/wordpress/?p=75">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, since the last update, I have been working on adding normal transformation and normal blending. I still haven&#8217;t been able to figure out correct bone placement and rotation, so for the time being I&#8217;ve put it aside to work on what is probably one of the most difficult aspects of this project;</p>
<p>Recreating the VM.</p>
<p>For those unfamiliar with the concept, <em>VM </em>is short for <em><a href="http://en.wikipedia.org/wiki/Virtual_machine">Virtual Machine</a>, </em>and the core of The Sims consists of a VM named Edith, which is constantly running the code inside objects (sims are also objects with their own programs for Edith to run).</p>
<p>Now, in TSO, the VM is less important because you only control one sim at a time, but you can still turn on free will to have your sim be autonomous.</p>
<p>The task of recreating Edith is so massive and all-encompassing  that it is hard to imagine where to start, but after quite a bit of research and cooperation with <a href="http://www.niotso.org">NIOTSO</a>, I&#8217;ve decided to start by writing a basic parser for SimAntics (the language that Edith programs are written in) that translates it into a human-readable form. After that, the next step will be to design an interface so that SimAntics programs can easily call functions defined in the Project Dollhouse executable. If all goes well, after a certain amount of time I should have a VM built in C# that can load *.iff files in realtime and run their programs synchronously and display state changes on the screen. <em>The Sims</em> is basically just a graphical representation of such a machine.</p>
<p><img class="alignleft" title="BHAV Editor" src="http://i45.tinypic.com/fp8280.png" alt="" width="700" height="500" /></p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=75</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to compile and run the Project Dollhouse client</title>
		<link>http://afr0games.com/wordpress/?p=68</link>
		<comments>http://afr0games.com/wordpress/?p=68#comments</comments>
		<pubDate>Mon, 09 Apr 2012 20:06:36 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=68</guid>
		<description><![CDATA[Since so many people are asking about the client, seemingly completely unable to wait until it is released as a compiled binary for testing, I feel like I&#8217;m forced to make this blogpost explaining the neccessary steps. Once you&#8217;ve grabbed &#8230; <a href="http://afr0games.com/wordpress/?p=68">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since so many people are asking about the client, seemingly completely unable to wait until it is released as a compiled binary for testing, I feel like I&#8217;m forced to make this blogpost explaining the neccessary steps.</p>
<p>Once you&#8217;ve grabbed the latest version of the repository, you should download and install Visual Studio C# Express Edition 2008 from <a href="http://go.microsoft.com/?linkid=7729278">here</a>.</p>
<p>Next you&#8217;ll need to download and install <a href="http://www.microsoft.com/download/en/details.aspx?id=39">XNA Gamestudio 3.1</a>, then <a href="http://code.google.com/p/luaforwindows/downloads/detail?name=LuaForWindows_v5.1.4-45.exe&amp;can=2&amp;q=">Lua for Windows</a>, as well as <a href="http://us.un4seen.com/files/z/4/Bass24.Net.zip">Bass.NET</a>. You can now open <em>TSOClient.sln </em>from <em>trunk\TSOClient\ </em>and compile the client. To compile an application in Visual Studio, simply press F5.</p>
<p>However, the client won&#8217;t run unless you have copied the Lua scripts to their appropriate directories. So for now, just press F5 to build the client. This will create a folder called <em>bin </em>in <em>trunk\TSOClient\TSOClient\ </em>with a folder called <em>Debug </em>inside.</p>
<p>The compiled client will be in the <em>Debug </em>folder. You need to create a folder called <em>gamedata </em>inside of <em>Debug</em>, and then copy all the three folders inside <em>trunk\TSOClient\LuaScripts\ </em>to this new folder. Lastly, copy <em>NAudio.dll</em> from <em>trunk\TSOClient\TSOClient\ </em>to <em>trunk\TSOClient\TSOClient\bin\Debug\</em></p>
<p>When you&#8217;ve done this, you can open up Visual Studio again (if you closed it) and press F6 to compile and debug the client. Now the client should run without any errors, providing you have installed TSO on your PC.</p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=68</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nearly there!</title>
		<link>http://afr0games.com/wordpress/?p=66</link>
		<comments>http://afr0games.com/wordpress/?p=66#comments</comments>
		<pubDate>Thu, 05 Apr 2012 18:55:30 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=66</guid>
		<description><![CDATA[After three, nearly four months of hard work, sweat, tears, frustration, research, teeth-grinding and hair-pulling, I&#8217;m nearly able to render a sim-body correctly; If you can&#8217;t see that clearly, it is a maid&#8217;s body with the arms straight down and &#8230; <a href="http://afr0games.com/wordpress/?p=66">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After three, nearly four months of hard work, sweat, tears, frustration, research, teeth-grinding and hair-pulling, I&#8217;m nearly able to render a sim-body correctly;</p>
<p><img class="alignnone" src="http://oi41.tinypic.com/dfkm5y.jpg" alt="" width="768" height="480" /></p>
<p>If you can&#8217;t see that clearly, it is a maid&#8217;s body with the arms straight down and the legs tucked above the head. I&#8217;m not sure why the legs are like that, but undoubtedly it has something to do with the skeleton. Anyways, what&#8217;s important is that I&#8217;m nearly there!</p>
<p>Long live Project Dollhouse!</p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=66</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>About the project&#8217;s timespan</title>
		<link>http://afr0games.com/wordpress/?p=60</link>
		<comments>http://afr0games.com/wordpress/?p=60#comments</comments>
		<pubDate>Fri, 30 Mar 2012 22:23:16 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=60</guid>
		<description><![CDATA[Today I was asked on Facebook when this project would be finished. I tried to explain that it doesn&#8217;t have any deadline, but the message didn&#8217;t seem to go through. Therefore I&#8217;m writing this post to put things into perspective. &#8230; <a href="http://afr0games.com/wordpress/?p=60">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I was asked on Facebook when this project would be finished. I tried to explain that it doesn&#8217;t have any deadline, but the message didn&#8217;t seem to go through.<br />
Therefore I&#8217;m writing this post to put things into perspective. One of the projects that inspired me to do this was <a href="http://code.google.com/p/corsix-th/">Corsix-TH</a>. It aims to rebuild <a href="http://en.wikipedia.org/wiki/Theme_hospital">Theme Hospital</a> using nothing but the game&#8217;s original assets and open-source code. The difference between that project and this is that Theme Hospital is a much older game, and much less complicated to rebuild. Corsix-TH has been in development now since mid-2009, and it only just reached version 0.01.</p>
<p>Think about that for a minute. Between 0.01 and 1.00 you can at the least put 9 incremental updates. And if each update takes  6 months to make, that equals out to 4.5 years. Now as far as I know, there is currently only one developer working on Corsix-TH, and hopefully more developers will join as the project matures. That&#8217;s my hope for this project as well, but at least these figures should put things into perspective.</p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=60</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Progress&#8230;</title>
		<link>http://afr0games.com/wordpress/?p=57</link>
		<comments>http://afr0games.com/wordpress/?p=57#comments</comments>
		<pubDate>Sat, 24 Mar 2012 22:54:30 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=57</guid>
		<description><![CDATA[So far I&#8217;ve decided to concentrate on the skeleton, and the skeleton only, because everything else is depending on it. This is the closest I&#8217;ve been able to come so far; I&#8217;m still trying to figure out why the root &#8230; <a href="http://afr0games.com/wordpress/?p=57">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So far I&#8217;ve decided to concentrate on the skeleton, and the skeleton only, because everything else is depending on it.<br />
This is the closest I&#8217;ve been able to come so far;</p>
<p><img alt="" src="http://i40.tinypic.com/11rvqxf.png" title="Skeleton" class="alignnone" width="823" height="641" /></p>
<p>I&#8217;m still trying to figure out why the root bone is located away from the rest of the skeleton and why the upper arms are above the head, and the lower arms are way down. Other than that, everything seems to be correct.</p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=57</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tension is rising&#8230;</title>
		<link>http://afr0games.com/wordpress/?p=52</link>
		<comments>http://afr0games.com/wordpress/?p=52#comments</comments>
		<pubDate>Mon, 19 Mar 2012 15:32:33 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Information]]></category>
		<category><![CDATA[Rendering]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=52</guid>
		<description><![CDATA[Have you ever tried hammering a nail into a wall using nothing but a rock, with both hands tied firmly behind your back? That&#8217;s just about how it feels trying to do any 3D operations in XNA that are even &#8230; <a href="http://afr0games.com/wordpress/?p=52">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried hammering a nail into a wall using nothing but a rock, with both hands tied firmly behind your back?<br />
That&#8217;s just about how it feels trying to do any 3D operations in XNA that are even remotely advanced. I have now tried for several months to set up skeletal animation, and am now in a situation where I&#8217;ve discovered that XNA even has a built-in function for parts of what I&#8217;ve been trying to do (transforming a set of vertices based on a bone&#8217;s location in 3D space), but that this is completely useless so long as I am unable to position the skeleton&#8217;s bones correctly in 3D space.<br />
My current theory is that the bones&#8217; locations (which are made up of a rotation and a translation) are stored as OpenGL-native coordinates. Vitaboy (the rendering system used by <em>The Sims</em> and <em>The Sims Online</em>) was originally written in Direct3D, but it isn&#8217;t unthinkable that it was ported to OpenGL for TSO. I have tried every possible matrix and vector based operation on the bones&#8217; translations and rotations that I could possibly think of, but nothing seems to help.<br />
I have been putting this off for what feels as long as possible, and I&#8217;m giving myself another week, but if I haven&#8217;t made any significant progress within that timeframe I&#8217;m switching to OpenGL.<br />
I have already tried SFML (Simple Fast Multimedia Library &#8211; an engine that allows you to use OpenGL calls and combine them with calls to the engine), but it applies some kind of funky custom world matrix that fucks up animation and rendering.<br />
The reason I&#8217;ve been putting this off for so long is that I know that rewriting the GUI-system in OpenGL is going to take time and be a learning process all of its own, but my current consensus is that it&#8217;ll take less time than trying to fight with XNA in order to make it do something it obviously wasn&#8217;t meant to do.<br />
I am allowing comments on this post in the hope that I can get some bright ideas and/or support.</p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=52</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>PHP and HTTP</title>
		<link>http://afr0games.com/wordpress/?p=39</link>
		<comments>http://afr0games.com/wordpress/?p=39#comments</comments>
		<pubDate>Thu, 16 Feb 2012 07:58:53 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=39</guid>
		<description><![CDATA[So, after a tip from Jayenkai over at [url=http://www.socoder.com]Socoder[/url], I decided to use a webserver after all, but I wrote a couple of PHP scripts to take care of finding the manifests. One, called &#8220;patch.php&#8221;, is the most important. It &#8230; <a href="http://afr0games.com/wordpress/?p=39">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, after a tip from Jayenkai over at [url=http://www.socoder.com]Socoder[/url], I decided to use a webserver after all, but I wrote a couple of PHP scripts to take care of finding the manifests.</p>
<p>One, called &#8220;patch.php&#8221;, is the most important. It sends the right manifest(s) to a client based on what version is passed to it.</p>
<pre class="brush: php; title: ; notranslate">

&lt;?php

/*The contents of this file are subject to the Mozilla Public License Version 1.1
(the &quot;License&quot;); you may not use this file except in compliance with the
License. You may obtain a copy of the License at http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an &quot;AS IS&quot; basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.

The Original Code is patch.php.

The Initial Developer of the Original Code is
Mats 'Afr0' Vederhus. All Rights Reserved.

Contributor(s): ______________________________________.
*/

include 'createzip.php';

if(isset($_GET['Version']))
{
	$ClientVersion = intval(htmlspecialchars($_GET['Version']));
	$NewManifest = &quot;&quot;;

	if($handle = opendir(realpath('./patches/')))
	{
		//Find out if there are any manifests newer than the client's version.
		while (false !== ($entry = readdir($handle)))
		{
        		if(intval(str_replace('.manifest', '', $entry)) &gt; $ClientVersion)
			{
				$NewManifest = realpath('./patches') . '/' . $entry . '.manifest';
				break;
			}
		}

		if(empty($NewManifest) || strcmp($NewManifest, realpath('./patches')) == 0)
		{
			header('Content-Description: No New Manifest');
			header('Content-Type: text/html; charset=utf-8');
			echo('&lt;html&gt;&lt;body&gt;&lt;p&gt;No new manifest!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;');
		}
		else
		{
			//Open the new manifest and check if it has a child, which means an
			//incremental update needs to take place...
			$FileHandle = fopen($NewManifest, 'r');

			$Parent = fgets($FileHandle);
			$CurrentChild = fgets($FileHandle);
			$Path = realpath('./patches');

			$Parent = str_replace('Parent=', '', $Parent);
			$Parent = str_replace('&quot;', '', $Parent);
			$Parent = trim($Parent);
			$CurrentChild = str_replace('Child=', '', $CurrentChild);
			$CurrentChild = str_replace('&quot;', '', $CurrentChild);
			$CurrentChild = trim($CurrentChild);

			fclose($FileHandle);

			//This is a compromise. Instead of checking for all childs, just check for the first one,
			//and let the client handle the other children (if any).
			if(empty($CurrentChild) !== true &amp;&amp; empty($Parent) !== true)
			{
				$Parent = $Path . '/' . $Parent;
				$CurrentChild = $Path . '/' . $CurrentChild;

				$FilesToZip = array($CurrentChild, $NewManifest);
				$ZipName = './' . strval(rand()) . '.zip';
				create_zip($FilesToZip, $ZipName);

				//Client should check the Content-Description header to figure out what to expect.
				header('Content-Description: Zipped File Transfer');
    				header('Content-Type: application/octet-stream');
    				header('Content-Disposition: attachment; filename='.basename($ZipName));
    				header('Content-Transfer-Encoding: binary');
    				header('Expires: 0');
    				header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    				header('Pragma: public');
    				header('Content-Length: ' . filesize($ZipName));
    				ob_clean();
    				flush();
    				readfile($ZipName);

				unlink($ZipName);
				exit();
			}
			//There was a child, but no parent.
			else if(empty($CurrentChild) !== true &amp;&amp; empty($Parent) == true)
			{
				$CurrentChild = $Path . '/' . $CurrentChild;

				$FilesToZip = array($CurrentChild, $NewManifest);
				$ZipName = './' . strval(rand()) . '.zip';
				create_zip($FilesToZip, $ZipName);

				//Client should check the Content-Description header to figure out what to expect.
				header('Content-Description: Zipped File Transfer');
    				header('Content-Type: application/octet-stream');
    				header('Content-Disposition: attachment; filename='.basename($ZipName));
    				header('Content-Transfer-Encoding: binary');
    				header('Expires: 0');
    				header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    				header('Pragma: public');
    				header('Content-Length: ' . filesize($ZipName));
    				ob_clean();
    				flush();
    				readfile($ZipName);

				unlink($ZipName);
				exit();
			}
			//There was a parent, but no child.
			else if(empty($Parent) !== true &amp;&amp; empty($CurrentChild) == true)
			{
				$Parent = $Path . '/' . $Parent;

				$FilesToZip = array($Parent, $NewManifest);
				$ZipName = './' . strval(rand()) . '.zip';
				create_zip($FilesToZip, $ZipName);

				//Client should check the Content-Description header to figure out what to expect.
				header('Content-Description: Zipped File Transfer');
    				header('Content-Type: application/octet-stream');
    				header('Content-Disposition: attachment; filename='.basename($ZipName));
    				header('Content-Transfer-Encoding: binary');
    				header('Expires: 0');
    				header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    				header('Pragma: public');
    				header('Content-Length: ' . filesize($ZipName));
    				ob_clean();
    				flush();
    				readfile($ZipName);

				unlink($ZipName);
				exit();
			}
			//There was neither a parent nor a child. This should really never occur.
			else
			{
				header('Content-Description: File Transfer');
    				header('Content-Type: application/octet-stream');
    				header('Content-Disposition: attachment; filename='.basename($NewManifest));
    				header('Content-Transfer-Encoding: binary');
    				header('Expires: 0');
    				header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    				header('Pragma: public');
    				header('Content-Length: ' . filesize($NewManifest));
    				ob_clean();
    				flush();
    				readfile($NewManifest);

				exit();
			}
		}
	}
}
else
{
	header('Content-Description: Invalid Request');
	header('Content-Type: text/html; charset=utf-8');
	echo('&lt;html&gt;&lt;body&gt;&lt;p&gt;Invalid request!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;');
}
?&gt;
</pre>
<p>This code depends on another script I found while rummaging through Google:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
//From: http://davidwalsh.name/create-zip-php
function create_zip($files = array(),$destination = '',$overwrite = false) {
  //if the zip file already exists and overwrite is false, return false
  if(file_exists($destination) &amp;&amp; !$overwrite) { return false; }
  //vars
  $valid_files = array();
  //if files were passed in...
  if(is_array($files)) {
    //cycle through each file
    foreach($files as $file) {
      //make sure the file exists
      if(file_exists($file)) {
        $valid_files[] = $file;
      }
    }
  }
  //if we have good files...
  if(count($valid_files)) {
    //create the archive
    $zip = new ZipArchive();
    if($zip-&gt;open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {
      return false;
    }
    //add the files
    foreach($valid_files as $file) {
      $zip-&gt;addFile($file,$file);
    }
    //debug
    //echo 'The zip archive contains ',$zip-&gt;numFiles,' files with a status of ',$zip-&gt;status;

    //close the zip -- done!
    $zip-&gt;close();

    //check to make sure the file exists
    return file_exists($destination);
  }
  else
  {
    return false;
  }
}
?&gt;
</pre>
<p>The &#8216;patch.php&#8217; script can be utilized by clients as such;</p>
<p><em>http://www.webserver.com/patch.php?Version=ClientVersion</em></p>
<p>Lastly there&#8217;s the &#8216;getmanifest.php&#8217; script which simply retrieves a specific manifest;</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
/*The contents of this file are subject to the Mozilla Public License Version 1.1
(the &quot;License&quot;); you may not use this file except in compliance with the
License. You may obtain a copy of the License at http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an &quot;AS IS&quot; basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.

The Original Code is getmanifest.php.

The Initial Developer of the Original Code is
Mats 'Afr0' Vederhus. All Rights Reserved.

Contributor(s): ______________________________________.
*/

if(isset($_GET['Manifest']))
{
	$RequestedManifest = htmlspecialchars($_GET['Manifest']);
	$FoundManifest = &quot;&quot;;

	if($handle = opendir('./patches/'))
	{
		//Find the requested manifest...
		while (false !== ($entry = readdir($handle)))
		{
        		if($entry === $RequestedManifest)
			{
				$FoundManifest = './patches/' . $entry;
				break;
			}
		}

		if(empty($FoundManifest) || strcmp($FoundManifest, './patches') == 0)
		{
			header('Content-Description: Invalid Request');
			header('Content-Type: text/html; charset=utf-8');
			echo('&lt;html&gt;&lt;body&gt;&lt;p&gt;No manifest by that name exists!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;');
		}
		else
		{
			header('Content-Description: File Transfer');
    			header('Content-Type: application/octet-stream');
    			header('Content-Disposition: attachment; filename='.basename($FoundManifest));
    			header('Content-Transfer-Encoding: binary');
    			header('Expires: 0');
    			header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    			header('Pragma: public');
    			header('Content-Length: ' . filesize($FoundManifest));
    			ob_clean();
    			flush();
    			readfile($FoundManifest);

			exit();
		}
	}
}
else
{
	header('Content-Description: Invalid Request');
	header('Content-Type: text/html; charset=utf-8');
	echo('&lt;html&gt;&lt;body&gt;&lt;p&gt;Invalid request!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;');
}
?&gt;</pre>
<p>It can be utilized as such;</p>
<p><em>http://www.webserver.com/getmanifest.php?Manifest=ManifestVersion.manifest</em></p>
<p>I also created a <a href="http://www.afr0games.com/uploads/Manifestation.exe" title="Manifestation">tool</a> for generating these manifests. The important thing, however, is that the two first lines of a manifest are stored as plain ASCII strings so they can be read by &#8216;patch.php&#8217;. Aside from that, manifests can look however you want them to.<br />
Here&#8217;s a sample manifest generated by Manifestation;</p>
<div style="border: 1px solid ;">
Child=&#8221;"<br />
NumFiles=48<br />
&#038;DLLs\Aries.dll MD5: ?5??????I?[/?<br />
*DLLs\authlogin.dll MD5: ?????<?I?X???<br />
4DLLs\DBAppServiceClientD.dll MD5: "??(???N?$????<br />
!dummy.jpg MD5: )8???Qc??R??c/<br />
!dummy.tga MD5: O??????????NW&#038;<br />
&#038;dummy_8bit.bmp MD5: ?vu$"????By???<br />
'dummy_24bit.bmp MD5: ^p?&#038;;????2?"j;)<br />
EP2.dat MD5: ?X???8??Y????w?<br />
$EP5Samps.dat MD5: ?J<br />
%?F[?????<br />
&#038;DLLs\gimex.dll MD5: DV???O??IO><br />
(HitListsTemp.dat MD5: ~l?{??JL,?2?9?<br />
.DLLs\HitMp3DecodeD.dll MD5: ????psCX?p'??2%6<br />
&#038;DLLs\ijl10.dll MD5: ?r?q.GcP??<br />
1DLLs\InternetServiceD.dll MD5: ?	y?fU?|[?<O<br />
)DLLs\libexpat.dll MD5: KW??(e0??????<br />
&#038;menulights.ini MD5: ?\2???????EU??<br />
&#038;properties.txt MD5: c????eh???%7??<br />
'rock_colors.txt MD5: i-??H??K??u ?pI?<br />
'sand_colors.txt MD5: *lm??|j&#038;1x+?o<br />
'snow_colors.txt MD5: &#038;?{H??<?V?q?fT<br />
"splash.bmp MD5: ?L???.g?N?????6<br />
"Stings.dat MD5: ???~Z3/?v?????<br />
$template.lch MD5: {????8??Y???S??<br />
)DLLs\TSOAnimD.dll MD5: B??si(JY?@4?p??<br />
$TSOAudio.dat MD5: 8J?)????8?p?p??<br />
.DLLs\TSOAudioViewD.dll MD5: ???.?}??!?????<br />
%TSOClient.exe MD5: ??s?$?#??8????A<br />
2TSOData_datadefinition.dat MD5: #?!L??*B? ???c}<br />
6DLLs\TSODataServiceClientD.dll MD5: %?0????O??(5?{?<br />
6DLLs\TSOEdithPluginClientD.dll MD5: ??:?@w?'k??m?<br />
(DLLs\TSOFont.dll MD5: ???B?mu??L??<br />
R<br />
 tsofp.va MD5: 	i+<????????X<br />
*DLLs\TSOGimexD.dll MD5: ??W? ???????R<br />
,DLLs\TSOGraphicD.dll MD5: ?=gdhV??>ro???<br />
8DLLs\TSONetServiceSimClientD.dll MD5: !???m??>`<??+?<br />
?<br />
,DLLs\TSOPersistD.dll MD5: `dN7??c?i&#038;?N?<br />
1DLLs\TSOPersistToolsD.dll MD5: ??u?|.????E?<br />
6DLLs\TSOPresentationLayerD.dll MD5: K?7==2cl?U]N?<br />
2DLLs\TSOServiceClientD.dll MD5: ?k9?7??K??&#8217;;^<br />
?<br />
4DLLs\TSOSimulatorClientD.dll MD5: ?.?????<???????<br />
!tsov2.dat MD5: Pk?`?'?p."??`<br />
1DLLs\TSOViewerClientD.dll MD5: ?H???r?|yYlI<br />
+DLLs\TSOWinAppD.dll MD5: ??{`?{?c??1k?o??<br />
0DLLs\TSOWorldClientD.dll MD5: ?v??N?)???J?<br />
"tuning.dat MD5: mx???HW?????r.n<br />
+tuning_hardcore.ini MD5: ???%?;+???????!A<br />
$userinfo.ini MD5: ?9\.J????F?dX??<br />
version MD5: z?g??????8</div>
<p>The added MD5s after filenames are checksums that can be used by clients to verify file integrity.<br />
If you&#8217;re looking for a general-purpose way to patch your game(s), I hope I&#8217;ve given you some food for thought!</p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FTP vs. HTTP</title>
		<link>http://afr0games.com/wordpress/?p=35</link>
		<comments>http://afr0games.com/wordpress/?p=35#comments</comments>
		<pubDate>Thu, 09 Feb 2012 22:45:32 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=35</guid>
		<description><![CDATA[Right. I just tried getting the FTP server I&#8217;ve been working on to work with FileZilla for the umpteenth time. It still doesn&#8217;t work, no matter what I do. Unfortunately, the FTP-protocol is extremely badly documented (aside from the documents &#8230; <a href="http://afr0games.com/wordpress/?p=35">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Right. I just tried getting the FTP server I&#8217;ve been working on to work with FileZilla for the umpteenth time. It still doesn&#8217;t work, no matter what I do.</p>
<p>Unfortunately, the FTP-protocol is extremely badly documented (aside from the documents available from IETF, which are extremely terse, contains unneeded bloat and are generally just downright bad). I&#8217;ve been able to make my way up to and including the LIST and/or MLSD command (the MLSD being a newer extension command), but when trying to transfer the data containing the directory listing for the root directory, FileZilla never acknowledges that the data was received! Instead it times out and decides that there was a problem receiving the directory listing.</p>
<p>So, I&#8217;ve been thinking, would it make sense to just switch to HTTP for transferring patches to clients? It is starting to look extremely tempting. Arguably, I could code my way around the FTP-protocol by introducing non-standard protocol &#8220;extensions&#8221;, but that would defeat the purpose of using FTP in the first place (namely that it&#8217;s a pre-designed filetransfer protocol).</p>
<p>I don&#8217;t know if I&#8217;ll have the time tomorrow (I should study), but one of these days I&#8217;m going to install a copy of <a href="http://httpd.apache.org/">Apache</a> on my box and see about making my patch client communicate with it.</p>
<p>So far I&#8217;ve been thinking of two possible solutions for a directory structure on the server:</p>
<ul>
<li>Dumping a manifest  and all files into the root folder. This would have the downside of making it near-impossible to do incremental updates, unless the manifest contained information about which files belonged to which update.</li>
<li>Have a manifest in the root folder that points to different versions contained in separate directories. This seems like the best way to go, as it would enable incremental updates without making the manifest needlessly complex.</li>
</ul>
<p>Once I&#8217;ve been able to write some basic HTTP code for the patch client, I&#8217;ll make another post with pictures of the client to inform of the progress.</p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=35</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D</title>
		<link>http://afr0games.com/wordpress/?p=9</link>
		<comments>http://afr0games.com/wordpress/?p=9#comments</comments>
		<pubDate>Tue, 07 Feb 2012 17:52:32 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Rendering]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=9</guid>
		<description><![CDATA[After a lot of hair pulling, teeth grinding, swearing and performing sacrificial rituals to Microsoft in my back garden, I finally figured out how to render meshes correctly on top of textures (with some help from the Gamedev.net forums). As you &#8230; <a href="http://afr0games.com/wordpress/?p=9">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After a lot of hair pulling, teeth grinding, swearing and performing sacrificial rituals to Microsoft in my back garden, I finally figured out how to render meshes correctly on top of textures (with some help from the <a href="http://www.gamedev.net/">Gamedev.net forums</a>).</p>
<div class="wp-caption alignnone" style="width: 582px"><img class=" " src="http://i44.tinypic.com/117tg1i.png" alt="The &quot;Create A Sim&quot; screen" width="572" height="413" /><p class="wp-caption-text">3D head being rendered in the client</p></div>
<p>As you can see, there’s still stuff to figure out, such as correct rotation and placement in 2D space. There’s also the issue of selecting the right mesh when the corresponding button is pressed, which is currently a little off. But the rendering is in place, and that’s the important thing for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=9</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New website up!</title>
		<link>http://afr0games.com/wordpress/?p=1</link>
		<comments>http://afr0games.com/wordpress/?p=1#comments</comments>
		<pubDate>Tue, 07 Feb 2012 16:38:37 +0000</pubDate>
		<dc:creator>Afr0</dc:creator>
				<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://afr0games.com/wordpress/?p=1</guid>
		<description><![CDATA[Finally, Project Dollhouse has its own website. I&#8217;ve been putting it off for a long time due to working on the code, but I figured it was time to make it happen. In this section I will be blogging about &#8230; <a href="http://afr0games.com/wordpress/?p=1">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Finally, Project Dollhouse has its own website. I&#8217;ve been putting it off for a long time due to working on the code, but I figured it was time to make it happen. In this section I will be blogging about any news related to the project.</p>
<p>Please forgive if things aren&#8217;t looking &#8220;up to scratch&#8221; at the moment, as I am still tweaking the setup to make the website just the way I want it.</p>
]]></content:encoded>
			<wfw:commentRss>http://afr0games.com/wordpress/?feed=rss2&#038;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

