Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

Content compiler with multiple outputs

4: Adsense
  • You cannot reply to this topic
2 replies to this topic

#1 3DModelerMan   Members   


Posted 26 January 2014 - 07:28 PM

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.

#2 Hodgman   Moderators   


Posted 27 January 2014 - 04:49 AM

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.

#3 3DModelerMan   Members   


Posted 27 January 2014 - 03:28 PM

Thanks for the help. It's working great now.