One of the attractions of writing nonfiction, mainstream fiction, and most genre fiction is that you and the reader already share the same universe: the Real World, where the cultures, mores, politics, and history are all well known and relatively easy to research. Research is itself a major hot-button topic for writers, one I’ll save for another time. Suffice it to say that every writer of these genres knows more about the world, based on his or her research, than comes out in the writing; we don’t want to slow down the action with history lessons, infodumps, or minutia that only a specialist would care about.
In speculative fiction—science fiction, fantasy, horror, alternate history, and related fields—some or all of the universe’s history is invented. In alternate history and near-future stories, the history, cultures, and the like are shared with the real world up to a point, before the tale diverges from what we know. In epic fantasy, the milieu is purely invented. But that doesn’t mean that, as a writer, you shouldn’t know the length and breadth of your world’s history, or that you should make it up as you go along.
Consider J.R.R. Tolkien’s Silmarillion. It’s like a Bible for Middle-Earth, and the stories collected in it describe, in detail, the events that led up to The Hobbit and The Lord of the Rings. But he wrote it mostly for his own elucidation (he liked to say he “discovered” Middle-Earth rather than invented it), and may not have intended to have it published. Certainly it was published long after his death, by his son and editor, Christopher Tolkien. Although few of the stories made it into his classics in any form, they underlay and informed every word he wrote in that universe.
You don’t have to write your own Silmarillion, but before you set pen to paper, it’s a good idea to know all the basics of your invented world. “Discover” everything from its creation stories to its various cultures to its shared history, and the individual characters and their own histories. You don’t have to use all this material in your tales, and probably shouldn’t—but it should be there to surround and enwrap your stories, to add verisimilitude and make them seem all the more natural.
One of my favorite writers, the prolific Kristine Kathryn Rusch, often writes stories about her characters just for herself, so that she can better understand a developing storyline in one of her novels. Sometimes she publishes them; sometimes she doesn’t. She’s especially taken up this tactic with her eight-book Anniversary Day Saga, a subset of her popular Retrieval Artist series, set in a far-future time where Earth is the center of an alliance of thousands of intelligent species sprawled across the known universe.
Rusch never discusses when the stories occur or how large the known universe is. But she certainly knows—and you get the sense of a grand sweep of stories set in a well-worn, lived-in universe where humans are subject to alien laws they don’t understand when they visit planets belonging to other species, just as those aliens are subject to ours. That apparent inequity spawns most of the friction that leads to most of the stories she sets in that universe.
How well do you know your own universe? What rules and physical laws hold it together? Are the aliens truly alien, or just thinly disguised humans? And if the latter, did you create them that way to get a point across? Was that murder really a murder, or—in the case of Orson Scott Card’s Speaker for the Dead—was it an honest, if misguided, attempt to honor the victim by helping him pass on to the next stage of his life?
Not everything will be obvious to the reader at first, and you shouldn’t try to make it so. That would break the basic laws of literature and prove boring, if nothing else. The world is your background, and in some cases it may almost be a character in your story; but it isn’t the story itself. No writer reveals everything he or she knows about the setting, whether writing about historical events in the real world or in an epic fantasy trilogy. But he or she should be able to answer all the questions about it anyone might ask, as long as doing so doesn’t ruin the story for the reader.