Jason Mitchell

Quick Tip: Fixing Incorrectly Sized Bounding Sphere for 3DS Model in XNA

Recently I’ve been spending a lot of time working on a 3D game engine using XNA and wanted to implement some model measuring functionality.  I noticed that my measurements weren’t coming out quite right so with the help of the App Hub’s shape renderer sample I was able to visualise the bounding sphere for the model and noticed it was significantly smaller than my model.  After some poking around and googling I discovered that I needed to set the units in my install of 3DS Max to be centimeters – once this was done and I exported my model again the bounding spheres were correctly sized and my model measurements were returning the correct results!


Getting Started With Fluent NHibernate and Auto Mapping in C#

I always hear good things about NHibernate and how it is better than alternatives such as Entity Framework so I decided to try it out for myself; not being a fan of large XML configuration files I went the route of using Fluent NHibernate which provides a fluent interface for configuration purposes.  Even though I’ve recently become a big fan of ASP.NET MVC 3 I decided to try out NHibernate in an ASP.NET Web Forms application since that’s what I work with every day.

Read the rest of this entry »


XNA and C#: Calling DateTime.Now is Expensive

While working on a new game engine using XNA I decided to run Visual Studios profiling tools against a basic demo game to measure CPU usage.  The results showed that the update process used approximately 65% of the CPU time while the render process used roughly 25%.  This ratio was not what I had expected at all because the updating was fairly simple so I drilled down into report to find the culprit.  It turns out the code using up the most of the CPU time in the update was a call to DateTime.Now to use as a time stamp.

Read the rest of this entry »


Data Access Using a Generic Repository in C#

The repository pattern is an abstraction layer which provides a well-organised approach to maintaining a separation between an applications data access and business logic layers.  This gives us the important advantages of making code more maintainable and readable and improving the testability of our code.  It also works great with dependency injection!

When I started looking at the repository pattern I found that a lot of the samples on the internet used explicitly typed repositories such as ICustomerRepository and IOrderRepository.  However for a website I’m currently working on all of my CRUD operations were pretty much the same and I wanted to reduce the amount of code I needed to write so I implemented a basic generic repository which would work with any of my data model classes.

Read the rest of this entry »


Quick Tip: Turn off workflows when importing large amounts of data to SharePoint

Recently at work I’ve been working on a script to import large amounts of data (~800,000 list items) into a SharePoint site.  The first version of the script had obvious performance issues and I had estimated it to run for 29 hours.  Turning off workflows which start automatically when a new list item is created cut this time to around 3 hours.

Read the rest of this entry »


ASP.NET: “The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect.”

While working on my current ASP.NET project at work I encountered the following error when trying to call the SubmitChanges method on my LINQ to SQL data context:

The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 3 (“@p0″): The supplied value is not a valid instance of data type float. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision.

Read the rest of this entry »


XNA Twitter Powered Tic Tac Toe

This was a project that was not mostly pointless and impractical but is as bizarre as this article’s title makes it sound.  One day about two years ago I was bored, very bored.  I was at a total loss for small projects to work on in the evenings after work.  Somehow I came up with the idea to make a multiplayer XNA Tic Tac Toe game which used Twitter mentions for sending messages between players (wtf….I know).  Basically the game constructs simple text “commands” and posts them to a Twitter account and the other player’s game would poll Twitter looking for messages from the other player.

I decided to post this project because I’ve been at a loss for what to write about recently and I thought this project was so strange that I thought I should share it.  The project was made in XNA 3.0 or 3.1 and may not work anymore depending on what has changed with Twitter’s API; I really don’t know and I haven’t run the game.

Download: http://www.jason-mitchell.com/Uploads/TwitterTicTacToe_24-08-2011.zip


University Dissertation and Project

Now that I’m finished with university and have a bit more time on my hands I thought I would write an article about my final year dissertation and project.  The goal of my project was to create a framework to enable the creation of games which make use of multiple devices to provide a single game experience.  In the case of my project I created an XNA game running on Windows which had its gameplay extended by menus and mini-games running on Windows Phone 7.

This project was motivated by users becoming continuously more connected with the internet, other devices and those around him due to the increasing propagation of smartphones among consumers and wider availability of high-speed wireless data networks.

Read the rest of this entry »