Whether you live in “McFarland USA” or down the street from “Glory Road,” it’s a hardly a “Miracle” if you “Remember the Titans” to understand Disney has a nearly “Invincible” formula for sports movies inspired by true events.

It goes something like this. A dedicated and knowledgeable but underachieving coach comes across a raw but remarkably talented individual (or team), and is convinced this individual (or team) could go all the way — if only they can overcome the odds and continue to believe in themselves, even when things seem the most hopeless and the mountain is just too high too climb.

Meanwhile, a worried parental figure thinks the coach might be filling her offspring with crazy dreams that will only lead to inevitable heartbreak.

Cue the big game/tryout/match/event/race, by which time we’ve really come to like and admire the coach and his protégé, and darned if we don’t find ourselves rooting for them to ACHIEVE THEIR DREAMS as the music swells and the golden-hued cinematography reinforces our emotions.

Even as we’re aware of the formula and the manipulative tricks, we’re enjoying the ride.

So it is with “Queen of Katwe,” which is not about football or track and field or hockey or baseball but the pulse-pounding sport (board game?) of chess, and while there’s no way to make the Smothered Mate or some other checkmate move as cinematically exciting as a last-minute bucket or a ninth-inning home run, this still works as a solid Disney sports movie because of the remarkable story, Mira Nair’s energetic and uplifting direction, and one of the most endearing casts I’ve enjoyed in any movie this year.

Acting novice Madina Nalwanga is wonderfully natural as Phiona Mutesi, an adolescent girl living with her mother, sister and two brothers in the slums of Katwe in Kampala, Uganda.

Phiona’s father has passed away, leaving Phiona’s mother Harriet (Lupita Nyong’o in a powerful, sometimes heartbreaking, occasionally joyful performance) and the children to scrape out a living by selling corn. Their “home” isn’t much more than a glorified tent, but it’s a home, and they’re a close-knit, loving family.

One day, Phiona stumbles upon a chess club run by Robert Katende (David Oyelowo from “Selma”), a missionary and former football (aka soccer) standout who uses the game as a tool to teach children strategic thinking and self-worth.

It doesn’t take long for “Coach” to see Phiona has a special affinity for the game. Even though she can’t read, she can “see” the board with amazing clarity and is able to plan three, four, five moves ahead.

Cue the machinery for the Coach to encourage Phiona to get serious about the game, to learn how to read so she can soak up chess strategy and to dream about winning regional, national and even international competitions that could lead to a college scholarship, cash prizes and a ticket for Phiona and her family to leave the slums and have a life they’ve never dared even dream about.

And cue Phiona’s hardworking and street-smart mother’s concerns the coach is filling her daughter’s head with crazy dreams while the family is falling apart.

“Queen of Katwe” covers more than a half-decade in Phiona’s story. Nalwanga looks too old to be playing the 10-year-old we meet at the outset of the story, but we overlook that stretch because she’s so good playing the teenage version of Phiona.

Nyong’o, who burst to stardom with her Oscar-winning role in “12 Years a Slave,” is an absolute force as Harriet. David Oyelowo (“Selma”) deserves supporting actor consideration for his rich and layered work as the coach.

It’s a team effort, and even though we know this playbook by heart, cheers all around.

★★★

Disney presents a film directed by Mira Nair and written by William Wheeler, based on a book by Tim Crothers. Running time: 124 minutes. Rated PG (for thematic elements, an accident scene, and some suggestive material). Opens Friday at local theaters.