The art of creating worlds is crucial to good Fantasy and Science Fiction.
There are four basic parts of a story: plot, character, setting, and theme.
You cannot be a good writer unless you can command each of these.
If you have a mediocre, predictable, or contrived plot, your book will bore readers.
If your characters are two dimensional, unmotivated, or cliché, readers will not care about what happens to them in your story.
Theme is what makes a story more meaningful than mere entertainment.
But what sets Fantasy and Science Fiction apart from other genres is the setting.
Think MINORITY REPORT:
The story of a rogue police detective dodging a former colleague because he's been set up by the authorities sounds like a fairly typical mystery/thriller.
But what if the crime the detective was accused of hasn't actually happened yet, but was only predicted by a police psychic?
Suddenly you have the brilliant Science Fiction movie Minority Report.
Gattaca is essentially a thriller centered around an identity theft crime.
But what makes the story Science Fiction is its setting in a eugenic society based on DNA determinism.
A story about an engineer hired to help build a ceramic engine for a race car transforms into a fantasy story when you find out why the owners want a ceramic engine.
They are "allergic" to iron because they happen to be elves.
To be a good writer you need to know character, plot, and theme.
But to be a good Fantasy and Science Fiction writer, you need to master setting.
This is true even if your world is not a major focus of your story.
Alien for example has two worlds:
the barren, stormy planet where they discover the derelict alien spacecraft,
and the Nostramo.
You never see the ship's engines or learn anything about how they work,
you never learn much about the politics of Earth,
You learn absolutely nothing about the mysterious alien wreck,
There's little there about the technology of the android, or any of that.
The rest of the universe, the "Corporation", the government, is essentially implied,
but it's there enough that you are aware of a world bigger than the Nostramo.
There's just enough to give the alien good hiding spaces for it to jump out and slaughter the crew one at a time.
The key is that those hiding spaces don't come across as meaningless or contrived like the Chompers in Galaxy Quest.
Nor do you need to create a universe that is totally original or free of those dreaded Fantasy clichés.
Think about the "greats:"
Fantasy worlds like Middle Earth, the lands of Jordan's Wheel of Time, Discworld.
These worlds are made up, in many cases of pieces borrowed from other sources.
Tolkien took most of his world from ancient Norse mythology and Celtic legend.
Discworld is an intentional hodgepodge of other fantasy ideas.
The worlds of Dungeons and Dragons are so derivative of Tolkien, it was nearly sued out of existence in its early days.
The pieces may not be entirely original,
but the whole is a world that sucks the reader in and keeps them coming back.
And that's the key for creating a realistic world for your story, creating the world as a whole.
Our world, its physics, geography, environment, biology, and the human cultures and civilizations on it
all connect in complex interdependent systems.
You don't have to detail every aspect of your world,
nor does your world have to be totally feasible from a purely scientific standpoint.
But if your world can reflect some of that complexity
it will make your imaginary world more real to your reader.
It will anchor your characters to the environment, anchor the plot in a greater flow of history,
and especially in Science Fiction and Fantasy, provide a foundation for the development of your theme.
All this is not to say that your worlds have to be completely scientifically realistic.
Middle Earth, geographically speaking, doesn't work.
There should be a rain shadow east of the Misty Mountains
that would make the huge forest of Mirkwood impossible.
The reality of Middle Earth is in its history.
The Emin Muil isn't barren and rugged because of geological forces like volcanism.
It's there because of the wars 3000 years before that destroyed it.
J.R.R. Tolkien studied languages.
Especially the history and development of English and related Germanic/Scandinavian tongues.
He began playing around at inventing a language or two of his own.
He combined this with his love of the legends and mythology of England
slowly began crafting a history to explain the development of the languages he was inventing.
(In other words, the model for creating worlds suggested by this post is hardly gospel,
there are other ways of achieving the goal of creating a world that becomes real to your readers)
That story is the basis of the quintessential fantasy, The Lord of the Rings.
One of the reasons readers enthusiastically return again and again to Middle Earth
is because the history of Middle Earth lends power to the narrative.
The characters aren't just slogging their way over hills,
but treading across ancient battlefields, skirting ruins of ancient towers, walking through forests planted in the dawn of the world.
That history gives the world of middle earth a reality that sucks the reader into the story.
George Lucas's Star Wars universe was never very well developed,
especially from a technology standpoint, but it still works.
For example, when we first see the Millennium Falcon
and Luke comments, "What a hunk of junk!" Han counters, "She can make point five factors past light speed."
Now we are never told exactly how fast a "factor" is or why only one half of a factor is so blazingly fast.
But we can easily infer from the reactions of the characters, and the confidence of Han,
that whatever the speed is, it's considerably faster than usual for small, run-down cargo ships.
You're never told anything about the engineering behind a "blaster" -
notice they avoid the term "laser" when talking about hand held weapons- or what kind of engines the ships use.
That's all black box technology.
The important thing is that when you pull the trigger the gun shoots, and it fires consistently.
You don't get a gun barely wounding a person in one scene
when in the scene just before the same gun blew a cubic foot hole in a stone wall.
When you push the throttle forward the ship speeds up.
Or when the engine breaks down and Han and Chewie start fixing it,
you may not have any idea what the "transtator" does, but they clearly do.
I do have a hard science buddy
who always complains about how the fighters
fly more like airplanes in an atmosphere rather than a space ship in micro-gravity.
But as long as it's the way things consistently work
your reader has a much easier time "suspending their disbelief" and living in your world with your characters.
MORE ABOUT WORLD BUILDING