Copied in F3 mission framework.