Advertisement Jump to content
Sign in to follow this  
3DModelerMan

Content compiler with multiple outputs

This topic is 1821 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on a content compiler that will take my raw input assets and convert them into resources for loading into my engine. The actual conversion is easy and I've already got it working fine. The problem is that one input file (a PSD image for example) can produce multiple output files (each layer of the PSD as a separate DDS texture if that option is enabled). This part is working fine too, but I need to figure out how to clean the resources up when the input file is deleted. I don't want to have to re build all the assets every time a file is deleted/renamed/whatever. I just want to be able to delete the multiple outputs from the one asset file, and rebuild that single file. How would you recommend going about tracking the outputs? I already have a metadata file for per-asset options, but using that to track outputs seems like it would be fragile to any changes made in Windows Explorer while the content compiler wasn't running.

Share this post


Link to post
Share on other sites
Advertisement

I don't currently have this feature implemented (i.e. if I delete an input file, it's outputs still continue to exist until next time I force a full rebuild by deleting the compiled data directory).

 

However, I have the build-system maintain a central database of records of all the work it's done. Whenever a file is built, the input and output file-names, time-stamps and hashes are stored in this database, along with the version number of the data-compiler plugin that was used.

 

At the moment this lets me check if an input file has been modified, and then find all outputs that were built using that input file, so they can be re-built.

To implement your feature, I could check if an input file no longer exists, find all the outputs that were built using it, and delete them.

 

When I start up my tool, I scan the entire content directory checking file-names and time-stamps, which is extremely fast, and lets you detect any missing or modified files. I then subscribe to events about any changes to that directory, so the tool is notified of modifications/creations/deletions while it's running.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!