Compact Save

Date:    Tue, 18 Mar 1997 13:07:34 -0800
From:    "Terry R. Schussler" 
Subject: Which order are cast members written to CD?

>I'm thoroughly confused.  Does anyone know which order Director 5.01
>writes cast members to CD.
Overview:
Director's Save and Compact, Save As... and Update Movies commands all save out a Director file in "optimized format." These operations usually take much longer (depending on the size of the file and recent changes) than the Save or Save All commands because these commands simply _append_ new data structures to the end of the current file. When Director loads a movie, it will read everything in sequential order and as it finds _newer_ versions of various data structures (castmembers, score structures, scripts, etc.) it will replace the previous read version with the newer version. As a result, loading such unoptimized files can take significantly longer, especially if they've been frequently edited and saved.

So, to obtain optimized files for playback, the Save and Compact, Save As... or Update Movies command needs to be employed.

How It Works for .DIR files:
First, Director creates a new file and writes out the data structures for the Score, the cast libraries with member definitions (but not media) and then the compiled scripts.

The "media compacting" process begins by scanning the Score structure of the movie. Director starts in frame 1 and the first "special effects" channel. It examines each cell looking for a reference to a castmember located in an _internal_ castlibrary. When it finds the member, it writes its media (remember that its property structure is already there) to the file - unless it is already in the file in which case Director simply moves on to the next cell.

Once Director has scanned and saved each member referred to explicitly by the Score, it then starts scanning the _internal_ cast libraries starting at member 1 of castLib 1. Director walks through every member slot and if the member is not already written to disk (from the previous Score scan) it will then write its media to disk.

How It Works for .CST files:
Director writes out the castlibrary structure and compiled scripts (remember, there's no Score) and then simply scans the cast library starting at member 1 and writes out each member's media.

Shockwave:
Processing a movie for Shockwave using AfterBurner performs the same operation as Save and Compact, with the addition of inline media compression being applied to most members and the addition of the "protection" process as applied by the Protect Movies features of Director.

I hope this information is helpful. It is based on my own observations and research -- any mistakes herein are my own.


Date:    Tue, 18 Mar 1997 21:34:09 EST
From:    John Dowdell <71333.42@CompuServe.COM>
Subject: Re: Which order are cast members written to CD?
Eric Mueller writes on March 17, in part, "I'm thoroughly confused. Does anyone know which order Director 5.01 writes cast members to CD. I've gotten several conflicting answers - one person will say Director writes Cast members in the order they appear in the score, while another will say Cast members are written in the order they appear in the Cast."

Although this is in the KB, it can be hard to find... difficult to get unique search words for this topic. It's in the record by Mark Shepherd in Nov 94, with the unique keywords of "file seek offset, traceLoad, optimization". Here's the relevant part:

"After a 'Save As...' or 'Save and Compact' Director rewrites fully-imported media to disk in the order in which they occur in the Score. Graphics not in the Score (puppets and such) are then written after this file, in Cast Window order."

The several prior answers you received are not really conflicting answers, more like partial answers. Director 4 and above automatically optimized file writes for linear streaming presentations. Media is written to disk in the order it appears in the Score, and then the Cast is checked for any remaining media. I think this information may also be in the MediaBook CD.

Eric also writes, "Where does Director write Movie and Parent Scripts? What about external, linked Casts? I've also noticed that when my movie is started all scripts in the cast seem to be loaded in memory. If this is really true, then wouldn't it be best to have all scripts located at the beginning of the cast?"

This issue will come up frequently over the next few months, as we start designing streaming presentations. Here's the scoop:

Instructions load first. Then the movie can start. Media can stream in the background. All tokenized scripts will load into memory before start of play. All cast database info will load into memory before start of play. The position of scripts in the cast won't matter here, because (the tiny) instructions load before play, and (the massive) media loads during play.

Complex area when optimizing like this, Eric... hope the above is of use in your work, and please post back to the list if it needs to be clarified.