incorporated code from cutscene generator of techdemo