Thursday, April 23, 2009

Speed up your Compact Frameworks Builds

One features that is built in to the CompactFrameworks build process is an evaluation of your code to make sure that all of the “stuff” you use within the .NET frameworks is indeed available to the Compact Frameworks.  While this sounds like and a good idea, and it probably is, it does come with a cost.  The project I’m working on is not too small at ~35K NCLOC but by default it was taking a minimum of 75 seconds to do a full re-build.  After casually watching Debug View while building I was noticing a lot of calls to “Platform Validation Task”.  In fact most of the time it was building, it was spitting out these debug messages.  So with that bit of knowledge it was fairly easy to figure out the next steps on how to make this more efficient.

 

1) Find the target file for Compact Frameworks: [MS_BUILD_DIR]\Microsoft.CompactFramework.Common.Targets

2) Find the section that runs the PlatformVerificationTask and add a condition as shown below, you could just comment out this section, but running this for releases is probably a good idea.

 

image

 

Once I made this change, my build time went from 75+ seconds down to less than 5.

Hope this helps you out.

-ec

Wednesday, April 15, 2009

Improving the rendering of your models with MultiSampling in XNA

When you first compile, build and render your models in XNA, they can look pretty bad.  By default MultiSampling isn’t enabled for your game.  If you enable MultiSampling, the appearance of your models will be greatly enhanced. 

MultiSampling will antialias the edges of the triangles for your model. According the XNA Developer Center

Antialiasing is the process of smoothing the edges of triangles by averaging neighboring pixels in a render target. Because this process samples multiple pixels, it is also known as multisampling.

The first screen capture is from the Windows version of my game that does not have MultiSampling enabled.

NoMultiSampling

 

The second screen capture show how this looks with MultiSampling enabled.

MultiSampling

 

As you can see the grid lines look much better as well as the guns and the edges of the ships.

 

Enabling MultiSampling is easy, in the constructor of your game you will need to set a property and hookup an event.

The instructions can be found at:

http://msdn.microsoft.com/en-us/library/bb975403.aspx

 

It’s important to note that you MUST setup your graphics device in the constructor.  I had done this in the Initialize function, at that point the Graphics Device has already been setup and resetting it causes very bad things to happen once you deploy your game to the XBOX 360 (this cost me about 4 hours that I’ll never get back).

Enjoy!

-ec

Wednesday, April 1, 2009

Announcing V4.1.2009 of Cloud-2-Relational Query Engine

We are pleased to announce the release of V4.1.2009 of the Cloud-2-Relational Query Engine.

What is it?

Our Query Engine will allow you to write SQL that will be executed against both a cloud table storage provider as well as most relational database engines.

We all know the benefit of an RDBMS is the ability to write sophisticated DML to extract data.  Although these scale fairly well, to store hundreds of millions of records requires special attention or your performance will suffer.  Most cloud storage solutions have the ability to store zillions of records (well at least in theory) but don’t really support joins, this is a real problem if you want to normalize your database.

This is where our product comes in.  The best of both worlds, the ability of a cloud table provider to store zillions of orders and the ability to join those orders with a much smaller lookup table such as OrderStatus

You simply write a query such as:

select rdbms.Status, cloud.OrderNumber, cloud.OrderAmount
  from status rdbms,
   join (Select  OrderNumber, OrderAmount 
           from  myCloud.orders 
          
where UserId = @userId) as cloud on cloud.OrderStatusId = rdbms.OrderStatusId

We are still working on enforcing referential integrity however once we do that we will have the best of both worlds.  Performance and Scalability of large scale cloud storage and flexibility of a RDBMS.

-ec