Avoiding Unnecessary Content Rebuilds

As I continue to work with my project, I’ve ran into a nasty situation where a certain sequence of events can lead to a complete content rebuild on the game project.  Sometimes this isn’t a big problem, but my game is now taking 2 minutes or so to completely rebuild from scratch.

My situation is as follows…I have a main game project and two other class libraries.  The first class library is the root of the project dependency tree.  It’s a library containing shared components.  The second library is a content pipeline extension containing my custom importers and processors.  If I make a change in the first library (let’s call this the “data” library), it causes the content pipeline library to need to be rebuilt.  OK, no problem, it builds in a about 5 seconds flat.  The real issue is that when Visual Studio detects that the main game project is using content processors from that pipeline extension library, it thinks all of the game content needs to be rebuilt.  This is bad because it takes so long to rebuild my project.

The solution is to break up the “data” library into two libraries:  one contains the objects that the content pipeline extension library requires and the other contains everything else.  The second class library containing the shared data objects is the stuff that is changing frequently anyway, so this means that the content pipeline library will not need to be rebuilt as much.  This causes the entire project build to speed up because of the incremental build characteristics of the content pipeline.  I’m glad I was able to work around this issue.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: