<?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>Catalin&#039;s XNA Blog &#187; GFR</title>
	<atom:link href="http://www.catalinzima.com/category/gfr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.catalinzima.com</link>
	<description>XNA Tutorials, Samples and Thoughts</description>
	<lastBuildDate>Tue, 20 Sep 2011 19:51:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Mass Effect Dialogue Sample</title>
		<link>http://www.catalinzima.com/2009/04/mass-effect-dialogue-sample/</link>
		<comments>http://www.catalinzima.com/2009/04/mass-effect-dialogue-sample/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 21:33:05 +0000</pubDate>
		<dc:creator>Catalin Zima</dc:creator>
				<category><![CDATA[GFR]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.catalinzima.com/?p=517</guid>
		<description><![CDATA[Finally, the dialogue system sample is here. In this sample, I tried to replicate the dialogue system as seen in Bioware’s Mass Effect. The main aspects that I intended to implement were: Dialogue Wheel, showing short previews of what the Player Character will say. You don’t see the whole answer before you choose it. Only]]></description>
			<content:encoded><![CDATA[<p>Finally, the dialogue system sample is here.</p>
<p>In this sample, I tried to replicate the dialogue system as seen in Bioware’s <a href="http://masseffect.bioware.com/">Mass Effect</a>. The main aspects that I intended to implement were:</p>
<ul>
<li>Dialogue Wheel, showing short previews of what the Player Character will say. You don’t see the whole answer before you choose it. Only after you choose it, you see it spoken by the player’s character.</li>
<li>Investigate branch. In a dialogue “hub” (a place where the player can make choices), there may be one or more topics which do not count as “choices”, but rather as information gathering. They are accessible through an “Investigate” option on the Dialogue Wheel</li>
<li>Choice on the right side of the wheel almost always have a certain meaning. The Top-Right choice is usually a good choice, the Center-Right is a neutral choice, and the Lower-Right is a renegade choice</li>
<li>Besides these two features which are defining for Mass Effect, the normal functionality you would expect from a dialogue system in an RPG.</li>
</ul>
<p>One thing I wanted to do, but didn’t get to is a more detailed handling of the preconditions and consequences of a choice. As you can read in the sample’s page, each dialogue branch has these associated, as collection of Key-Value pairs. I decided to simply shows the consequences on the screen. In a game, these would be handled by some other module of the game, such as a scripting system, or quest system, or something like that. Thus, some choices could be unavailable (based on the precondition) and some choices may lead to very different results, affecting immediate events, or events later in the game (using Consequences to set flags). This is really game-specific, so an thorough exemplification of what can be done with them is hard to do in a sample.</p>
<p>To develop the class hierarchy (shortly described on the sample’s page), I first began by playing a few dialogues in Mass Effect, and carefully analyzing what was happening as a developer, not as a player. So I decided that I’ll need some class to represent a line delivered by a character. This includes the sound and subtitles, and I named it a SpeechLine. My class also contains some ID that should represent the character’s ID. In a more evolved system, a SpeechLine would also contains stuff like camera position, camera target, character animations, etc. If all these were available, cutscenes could be created as a sequence of SpeechLines. This is somehow outside the scope of this sample, but by looking at dialogue this way, you can see the need for a DialogueBranch, which in my code is a sequence of SpeechLines. </p>
<p>So player choices are tied together using DialogueBranches. But how do you represent a player choice? For this, I used the class DialogueHub, which contains the IDs of the DialogueBranches which are options available to the player in that hub. One such DialogueBranch would carry the conversation to another hub, thus advancing the dialogue according the the player’s choices. To handle the Investigate topics, I simply added them as DialogueBranches which don’t lead to another hub, but rather return to the hub that they were called from. To make this visible, the “Investigate” sub-hub is available to players.</p>
<p>All information related to a dialogue is held in the Dialogue class, directly loadable from an XML file using the Content Pipeline. In a real game, you would probably want to load this using a separate ContentManager, so you can unload all the dialogue resources once you’re done with them. After loading a Dialogue, you can start playing it with the DialoguePlayer class. I split the functionality of this class in two main classes, the BranchPlayer, and the HubPlayer. For drawing the dialogue interface, the DialogueWheel class is used. Simply modifying this class would cause the user interface to look different.</p>
<p>The sample’s page can be found <a href="http://www.catalinzima.com/?page_id=515">here</a>. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catalinzima.com/2009/04/mass-effect-dialogue-sample/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Small update</title>
		<link>http://www.catalinzima.com/2009/03/small-update/</link>
		<comments>http://www.catalinzima.com/2009/03/small-update/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 21:54:51 +0000</pubDate>
		<dc:creator>Catalin Zima</dc:creator>
				<category><![CDATA[GFR]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.catalinzima.com/?p=507</guid>
		<description><![CDATA[Just wanted to let everyone know I&#8217;m back from my little extended vacation after the MVP Summit, and will soon get back to working on some more XNA samples. The next sample should cover a feature from one of my favourite games. See you soon&#8230;]]></description>
			<content:encoded><![CDATA[<p>Just wanted to let everyone know I&#8217;m back from my little extended vacation after the MVP Summit, and will soon get back to working on some more XNA samples.</p>
<p>The next sample should cover a feature from <a href="http://masseffect.bioware.com/">one</a> of my favourite games.</p>
<p>See you soon&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catalinzima.com/2009/03/small-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>World of Goo Cursor Sample Thoughts</title>
		<link>http://www.catalinzima.com/2009/02/world-of-goo-cursor-sample-thought/</link>
		<comments>http://www.catalinzima.com/2009/02/world-of-goo-cursor-sample-thought/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 23:09:53 +0000</pubDate>
		<dc:creator>Catalin Zima</dc:creator>
				<category><![CDATA[GFR]]></category>
		<category><![CDATA[World Of Goo]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.catalinzima.com/?p=504</guid>
		<description><![CDATA[As I promised a while ago, I’m going to talk about how I built the World of Goo Cursor Sample. I’m not any sort of design analyst or critic, so I can&#8217;t give any in depth insight about what makes the World of Goo cursor special ( but if you are interesting in that kind]]></description>
			<content:encoded><![CDATA[<p>As I promised a while ago, I’m going to talk about how I built the <a href="http://www.catalinzima.com/?page_id=498">World of Goo Cursor Sample</a>. I’m not any sort of design analyst or critic, so I can&#8217;t give any in depth insight about what makes the World of Goo cursor special ( but if you are interesting in that kind of analysis, <a href="http://blog.wolfire.com/2008/11/world-of-goo-design-tour/">here</a>’s an interesting one).</p>
<p>I’ll start by saying what I liked about the cursor, which should be very easy to guess: yup, the trail it leaves behind when it moves, and the nice border that makes it visible anywhere on the screen. So those were two goals that I set for my samples.</p>
<p>If I had been a good developer, I first would have started World of Goo and would have spent a couple of minutes just looking at the cursor and how it behaves, but I didn’t. I just started coding, and ended up rewriting all the sample after a while. At least I learned a good lesson: do your research first.</p>
<p>So the first thing I wanted to do was the trail. My first idea was to keep a list of positions where the cursor has been. The list was limited in size, which caused the oldest positions to be removed each frame. When moving the mouse, I stored the new position each frame, and removed the oldest one. Then, when drawing the cursor, for each position stored in the trail, I rendered a circle from a texture. When I ran the code, the first problems appeared: when moving the mouse too fast, gaps appeared between different circles, and instead of having one continuous trail, I had several distanced circles. This is when I decided to go back to the basics, and start up World of Goo to take a closer look at the cursor.</p>
<p>After spending a few minutes in the game’s menu, I took note of the following:</p>
<ul>
<li>The cursor is indeed made up of many circles, as I suspected, but they are kept close enough so you don’t notice them most of the time.</li>
<li>The trail has a certain elasticity to it. When you move the cursor, the trail stays a little behind, and recovers with a different speed than the one you moved with</li>
<li>I still haven’t finished the second world of the game.</li>
</ul>
<p>With that new information (namely the second points), I scraped the code, and started fresh. The first thing I had to deal with was that elasticity. The knowledge on how to do that came from an unexpected place. The <a href="http://creators.xna.com/en-US/sample/chasecamera">Chase Camera Sample</a> found on the XNA Creator’s Club webpage deals with a chase camera that uses spring physics for nice camera movement. The documentation found in the project’s folder was especially useful, because it contained some description on how the spring for the camera was implemented. </p>
<p>My idea was that if I built a trail composed of a chain of nodes, tied to each other with springs that had the resting length of 0 (each node always tries to reach the position of the previous node), it would work as expected.</p>
<p>The result can be seen in the sample, in the UpdateTrailNodes function, where a force is computed for each node, such that it pulls the node towards the previous one in the list. Then after some trial-and-error for the values of different parameters (now settable through the sample’s interface), I obtained a pretty good approximation of the behavior. By keeping the springs stiff enough, the nodes rarely get too far apart, so the circles appear as a continuous trails.</p>
<p>All left to do was the border. For this, the solution is rather simple. First, I draw all the nodes using the color I want for the border (White), and scaling them to make them slightly larger than normal. After this, I go again through the list of nodes, and draw them with their normal color (Black), at their normal scale. The black nodes overlap the central area of the white ones, and thus the border is created.</p>
<p>After using these two techniques I was satisfied enough to release the sample into the wild, and I hope the explanations help with a better understanding of the <a href="http://www.catalinzima.com/?page_id=498">code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catalinzima.com/2009/02/world-of-goo-cursor-sample-thought/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>World of Goo Cursor sample</title>
		<link>http://www.catalinzima.com/2009/01/world-of-goo-cursor-sample/</link>
		<comments>http://www.catalinzima.com/2009/01/world-of-goo-cursor-sample/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 01:51:56 +0000</pubDate>
		<dc:creator>Catalin Zima</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[GFR]]></category>
		<category><![CDATA[World Of Goo]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.catalinzima.com/?p=503</guid>
		<description><![CDATA[As an exception, I will post the sample for now, and come back with the informative and explanatory blog post in a few days, since my exams don’t allow me too much XNA work at once. So the first sample deals with the XNA implementation of something similar to the mouse cursor encountered in World]]></description>
			<content:encoded><![CDATA[<p>As an exception, I will post the sample for now, and come back with the informative and explanatory blog post in a few days, since my exams don’t allow me too much XNA work at once. </p>
<p>So the first sample deals with the XNA implementation of something similar to the mouse cursor encountered in World of Goo. My blog post later this week will contain more information about how I built the sample, but until then, you can try it out, and play with it.</p>
<p>To download it, access the sample’s page, <a href="http://www.catalinzima.com/?page_id=498">here</a>.</p>
<p>&#160;<a href="http://www.catalinzima.com/?page_id=498"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="GooCursor 2009-01-26 00-39-30-55" border="0" alt="GooCursor 2009-01-26 00-39-30-55" src="http://www.catalinzima.com/wp-content/uploads/2009/01/goocursor20090126003930551.jpg" width="244" height="184" /></a> <a href="http://www.catalinzima.com/?page_id=498"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="GooCursor 2009-01-26 00-36-14-92" border="0" alt="GooCursor 2009-01-26 00-36-14-92" src="http://www.catalinzima.com/wp-content/uploads/2009/01/goocursor20090126003614921.jpg" width="244" height="184" /></a> </p>
<p>Have fun toying with the configurable parameters! <img src='http://www.catalinzima.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.catalinzima.com/2009/01/world-of-goo-cursor-sample/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Introducing Game Features repliCATor</title>
		<link>http://www.catalinzima.com/2009/01/introducing-game-features-replicator/</link>
		<comments>http://www.catalinzima.com/2009/01/introducing-game-features-replicator/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 00:52:23 +0000</pubDate>
		<dc:creator>Catalin Zima</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[GFR]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.catalinzima.com/?p=477</guid>
		<description><![CDATA[Ok, so I’m not quite that crazy yet… While working on the logo for my new series of samples I created the cat featured in the previous post, and I was caught in the excitement of seeing something cute come out of my horrendous artistic skills, so I decided to give it some voice. Now,]]></description>
			<content:encoded><![CDATA[<p>Ok, so I’m not quite that crazy yet… While working on the logo for my new series of samples I created the cat featured in the previous post, and I was caught in the excitement of seeing something cute come out of my horrendous artistic skills, so I decided to give it some voice. Now, getting back to the purpose of this post…</p>
<p>This next year-or-so, I’ll be releasing samples under a new theme: “Game Features replicator”</p>
<p><a href="http://www.catalinzima.com/wp-content/uploads/2009/01/title1.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Game Features Replicator" border="0" alt="Game Features Replicator" src="http://www.catalinzima.com/wp-content/uploads/2009/01/title-thumb.png" width="437" height="95" /></a>What this means is that new samples will be created through the following method:</p>
<ul>
<li>Pick an interesting feature from games I play and like.</li>
<li>Analyze the feature, and see how it works. I’ll also say some words about the analysis, about how I looked at the feature, how I assumed it works, and what objectives I set for the XNA sample.</li>
<li>Try to make an equivalent implementation in XNA. This is not going to work/function identical to the original feature, but I will always try to reach each point that made that certain feature interesting, and provide a satisfying equivalent.</li>
<li>Release the sample so anyone can learn from it and use it in their own games.</li>
</ul>
<p>The first of these samples will look at a mouse cursor, as it appears in <a href="http://2dboy.com/games.php">World of Goo</a>, and I will upload it to the site soon. </p>
<p>I hope you’ll like this series of samples, and I’ll do my best to make each one special.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catalinzima.com/2009/01/introducing-game-features-replicator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

