Discovering Subgoals in Complex Domains