Fassbender plays both the kindly android Walter and his twisted, civilization-ending "brother" David. David can create (and uses that talent to engineer alien life), while Walter cannot — an intentional limitation in his programming. But in a moving and seductive scene that's been described as possibly homoerotic, David teaches Walter the flute, declaring "you have symphonies in you, brother!" Later, the pair share a kiss, with David telling Walter no one will ever love like he does — before attempting to kill him.

In a conversation with Heat Vision, the film's co-screenwriter Dante Harper breaks down that Walter and David flute scene, the larger role James Franco's Captain once was to have, the massive backstory the team conceived of for the Engineers and an ending that wasn't always quite as bleak.

Because I am familiar with James Franco, I felt the loss of the captain more. Is that why a movie star was cast in the brief role?

Originally, the James Franco character was part of what was a larger storyline, involving learning a little more about his background and actually getting to see some of his dreams that he'd had while he was asleep. It had to do with the backstory of both Daniels [Katherine Waterson] as well as Billy Crudup's character, Oram. Part of Ridley's idea was that this was a ship that not only had this external problem, but it also had this problem that there was this captain who was not the original captain who is now going to lead the mission and maybe make some terrible mistakes. The James Franco character is in that teaser a good bit more, and I think in different versions of the screenplay as it went along, he had a larger role, but his role was always to be an absent captain.

Walter and David emerged as the surprise standouts of this movie. How did you craft their conversations?

One of the things that was really beautiful for me to see was Michael Fassbender doing the role, because no matter what you can envision as a screenwriter, when a truly great actor gets the material, they can create dimensions in the material that you just never expected.

Nothing had really prepared me for the terror that Fassbender would bring to his version of David, who really feels unhinged in this way that was on there on the page, but what Fassbender does in the movie gives Covenant a whole other element. He is as interesting as the alien in his own way. This was an alien story, but it was also about creators and their creations, and there is this David story that sort of mimics the whole alien story itself, and the Engineers' story.

The scene in which David teaches Walter the flute will undoubtedly go down as a classic. How did that come about?

I wrote many versions of the "David seduces Walter" scene. It's a really delicate, hard scene to get right. I do think we all owe the actual use of the flute to [co-writer] John Logan or Ridley — it came after me.

I do know that from the get-go, it's such a hard scene to get right, because you've got these two identical robots, you've got this unhinged narcissist. … But I really think Ridley handled that so beautifully, that you have this homoerotic scene that also at the same time turns out to be truly just terrifying and not about the eroticism. I think it manages to be really enthralling and beautiful, and so much of it has to do with how Fassbender does it, giving it that flute. It's a scene that easily could have gone wrong. If you imagine a different actor or a poorly written scene, it would just become an obligatory kind of scene, but the way it ends up being written and the way it ends up being played — it's really one of my favorite parts, and I have four or five different parts of that movie.

David looking down as he unleashed a plague on the Engineer's home world is also incredibly daring. But it's also very brief. How did you decide how much you wanted to show of that?

That's an image Ridley was very, very passionate about from the beginning of our conversations. The only question became where to put it in the movie, and we played with lots of different versions, where it was something you saw at the very beginning. Now it's revealed much, much later. The image itself is this moment that should be a greeting that becomes a horrible bombing. It reminds us of footage from Vietnam, for example. That was something that was clearly one of the most powerful images Ridley knew had to be in there, and we did many different versions of it and I can tell they probably played with where it was in the film well after I was working on it. I happened to really love where it ended up in the movie. It's an odd place, but it turns that whole sequence in the city into this beautiful reveal that feels like you are falling into some sort of demented dream of this robot. It is definitely one of those images Ridley was very clear he needed somewhere.

It's at that moment we really understand who David is.

When I saw the movie the first time, I recognized for the first time the degree to which it's very much a Gothic story, in a formal sense of what the elements of a Gothic story are. Which I wouldn't really say about any of the other Alien movie. You go to this place that has elements of this lost civilization that may have been evil, or maybe not. You're not sure. And it's been destroyed and the whole planet is this haunted house. And then you meet this person who is this sort of Caliban or a Fall of the House of Usher type of figure who, everything you see, you aren't going to have it explained, but you have a sense that many terrible things happened in this past in this place. It deals with history, which you don't normally see in science fiction.

Some fans won't like that we now know so much about the Xenomorphs' origins. What is your reaction to that, and how did you decide how much of that backstory to share?

In terms of how much we know, and how much we learn, that in a sense becomes Ridley's decision. It's very hard to fabricate new information, but it's very easy to cut it out. In my drafts of the screenplay — and I'm sure drafts that came along later — even if you're keeping things shrouded in mystery, I think you actually have to know what happened, because people can tell when they see a tip of an iceberg but there's no real iceberg underneath it and you really haven't done the math, you haven't figured out what happened. I think I could write a small book about all the things that happened, because we had to figure all that out. So the question became, "How much are we going to learn?" One of the things that was interesting about the final cut of the film is we actually ended up learning a lot less than was possible given the drafts that we had. That was always the question with every draft, "How much can we reveal, how much can we not?" At the end of the day, I think a lot of those decisions got made in the editing room. You can tell the information is there. I think they pulled back in places. If you've seen teaser No. 2 that has the scene between David and Shaw [Noomi Rapace] — that was a scene that was at the beginning of many drafts of the movie that I wrote, because at the time, we were thinking that this movie would really pick up a few seconds or a few days after Prometheus ended.

That opening became kind of a stand-alone piece. It gives you a sense of the degree to which there used to be a lot more technical information about what exactly happened. There is the history of the Engineers and their relationship to the xenovirus, and also David's creation of the alien. Both of those things were always a question of how on the nose to get.

And what about that ending? Did you always know David would win completely?

No. There always had to be the seeds of something bad happening at the end, and the ending as it is now, where David is strongly holding all the cards and has won completely, that was always a possibility. I'm sure Ridley had a very clear idea, because he doesn't begin shooting unless he knows how he's going to do everything, but, even in my drafts, there were a lot of different ways it could end.

I knew we were not going to have twin robots without a certain amount of switcheroo. One thing I'm proud of is — because that always comes up when there are twins — we thought, "How do you make them forget that's probably going to happen?" I struggled with that as a screenwriter and then at the end, I felt like the film really did a good job. That's a feat of editing as much as anything else, but you do believe the good Walter beat up David and got on that ship with them. It somehow feels like a surprise, although in retrospect, "Of course they were going to do that."

***

For more from Alien: Covenant, take a look at why the Xenomorph remains horrifying to audiences decades later; this handy primer for how Covenant ties into the larger mythology; and our interview with Billy Crudup on why Ridley Scott scolded him on set.