Set in a theoretical reality of multiple universes, Broadway’s ‘Constellations’ requires actors to mind the punctuation as if it were the word of God.

In “Constellations,” two people, Roland and Marianne, play out their relationship again and again in what’s known as a multiverse—a hypothetical reality in which there are an infinite number of universes in which an infinite number of us exist, each living out a different version of our lives. To make such a theoretical premise clear on paper, playwright Nick Payne used three different fonts in the script—bold, italic, and normal—to denote that Roland and Marianne have switched to a new universe.

“A lot of people read [the script] and have lots of questions,” says Mr. Gyllenhaal, who took classes in Eastern religion at Columbia University, “and some people say, ‘Oh, I get it.’ I got it.”

“Constellations,” which opens Jan. 13 at the Samuel J. Friedman Theatre in New York City, plays out like a long episode of déjà vu. When Mr. Gyllenhaal and Ms. Wilson meet in the first scene, their interaction repeats in five different ways. In some versions, or “universes,” Mr. Gyllenhaal has a girlfriend already and the conversation ends abruptly. In another version he’s just not interested. And then in one version, he really likes Marianne and she him, and a match is made. The play continues in this stuttering manner for seven more scenes, each containing new endings for the characters.

The personalities of Roland, a beekeeper, and Marianne, a theoretical physicist, stay essentially the same, and they say essentially the same lines to each other scene after scene, with slight shifts that will veer their lives into dramatically different directions. A single word, or even a punctuation mark, ends up changing the outcome of the scene.

“They’ve learned the script to the comma,” says Mr. Payne of his actors. “There are nights when I watch it and I can see the text on the page when they’re saying it.”

Mr. Payne doesn’t generally interfere with the actors’ interpretations of the text. But he will interfere if he thinks clarity is lost—which often comes down to a misplaced pause.

To learn the surgically precise script, and to perfect the pauses, interruptions and “universe” changes that must be seamless every night, Mr. Gyllenhaal and Ms. Wilson rehearsed their lines together instead of on their own, like ballet dancers.

“We would go out to dinner and run all our lines; we would meet up on our days off; we would meet up an hour before rehearsal and we’d speed run through the lines while we were walking from downtown,” says Mr. Gyllenhaal. “There’s a lot of overlapping dialogue, but the overlapping is very specific,” he explains, “and there’s not a consistency mathematically of how you would approach it.”

To illustrate the point, Mr. Gyllenhaal begins reciting a scene—both his and her lines, complete with verbalized punctuation. “She says, ‘ellipses, He, ellipses, he said that, ellipses,’ and I say, ‘We can stop, period.’ She says, ‘No, I’m OK, period.’ I say, ‘We could eat, period.’ She goes, ‘No, I’m fine.’ I go, ‘Honestly we can stop, comma, we can eat, period.’ She goes, ‘I think I’d rather just, dash.’ I say, ‘No, you’re right, dash.’ She says, ‘I think I’d rather just get through it, dash.’ I say. ‘Absolutely, period.’ ”

Although he giggles through Mr. Gyllenhaal’s impromptu reading of his work, Mr. Payne acknowledges that his script does demand a loyal memorization. “I’m not a stickler for rhythm, per se. I think the lines should be free to exist however the actors want,” he says. “But I think punctuation is worth adhering to,” he says.