When Pixar released “Finding Nemo” in 2003, audiences around the world fell in love with two clown fish named Nemo and Marlin, and a cheerful blue tang named Dory with short-term-memory loss.

On June 17, roughly 13 years later, Pixar is following up with a sequel called “Finding Dory,” which explores Dory’s mysterious backstory.

“Finding Dory,” which is set six months after the conclusion of the first film, follows Dory (voiced by Ellen DeGeneres) as she migrates from the Great Barrier Reef to the California coast to figure out her origins. Unlike “Finding Nemo,” which mostly takes place in the open ocean, “Finding Dory” mainly unfolds in a facility called the Marine Life Institute, which was loosely inspired by the real-life Monterey Bay Aquarium.

On a recent tour of Pixar’s studios in Emeryville, director Andrew Stanton explained that “Finding Dory” is an accidental sequel. After wrapping up “Finding Nemo,” Stanton had no desire to watch the movie again, much less pursue another fish-centered adventure. But when Pixar decided to rerelease “Finding Nemo” in 3-D several years ago, Stanton watched the movie again and realized that Dory’s fate seemed unresolved.

“I found myself worrying about whether Dory would lose this new family just as she had lost wherever she had come from,” Stanton said.

Sequels, especially for children’s movies, have a reputation for being lazy. But Stanton said that “Finding Dory” pushed the limits of his team’s creative faculties in ways “Finding Nemo” never did. The greatest immediate problem was Dory’s short-term-memory loss, which Stanton jokingly called the “bane of our existence.”

“It was the first, second, third biggest problem of the movie,” Stanton said. “You don’t realize until you take it away that a main character needs memory in order to tell the audience how they’re growing and feeling and how they self-reflect.”

Although he was tempted to overcome that obstacle by simply curing Dory of her memory loss, Stanton decided to keep Dory’s disability. In addition to being integral to the movie’s message that flaws can be “superpowers,” Dory’s memory was a fundamental part of her personality.

“It just didn’t feel right,” Stanton said. “It’s so fundamental to who Dory is, and no one wanted to fix her anyway.”

This particular challenge was tackled in the script. But technical problems were harder to sidestep, like designing Dory’s sidekick, Hank, an octopus with seven tentacles.

Jason Deamer, the character director for “Finding Dory,” noted that before Hank, he’d never drawn an octopus in his life. He was initially overwhelmed by some of the challenges, like figuring out how to create facial expressions for an animal that basically lacks a face. This eventually required Deamer to give Hank a mouth instead of a beak, which came close to breaking an unofficial rule about animals in the film.

“We exaggerate things, but we don’t put mouths where they aren’t,” Deamer said, explaining that it took several drafts before he figured out how to give Hank a mouth that wouldn’t strike viewers as unnatural.

Hank not only had to look natural — he had to move naturally. This was a tall order for Pixar’s animators, who had to program complicated motions, like the curve that rolls down an octopus’ tentacle.

“The difficulties with Hank span everything from design to the end of the pipeline,” said technical director John Halstead. “How do you make an octopus appealing and fun to watch? How do you make sense of something that’s flexible and floppy?”

To get more acquainted with Hank and other subjects that they’d be designing for “Finding Dory,” the film’s team took several trips to the Monterey Bay Aquarium, which became the inspiration for the film’s Marine Life Institute.

During one visit, the animation team was allowed to physically interact with some of the aquarium’s resident octopuses.

“We just stood there and this 70-pound animal came out of the water and attached itself to our arms, wrapped around us,” said supervising animator Michael Stocker, describing how one animator petted an octopus on its mantle, causing it to purr with pleasure. “You could really feel the intelligence of the animal.”

While Hank is the obvious showstopper in “Finding Dory,” the setting is also the result of meticulous craftsmanship. As with Hank, mimicking the California coastal waters where much of the movie takes place required a great deal of patience.

“The natural environments are much more challenging to make because the computer loves math,” said Steve Pilcher, one of Pixar’s production designers. “It loves tables and chairs and walls and flat planes. Anything that becomes a molded form with twists and turns just becomes a lot more challenging to make look convincing.”

To highlight the extraordinary level of attention paid to designing sets, Pilcher explained how his team would go about creating a PVC pipe that might appear in a scene.

To make the pipe look real, Pilcher and his colleagues would research what sort of algae would grow in an underwater pipe. Then they would apply different species of algae in random patches. They would then install mussels along the sides of the pipe, making sure each one had slight variations in shape, color and size.

This kind of set piece takes hours to create, but it may only appear onscreen for several seconds. It’s an appalling amount of work, but Pilcher sees this kind of work as a means to an end.

“When you see that it works really well, you don’t care that it’s only on camera for a second,” he said. “As long as it’s building for a better movie, I’m all for it.”

In a similar vein, Pixar’s “Finding Dory” team put special effort into the effect that they struggled with the most in “Finding Nemo”: water. Halstead recalled that when “Finding Nemo” was being filmed, the technology for simulating realistic water was barely in its infancy.

“We were only able to do a few shots where you could actually see breaking water — that’s where the challenge was,” Halstead said.

For “Finding Dory,” Pixar’s team was able to use a new rendering program that gives a more faithful simulation of how light behaves in water. It’s a major labor-saving technique, but it’s also a matter of pride for Halstead and his team that they were able to improve something aesthetically from the first film.

“It’s very satisfying to revisit this world and these characters with 13 years of evolution in the technology and the production approach to bring it to bear on ‘Finding Dory,’” Halstead said.