<?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>Sgt. Conker &#187; JEmgine</title>
	<atom:link href="http://www.sgtconker.com/tag/jemgine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sgtconker.com</link>
	<description>We are &#34;absolutely fine&#34;</description>
	<lastBuildDate>Wed, 06 Jul 2011 13:29:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Jemgine: Now for XNA 4.0</title>
		<link>http://www.sgtconker.com/2010/09/jemgine-now-for-xna-4-0/</link>
		<comments>http://www.sgtconker.com/2010/09/jemgine-now-for-xna-4-0/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 19:11:27 +0000</pubDate>
		<dc:creator>Sgt. Conker</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[2D Engine]]></category>
		<category><![CDATA[Blecki]]></category>
		<category><![CDATA[JEmgine]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1812</guid>
		<description><![CDATA[Mr "My engine is better than your engine" Blecki has very kindly updated his XNA Engine to XNA 4.0.
A reminder that you can get the latest source on codeplex
There isnt much else to but .. Awsomesauce... you should go download it immediately. 
Read direct from the source here 
]]></description>
			<content:encoded><![CDATA[<p><a href="http://jemgine.omnisu.com/">Mr "My engine is better than your engine" Blecki</a> has very kindly updated his XNA Engine to XNA 4.0.<br />
A reminder that you can get the latest source on <a href="http://jemgine.omnisu.com/?p=437">codeplex</a></p>
<p>There isnt much else to but .. Awsomesauce... you should go download it immediately. </p>
<p>Read direct from the <a href="http://jemgine.omnisu.com/?p=437">source here</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/09/jemgine-now-for-xna-4-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Article: Node-Based Scripting</title>
		<link>http://www.sgtconker.com/2010/09/article-node-based-scripting/</link>
		<comments>http://www.sgtconker.com/2010/09/article-node-based-scripting/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 19:36:55 +0000</pubDate>
		<dc:creator>Absolutely Fine Tutorial Contest</dc:creator>
				<category><![CDATA["Absolutely fine"]]></category>
		<category><![CDATA[2010 Contest Entries]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Contest]]></category>
		<category><![CDATA[Absolutely Fine Tutorial Contest]]></category>
		<category><![CDATA[Blecki]]></category>
		<category><![CDATA[JEmgine]]></category>
		<category><![CDATA[node-based scripting]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1641</guid>
		<description><![CDATA[by Blecki

Node-based scripting is not a traditional scripting language. And it's not a new idea, though it seems like people have forgotten about it. New systems appear - see Unreal Engine's Kismet - which people think are amazing new technologies. They aren't new; just amazing. I first encountered this scripting system in the quake engine. [...]]]></description>
			<content:encoded><![CDATA[<h4 style="text-align: center;">by <a href="http://jemgine.omnisu.com/">Blecki</a></h4>
<p style="text-align: center;"><img class="aligncenter" src="http://www.sgtconker.com/wp-content/uploads/contest/2010/blecki/MoveEntityNode.jpg" alt="Node Based Scripting" /></p>
<p>Node-based scripting is not a traditional scripting language. And it's not a new idea, though it seems like people have forgotten about it. New systems appear - see Unreal Engine's Kismet - which people think are amazing new technologies. They aren't new; just amazing. I first encountered this scripting system in the quake engine. It was very crude, and limited, but it had all the basic properties of the system I am about to describe.</p>
<p>A brief note : Throughout this article, I use my own engine, Jemgine, and it's level editor for my examples. Jemgine is available at <a href="http://jemgine.codeplex.com">http://jemgine.codeplex.com</a> You'll need to have XNA Gamestudio 3.1 installed to compile it, and to run the editor.</p>
<p>The target user of a node-based scripting system isn't the programmer, it's the level designer. The level designer might not know how to program. They might be constantly bothering a programmer to write scripts for them. Node-based scripting is an attempt to give the non-programmer level designer tools they understand and can use to create interesting behavior in a level without involving the programmer, and without having to learn a complex scripting language.</p>
<p><span id="more-1641"></span></p>
<p>Node-based scripting is a visual programming language. Most visual programming languages make the same mistake. They try and present the nuts and bolts of programming in a visual manner. Programs are still made of for loops and variables, only they're little boxes on the screen instead of text. They require the same skill set as programming in a text editor, except it takes longer to put the program together. Understandably, they aren't terribly usefull languages. The target audience doesn't know how to program - getting rid of the text editor doesn't change that. And those that do know how to program aren't going to give up the text editor for a less productive environment. Node-based scripting doesn't have to fall into this trap.</p>
<p>First, what is a node? A node is a little atom of behavior. It's an action that can be applied to the objects in the game world, or a chunk of logic. It's important to strike a balance somewhere between the low level and the high level. If your nodes represent loops and variables and conditions, you'll fall into that trap I described earlier. Make the nodes too high level, and you'll lose their flexibility. It can be beneficial to have some of those low level constructs, and some of the high level. Focus on the middle ground, but understand that you're going to end up with a fair mix of both.</p>
<p>Nodes have inputs and outputs. These are represented by terminals. Output terminals are connected to input terminals. Nodes also have references. These reference terminals are connected to other nodes or game objects. For example, the node 'MoveGameObject' has one input to trigger the action. It has two outputs - Began and Arrived, which are triggered when the movement begins and when it ends, respectively. It also has two references. One that's connected to the game object that needs moving, and another that's connected to the waypoint to move it to.</p>
<p><img class="alignnone" title="Move Entity Node" src="http://www.sgtconker.com/wp-content/uploads/contest/2010/blecki/MoveEntityNode.jpg" alt="" width="256" height="256" /></p>
<p>A node can be as simple in code as a list of terminals and a virtual function. Like this.</p>
<pre class="brush: csharp; title: ;">
public class Input
{
	public Node Owner;
}

public class Output
{
	public Input Target;
}

public class Reference
{
	public Node Target;
}

public class Node
{
	public List&lt;Input&gt; Inputs;
	public List&lt;Output&gt; Outputs;
	public List&lt;Reference&gt; References;

	public virtual void FireInput(Input Input, ScriptContext Context) {}
}
</pre>
<p>You'll need a way to create the script. You can do it in code, or you can do it in XML, but since the whole point of this system is to make it easy for your level designers to use, you should do it in your level editor. The level editor only needs to support two basic operations. Creating nodes, and connecting terminals.</p>
<p>You can see this in action within the Jemgine level editor. In the editor, press Alt+S to create a new script node. Then, with that node selected, hold alt and left click and drag an output terminal to connect it to an input terminal. This is probably the most important part of the system, so why aren't I spending more time on it? Because it's a terribly complex system and it's way beyond the scope of this article. But, I do suply a reference implementation in the form of the Jemgine level Editor.</p>
<p>The other half of the system is the engine that executes a script in the game. At first blush it seems that this would be very complicated, but it turns out it's the simplest piece of the puzzle. Because it's so simple, here is the entire implementation.</p>
<pre class="brush: csharp; title: ;">
public class ScriptDriver
{
	class FireEvent
	{
		internal Output Output;
		internal ScriptContext Context;
	}

	List&lt;FireEvent&gt; FireEvents = new List&lt;FireEvent&gt;();

	public void FireOutput(Output Output, ScriptContext Context)
	{
		FireEvents.Add(new FireEvent { Output = Output, Context = Context });
	}

	public void Update(int Cycles)
	{
		while (Cycles &gt; 0)
		{
			--Cycles;

			var LocalList = new List&lt;FireEvents&gt;(FireEvents);
			FireEvents.clear();
			foreach (var FireEvent in LocalList)
				if (FireEvent.Output.Target != null)
					FireEvent.Output.Target.Owner.FireInput(FireEvent.Output.Target, FireEvent.Context);
		}
	}
}
</pre>
<p>You might not need a script engine at all. When a script is fired, you could just call FireInput on it yourself. The benefit of a scripting engine is that it can delay the execution of a fired input until the next update cycle, which will prevent a bad script from creating an infinite script loop and freezing the game. This is why the Update function makes a copy of the fire list.</p>
<p>The only piece of the puzzle left is getting these scripts from the editor to the game. I use XNA's built in XML serializer. Actually, this is the only part of the article that actually depends on XNA. The XML Serializer is great, and it's already integrated into the content pipeline. But it has a few flaws. Notably, our script is a graph, and the XML Serializer can't handle a graph. We have to flatten it first, by which I mean replace all the references with simple indicies we can use to restore the references at load time. You could keep the script in a flat format all the time, but I found it was easier to flatten and restore than to work with the flat format all the time.</p>
<p>Flattening isn't complicated. First, assign all the objects an id. Then, copy the id of the referenced object into the terminal. The XML Serializer can be setup to serialize that id, and not the reference.</p>
<p>If game objects and entity components are themselves script nodes, this will allow you to attach scripts to all sorts of things. A health component, for example, could have an output terminal that it fires when the game object it is attached to dies. Now a script can be attached to an object's death very easily.</p>
<p>In a traditional scripting system, it can be pretty hard to tell what's going on in a level, especially if you aren't the level designer that built it. A node-based scripting system solves this problem. In a traditional system, what you see in the level editor is a filename. With this node-based system, the script is right there, in the level. This can be a disadvantage too.</p>
<p>It's a pain to build a complex script over and over for different levels, so the editor should be able to import a script into the level. The Jemgine level editor can import entire levels into another, so I can create a level that includes not just the script but the objects it operates on. This solves one of the disadvantages, but if there is an error in the original script, fixing that script won't fix every level that uses it. We've traded this 'fix in one place' for a bit of additional flexibility. Because the script is copied into the level, we can make customizations to the script specific to that level.</p>
<p>When you first start working with a scripting system like this, it's going to seem like there is no advantage at all. You'll still have level designers taking up valuable programmer time, but instead of scripts the programmers will be writing nodes. Eventually you'll build up a large library of script nodes and the level designers will find fewer and fewer things to bug the programmers about.</p>
<p>At first, the level designers just won't get it. You probably won't get it either. But after you write a few scripts, after you solve a few problems, it will click, and soon your level designers will be doing things you had never imagined.</p>
<p>This is a script for a door I created in the Jemgine level Editor.</p>
<p><img src="http://www.sgtconker.com/wp-content/uploads/contest/2010/blecki/DoorScript.jpg" alt="Door Script" /></p>
<p>In this script, there are two game objects. One is the door itself, the other implements the trigger zone for the door's button. The nodes labelled 'PolygonPhysics' are entity components attached to the game objects that interact with the engine's physics sub system. When the player touches the trigger zone, the PolygonPhysics component fires it's OnContact output. This is connected to a UseAction node, which will wait until the player presses a button before firing it's output. So if the player is touching the trigger zone, and presses the button, the UseAction node will fire that relay, which fires four other nodes. MoveEntity does exactly what you would expect. Disable disables the original switch, so the player can't press it again. Show and Hide work together with two other game objects (Switch On, and Switch Off) to change the switch graphic. Finally, MoveEntity plays some sounds.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/09/article-node-based-scripting/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Jemgine.Hex now available for download</title>
		<link>http://www.sgtconker.com/2010/08/jemgine-hex-now-available-for-download/</link>
		<comments>http://www.sgtconker.com/2010/08/jemgine-hex-now-available-for-download/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 04:21:11 +0000</pubDate>
		<dc:creator>Sgt. Conker</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Blecki]]></category>
		<category><![CDATA[Engine]]></category>
		<category><![CDATA[JEmgine]]></category>
		<category><![CDATA[Jemgine.Hex]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1604</guid>
		<description><![CDATA[
Our friend Blecki has released another project called Jemgine.Hex.
Here's some info from his codeplex project.
Jemgine.Hex implements a subdivideable hexagonal grid for XNA projects. Jemgine.Hex makes it easy to create hexagonal grids in vertical and horizontal orientations and to do mouse picking on them. It's written in C#.
All source is for XNA 4.0, but the library [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Jemgine.Hex" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=jemginehex&amp;DownloadId=144857" alt="" width="384" height="230" /><br />
Our friend Blecki has released another project called Jemgine.Hex.</p>
<p>Here's some info from his codeplex project.</p>
<p>Jemgine.Hex implements a subdivideable hexagonal grid for XNA projects. Jemgine.Hex makes it easy to create hexagonal grids in vertical and horizontal orientations and to do mouse picking on them. It's written in C#.</p>
<p>All source is for XNA 4.0, but the library itself will compile against XNA 3.1 if it's references are changed. The demo project will not.</p>
<p>The HexDemo project contains examples of<br />
*Rendering hexagonal grids<br />
*Generating a series of subdivided grids<br />
*Detecting the tile under the mouse of several subdivision levels</p>
<p>Please go check it out <a href="http://jemginehex.codeplex.com/">here</a></p>
<p style="text-align: center;">You can also see the Blecki's Jemgine XNA Engine which is a very fast maturing engine for XNA <a href="http://jemgine.codeplex.com/">here</a></p>
<p style="text-align: center;"><a href="http://jemgine.codeplex.com/"></a><br />
<img class="aligncenter" title="Jemgine" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=jemgine&amp;DownloadId=137418" alt="" width="512" height="320" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/08/jemgine-hex-now-available-for-download/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Recent News : XNA Still exists!</title>
		<link>http://www.sgtconker.com/2010/04/recent-news-xna-still-exists/</link>
		<comments>http://www.sgtconker.com/2010/04/recent-news-xna-still-exists/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 10:33:49 +0000</pubDate>
		<dc:creator>Sgt. Conker</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Engines]]></category>
		<category><![CDATA[JEmgine]]></category>
		<category><![CDATA[Shawn Hargreaves]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1392</guid>
		<description><![CDATA[We think everyone must be busy playing with XNA 4 and WP7 tools as we're very light on news recently.
Here's a short brief round-up of some of the things we've heard about on the grapevine.
Mr "I don't provide screenshots" Blecki has released an Alpha 3 version of Jemgine. I here and now request that this [...]]]></description>
			<content:encoded><![CDATA[<p>We think everyone must be busy playing with XNA 4 and WP7 tools as we're very light on news recently.<br />
Here's a short brief round-up of some of the things we've heard about on the grapevine.</p>
<p><a href="http://jemgine.omnisu.com/">Mr "I don't provide screenshots" Blecki</a> has released an <a href="http://jemgine.omnisu.com/?p=336">Alpha 3</a> version of Jemgine. I here and now request that this gets published to codeplex so it's easier for interested parties to keep up to date.<br />
There's also a pretty cool <a href="http://jemgine.omnisu.com/?p=334">video </a>of his engine in action.</p>
<p><a href="http://blogs.msdn.com/shawnhar">Shawn "The Prophet" Hargreaves </a>keeps us refreshed on changes in XNA 4.0 with this goodbye to ElapsedRealTime and TotalRealTime. Take a read <a href="http://blogs.msdn.com/shawnhar/archive/2010/04/13/elapsedrealtime-and-totalrealtime-in-xna-game-studio-4-0.aspx">here</a></p>
<p>Jeromy "No Nickname" Walsh has launched a new website relating to game development called <a href="http://gamedevelopedia.com/">GameDevelopedia.com</a>. He's just published his first for the site. First of many let's hope. <a href="http://gamedevelopedia.com/post/NeHe-Tutorial-1.aspx">Check it out here</a></p>
<p>Heard about VS2010 RTM ? Never mind. It's not officially supported with the Windows Phone 7 tools. My advice would be to ignore it for now until there is an update to the Windows Phone tools. <a href="http://windowsteamblog.com/blogs/wpdev/archive/2010/04/12/visual-studio-2010-rtm-and-the-windows-phone-developer-tools-ctp.aspx">Here's some more details on that story</a></p>
<p>Another interesting WP7 related post on the official dev blog.<br />
<a href="http://windowsteamblog.com/blogs/wpdev/archive/2010/04/08/automatic-rotation-support-or-automatic-multi-orientation-layout-support-for-windows-phone.aspx">Automatic Rotation Support or Automatic Multi-Orientation Layout Support for Windows Phone</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/04/recent-news-xna-still-exists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jemgine Editor Alpha</title>
		<link>http://www.sgtconker.com/2010/03/jemgine-editor-alpha/</link>
		<comments>http://www.sgtconker.com/2010/03/jemgine-editor-alpha/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 01:06:57 +0000</pubDate>
		<dc:creator>Sgt. Conker</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[JEmgine]]></category>
		<category><![CDATA[Map editor]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1282</guid>
		<description><![CDATA[Mr "I don't provide screenshots" Blecki has announced an updated build of his Jemgine map editor.
Some key points he makes.

A 2d platformer engine with 'advanced physics'.
A feature-rich editor (That one up there!)
A single-player 'test game' to use as a base and guide for the engine.
My eternal love and support.

More details here
]]></description>
			<content:encoded><![CDATA[<p><a href="http://jemgine.omnisu.com">Mr "I don't provide screenshots" Blecki</a> has announced an updated build of his Jemgine map editor.</p>
<p>Some key points he makes.</p>
<ul>
<li>A 2d platformer engine with 'advanced physics'.</li>
<li>A feature-rich editor (That one up there!)</li>
<li>A single-player 'test game' to use as a base and guide for the engine.</li>
<li>My eternal love and support.</li>
</ul>
<p>More details <a href="http://jemgine.omnisu.com/?p=319">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/jemgine-editor-alpha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>48 hour shmup</title>
		<link>http://www.sgtconker.com/2010/02/48-hour-shmup/</link>
		<comments>http://www.sgtconker.com/2010/02/48-hour-shmup/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 21:14:14 +0000</pubDate>
		<dc:creator>Sgt. Conker</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[JEmgine]]></category>
		<category><![CDATA[Shmup]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1138</guid>
		<description><![CDATA[
Blecki, the man behind jemgine has released news of his 48 hour shmup project.
He's provided an updated video and a download for you to try out.
"It uses XNA, of course. You'll need the 3.1 redist. http://www.microsoft.com/downloads/details.aspx?FamilyID=53867a2a-e249-4560-8011-98eb3e799ef2&#38;displaylang=en"
More details over here
]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://jemgine.omnisu.com/wp-content/uploads/2010/02/shmup2.jpg" alt="" width="294" height="181" /></p>
<p>Blecki, the man behind <a href="http://jemgine.omnisu.com">jemgine</a> has released news of his 48 hour shmup project.<br />
He's provided an updated video and a download for you to try out.</p>
<p><em>"It uses XNA, of course. You'll need the 3.1 redist. http://www.microsoft.com/downloads/details.aspx?FamilyID=53867a2a-e249-4560-8011-98eb3e799ef2&amp;displaylang=en"</em></p>
<p><em><span style="font-style: normal;">More details over <a href="http://jemgine.omnisu.com/?p=282">here</a></span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/02/48-hour-shmup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

