A running joke in “Game of Thrones” has Peter Dinklage’s character, Tyrion, repeatedly butchering the Valyrian language, despite his best efforts.

In a recent episode, he tries to ask a military guard for permission to see a prisoner and comes up with: “Nyke mzun ipradagon bartanna relio.” A subtitle on the screen translates this for us as: “I drink to eat the skull keeper.”

When the guard stares at him in confusion, Tyrion tries again but only utters more gibberish. Finally, the guard informs him in perfect English, “I speak the common tongue.” Hah.

It’s a simple gag on its face, but there’s a deeper layer. The language Tyrion is garbling actually exists. There is a Valyrian grammar, a dictionary containing thousands of words, and even separate dialects for the various Valyrian-descended cultures that exist in the show. After eight seasons, High Valyrian, Low Valyrian and the separate language of Dothraki are as well developed as the character of Tyrion himself.

Any number of fan-created guides and online dictionaries can teach them to you, but their true developer is a linguist named David J. Peterson, whom HBO hired out of an online community of amateur language inventors — invigorating an art that only a few years ago was so obscure many of its practitioners assumed they were the only people in the world doing it.

Some in this community — they call themselves “conlangers,” for language constructors — have spent nearly their entire lives developing a personal language, to the point they might think in it, pray in it, dream in it.

Peterson’s original inspiration: He was irritated by a scene in “Star Wars: Return of the Jedi” when he was a teenager in the 1990s. Like most movies that are supposed to have fictional languages, “Star Wars” just uses random gibberish instead. Princess Leia uses the two made-up words, “yaté” and “yotó,” to refer to, variously: a Wookie; a bounty; a thermal detonator; and 50,000 space credits. Yaté yaté yotó yotó.

“If you ask the people who work on ‘Star Wars,’ they think it’s a big joke,” Peterson said. “They don’t care at all. And fans are spending hours and hours analyzing that garbage.”

He felt he could do better — and so began devoting his free time to making up languages that had their own coherent grammars, phonologies (or sound systems) and even imaginary cultural influences. His hobby coincided with his formal study of linguistics, and in the late 1990s it led him to an Internet message board — a small but active community of people from around the world who were doing exactly the same thing as he was.

This community’s body of work includes what must be some of the stranger creative endeavors of the modern age. A former California DMV worker, for instance, spent years developing a language called Ithkuil that he says can convey something as complex and abstract as a cubist painting in half a dozen words. The grammar is so complicated that it can take 15 minutes or more to figure out how to conjugate and pronounce a single sentence, so it’s not exactly marketable.

But conlangers did occasionally penetrate the broader culture. They trace their history to the 12th century, when the Benedictine nun Hildegard of Bingen created a “lingua ignota” for divine communication. Nineteenth century idealists created international languages they hoped would unite the world, though only Esperanto is spoken by more than a handful of people today.

The most famous proto-conlanger was the author J.R.R. Tolkien, who invented a deeply structured Elvish language for his “Lord of the Rings” trilogy in the 1950s, including Elvish songs and poetry. His passion features in the new biopic “Tolkien.” Since then, pop culture has occasionally dabbled in the art — notably “Star Trek’s” Klingon language, and “Avatar’s” Na’vi.

The novelist George R.R. Martin scattered a few Valyrian and Dothraki sentences throughout his fantasy series, “A Game of Thrones.” So when HBO adapted the books into a TV show, the network sought out Peterson to deconstruct those snippets and develop them into working languages, which now reside on a 600-page document owned by HBO, and in the imaginations of thousands of fans — some of whom learn High Valyrian on the app Duolingo.

And Peterson has done what seemed unimaginable even 10 years ago: Make a career out of inventing languages, consulting for “Penny Dreadful,” “The 100,” “Into the Badlands” and other shows.

Jessie Sams, an associate linguistics professor at Stephen F. Austin State University in Nacogdoches and a conlanger, started lobbying to teach a course in the subject in 2011 — just as “Game of Thrones” began.

She had two issues: Neither her colleagues nor students were very enthusiastic.

“I had to beg students to take it,” she said. “I was the professor who brought cookies every week. I was like, ‘Don’t drop! Don’t drop! Stay in it.’ ” On the faculty side, “People said, wait, how is that going to look for our students if they go to grad school and ‘invented languages’ shows up for their linguistics course?’ “

But she scrabbled together not quite a dozen students and developed a curriculum that now includes assignments such as “What is a written or oral tradition your speakers have in their culture?”

In that first year, a student named Lindsey Antonini won one of the university’s top prizes, for a language for bears she created called “ARKTOSK,” assuaging the academic critics. Today, Sams’s class has a waiting list, and her students tend to cluster around a table discussing the latest episode of “Game of Thrones” before her lectures.

Computer programming major Charlie Davis, 22, invented a language called Jan Zhuo, and his final project this month was a 100-word glossary with at least 10 etymologies.

“It actually is extremely challenging — creating a whole language, something usable, in a three- or four-month period,” he said. “I did kind of think it would be a blowoff class.”

When Lysie Sarantos realized that the Dothraki and Valyrian lines on “Game of Thrones” were not just gibberish, she phoned her father, Peter Tarlow, who lives in College Station, where she grew up. “Dad,” she said, “you should sell Peterish to Hollywood.”

Peterish — known formally as La Petro — is a language of some 10,000 words that Tarlow invented as a child in the 1960s. He spent years layering it with words and rules. It sounds like a strange blend of Romance languages (Tarlow is fluent in several) and Yiddish (he is a retired rabbi). Naturally, it excels at expressing concepts particular to its inventor’s domestic existence. The word “shlepgihjhet,” for example, translates loosely into “a miserable daily experience.” Or as Tarlow put it: “Oh, my God, I’m going to have to go to the airport! I’m carrying a bunch of bags! My wife is yelling at me. Shlepgihjhet.”

“It’s sort of always been there,” said Sarantos, who now lives in Silver Spring, Maryland. “I was in middle school before I realized it was weird that my dad made up a language.”

The family dog was trained toturn his head”rihjhet” and “efte,” right and left. Tarlow once mortified a teenage Sarantos by yelling “yil ēn tard!” — you’re late! — in the middle of a shopping mall when he collected her from her friends. And he once declared his wife Sara Alpern a “full professor in La Petro” — an honor she declined, as she is an actual professor of history at Texas A&M University.

As with many conlangs, Peterish managed to stick around despite its oddness. Sarantos’s brother Nathaniel Tarlow, a lawyer in Houston, still speaks in it with their father. Her 9-year-old son, Manny, once invited his grandfather to class to demonstrate the language, and proudly coined a Peterish slang word for woodpecker: “tututuquer.”

Now 73, Tarlow likes to take long walks in the mornings, and he speaks to himself in La Petro — using words and concepts that are by now so bound up with his personal experience they have no equivalent in English or any other language.

“As I’ve gotten older, the language has reflected my personality more and more,” he said. “At first it was this artificial conceptualization, then it took on a human quality ... It’s the best way I can communicate with myself because it reflects myself.”