<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF
	xmlns="http://purl.org/rss/1.0/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel rdf:about="http://feeds.garagegames.com/rss/blogs/developer/110205/">
		<title>Blog for David Everhart at GarageGames.com</title>
		<description>Blog feeds for Gamers and Developers in the GarageGames community.</description>
		<link>http://www.garagegames.com/</link>
		<image rdf:resource="http://www.garagegames.com/images/GarageGames_logo_small_w.gif" />
		<dc:date>2008-11-22T05:50:02+00:00</dc:date>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/15357"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/15035"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/14937"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/14210"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/14116"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/13993"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/13970"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/13933"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/13910"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/110205/13891"/>
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="http://www.garagegames.com/blogs/110205/15357">
		<dc:format>text/html</dc:format>
		<dc:date>2008-09-03T03:23:08+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>TorqueX 3D Hiding Meshes Part 2</title>
		<link>http://www.garagegames.com/blogs/110205/15357</link>
		<description>&lt;b&gt;Update on Hiding Meshes&lt;/b&gt;&lt;br&gt;&lt;br&gt;I have finally completed my testing on my art asset creation. In my last blog, I had a barebones static mesh , that was able to hide and show meshes using my MeshManager class. I have since updated that class, and added some error handling, refactored some of the functions, replaced one of the loops with a find call, added xml definitions , and changed the return value to a MeshManagerResult object , which contains the status and any error messages. Here it is in its full glory:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;using System;&lt;br&gt;using System.Collections.Generic;&lt;br&gt;using System.Text;&lt;br&gt;using GarageGames.Torque.Core;&lt;br&gt;using GarageGames.Torque.T3D;&lt;br&gt;namespace StarterGame3D&lt;br&gt;{&lt;br&gt;    /// &amp;lt;summary&amp;gt;&lt;br&gt;    /// This class manages meshes and their visibility. It uses static methods that can be called from anywhere. &lt;br&gt;    /// &amp;lt;/summary&amp;gt;&lt;br&gt;    public class MeshManager&lt;br&gt;    {&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This Method allows you to turn a meshs visibility on&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;modelName&amp;quot;&amp;gt;This is the name of the model in the TorqueObjectDatabase. &amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;meshName&amp;quot;&amp;gt;This is the name of the mesh in the model you want to show&amp;lt;/param&amp;gt;&lt;br&gt;        public static MeshManagerResult ShowMesh(string modelName, string meshName)&lt;br&gt;        {&lt;br&gt;            return SetMeshVisibility(modelName,meshName, true);  &lt;br&gt;        }&lt;br&gt;&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This Method allows you to turn a meshs visibility off&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;modelName&amp;quot;&amp;gt;This is the name of the model in the TorqueObjectDatabase. &amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;meshName&amp;quot;&amp;gt;This is the name of the mesh in the model you want to hide&amp;lt;/param&amp;gt;&lt;br&gt;        public static MeshManagerResult HideMesh(string modelName, string meshName)&lt;br&gt;        {&lt;br&gt;            return SetMeshVisibility(modelName, meshName, false);&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This Method allows you to turn off the visibility for all meshs in a model&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;modelName&amp;quot;&amp;gt;This is the name of the model in the TorqueObjectDatabase. &amp;lt;/param&amp;gt;&lt;br&gt;        public static MeshManagerResult HideAllMeshes(string modelName)&lt;br&gt;        {&lt;br&gt;            return SetMeshVisibility(modelName, false);  &lt;br&gt;        }&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This Method allows you to turn on the visibility for all meshs in a model&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;modelName&amp;quot;&amp;gt;This is the name of the model in the TorqueObjectDatabase. &amp;lt;/param&amp;gt;&lt;br&gt;        public static MeshManagerResult ShowAllMeshes(string modelName)&lt;br&gt;        {&lt;br&gt;            return SetMeshVisibility(modelName, true);  &lt;br&gt;        }&lt;br&gt;&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This Method is the first overloaded method that allows you to turn&lt;br&gt;        /// off or on all the mesh's visibility in a model. &lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;modelName&amp;quot;&amp;gt;This is the name of the model in the TorqueObjectDatabase. &amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;visible&amp;quot;&amp;gt;This is a flag to indicate whether to turn all the model's meshes visibility on or off. true = turn on, false = turn off&amp;lt;/param&amp;gt;&lt;br&gt;        private static MeshManagerResult SetMeshVisibility(string modelName, bool visible)&lt;br&gt;        {&lt;br&gt;            MeshManagerResult result = new MeshManagerResult();&lt;br&gt;            TorqueObject model = TorqueObjectDatabase.Instance.FindObject&amp;lt;TorqueObject&amp;gt;(modelName);&lt;br&gt;            if (model != null)&lt;br&gt;            {&lt;br&gt;                T3DTSRenderComponent componentRender = model.Components.FindComponent&amp;lt;T3DTSRenderComponent&amp;gt;();&lt;br&gt;                for (int meshIndex = 0; meshIndex &amp;lt; componentRender.Shape.Objects.Length; meshIndex++)&lt;br&gt;                {&lt;br&gt;                    if (visible)&lt;br&gt;                    {&lt;br&gt;                        componentRender.ShapeInstance.MeshObjects[meshIndex].Visibility = 1.0f;&lt;br&gt;                    }&lt;br&gt;                    else&lt;br&gt;                    {&lt;br&gt;                        componentRender.ShapeInstance.MeshObjects[meshIndex].Visibility = 0.0f;&lt;br&gt;                    }&lt;br&gt;                }&lt;br&gt;                result.Status = MeshManagerResult.StatusType.Success;&lt;br&gt;            }&lt;br&gt;            else&lt;br&gt;            {&lt;br&gt;                result.Status = MeshManagerResult.StatusType.Failed;&lt;br&gt;                result.ErrorMessage = &amp;quot;Could not find a model in TorqueObjectDatabase named &amp;quot; + modelName;&lt;br&gt;            }&lt;br&gt;            return result;&lt;br&gt;        }&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This Method is the second overloaded method that allows you to turn&lt;br&gt;        /// off or on all the mesh's visibility in a model. &lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;modelName&amp;quot;&amp;gt;This is the name of the model in the TorqueObjectDatabase. &amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;meshName&amp;quot;&amp;gt;This is the name of the mesh in the model&amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;visible&amp;quot;&amp;gt;This is a flag to indiciate whether to turn the mesh's visibility on or off. true = turn on, false = turn off&amp;lt;/param&amp;gt;&lt;br&gt;        private static MeshManagerResult SetMeshVisibility(string modelName, string meshName, bool visible)&lt;br&gt;        {&lt;br&gt;            MeshManagerResult result = new MeshManagerResult();&lt;br&gt;            TorqueObject model = TorqueObjectDatabase.Instance.FindObject&amp;lt;TorqueObject&amp;gt;(modelName);&lt;br&gt;            if (model != null)&lt;br&gt;            {&lt;br&gt;                T3DTSRenderComponent componentRender = model.Components.FindComponent&amp;lt;T3DTSRenderComponent&amp;gt;();&lt;br&gt;                int meshIndex = componentRender.Shape.FindObject(meshName);&lt;br&gt;                if(meshIndex &amp;gt; -1)&lt;br&gt;                {&lt;br&gt;                    if (visible)&lt;br&gt;                    {&lt;br&gt;                        componentRender.ShapeInstance.MeshObjects[meshIndex].Visibility = 1.0f;&lt;br&gt;                    }&lt;br&gt;                    else&lt;br&gt;                    {&lt;br&gt;                        componentRender.ShapeInstance.MeshObjects[meshIndex].Visibility = 0.0f;&lt;br&gt;                    }&lt;br&gt;                    result.Status = MeshManagerResult.StatusType.Success;&lt;br&gt;                }&lt;br&gt;                else&lt;br&gt;                {&lt;br&gt;                    result.Status = MeshManagerResult.StatusType.Failed;&lt;br&gt;                    result.ErrorMessage = &amp;quot;Could not find a mesh in the shape named &amp;quot; + meshName;&lt;br&gt;                }&lt;br&gt;            }&lt;br&gt;            else&lt;br&gt;            {&lt;br&gt;                result.Status = MeshManagerResult.StatusType.Failed;&lt;br&gt;                result.ErrorMessage = &amp;quot;Could not find a model in TorqueObjectDatabase named &amp;quot; + modelName;&lt;br&gt;            }&lt;br&gt;&lt;br&gt;            return result;&lt;br&gt;&lt;br&gt;        }&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This method will get all meshes and the state of their visibility. It returns a List&amp;lt;string&amp;gt; &lt;br&gt;        /// where each string is in the format of MeshName: [nameofmesh] ||Visibility: [visible or not]&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;modelName&amp;quot;&amp;gt;This is the name of the model in the TorqueObjectDatabase.&amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;showHidden&amp;quot;&amp;gt;Flag to indicate to show hidden or not&amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;showVisible&amp;quot;&amp;gt;Flag to indicate to show visible or not&amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br&gt;         public static List&amp;lt;string&amp;gt; ListMeshes(string modelName,bool showHidden, bool showVisible)&lt;br&gt;        {&lt;br&gt;            List&amp;lt;string&amp;gt; meshes = new List&amp;lt;string&amp;gt;();&lt;br&gt;            TorqueObject model = TorqueObjectDatabase.Instance.FindObject&amp;lt;TorqueObject&amp;gt;(modelName);&lt;br&gt;            if (model != null)&lt;br&gt;            {&lt;br&gt;                T3DTSRenderComponent componentRender = model.Components.FindComponent&amp;lt;T3DTSRenderComponent&amp;gt;();&lt;br&gt;               &lt;br&gt;                string mesh = &amp;quot;&amp;quot;;&lt;br&gt;                for (int objectIndex = 0; objectIndex &amp;lt; componentRender.Shape.Objects.Length; objectIndex++)&lt;br&gt;                {&lt;br&gt;                    float meshVisibility = componentRender.ShapeInstance.MeshObjects[objectIndex].Visibility;&lt;br&gt;&lt;br&gt;                    if (showVisible &amp;amp;&amp;amp; meshVisibility == 1.0f)&lt;br&gt;                    {&lt;br&gt;                        mesh = &amp;quot;MeshName:&amp;quot; + componentRender.Shape.Names[componentRender.Shape.Objects[objectIndex].NameIndex] + &amp;quot;||Visibility:Visible&amp;quot;;&lt;br&gt;                        meshes.Add(mesh);&lt;br&gt;                    }&lt;br&gt;                    if (showHidden &amp;amp;&amp;amp; meshVisibility == 0.0f)&lt;br&gt;                    {&lt;br&gt;                        mesh = &amp;quot;MeshName:&amp;quot; + componentRender.Shape.Names[componentRender.Shape.Objects[objectIndex].NameIndex] + &amp;quot;||Visibility:Hidden&amp;quot;;&lt;br&gt;                        meshes.Add(mesh);&lt;br&gt;                    }&lt;br&gt;                }&lt;br&gt;            }&lt;br&gt;            return meshes;&lt;br&gt;        }&lt;br&gt;&lt;br&gt;    }&lt;br&gt;    /// &amp;lt;summary&amp;gt;&lt;br&gt;    /// This class represents the result of a MeshManager call&lt;br&gt;    /// &amp;lt;/summary&amp;gt;&lt;br&gt;    public class MeshManagerResult&lt;br&gt;    {&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This enumeration represents the status of the call&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        public enum StatusType&lt;br&gt;        {&lt;br&gt;            /// &amp;lt;summary&amp;gt;&lt;br&gt;            /// This means the function call was successful&lt;br&gt;            /// &amp;lt;/summary&amp;gt;&lt;br&gt;            Success,&lt;br&gt;            /// &amp;lt;summary&amp;gt;&lt;br&gt;            /// This means the function call was not successful&lt;br&gt;            /// &amp;lt;/summary&amp;gt;&lt;br&gt;            Failed&lt;br&gt;        }&lt;br&gt;        private string _errorMessage=&amp;quot;&amp;quot;;&lt;br&gt;        private StatusType _status;&lt;br&gt;&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This is populated if the Status = Failed with the proper error message&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        public string ErrorMessage&lt;br&gt;        {&lt;br&gt;            get { return _errorMessage;}&lt;br&gt;            set { _errorMessage = value; }&lt;br&gt;        }&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This Status of the call&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        public StatusType Status&lt;br&gt;        {&lt;br&gt;            get { return _status; }&lt;br&gt;            set { _status = value; }&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;This can be used in conjunction with the &amp;quot;Extending the Torque X Console&amp;quot; resource found here:&lt;br&gt;&lt;br&gt;&lt;a href='http://tdn.garagegames.com/wiki/TorqueX/ExtendingTXConsole' target=_blank&gt;Extending the Torque Console&lt;/a&gt;&lt;br&gt;&lt;br&gt;I put in all my console methods into one class called ConsoleMethods. For instance, to be able to type ShowMesh(modelname,meshname) from the Torque Console (accessed by hitting the ' key), I just added this:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;#define TORQUE_CONSOLE&lt;br&gt;using System;&lt;br&gt;using System.Collections.Generic;&lt;br&gt;using System.Text;&lt;br&gt;using GarageGames.Torque.Core;&lt;br&gt;using GarageGames.Torque.SceneGraph;&lt;br&gt;using GarageGames.Torque.Sim;&lt;br&gt;using GarageGames.Torque.GameUtil;&lt;br&gt;using GarageGames.Torque.T2D;&lt;br&gt;using GarageGames.Torque.Platform;&lt;br&gt;using GarageGames.Torque.GUI;&lt;br&gt;using GarageGames.Torque.T3D;&lt;br&gt;using GarageGames.Torque.TS;&lt;br&gt;using GarageGames.Torque.GFX;&lt;br&gt;using GarageGames.Torque.Util;&lt;br&gt;&lt;br&gt;namespace StarterGame3D&lt;br&gt;{&lt;br&gt;    /// &amp;lt;summary&amp;gt;&lt;br&gt;    /// This class encapsulates all the custom methods that can be called from the Torque Console&lt;br&gt;    /// &amp;lt;/summary&amp;gt;&lt;br&gt;    public class ConsoleMethods&lt;br&gt;    {&lt;br&gt;&lt;br&gt;        /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This method allows you to turn a meshs visibility on in a model. &lt;br&gt;        /// From the command line, you can access it via :  ShowMesh(modelname,meshname)&lt;br&gt;        /// You do not need quotes to surround the modelname or meshname.&lt;br&gt;        /// example: ShowMesh(Player,Boots)&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;error&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;parameters&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br&gt;        public static bool ShowMesh(out string error, string[] parameters)&lt;br&gt;        {&lt;br&gt;            error = null;&lt;br&gt;&lt;br&gt;#if !TORQUE_CONSOLE&lt;br&gt;            Assert.Warn(false, &amp;quot;Warning: TORQUE_CONSOLE not defined, output won't be displayed!&amp;quot;);&lt;br&gt;#endif&lt;br&gt;            // Print out all the parameters&lt;br&gt;            if (parameters.Length == 0)&lt;br&gt;                TorqueConsole.Echo(&amp;quot;No parameters passed into ShowMesh()&amp;quot;);&lt;br&gt;            else&lt;br&gt;            {&lt;br&gt;                for (int x = 0; x &amp;lt; parameters.Length; x++)&lt;br&gt;                {&lt;br&gt;                    TorqueConsole.Echo(&amp;quot;Parameter #&amp;quot; + x + &amp;quot; = &amp;quot; + parameters[x]);&lt;br&gt;                }&lt;br&gt;                MeshManagerResult result = MeshManager.ShowMesh(parameters[0], parameters[1]);&lt;br&gt;                if (result.Status == MeshManagerResult.StatusType.Success)&lt;br&gt;                {&lt;br&gt;                    TorqueConsole.Echo(parameters[1] + &amp;quot; is Visible&amp;quot;);&lt;br&gt;                }&lt;br&gt;                else&lt;br&gt;                {&lt;br&gt;                    TorqueConsole.Echo(result.ErrorMessage);&lt;br&gt;                }&lt;br&gt;            }&lt;br&gt;            &lt;br&gt;            return true;&lt;br&gt;        }&lt;br&gt;  }&lt;br&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;I have a lot more methods defined than that, and some that deal with anmations, such as:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;  /// &amp;lt;summary&amp;gt;&lt;br&gt;        /// This method allows you to play an animation. &lt;br&gt;        /// From the command line, you can access it via :  PlayAnimation(modelname,animationName)&lt;br&gt;        /// You do not need quotes to surround the modelname.&lt;br&gt;        /// example: PlayAnimation(Player)&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;error&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;param name=&amp;quot;parameters&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br&gt;        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br&gt;        public static bool PlayAnimation(out string error, string[] parameters)&lt;br&gt;        {&lt;br&gt;            error = null;&lt;br&gt;&lt;br&gt;#if !TORQUE_CONSOLE&lt;br&gt;            Assert.Warn(false, &amp;quot;Warning: TORQUE_CONSOLE not defined, output won't be displayed!&amp;quot;);&lt;br&gt;#endif&lt;br&gt;            // Print out all the parameters&lt;br&gt;            if (parameters.Length == 0)&lt;br&gt;                TorqueConsole.Echo(&amp;quot;No parameters passed into ShowMesh()&amp;quot;);&lt;br&gt;            else&lt;br&gt;            {&lt;br&gt;                for (int x = 0; x &amp;lt; parameters.Length; x++)&lt;br&gt;                {&lt;br&gt;                    TorqueConsole.Echo(&amp;quot;Parameter #&amp;quot; + x + &amp;quot; = &amp;quot; + parameters[x]);&lt;br&gt;                }&lt;br&gt;                TorqueObject model = TorqueObjectDatabase.Instance.FindObject&amp;lt;TorqueObject&amp;gt;(parameters[0]);&lt;br&gt;                T3DAnimationComponent animationComponent = model.Components.FindComponent&amp;lt;T3DAnimationComponent&amp;gt;();&lt;br&gt;                Animation animation = animationComponent.GetAnimation(parameters[1]);&lt;br&gt;                if (animation != null)&lt;br&gt;                {&lt;br&gt;                    animation.Play();&lt;br&gt;                    TorqueConsole.Echo(&amp;quot;Playing Animation&amp;quot;);&lt;br&gt;                }&lt;br&gt;                else&lt;br&gt;                {&lt;br&gt;                    TorqueConsole.Echo(&amp;quot;Could not find &amp;quot; + parameters[1]);&lt;br&gt;                }&lt;br&gt;            }&lt;br&gt;&lt;br&gt;            return true;&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;Once you have your ConsoleMethods class, all it takes to be able to call it then is this in your begin run:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;            CustomConsoleMethodPool customPool = new CustomConsoleMethodPool();&lt;br&gt;            customPool.RegisterMethod(ConsoleMethods.ShowMesh);&lt;br&gt;            customPool.RegisterMethod(ConsoleMethods.HideMesh);&lt;br&gt;            customPool.RegisterMethod(ConsoleMethods.HideAllMeshes);&lt;br&gt;            customPool.RegisterMethod(ConsoleMethods.ShowAllMeshes);&lt;br&gt;            customPool.RegisterMethod(ConsoleMethods.ListMeshes);&lt;br&gt;            customPool.RegisterMethod(ConsoleMethods.PlayAnimation);&lt;br&gt;            customPool.RegisterMethod(ConsoleMethods.StopAnimation);&lt;br&gt;            TorqueConsole.MethodPool = customPool ;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;You can then do any type of initialization such as:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;            string modelName = &amp;quot;Player&amp;quot;;&lt;br&gt;            MeshManager.HideAllMeshes(modelName);&lt;br&gt;            MeshManager.ShowMesh(modelName, &amp;quot;Default&amp;quot;);&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;Animations&lt;/b&gt;&lt;br&gt;&lt;br&gt;This took me a while to get going. I originally had every peice , per my last blog, of the player , on seperate layers, aka the default model was spread across 5 layers, and the gear he could use was spread across 5 layers. After doing some research on the various approaches, I think I have found a more common method of doing it. I now have one layer containing a default mesh which is the full body with all parts (head, chest, arms, feet, legs). Then, for the gear he can wear, it still resides on the different layers. Here is the new default testguy:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2823010635/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3066/2823010635_c16da1d666_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;The other 5 layers house individual peices of equipment, and are colored red. I took this into layout, and added one bone in the chest, as seen here:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2823852316/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3089/2823852316_c58f1df317_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;Here is the mesh setup in Layout:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2823046195/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3143/2823046195_6a7d3dfb2d_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;With this bone, I created 3 keyframes. At keyframe 0, it was in its rest position. At Keyframe 15, it was rotated horizontally 45 degrees. At KeyFrame 30, it went back to its rest position. This was a very basic animation, and I just wanted to see if I could get it into TorqueX, and then call it. Once I had my basic animation setup, I exported it as a DSQ using our good friend the LW2DTS plugin. I had to use the animation tabs to export the DSQ. One gotcha, is to make sure all your nodes are exported, , as seen below:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2823878794/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3256/2823878794_1e8cce5a39_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;And you also have to make sure your objects are used in the sequence, as below:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2823046165/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3171/2823046165_5d5ce63abc_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;Once I had the  DTS and DSQ, and verified it worked in Torque Showtool Pro, I put it into the game. Here is a shot where the animation is playing, and I show the head mesh (which would   realistically be more like a helm or hair) and the model is in its rest pose:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2823924174/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3098/2823924174_562376092f_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;Here you can see it rotating per the animation:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2823924212/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3177/2823924212_558b32d8ac_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;Here you can see the new console method I put in to stop the animation:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2823924274/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3141/2823924274_4291b3865c_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;Originally, it was only playing one frame, then stopping. After several weeks, and even some correspondence with Andy Hawkins on model setup (his lightwave information is priceless), I figured out that the T3DTSRenderComponent requires an updateanimation call. So on my Player Component, I added a call to updateanimation in the process tick function:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;public void ProcessTick(Move move, float dt)&lt;br&gt;        {&lt;br&gt;             if (move != null)&lt;br&gt;            {&lt;br&gt;                _renderComponent.UpdateAnimation(dt);&lt;br&gt;            }&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;In the starter fps demo, they use an animationFSM, but I was just testing a basic animation. Here is the xml for my animation component:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;&amp;lt;AnimationComponent type=&amp;quot;GarageGames.Torque.T3D.T3DAnimationComponent&amp;quot;&amp;gt;&lt;br&gt;          &amp;lt;SceneGroupName&amp;gt;PlayerMesh&amp;lt;/SceneGroupName&amp;gt;&lt;br&gt;          &amp;lt;Animations&amp;gt;&lt;br&gt;            &amp;lt;Animation type=&amp;quot;GarageGames.Torque.T3D.TSAnimation&amp;quot;&amp;gt;&lt;br&gt;              &amp;lt;ThreadName&amp;gt;ActionThread&amp;lt;/ThreadName&amp;gt;&lt;br&gt;              &amp;lt;SequenceFilename&amp;gt;data\Skeleton\test.dsq&amp;lt;/SequenceFilename&amp;gt;&lt;br&gt;              &amp;lt;Name&amp;gt;Rotate&amp;lt;/Name&amp;gt;&lt;br&gt;            &amp;lt;/Animation&amp;gt;&lt;br&gt;          &amp;lt;/Animations&amp;gt;&lt;br&gt;        &amp;lt;/AnimationComponent&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;There are some who are having issues having animations run through code only, but that does not surprise me. There seems to be a very heavy focus on having things load through the Torque Deserializer (Like the physic states), which seems like a really odd design choice. I would have thought that you could programmtically setup everything you need without the XML. Then again, I am still new to game engines, so maybe this is how it is supposed to be done. &lt;br&gt;&lt;br&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;br&gt;&lt;br&gt;I now have my asset creation pipeline functional, and can do basic animations as well as show and hide meshes on demand.  I also added some code to handle the toggling of a camera, which was no walk in the park hehe. One thing I noticed was when I switched cameras, I had to make sure it continued to update the animatin, otherwise it would stop. Nonetheless, I have got a lot done, and now with my pipeline defined, and Hiding Mesh class working solid, I am on the right track. I am currently testing John Kanalkis excellent 3d Builder, and will probably attempt to create a generic room, with some artifacts in it as my next step. Until then!</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/110205/15035">
		<dc:format>text/html</dc:format>
		<dc:date>2008-07-09T02:26:50+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>TorqueX - First Stab at Hiding Mesh Resource</title>
		<link>http://www.garagegames.com/blogs/110205/15035</link>
		<description>When I started to think of character customization, I was doing Arillian in 2D at the time. I used an approach similar to Diablo 2's style. However, per my last blog post, I am now in the 3D world. I looked around, and came upon a resource:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.garagegames.com/index.php?sec=mg&amp;amp;mod=resource&amp;amp;page=view&amp;amp;qid=5421'&gt;Hiding Meshes resource&lt;/a&gt;&lt;br&gt;&lt;br&gt;I studied it and researched all the pieces it touched. I asked on the forums if anyone had attempted this, but had no replies. I rolled up my sleeves, and decided to take a stab at it. I decided to do a prototype, and see if I could get the meshes to swap in and out at runtime. One of the first questions I had was, how the heck do you build your model? I didnt really know how to go about this , so did some research, and realized I needed a model made up of multiple meshes. &lt;br&gt;&lt;br&gt;In Lightwave 9, They use layers, like in photoshop. The thought crossed my mind, that maybe I could model the various bodyparts on individual layers, then export the model. I built a basic testman, with 5 layers dedicated to a blue testman, and 5 layers dedicated to a red testman. Below are some pictures. &lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2651688690/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3148/2651688690_c6de0917b9_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;This picture shows blue feet on layer 1 (Circled in red). &lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2651688718/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3058/2651688718_e81c5df60c_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;This picture shows blue Legs on layer 2 (Circled in red). &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2651688768/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3076/2651688768_5925f4f2cb_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;This picture shows all 5 layers for the blue testman (Layers 1-5 circled in red) . &lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2651688744/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3276/2651688744_c2a1a68cd3_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;This picture shows all 5 layers for the redtestman (Layers 11-15 circled in red) . The reason the layers arent 6-10 is because I wanted each layer bank (10 layers) to house one character setup. When you export, you can hide the layers with nothing on them . &lt;br&gt;&lt;br&gt;In all, I used 10 layers. Now I had to export the model to a DTS. Below are some pictures of that:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2651688812/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3222/2651688812_ec9b0b1e7a_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;This picture shows the meshes it found in the model.&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2650864067/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3235/2650864067_43f1571e04_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;The DTSNames are horrible, so I decided to change them, and I had to set each of them to export as a node or mesh, as depicted in the picture above. &lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2651688884/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3146/2651688884_b7bfe1afe8_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;When it was all set, the export looked like the above. Now that I had My model, it was time to get the model into the game. I used John Kanalkis's Create Player Function to do just that. I popped it into my game.cs.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;public void CreatePlayer() &lt;br&gt;        {  &lt;br&gt;            //create the simple torque object    &lt;br&gt;            TorqueObject objPlayer = new TorqueObject();&lt;br&gt;            objPlayer.Name = &amp;quot;CurrentPlayer&amp;quot;;&lt;br&gt;            //create the render component&lt;br&gt;            T3DTSRenderComponent componentRender = new T3DTSRenderComponent();&lt;br&gt;            componentRender.ShapeName = @&amp;quot;data\Skeleton\test.dts&amp;quot;;      &lt;br&gt;            //create the scene component    &lt;br&gt;            T3DSceneComponent componentScene = new T3DSceneComponent();&lt;br&gt;            componentScene.Position = new Vector3(1024, 1024, 295);&lt;br&gt;            //add both of the components&lt;br&gt;            objPlayer.Components.AddComponent(componentRender);&lt;br&gt;            objPlayer.Components.AddComponent(componentScene);&lt;br&gt;            //register the object&lt;br&gt;            TorqueObjectDatabase.Instance.Register(objPlayer);&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;I added a name to the model, so I can reference it later on. The next step I had to figure out , was how do you actually turn the meshes on and off. Looking at the C++ Hiding resources, it looked like they were manipulating the visibility of the meshes. So after some digging, I found it in the tsShapeInstance class. There is an internal _meshObjects that is an objectinstance[]. I needed to manipulate the meshes in there, so I added a public property to the class. &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;/// &amp;lt;summary&amp;gt;&lt;br&gt;        /// Gets and sets the array of meshes for the shape.&lt;br&gt;        /// &amp;lt;/summary&amp;gt;&lt;br&gt;        public ObjectInstance[] MeshObjects&lt;br&gt;        {&lt;br&gt;            get { return _meshObjects; }&lt;br&gt;            set { _meshObjects = value; }&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;Now that I had access to the meshes, I needed to be able to control the visibility of them. I decided to group all the related mesh functionality into a class called MeshManager . I decided to make it a static class , although a singleton could have worked as well. It has 5 functions:&lt;br&gt;&lt;br&gt;ShowMesh(string modelName,string meshName)&lt;br&gt;HideMesh(string modelName, string meshName)&lt;br&gt;HideAllMeshes(string modelName)&lt;br&gt;ShowAllMeshes(string modelName)&lt;br&gt;ListMeshes(string modelName,bool showHidden, bool showVisible)&lt;br&gt;&lt;br&gt;Here is the code for it:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;using System;&lt;br&gt;using System.Collections.Generic;&lt;br&gt;using System.Text;&lt;br&gt;using GarageGames.Torque.Core;&lt;br&gt;using GarageGames.Torque.SceneGraph;&lt;br&gt;using GarageGames.Torque.Sim;&lt;br&gt;using GarageGames.Torque.GameUtil;&lt;br&gt;using GarageGames.Torque.T2D;&lt;br&gt;using GarageGames.Torque.Platform;&lt;br&gt;using GarageGames.Torque.GUI;&lt;br&gt;using GarageGames.Torque.T3D;&lt;br&gt;using GarageGames.Torque.TS;&lt;br&gt;using GarageGames.Torque.GFX;&lt;br&gt;&lt;br&gt;namespace StarterGame3D&lt;br&gt;{&lt;br&gt;    public class MeshManager&lt;br&gt;    {&lt;br&gt;&lt;br&gt;        public static void ShowMesh(string modelName,string meshName)&lt;br&gt;        {&lt;br&gt;            SetMeshVisibility(modelName,meshName, true);  &lt;br&gt;        }&lt;br&gt;&lt;br&gt;        public static void HideMesh(string modelName, string meshName)&lt;br&gt;        {&lt;br&gt;            SetMeshVisibility(modelName,meshName, false);&lt;br&gt;        }&lt;br&gt;        public static void HideAllMeshes(string modelName)&lt;br&gt;        {&lt;br&gt;            TorqueObject model = TorqueObjectDatabase.Instance.FindObject&amp;lt;TorqueObject&amp;gt;(modelName);&lt;br&gt;            T3DTSRenderComponent componentRender = model.Components.FindComponent&amp;lt;T3DTSRenderComponent&amp;gt;();&lt;br&gt;&lt;br&gt;            for (int index = 0; index &amp;lt; componentRender.Shape.Objects.Length; index++)&lt;br&gt;            {&lt;br&gt;                componentRender.ShapeInstance.MeshObjects[index].Visibility = 0.0f;&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;        public static void ShowAllMeshes(string modelName)&lt;br&gt;        {&lt;br&gt;            TorqueObject model = TorqueObjectDatabase.Instance.FindObject&amp;lt;TorqueObject&amp;gt;(modelName);&lt;br&gt;            T3DTSRenderComponent componentRender = model.Components.FindComponent&amp;lt;T3DTSRenderComponent&amp;gt;();&lt;br&gt;            for (int index = 0; index &amp;lt; componentRender.Shape.Objects.Length; index++)&lt;br&gt;            {&lt;br&gt;                componentRender.ShapeInstance.MeshObjects[index].Visibility = 1.0f;&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;&lt;br&gt;        private static void SetMeshVisibility(string modelName, string meshName, bool visible)&lt;br&gt;        {&lt;br&gt;&lt;br&gt;            TorqueObject model = TorqueObjectDatabase.Instance.FindObject&amp;lt;TorqueObject&amp;gt;(modelName);&lt;br&gt;            T3DTSRenderComponent componentRender = model.Components.FindComponent&amp;lt;T3DTSRenderComponent&amp;gt;();&lt;br&gt;            for (int objectIndex = 0; objectIndex &amp;lt; componentRender.Shape.Objects.Length; objectIndex++)&lt;br&gt;            {&lt;br&gt;                if (componentRender.Shape.Names[componentRender.Shape.Objects[objectIndex].NameIndex].ToUpper() == meshName.ToUpper())&lt;br&gt;                {&lt;br&gt;                    if (visible)&lt;br&gt;                    {&lt;br&gt;                        componentRender.ShapeInstance.MeshObjects[objectIndex].Visibility = 1.0f;&lt;br&gt;                    }&lt;br&gt;                    else&lt;br&gt;                    {&lt;br&gt;                        componentRender.ShapeInstance.MeshObjects[objectIndex].Visibility = 0.0f;&lt;br&gt;                    }&lt;br&gt;                }&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        public static List&amp;lt;string&amp;gt; ListMeshes(string modelName,bool showHidden, bool showVisible)&lt;br&gt;        {&lt;br&gt;            TorqueObject model = TorqueObjectDatabase.Instance.FindObject&amp;lt;TorqueObject&amp;gt;(modelName);&lt;br&gt;            T3DTSRenderComponent componentRender = model.Components.FindComponent&amp;lt;T3DTSRenderComponent&amp;gt;();&lt;br&gt;            List&amp;lt;string&amp;gt; meshes = new List&amp;lt;string&amp;gt;();&lt;br&gt;            string mesh = &amp;quot;&amp;quot;;&lt;br&gt;            for (int objectIndex = 0; objectIndex &amp;lt; componentRender.Shape.Objects.Length; objectIndex++)&lt;br&gt;            {&lt;br&gt;                float meshVisibility = componentRender.ShapeInstance.MeshObjects[objectIndex].Visibility;&lt;br&gt;&lt;br&gt;                if (showVisible &amp;amp;&amp;amp; meshVisibility == 1.0f)&lt;br&gt;                {&lt;br&gt;                    mesh = &amp;quot;MeshName:&amp;quot; + componentRender.Shape.Names[componentRender.Shape.Objects[objectIndex].NameIndex] + &amp;quot;||Visibility:Visible&amp;quot;;&lt;br&gt;&lt;br&gt;                    meshes.Add(mesh);&lt;br&gt;                }&lt;br&gt;                if (showHidden &amp;amp;&amp;amp; meshVisibility == 0.0f)&lt;br&gt;                {&lt;br&gt;                    mesh = &amp;quot;MeshName:&amp;quot; + componentRender.Shape.Names[componentRender.Shape.Objects[objectIndex].NameIndex] + &amp;quot;||Visibility:Hidden&amp;quot;;&lt;br&gt;                    meshes.Add(mesh);&lt;br&gt;                }&lt;br&gt;            }&lt;br&gt;            return meshes;&lt;br&gt;        }&lt;br&gt;&lt;br&gt;&lt;br&gt;    }&lt;br&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;It doesnt have all its exception handling, and is not fully refactored yet,but for my prototype, that is ok. Now that I have a meshmanager, I decided to test it by putting this in my begin run:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;MeshManager.HideAllMeshes(&amp;quot;CurrentPlayer&amp;quot;);&lt;br&gt;MeshManager.ShowMesh(&amp;quot;CurrentPlayer&amp;quot;, &amp;quot;RedFeet&amp;quot;);&lt;br&gt;MeshManager.ShowMesh(&amp;quot;CurrentPlayer&amp;quot;, &amp;quot;RedLegs&amp;quot;);&lt;br&gt;MeshManager.ShowMesh(&amp;quot;CurrentPlayer&amp;quot;, &amp;quot;RedTorso&amp;quot;);&lt;br&gt;MeshManager.ShowMesh(&amp;quot;CurrentPlayer&amp;quot;, &amp;quot;RedArms&amp;quot;);&lt;br&gt;MeshManager.ShowMesh(&amp;quot;CurrentPlayer&amp;quot;, &amp;quot;RedHead&amp;quot;);&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;The result is below:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2650937227/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3041/2650937227_52a424cbe0_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;I hid all the meshes initially for the CurrentPlayer Object, then showed the 5 red meshes. Now, in order for me to test the functionality of the other functions, I wanted to use the console. In order for me to call custom methods from the torqueX console (accessed via ~), I had to extend it, with this great resource:&lt;br&gt;&lt;br&gt;&lt;a href='http://tdn.garagegames.com/wiki/TorqueX/ExtendingTXConsole' target=_blank&gt;Extending the TorqueX Console&lt;/a&gt;&lt;br&gt;&lt;br&gt;Once I implemented that, I added a class to handle all the custom methods , so that I could call them directly from the console.&lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2650951147/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3212/2650951147_75094eeb63_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;Here I hide the Red head mesh, with a HideMesh call. &lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2650957167/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3142/2650957167_65da54bb76_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;Now I show the Blue head mesh, with a ShowMesh call. &lt;br&gt;&lt;br&gt;&lt;a href='http://www.flickr.com/photos/28461737@N08/2651791158/' target=_blank&gt;&lt;img src='http://farm4.static.flickr.com/3069/2651791158_95cc297bdb_t.jpg'  alt=&quot;&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;In the above picture, I list all the meshes and their current state. &lt;br&gt;&lt;br&gt;The next step for me, is to create some basic animations, and test how the meshes react when switching on and off in an animation. Ok, its been a loooong post, so I will post the results of the animation one when I am done. Until then!</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/110205/14937">
		<dc:format>text/html</dc:format>
		<dc:date>2008-06-22T05:09:45+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>Journey Into 3D</title>
		<link>http://www.garagegames.com/blogs/110205/14937</link>
		<description>It has been about six months since my last post, and a lot has happened with my development of Arillian. I was going pretty strong in my 2d development of Arillian, but it was very time consuming, and the optimization required for the approach I required I dont think would work well with XNA and by extension TorqueX (maybe pure directx though) .&lt;br&gt;&lt;br&gt;In Diablo 2, they would stuff a character animation in 32 directions, into a roughly 80kb file. They would then blit it to the screen , similar to the XNA spritebatch render. Although I got my process to do something similar, it was still around 100 milliseconds, and the file sizes in XNA were getting fairly large. I also had a dependence on art assets from others.&lt;br&gt;&lt;br&gt;After reviewing Titans Quest and Mythos Overworld a little more in depth, and having read some of the Diablo 2 developer comments, in addition to my above concerns, I have come to the conclusion that 3D is truly the way to go. With that in mind, I stopped my 2d development on Arillian. However, due to the way I set it up, I can still use the core engine peices I have built to date. From this point, I decided I needed to do the following:&lt;br&gt;&lt;br&gt;1) Identify the New Pipeline&lt;br&gt;2) Choose a 3d Program that supports the pipeline&lt;br&gt;3) Learn the 3d program&lt;br&gt;4) Build a simple character, export via dts into the TorqueX engine&lt;br&gt;&lt;br&gt;&lt;b&gt;Identifying the new pipeline&lt;/b&gt;&lt;br&gt;&lt;br&gt;The first thing I did was try to identify the new art pipeline. I asked on the 3D modeling forum about that, and got some good replies. From what I gather, the pipeline looks like:&lt;br&gt;&lt;br&gt;1) Model&lt;br&gt;2) Texture&lt;br&gt;3) Rig&lt;br&gt;4) Animate&lt;br&gt;5) Export to DTS/DSQ&lt;br&gt;&lt;br&gt;&lt;b&gt;Choose a 3D Program &lt;/b&gt;&lt;br&gt;&lt;br&gt;I then began to look at the various 3D packages that might support that. I tried the following:&lt;br&gt;&lt;br&gt;1) 3DSMax - Apparently this is the big daddy of all 3d packages. I tried the evaluation, and even bought several good books on it, and did online research on it. I liked the interface, but the price tag makes this unavailable to me. &lt;br&gt;&lt;br&gt;2) Maya PLE - Similar to 3DSMax, eexcept I didnt buy any books for it. I really liked the interface of it as well. The price makes this unavailable to me as well. &lt;br&gt;&lt;br&gt;3) MilkShape - I tested this out, but didnt care too much for the interface. Sometimes there are programs that you just get a feeling about, and I didnt have a good one with milkshape, maybe it was because I had evaluated 3DSMax and Maya PLE before this. &lt;br&gt;&lt;br&gt;4) XSI Foundation - I liked this one as well. The interface took some getting used to, but in order to get the full suite of functionality, you had to get the upgrade. The foundation though looked like it would be the only thing required for the level of stuff I needed to do. All that for 500$, this was the first one I found that I might actually spend time on and use. &lt;br&gt;&lt;br&gt;5) LightRay 3D - I didnt like the interface. I have heard good things about this program, but it did not stick well with me. To be fair though, I did not give it as much time as the others. &lt;br&gt;&lt;br&gt;6) LightWave - This was the last one I tested. I had Blender , Modo, and  AC3D  (suggestion from a poster) up for testing as well. Something stuck with me on Lightwave. The interface to me was intuitive. The list of features would let me handle the above pipeline, and they had a very robust DTS exporter (by Gnometech).&lt;br&gt;&lt;br&gt; &lt;b&gt;Learn the 3D Package&lt;/b&gt;&lt;br&gt;&lt;br&gt;I chose Lightwave out of my 5 month evaluation period of the various programs. I have learned quite a bit about it, and the hotkeys have become second nature to me so far. The showtool was also written with a  lightwave like interface.  I downloaded the trial, and bought :&lt;br&gt;&lt;br&gt;&lt;a href='http://www.amazon.com/Essential-LightWave-v9-Fastest-Easiest/dp/1598220241' target=_blank&gt;Essential Lightwave 9&lt;/a&gt;&lt;br&gt;&lt;br&gt;The video tutorials are excellent, and I learned about the various approaches to 3D modeling at a high level:&lt;br&gt;&lt;br&gt;1) Polygonal Modeling&lt;br&gt;2) Spline Modeling&lt;br&gt;3) SubDivision Modeling&lt;br&gt;4) MetaBall modeling&lt;br&gt;&lt;br&gt;I did my first model with purely polygonal modelng approaches via the video tutorial :&lt;br&gt;&lt;br&gt;&lt;a href='http://img116.imageshack.us/img116/6990/testbl5.jpg' target=_blank&gt;&lt;img src='http://img116.imageshack.us/img116/6990/testbl5.th.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;I am currently learning about the spline modeling approaches. The thing that I really liked about this book and in particular Steve Warners website,was that the it explains things fairly well. I assumed that when modeling, you used one approach, and only one approach, I now understand that you can use a variety of modeling approaches, on the same model, dependent on the situation. There is a ton to learn, I am only on chapter 8 , and there are 27 chapters, and tons of video tutorials. I also picked up Dan Ablans book on Lightwave, and will go through that one as well when I am done with Steve Warners. &lt;br&gt;&lt;br&gt;There seems to be a very strong lightwave community out there, and I even found some good links here on the Torque site, such as Andy Hawkins post here:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.garagegames.com/index.php?sec=mg&amp;amp;mod=resource&amp;amp;page=view&amp;amp;qid=10098'&gt;Lightwave Rigging&lt;/a&gt;&lt;br&gt;&lt;br&gt;If the URL fails for whatever reason, the url is:&lt;br&gt;&lt;br&gt;http://www.garagegames.com/index.php?sec=mg&amp;amp;mod=resource&amp;amp;page=view&amp;amp;qid=10098&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;Build a simple character, export via dts into the TorqueX engine&lt;/b&gt;&lt;br&gt;&lt;br&gt;My current goal, including learning Lightwave , is to build a simple character, do some basic animations, export it to DTS/DSQ, then import it into Torque X. Once this basic peice is working, I want to see if I can implement a C# version of the hiding meshes resource:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.garagegames.com/index.php?sec=mg&amp;amp;mod=resource&amp;amp;page=view&amp;amp;qid=5421'&gt;Hiding Meshes resource&lt;/a&gt;&lt;br&gt;&lt;br&gt;The Hiding Meshes approach looks exactly what I want to do for character customization.After I get the basic flow down for creating and exporting/importing, I will begin to work on this. I understand the basics of whats happening in the code , but am unsure of how the setup of nodes, mounts, and the like is setup in Torque X. The character I am building will be a block man for testing purposes. I dont know if I need a segmented model, a continous one with parts defined, or what not. I will figure it out in time. &lt;br&gt;&lt;br&gt;One thing that I want to make clear, is this will still be a isometric viewed game. I want to implement the game as a 3d world, but use a isometric camera view for the game, similar to titans quest and mythos overworld. Ok, Thats a lot of writing :) Until the next update!!</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/110205/14210">
		<dc:format>text/html</dc:format>
		<dc:date>2008-01-28T09:29:53+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>TorqueX Newbie Diary #6</title>
		<link>http://www.garagegames.com/blogs/110205/14210</link>
		<description>Quite a bit has been done on Arillian since the last update. The main advances have been:&lt;br&gt;&lt;br&gt;1) Introduction of another animation&lt;br&gt;2) Revamp of the project setup&lt;br&gt;3) Revamp of the animation system &lt;br&gt;4) Animation change based on mouse&lt;br&gt;&lt;br&gt;&lt;b&gt;Introduction of another animation&lt;/b&gt;&lt;br&gt;&lt;br&gt;In order to test out animation transition, and the action that causes it, I needed another animation. I already had one for a human male in an idle mode with no weapons facing south. I went to my trusty poser 7 and used the same mode, but this time, rendered it southwest. One thing to note, I do not include shadows, since I will be implementing shadows runtime based on light sources. &lt;br&gt;&lt;br&gt;&lt;b&gt;Revamp of the project setup&lt;/b&gt;&lt;br&gt;&lt;br&gt;I restructured my project by moving out the peices to logical projects. I now have the following projects in my solution:&lt;br&gt;&lt;br&gt;1) DataAccess - Persistence layer, provides access to a persistance engine (in my case, Sql Server 2005 Express)&lt;br&gt;2) AnimationManagement - This project handles all the animation creation and management&lt;br&gt;3) Common - Anything that is common to all the projects, or needs to be access globally.&lt;br&gt;4) ArillianGameEngine - This project handles all the core Arillian classes, such as Player, ItemManager, etc&lt;br&gt;5) Game - The basic project that the startertemplates use, it is still used as the starting point&lt;br&gt;&lt;br&gt;&lt;b&gt;Revamp of the animation system &lt;/b&gt;&lt;br&gt;&lt;br&gt;I was unhappy with the file naming system I had originally used. Although Diablo II used a similar format for naming, it felt hackish to me. I went ahead and implemented a data model in sql server 2005 express  to persist  the animation information, as well as all game related information (such as login , accounts, saved games, configuration, etc). This allowed me to run stored procedures (that take around 5- 10 milliseconds) to grab animation layer information. Since my AnimationLayers have IDs now, My file system now has folders related to the ID. &lt;br&gt;&lt;br&gt;Fo example, The root folder to the animationlayers is constant (C:\Projects\Arillian\Game\data\Images\AnimationLayers). Inside that folder are folders called 1, 2, 3, 4, etc. They correspond to the AnimationLayerID. Inside those folders are the frames for that animation layer. If you recall, an AnimationLayer is just one layer for an animation configuration. The animation configuration for any player is always 4 animation layers (head, torso, lefthand, righthand). &lt;br&gt;&lt;br&gt;My Player object has one animated sprite, which I was hoping to just swap in and out the animation datas. Unfortunately, I do not think TorqueX was really designed for that. So I implemented a solution around it. I still have the animated sprite definition in my Player object, but now I copyto() a new animated sprite, attach the animation, and then run it from there. I maintain the object id of the current sprite in the TorqueObjectDatabase, so I can unregister it, and then register the new one, and set the current id. Here is my Player.UpdateAnimation() function so far:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;  public void UpdateAnimation()&lt;br&gt;        {&lt;br&gt;            DateTime startTime = DateTime.Now;&lt;br&gt;            Console.WriteLine(&amp;quot;UpdateAnimation::Start Time is &amp;quot; + startTime.ToLongTimeString());&lt;br&gt;            // Get the Current Camera&lt;br&gt;            T2DSceneCamera currentCamera = (T2DSceneCamera)TorqueObjectDatabase.Instance.FindObject(&amp;quot;Camera&amp;quot;);&lt;br&gt;&lt;br&gt;            // Get the AnimationConfiguration&lt;br&gt;            AnimationConfiguration configuration = GetAnimationConfiguration();&lt;br&gt;&lt;br&gt;            // Make sure we have 4, if we dont, then the AnimationConfiguration is not valid&lt;br&gt;            if (configuration.AnimationLayers.Count == 4)&lt;br&gt;            {&lt;br&gt;                // Get the T2dAnimationData&lt;br&gt;                T2DAnimationData animationData = AnimationManager.Instance.CreateT2DAnimationData(configuration, ImageFormat.Png);&lt;br&gt;&lt;br&gt;                // Check to see if the current sprice has an ID, default is -1&lt;br&gt;                if (currentSpriteId &amp;gt; -1)&lt;br&gt;                {&lt;br&gt;                    // Unmount the Camera&lt;br&gt;                    currentCamera.Dismount();&lt;br&gt;                    // Unregister it&lt;br&gt;                    TorqueObjectDatabase.Instance.Unregister(TorqueObjectDatabase.Instance.FindObject((uint)currentSpriteId));&lt;br&gt;&lt;br&gt;                }&lt;br&gt;                // Create a new copy based off our _sprite definition&lt;br&gt;                T2DAnimatedSprite spriteCopy = new T2DAnimatedSprite();&lt;br&gt;                _sprite.CopyTo(spriteCopy);&lt;br&gt;&lt;br&gt;                // Set the new animation data&lt;br&gt;                spriteCopy.AnimationData = animationData;&lt;br&gt;&lt;br&gt;                // Setup our Sprite&lt;br&gt;                TorqueObjectDatabase.Instance.Register(spriteCopy);&lt;br&gt;                currentSpriteId = Convert.ToInt32(spriteCopy.ObjectId);&lt;br&gt;                currentCamera.Mount(spriteCopy, &amp;quot;&amp;quot;, true);&lt;br&gt;&lt;br&gt;                // Play the new animation&lt;br&gt;                spriteCopy.PlayAnimation();&lt;br&gt;            }&lt;br&gt;&lt;br&gt;            DateTime endTime = DateTime.Now;&lt;br&gt;            Console.WriteLine(&amp;quot;UpdateAnimation::End Time is &amp;quot; + endTime.ToLongTimeString());&lt;br&gt;            TimeSpan timeToRun = endTime.Subtract(startTime);&lt;br&gt;            Console.WriteLine(&amp;quot;UpdateAnimation::Time to run is &amp;quot; + timeToRun.TotalMilliseconds.ToString());&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt; &lt;br&gt;&lt;br&gt;&lt;br&gt;When the code runs, this is how long it takes to compress 60 frames (4 animation layers * 15 frames each), draw a shadow on each cell of the final image (I do this runtime, as opposed to baking it in the image), render it to T2DAnimationData, and then attach it to the newly copied animated sprite:&lt;br&gt;&lt;br&gt;UpdateAnimation::Start Time is 3:01:17 AM&lt;br&gt;UpdateAnimation::End Time is 3:01:17 AM&lt;br&gt;UpdateAnimation::Time to run is 234.375&lt;br&gt;&lt;br&gt;&lt;br&gt;Now, when I run this, I cache the animation layer in a Dictionary&amp;lt;int,Image&amp;gt;. The int is the animation layer id, and the image is the animation layer image. When the animation is cached, it will use the image from there, instead of rerendering the 15 frames. Here is a cached pull:&lt;br&gt;&lt;br&gt;UpdateAnimation::Start Time is 3:01:19 AM&lt;br&gt;UpdateAnimation::End Time is 3:01:19 AM&lt;br&gt;UpdateAnimation::Time to run is 78.125&lt;br&gt;&lt;br&gt;There is no noticeable lag in animation switching. Bear in mind, the time to run is in milliseconds. I am happy with the speed of it, but do not know yet how it will perform when a lot of things are moving on the screen. The below code is the check to see if it is cached, and if is not, to cache it. &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;                    Image imageToMerge;&lt;br&gt;                    if (AnimationManager.Instance.AnimationLayerImages.ContainsKey(newAnimationLayer.ID))&lt;br&gt;                    {&lt;br&gt;                        // Load from cache&lt;br&gt;                        AnimationManager.Instance.AnimationLayerImages.TryGetValue(newAnimationLayer.ID, out imageToMerge);&lt;br&gt;                    }&lt;br&gt;                    else&lt;br&gt;                    {&lt;br&gt;                        // Load from file&lt;br&gt;                        imageToMerge = CreateAnimationImageStrip(newAnimationLayer);&lt;br&gt;                        // Store it for future use if it isnt already cached&lt;br&gt;                        AnimationManager.Instance.AnimationLayerImages.Add(newAnimationLayer.ID, imageToMerge);&lt;br&gt;                    }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt; Animation change based on mouse click position&lt;/b&gt;&lt;br&gt;&lt;br&gt;I first wanted to use a button to test my animation change, but realized I would have to figure out the new 1.5 GUI setup. Instead , I decided to implement the mouse functionality. I have some guidelines on what I want the mouse to do in regards to the player. They are:&lt;br&gt;&lt;br&gt;1) If the Shift button is held down, mouse clicking anywhere on the screen will have the player face that direction&lt;br&gt;2) If the shift button is not held down, and they are within a distance of 50, then perform the walk animation and move the player in that direction&lt;br&gt;3) If the shift button is not held down, and they are over a distance of 50, then perform the run animation and move the player in that direction&lt;br&gt;&lt;br&gt;I implemented ITickOBject on my custom player class, and in the process tick, handle the mouse. I have not integrated the distance or shift peices yet, but have implemented the change direction based on angle of mouse click or drag.Code is below:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;  public void ProcessTick(Move move, float dt)&lt;br&gt;        {&lt;br&gt;            // Get the current Mouse State&lt;br&gt;            MouseState state = Mouse.GetState();&lt;br&gt;            if (state.LeftButton == ButtonState.Pressed) // Means button was pressed&lt;br&gt;            {&lt;br&gt;                // Get the Mouse coordinates&lt;br&gt;                Vector2 mouseCoordinates = Utility.ConvertScreenToWorld(new Vector2((float)state.X, (float)state.Y), Configuration.Instance.ScreenResolution);&lt;br&gt;                // Figure out what the angle is in relation to the player&lt;br&gt;                float angle = T2DVectorUtil.AngleFromTarget(mouseCoordinates, Player.Instance.Sprite.Position);&lt;br&gt;                // Convert it to an enumeration we can use &lt;br&gt;                Enumeration.Direction newDirection = Utility.ConvertAngleToDirection(angle);&lt;br&gt;                // Check to see if we need to do anything&lt;br&gt;                if (newDirection != Player.Instance.Direction)&lt;br&gt;                {&lt;br&gt;                    //Console.WriteLine(newDirection.ToString());&lt;br&gt;                    float distance = Vector2.Distance(mouseCoordinates, Player.Instance.Sprite.Position);&lt;br&gt;                    Player.Instance.Direction = newDirection ;&lt;br&gt;                    Player.Instance.UpdateAnimation();&lt;br&gt;                }&lt;br&gt;&lt;br&gt;            }&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;This allows me to capture even mouse drag events, so you can literally mousedrag a circle around the player, and it will only fire if the angle is between certain ranges. You can also click, and it will do a check as well (Thanks to John Kanalkis for the idea, and Josh Thomas for the screen to world conversion function.).&lt;br&gt;&lt;br&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;br&gt;&lt;br&gt;Here are two screenshots of the south idle and southwest idle animations:&lt;br&gt;&lt;br&gt;Facing South:&lt;br&gt;&lt;img src='http://img101.imageshack.us/img101/1583/facingsouthls3.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;Facing SouthWest:&lt;br&gt;&lt;img src='http://img101.imageshack.us/img101/3058/facingsouthwestvc4.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;Its been a long and fun road so far, a lot more to go. With Poser 7, I am finally feeling comfortable in it, and can whip out renderings pretty easy. I am still learning the animation aspects of it though. The world is comng along, thanks to WorldCreator 2.5 as well. My next steps are to render out the 8 direction for the idle, walking, and running animations. I also want to get it so that you can move the player around like in Diablo. I am close to it now, the mechanics are there, I just need to flush it out. With the inclusion of a database, I now have a persistence layer I am very familiar with, so that should speed things up as well. Until the next update!</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/110205/14116">
		<dc:format>text/html</dc:format>
		<dc:date>2008-01-07T15:44:22+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>TorqueX Newbie Diary #5</title>
		<link>http://www.garagegames.com/blogs/110205/14116</link>
		<description>Well, I had a real long post written out, going into some pretty low level detail, but it seems this site has eaten that blog.... This time I will save off my post. Nonetheless, below is a screenshot of the start of my starting area, Ruston Post. It has only been 1.5 months since I started working from ground zero (literally), so be gentle!&lt;br&gt;&lt;br&gt;&lt;img src='http://img152.imageshack.us/img152/6405/arillianos8.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;The tiles are done in WorldCreator 2.5, and the character is done in Poser 7. I have got the import process from WorldCreator to TGBX down pretty tightly. I had some problems initially though. TGBX seemed to want to keep displaying a thin border around all my transparent PNGs. I finally discovered that I needed to:&lt;br&gt;&lt;br&gt;1) Save the WorldCreator files to a transparent gif&lt;br&gt;2) In adobe photoshop, convert it to RGB mode&lt;br&gt;3) Layer-&amp;gt;Matting-&amp;gt;Remove White Matte&lt;br&gt;4) Layer-&amp;gt;Matting-&amp;gt; Remove Black Matte&lt;br&gt;5) Layer-&amp;gt;Matting-&amp;gt;Defringe (I used 2 pixels).&lt;br&gt;6) Save as web for a transparent PNG-24&lt;br&gt;&lt;br&gt;I have to do this process for each tile, so TGBX wont render a border around the transparent png. So far it seems to work, as the screenshot above shows. Another issue I ran into was that the default tilemap object does not work too well with truly 2:1 isometric tiles. You can generate a top down 2D tile, then rotate the tilemap object 60 degrees, but the look is definitely not isometric (think that is called trimetric, not sure).  I ended up placing them as static sprites, at layer 30. If it becomes a performance issue, I will write my own isometric tiling system in XNA. &lt;br&gt;&lt;br&gt;I am amazed at the power WorldCreator has. It uses masks, which are color coded, and can render in top 2, isometric floor, isometric walls, etc. Once I figured out how to work in it, and then how to export from it to TGBX, creating new content for Arillian became not only feasible, but fairly painless. In the screenshot above, I have a dirt road tile, a grass tile, a tower item, and an archway. Each of them took less than a minute roughly to create, but it was the export into TGBX that was holding me up. With that out of the way, my environment creation pipeline should be much more efficient!&lt;br&gt;&lt;br&gt;The character was done using Poser 7.0. I am using the Michael 3.0 Base, with muscular body morphs, and the honor bound light armor set.  In Arillian, there are three types of armor, light, medium, and heavy. Each type has several visual styles, and the one above is a light armor. Although you cant see it above in the screenshot, he is doing an idle animation, and I rendered out the animation from Poser 7.0 as 10 frames.&lt;br&gt;&lt;br&gt;The character you see above is the final product of an AnimationConfiguration being processed. The AnimationConfiguration class contains a List&amp;lt;AnimationLayer&amp;gt;. Each AnimationLayer contains how many frames it needs, and attirbutes which help it to get the frames from where they are stored locally. The character above uses an AnimationConfiguration with 4 AnimationLayers. In my testing, I manually create the layers, though in reality the generation of the animation layer will be handled automatically. &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt; AnimationConfiguration newConfiguration = new AnimationConfiguration();&lt;br&gt;            newConfiguration.T2DAnimationDataTemplate = Enumeration.T2DAnimationDataTemplate.DefaultCharacter;&lt;br&gt;            newConfiguration.ID=1;&lt;br&gt;            AnimationLayer headLayer = new AnimationLayer();&lt;br&gt;            headLayer.AnimationType = Enumeration.AnimationType.Character;&lt;br&gt;            headLayer.Race =Enumeration.Race.Human;&lt;br&gt;            headLayer.Gender = Enumeration.Gender.Male;&lt;br&gt;            headLayer.AnimationLayerType = Enumeration.AnimationLayerType.Head;&lt;br&gt;            headLayer.ItemToken = &amp;quot;LIT&amp;quot;;&lt;br&gt;            headLayer.Mode = Enumeration.Mode.TownNeutral;&lt;br&gt;            headLayer.WeaponClass = Enumeration.WeaponClass.HandToHand;&lt;br&gt;            headLayer.Direction = Enumeration.Direction.South;&lt;br&gt;            headLayer.FrameCount = 10;&lt;br&gt;            headLayer.FormatOfImage = ImageFormat.Png;&lt;br&gt;            headLayer.Sort = 2;&lt;br&gt;            newConfiguration.AnimationLayers.Add(headLayer);&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;From this, I can generate the path as data/globals/character/human/male/LITTNHTHSO. Since there are 10 frames and the format is png, it will get data/globals/character/human/male/LITTNHTHSO_1.png  to data/globals/character/human/male/LITTNHTHSO_10.png. It then creates a horizontal strip out of the frames. Here is the full code to render the character above:&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;  public static void CreateAnimation()&lt;br&gt;        {&lt;br&gt;           &lt;br&gt;            AnimationConfiguration newConfiguration = new AnimationConfiguration();&lt;br&gt;            newConfiguration.T2DAnimationDataTemplate = Enumeration.T2DAnimationDataTemplate.DefaultCharacter;&lt;br&gt;            newConfiguration.ID=1;&lt;br&gt;            AnimationLayer headLayer = new AnimationLayer();&lt;br&gt;            headLayer.AnimationType = Enumeration.AnimationType.Character;&lt;br&gt;            headLayer.Race =Enumeration.Race.Human;&lt;br&gt;            headLayer.Gender = Enumeration.Gender.Male;&lt;br&gt;            headLayer.AnimationLayerType = Enumeration.AnimationLayerType.Head;&lt;br&gt;            headLayer.ItemToken = &amp;quot;LIT&amp;quot;;&lt;br&gt;            headLayer.Mode = Enumeration.Mode.TownNeutral;&lt;br&gt;            headLayer.WeaponClass = Enumeration.WeaponClass.HandToHand;&lt;br&gt;            headLayer.Direction = Enumeration.Direction.South;&lt;br&gt;            headLayer.FrameCount = 10;&lt;br&gt;            headLayer.FormatOfImage = ImageFormat.Png;&lt;br&gt;            headLayer.Sort = 2;&lt;br&gt;            newConfiguration.AnimationLayers.Add(headLayer);&lt;br&gt;&lt;br&gt;           &lt;br&gt;           &lt;br&gt;            AnimationLayer torsoLayer = new AnimationLayer();&lt;br&gt;            torsoLayer.AnimationType = Enumeration.AnimationType.Character;&lt;br&gt;            torsoLayer.Race = Enumeration.Race.Human;&lt;br&gt;            torsoLayer.Gender = Enumeration.Gender.Male;&lt;br&gt;            torsoLayer.AnimationLayerType = Enumeration.AnimationLayerType.Torso;&lt;br&gt;            torsoLayer.ItemToken = &amp;quot;LT1&amp;quot;;&lt;br&gt;            torsoLayer.Mode = Enumeration.Mode.TownNeutral;&lt;br&gt;            torsoLayer.WeaponClass = Enumeration.WeaponClass.HandToHand;&lt;br&gt;            torsoLayer.Direction = Enumeration.Direction.South;&lt;br&gt;            torsoLayer.FrameCount = 10;&lt;br&gt;            torsoLayer.FormatOfImage = ImageFormat.Png;&lt;br&gt;            torsoLayer.Sort = 1;&lt;br&gt;            newConfiguration.AnimationLayers.Add(torsoLayer);&lt;br&gt;&lt;br&gt;            AnimationLayer leftHandLayer = new AnimationLayer();&lt;br&gt;            leftHandLayer.AnimationType = Enumeration.AnimationType.Character;&lt;br&gt;            leftHandLayer.Race = Enumeration.Race.Human;&lt;br&gt;            leftHandLayer.Gender = Enumeration.Gender.Male;&lt;br&gt;            leftHandLayer.AnimationLayerType = Enumeration.AnimationLayerType.LeftHand;&lt;br&gt;            leftHandLayer.ItemToken = &amp;quot;LIT&amp;quot;;&lt;br&gt;            leftHandLayer.Mode = Enumeration.Mode.TownNeutral;&lt;br&gt;            leftHandLayer.WeaponClass = Enumeration.WeaponClass.HandToHand;&lt;br&gt;            leftHandLayer.Direction = Enumeration.Direction.South;&lt;br&gt;            leftHandLayer.FrameCount = 10;&lt;br&gt;            leftHandLayer.FormatOfImage = ImageFormat.Png;&lt;br&gt;            leftHandLayer.Sort = 1;&lt;br&gt;            newConfiguration.AnimationLayers.Add(leftHandLayer);&lt;br&gt;&lt;br&gt;            AnimationLayer rightHandLayer = new AnimationLayer();&lt;br&gt;            rightHandLayer.AnimationType = Enumeration.AnimationType.Character;&lt;br&gt;            rightHandLayer.Race = Enumeration.Race.Human;&lt;br&gt;            rightHandLayer.Gender = Enumeration.Gender.Male;&lt;br&gt;            rightHandLayer.AnimationLayerType = Enumeration.AnimationLayerType.RightHand;&lt;br&gt;            rightHandLayer.ItemToken = &amp;quot;LIT&amp;quot;;&lt;br&gt;            rightHandLayer.Mode = Enumeration.Mode.TownNeutral;&lt;br&gt;            rightHandLayer.WeaponClass = Enumeration.WeaponClass.HandToHand;&lt;br&gt;            rightHandLayer.Direction = Enumeration.Direction.South;&lt;br&gt;            rightHandLayer.FrameCount = 10;&lt;br&gt;            rightHandLayer.FormatOfImage = ImageFormat.Png;&lt;br&gt;            rightHandLayer.Sort = 1;&lt;br&gt;            newConfiguration.AnimationLayers.Add(rightHandLayer);&lt;br&gt;            &lt;br&gt;&lt;br&gt;            AnimationManager.Instance.AnimationConfigurations.Add(newConfiguration);&lt;br&gt;&lt;br&gt;            DateTime startTime = DateTime.Now;&lt;br&gt;            Console.WriteLine(&amp;quot;CreateAnimation StartTime is &amp;quot; + startTime.ToLongTimeString());&lt;br&gt;&lt;br&gt;            DrawAnimationConfiguration(1, new Microsoft.Xna.Framework.Vector2(4, 10));&lt;br&gt;&lt;br&gt;            DateTime endTime = DateTime.Now;&lt;br&gt;            Console.WriteLine(&amp;quot; CreateAnimation End Time is &amp;quot; + endTime.ToLongTimeString());&lt;br&gt;            TimeSpan timeToRun = endTime.Subtract(startTime);&lt;br&gt;            Console.WriteLine(&amp;quot;CreateAnimation Time to run is &amp;quot; + timeToRun.TotalMilliseconds.ToString());&lt;br&gt;&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Thats a lot of code, but once its tied into the player, it will be autogenerated. For now, I typed it out for testing purposes. There is a lot going on there, but the total time from scratch is around 250 milliseconds. My initial cache testing showed under 100 milliseconds, but I am still testing that. &lt;br&gt;This is the test drawing code:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt; public static void DrawAnimationConfiguration(int configurationID, Vector2 position)&lt;br&gt;        {&lt;br&gt;            AnimationConfiguration newAnimationConfiguration = AnimationManager.Instance.AnimationConfigurations.Find(delegate(AnimationConfiguration animationConfiguration) { return animationConfiguration.ID == configurationID; });&lt;br&gt;            T2DAnimationData testData = AnimationManager.Instance.CreateT2DAnimationData(newAnimationConfiguration, ImageFormat.Png);&lt;br&gt;            // setup our animation sprite&lt;br&gt;            T2DAnimatedSprite newSprite = new T2DAnimatedSprite(testData);&lt;br&gt;            newSprite.Position = position;&lt;br&gt;            newSprite.Folder = TorqueObjectDatabase.Instance.CurrentFolder;&lt;br&gt;            newSprite.Visible = true;&lt;br&gt;            newSprite.Layer = 0;&lt;br&gt;            newSprite.Name = &amp;quot;test&amp;quot; + configurationID.ToString();&lt;br&gt;            newSprite.Size = new Vector2(20);&lt;br&gt;            &lt;br&gt;&lt;br&gt;            // this is for test purposes&lt;br&gt;            //newSprite.OnFrameChange =  delegate(int frame) { Console.WriteLine(frame.ToString());};&lt;br&gt;            if (newSprite.IsRegistered)&lt;br&gt;            {&lt;br&gt;                TorqueObjectDatabase.Instance.Unregister(newSprite);&lt;br&gt;            }&lt;br&gt;            TorqueObjectDatabase.Instance.Register(newSprite);&lt;br&gt;            newSprite.PlayAnimation();&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;I have also been studying and learning 3DSMax, and bought the 3dsMax official learning guide book. I am roughly halfway through it, there is a lot to learn. I am continuing to learn it because although Poser 7.0 is powerful, I may need the raw power of 3dsmax to do what I need at times. The fact they did all the animations and design for the barbarian in Diablo 2 in 3ds max tells me it is very powerful in that regard. Ahh well, so much to learn, and much more to do. Next update, I hope to have the starting area completed, and character movement working (along with the walking animation). Until Then!</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/110205/13993">
		<dc:format>text/html</dc:format>
		<dc:date>2007-12-12T03:07:58+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>TorqueX Newbie Diary #4</title>
		<link>http://www.garagegames.com/blogs/110205/13993</link>
		<description>Well, this has been a busy period , but I have been able to make a lot of strides recently. I am currently learning Poser 7,3DSMax, and WorldCreator. I am thinking that my toolset will be:&lt;br&gt;&lt;br&gt;Poser 7 - character animation sprite maps&lt;br&gt;3DSMax - Prop creation (clothes, weapons, etc) &lt;br&gt;Photoshop - sprite strip maker&lt;br&gt;WorldCreator 2.5 - Tiles, Environment, World Objects (awesome 2D world engine)&lt;br&gt;TorqueX 1.5 - Game Engine&lt;br&gt;&lt;br&gt;I am still learning on all of them minus photoshop which I have used for the last 5 years. &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;Animation Creator&lt;/b&gt;&lt;br&gt;&lt;br&gt;I have retooled the AnimationCreator and stripped it down to several classes. I now have an AnimationLayer class, which BodyAnimationLayer inherits from, and ItemAnimationLayer inherits from BodyAnimationLayer. The AnimationManager singleton can cache them, preload animation layers, and of course merge them into a T2DAnimatedData, and then cache it for reuse. I also have an AnimationHelper which has generic image support functions and an AnimationConfiguration class which houses a configuration of animation layers(both body and item). I was also able to get the T2dAnimationData conversion working like a champ (Thanks to John Kanalkis). The 1.5 release offered a SimpleMaterial object that allowed me to set my texture directly. &lt;br&gt;&lt;br&gt;I realized halfway through developing it, that I only really will use imagestrips. That is what the animation layer is, literally, just a class that houses the image path, an ID, and a sort. The Body Animation Layer inherits from that, and has 4 variables: Race, Mode, WeaponClass, and Direction. Regardless of the character animation, every single frame requires this essential set of 4 variables, hence they are put in a class. The Item Animation Layer inherits from the Body Animation Layer and adds Item specific things, such as the Itemtype. &lt;br&gt;&lt;br&gt;I have figured for my testing purposes, I will use 1 Race , that being Human for now For the modes, I have defined them as :&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;  public enum Mode&lt;br&gt;        {&lt;br&gt;            Attack1 = 1,&lt;br&gt;            Attack2 = 2,&lt;br&gt;            Attack3 = 3,&lt;br&gt;            Block = 4,&lt;br&gt;            CautiousIdle = 5,&lt;br&gt;            Cast = 6,&lt;br&gt;            GetHit = 7,&lt;br&gt;            Idle = 8,&lt;br&gt;            Kick = 9,&lt;br&gt;            Run = 10,&lt;br&gt;            Walk = 11&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;These modes represent the action that is occuring. For example, a character can be attacking, blocking, idling, casting, running, etc. You get the idea. Each one of those modes causes the animation to behave differently. For my WeaponClass, the values are:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;   public enum WeaponClass&lt;br&gt;        {&lt;br&gt;            Bow = 0,&lt;br&gt;            ClawsAndShield = 1,&lt;br&gt;            CrossBow = 2,&lt;br&gt;            DualClaws = 3,&lt;br&gt;            HandToHand = 4,&lt;br&gt;            HandAndShield = 5,&lt;br&gt;            OneHandedSwing = 6,&lt;br&gt;            OneHandThrust = 7,&lt;br&gt;            LeftSwingRightSwing = 8,&lt;br&gt;            LeftSwingRightJab = 9,&lt;br&gt;            LeftJabRightSwing = 10,&lt;br&gt;            LeftJabRightJab = 11,&lt;br&gt;            Staff = 12,&lt;br&gt;            TwoHandedSwing = 13,&lt;br&gt;            TwoHandedThrust = 14&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;These weaponclasses further represent how the animation needs to play by defining the way they hold the weapons (a staff is different from a claw for instannce) . The last of the four is direction, which is pretty easy to define:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;  public enum Direction&lt;br&gt;        {&lt;br&gt;            South,&lt;br&gt;            SouthWest,&lt;br&gt;            West,&lt;br&gt;            NorthWest,&lt;br&gt;            North,&lt;br&gt;            NorthEast,&lt;br&gt;            East,&lt;br&gt;            SouthEast&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;So to do an example, you could have a human that is running, with dual swords, and headed Southeast. If you figure (for my test), 1 race, 11 modes , 14 weaponclasses, and 8 directions, thats a ton of sprites (1232 to be exact). However, we know that we can flip at least 3 of them, so now we are down to 5 directions (770 sprites).  Keep in mind, this is only for a naked character with no armor or weapons. Now in my preload, I only load the configuration (not the images). The images are merged on demand, then cached. I am still unit testing this at the moment and will get some numbers on the runtime merge(I am thinking less than a 100 milliseconds more than likely based on my past tests). Since I have optimized the code some, It should be pretty quick. &lt;br&gt;&lt;br&gt;As for the Armor and Weapons, those all have the same as the body, but I can reuse a lot of the same strips. For instance, the helm strip for a human running with dual swords southeast is the same for a human walking with dual swords goung southeast. Also, if a character is only switching weapons, the animation that is cached only really needs to change one peice of it, so caching the animation in various merge states is ideal (Aka cache the body, then cache the body with armor on, then cache the body with armor and weapons). That way if they switch weapons, we just call the second one we stored, swap in the new itemanimationlayer, merge, recache, and we are on our way. This can be also based on what I think will change the most. For instance, gloves usually get swapped more than say a chest peice. &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;Core Game Objects&lt;/b&gt;&lt;br&gt;&lt;br&gt;I have also created a Player singleton, that houses (for the moment) an Equipment Object that houses everything he is wearing. It will manage the state of the player , and also contain a List&amp;lt;InventoryItem&amp;gt;. I also built an ItemManager singleton, that stores Items. I have a base Item class, and classes that inherit from it like EquippableItem have inventory images, a List&amp;lt;ItemAnimationLayer&amp;gt;, etc. I can actually pass a BodyAnimationLayer to the List&amp;lt;ItemAnimationLayer&amp;gt; in the item and have it pull out the correct Item animation layer. &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;public ItemAnimationLayer GetAnimation(BodyAnimationLayer bodyLayer)&lt;br&gt;        {&lt;br&gt;            return _itemAnimationLayers.Find(delegate(ItemAnimationLayer itemlayer) { return itemlayer.BodyLayer.Equals(bodyLayer); });&lt;br&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;The ItemLayer exposes a reference to the baseclass for searching purposes. Well, looks like I have written a ton of stuff. I will continue learning on Poser 7, WorldCreator 2.5, 3DS Max, and of course our good friend Mr Torque X 1.5. Until then!!</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/110205/13970">
		<dc:format>text/html</dc:format>
		<dc:date>2007-12-07T02:36:35+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>TorqueX Newbie Diary #3</title>
		<link>http://www.garagegames.com/blogs/110205/13970</link>
		<description>&lt;b&gt;Animation Creator&lt;/b&gt;&lt;br&gt;&lt;br&gt;Well, after spending a lot of time with the torquex 3d stuff, I have decided to instead spend some more time trying out some 2D approaches. As such , I began researching 2d character itemization techniques. There was a lot of basic information out there, but most of it was not too helpful. Techniques ranged from swapping out channels, to writing the individual peices to the screen as individual peices, held together by a logical representation of the base object. &lt;br&gt;&lt;br&gt;I tried the second approach somewhat, but mounting a helm animation, chest animation, leg animation, boot animation, weapon animation, etc adds up, and thats just ONE direction. If your animations were 10 frames per animation, your looking at around 100+ easily for a complex animation.  While these are definitely viable, they just dont seem to practical to me.  After some more research, I came upon this:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href='http://paul.siramy.free.fr/_divers2/Extracting%20Diablo%20II%20Animations.pdf' target=_blank&gt;Diablo II's Animations&lt;/a&gt;&lt;br&gt;&lt;br&gt;Paul Siramy in his excellent pdf went through how Diablo II did their character itemization, even down to the file formats, structure, and how it all comes together. They used a technique where they applied images (sprites) into frames at runtime, then meshed them all together for one final animation. In his pdf, he explains how they basically have body parts, weapons, and items, and can literally adjust the tint (via a colormap) to create new versions of an existing item . The neat thing about this approach,is you only deal with the final animation, versus say 10 T2dAnimatedSprites mounted to each other. &lt;br&gt;&lt;br&gt;&lt;br&gt;With all that in mind, and after dissecting that pdf over many smoke breaks, lunches, late night reading, and good old fashioned bathroom reading material, I decided to build my own. I first checked out XNA support for Texture2D. It seemed pretty lacking, and although you can render a texture to another texture, it doesnt seem like it was really built for manipulating images. My next technology I looked at was GDI+, something I have worked with extensively in the past. I know it has very robust image handling capabilities, but the downside is it does not run on Xbox 360 (which is fine for me). Windows Presentation Foundation is a little too far in the future for me to really use (although I can see it will be a powerhouse when .NET 3.0 is used everywhere).  With all that in mind, I chose GDI+, with the mindset that the logical structure of my AnimationCreator library wont change much, although the underlying image manipulation might. &lt;br&gt;&lt;br&gt;At a high level,the rough prototype I have now basically merges images into a frame, and then  merges frames into a framelayer, and then finally merges framelayers into an animation. There is also an AnimationDatabase singleton, allowing you to cache your animations, framelayers, and spritesheets if you have any.  and call them at will. I also built the prototype so you can load a spritesheet directly to a framelayer (you use a List&amp;lt;FrameDefinition&amp;gt; to specify how to slice it up, any colormaps, etc).&lt;br&gt;&lt;br&gt;The goal was to be able to produce that final animation image. This image is then converted to a DefaultEffect, then passed in as the material for a T2dAnimationData object. In essence, you can literally build either frame by frame, or whole frame layers at once, or anywhere inbetween, and come out with an animation that takes around 200 milliseconds so far to create. You can also apply colormaps at the frame, framelayer, or animation level. &lt;br&gt;&lt;br&gt;A good example of the flexibility I am aiming for is that you could, at runtime, get an animation you created already via the  AnimationDatabase, and then change the 7th frame of the helm frame layer if you wanted to. I wanted it so you can literally touch any frame or framelayer in the animation, then rebuild the animation on the fly. &lt;br&gt;&lt;br&gt;I am having some issues with the defaulteffect aspect of the Torque engine however,and  I may just need to create my own effect to support this (I hope not). The current effects assume you have an asset or a file, but no real stream support. It does have some functionality allowing you to change the base texture of an already loaded one, but my tests have not been successful as of yet(nor have I got a response from the forums). I will post it once it is cleaned up , has a lot more validation, and has been optimized. Since it is a seperate project, you can just drop in the binary or add the project once its done, and of course, I will provide it to anyone that wants it.  Until next time!</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/110205/13933">
		<dc:format>text/html</dc:format>
		<dc:date>2007-12-01T06:34:50+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>TorqueX Newbie Diary #2</title>
		<link>http://www.garagegames.com/blogs/110205/13933</link>
		<description>Well, it has been an eventful last few days. I continued working on the Main menu GUI aspects of Arillian, and also dabbled in other areas. I have a ton to learn. &lt;br&gt;&lt;br&gt;&lt;b&gt;GUIBitmapButton and Mouse click event&lt;/b&gt;&lt;br&gt;&lt;br&gt;I came across a problem trying to get my GUIBitmapButtons to register a mouse click. At first I figured I didnt read through the code correctly , so spent quite a bit of time seeing how the inputmanager class works. I still was not able to figure out how to bind a mouseclick to the GUIBitmapButton I had on my main menu. The BindAction that was used for the keyboard and gamepad didnt seem to work with the mouse. &lt;br&gt;&lt;br&gt;After thinking about it, I decided to roll my own. I have done a first pass, by extending the GUIBitmapButton to expose a delegate for the mouse click event. I also implemented the ITickObject interface , and in the ProcessTick, I check the current mouse position, against the bounding box of the button. If it is in the bounds, and the mousebutton state is pressed, I fire off the delegate. I also set the focus to the control at that point. That works like a champ. However, I only wanted it to do the mouse checking when the button is &amp;quot;awake&amp;quot;. So I overrode the OnWake function and registered it with the ProcessList, and then I overrode the OnSleep function, so it can be removed. &lt;br&gt;&lt;br&gt;For my second pass, I think I am going to inherit from the GUIBitMapButton, maybe call it GUIBItmapEnhancedButton, and put all my modifications into that. That way I can use the stock one or my enhanced version. I am thinking I will add another texture for the pressed down state, and also expose a onMouseHover delegate. &lt;br&gt;&lt;br&gt;&lt;b&gt;Level State Machine&lt;/b&gt;&lt;br&gt;&lt;br&gt;I went through the TorqueCombat Level State Machine code, and it provided some good insights. I used to think of the .txscene files loaded by the sceneloader were &amp;quot;levels&amp;quot; so to speak. However, in their example, they actually create the level through code, and populate it with what is needed. The .txscene file looks like it has everything in it, and it is pulled out as needed. I am thinking I may still want to go with the level per .txscene, especially if I am looking at a possible 3d environment (not fully sure at the moment).  I am still going through the code, there is a ton going on in there!! &lt;br&gt;&lt;br&gt;&lt;b&gt;Sound Effects&lt;/b&gt;&lt;br&gt;&lt;br&gt;I went ahead and used the XACT utility to import some .wav files. I created a new wavebank, and a new soundbank. The two sounds I used were the mouseover and mousedown sounds. When I saved off the project, it created a xap file (I assume that is their project file extension). When I compiled, it created three files, a .xgs , a xsb, and a xwb.  I am thinking xgs stands for XACT Global Settings  , which I found is also referenced in my torquesettings.xml as a value for AudioGlobalSettings. I am also thinking that the xsb is XACT Sound Bank , and xwb is XACT wave bank.&lt;br&gt;&lt;br&gt;Once I figured out how it was working, getting it to play wasnt too hard at all. I just had to set up the soundbank and wavebank in code, then tell the soundbank to play a cue. I tested it out, and it worked out great. I can now use sound effects (and I assume ambient music and soundtracks)  throughout Arillian!!&lt;br&gt;&lt;br&gt;&lt;b&gt;World Generation&lt;/b&gt;&lt;br&gt;&lt;br&gt;This is something I have been meaning to do some research heavily into. I thought I was set on a 2.5d world, but I am not so sure anymore. All the benefits of a 3d world just seem hard to pass up. I have heard it is more difficult, but thats ok, I am up for a challenge. I took a look at the new TorqueX 3d beta, and checked out some of the terrain loading code. &lt;br&gt;&lt;br&gt;I am completely new to this whole process, so I noted the types they supported. Then I went and read what the heck a heightmap is, and found it to be fairly straightforward. I checked out terrain editors, and came across L3dt, FreeWorld3D, Terragen, and a host of others. This has me wondering if I can generate  small 3d terrain heightmaps (in 16 bit .raw format) , and swap them in and out with the sceneloader, based on the Level State Machine.&lt;br&gt;&lt;br&gt;I am thinking instead of one whole world, I only bring &amp;quot;chunks of it&amp;quot;. I checked out the fps demo, and they have various .txscene files, and the definition of the terrain was in there.  I am leaning towards L3DT (non Torque) one atm, but am still researching it. &lt;br&gt;&lt;br&gt;&lt;br&gt;Thats it for now. I am having fun researching and learning all these new aspects. Until the next update!</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/110205/13910">
		<dc:format>text/html</dc:format>
		<dc:date>2007-11-27T00:51:40+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>TorqueX Newbie Diary #1</title>
		<link>http://www.garagegames.com/blogs/110205/13910</link>
		<description>Well, my foray into the world of Torque X has begun. I recently went through and paired down my scope to test out the viablity of using Torque X. Arillian (formerly World of Arillian) has around 20 races, 40 skill trees with each skill tree having around 10-15 skills (around 450 skills ), and a playable area roughly 5 times larger than Diablo II. For my feasibility test , I plan on the following:&lt;br&gt;&lt;br&gt;Phase 1:&lt;br&gt;- Implement 1 Race (Human) with animations&lt;br&gt;- Implement 1 Enemy (skeleton) with animations&lt;br&gt;- Implement 2 Skills (1 active and 1 Passive)&lt;br&gt;- Implement 2 Areas (1 part of a town and a graveyard)&lt;br&gt;- Implement and Test Physics for player and enemy&lt;br&gt;- Implement and Test Basic AI for Enemy&lt;br&gt;- Implement Canvas State Machine [*Completed*]&lt;br&gt;- Implement Intro Splash Screen, Main Menu, Main Game GUI&lt;br&gt;- Implement Level State Machine&lt;br&gt;- Integrate 1 sound track, and several sounds for actions&lt;br&gt;- Test Basic combat&lt;br&gt;&lt;br&gt;Phase 2:&lt;br&gt;- Implement Basic Inventory System&lt;br&gt;- Implement 1 NPC merchant and merchant framework&lt;br&gt;- Implement Basic quest framework&lt;br&gt;- Impement character selection GUI, character creation GUI, cutscene GUI&lt;br&gt;&lt;br&gt;Now, I realize that looks ambitious, but given the scope of Arillian, this is a tiny slice to see if it is even viable. I want to make sure that all the above peices work before I progress any further. The goal is to get to the point where I can focus on content implementation. I want to ensure the framework I build makes it easy to do that, and although I could buy an addon or the like, I find its better to learn from the ground up (to some extent, Torque X looks like they already did the legwork on wrapping XNA) so I REALLY understand whats going on and what this baby can do! I have only had TorqueX for about two and a half weeks so far, and it has really impressed me. I went ahead and bought the source, because its easier for me to understand the intent of the Torque Engine components when I can see what it is wrapping in XNA, and how I can utilize it. &lt;br&gt;&lt;br&gt;I have decided that Arillian will be done as a 2.5D game. I know it is possible now thanks to the help of this community. I am going for the 2d isometric look (for the environment), with 3d art assets (characters,items,effects, etc). I get the utility of using 3d for character runtime itemization while retaining an awesome 2d look and feel. More than likely, I will outsource my 3d modeling aspects as well as my soundtracks, and focus more on the game programming. &lt;br&gt;&lt;br&gt;Since Torque X doesnt fully support 3d yet (in particular T2dShape3D), I decided to work on the GUI. My first test was to put some text on the screen, with the Exocet font (same font as diablo). I ran into a lot of issues with it, but finally found a XNAExtras pack that allowed me to convert the font I wanted into the format the TorqueX framework requires. &lt;br&gt;&lt;br&gt;With that out of the way, I built a basic framework, using TorqueCombatPro as my tutorial project to look at. I used StarterGamePro as my basic template, and began adding in peices from torquecombat pro. I dissected each peice I moved over to fully understand how it works, why it works that way, and how I can extend it if need be. Having the source, and being able to trace it through the framework has helped me a lot on what is happening. &lt;br&gt;&lt;br&gt;At this point, I have a functioning Canvas State Machine, that allows me to switch what is rendered on the GUICanvas by just simply setting the NextCanvasState variable from anywhere in the game. The Canvas state is checked for changes on each tick of an overidden update in my main game program. I have a basic splash screen which renders, then switches to a main menu page (nothing on it atm). I realize I will need roughly around 8-10 GUIs, but the framework to put them and manage the state of the GUICanvas has been implemented. &lt;br&gt;&lt;br&gt;The next peice I am working on is the Level State Machine, which from skimming over it, looks to be a lot more complex. I will also be flushing out the intro splash screen, main menu GUI and basic main game gui. So much to do, but man is this fun!! Till the next update!</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/110205/13891">
		<dc:format>text/html</dc:format>
		<dc:date>2007-11-24T01:27:27+00:00</dc:date>
		<dc:creator>David Everhart</dc:creator>
		<title>And so it begins...</title>
		<link>http://www.garagegames.com/blogs/110205/13891</link>
		<description>When I was a kid , in the 6th grade, I was introduced to the commodore 64. My dad subscribed to a magazine called compute gazette, and I would spend hours typing in the code, and try to play. I learned to hate the term &amp;quot;Syntax Error &amp;quot;! This began a lifelong fascination with gaming for me. &lt;br&gt;&lt;br&gt;Fast forward to my early twenties and a game came out that completely floored me. It was Blizzards Diablo. I was blown away by the dark theme, the action style of the game, the music, the graphics, and its rpg elements. Then its sequel came out later on called Diablo II , and then its expansion Lord of Destruction came out after that. I played the heck out of the whole series, and it left a big impression on me. I was in particular a huge fan of the necromancer class. I havent really seen a necromancer type class I liked since Diablo II.   Every rpg I played after that was compared to those games. Most just didnt compare. &lt;br&gt;&lt;br&gt;When hellgate london by Flagship Studios (The creators of the original Diablo) came out, I was pretty excited, thinking it might be the next Diablo II. I was dissapointed though, it shared some similarities, but not too much. I tried out the summoning class, and it was not quite what I expected. Their other offering was Mythos, and although I did not play it, the description of a light themed world, with a class based design didnt interest me much. &lt;br&gt;&lt;br&gt;I began thinking about a gameworld I had been thinking of since my college days. I had various peices of information scattered around, and wondered to myself &amp;quot;How hard is it to create an isometric game like Diablo II , with a freeform skill based system?&amp;quot; Having been a developer for pretty much all my life, I naturally researched it, and came upon Managed Direct X. &lt;br&gt;&lt;br&gt;My forays into that world were pretty daunting. Although I can read C# like a book, understanding all the aspects of Direct X, how everything tied in, and knowing what I write now, may change to the point that it requires a rewrite, made me look elsewhere. I came upon two engines, Torque X and Visual 3D.Net. Being new to the world of game development, I did some research, and have not yet fully decided as of yet, but I am leaning towards Torque X atm. &lt;br&gt;&lt;br&gt;I realize I have a lot to learn, and am looking forward to creating my game &amp;quot;World Of Arillian&amp;quot; , an isometric viewable game ala Diablo II style with a 100% freeform skill based system (no classes here!). I have designed much of my gameworld on paper (and in MS Word!), and am still working on the combat mechanics and the like. Nonetheless, I have begun a new foray into the world of Torque X, and realize my ambitions will require a 3d engine. I am hoping they release torquex 3D soon, as I really like the 2d game builder. More to come as I get deeper into my game, but for now, since torque X does not support 3D, I am working on the GUI, which I hope will be transferrable! Until then...</description>
	</item>
</rdf:RDF>
