Using Casablanca, since that's what I'm working on. An interesting movie if you've never seen it. I thought it'd be cheesy or boring, so I put it off until about five years ago--and fell in love. Good movie, great plot, strong ending. Probably the best example of how to co-author a book or movie with more than two writers.
Back when Casablanca was filmed, there were a lot of people who never left their hometown, television was still in its infancy and the vast majority of people didn’t have much of a worldview.
Morocco was just as foreign to them, as Hogwarts and Middle Earth were to us. They needed to “see” it to understand the story and place the action in context, which means there’s a lot of world-building in Casablanca.
The film opens on a globe and spirals down to a map. Casablanca is in Morocco and Morocco is in North Africa.
Desperate people push through the streets, the world is at war. There’s voice-over narration, just in case. Very much like a newsreel from the same time period, and because of the way the voice-over is used, it establishes an air of verisimilitude.
The framework that contains Rick’s story—the world at war, the Nazis, the refugees and resistance—is very big, in a lot of ways like the set-up for the original Stars Wars trilogy, but when the camera sweeps over the street outside Rick’s bar, what you see are people.
The external story--that of the war, arcs over the individual arcs of Rick, Ilsa, and Lazslo, and encloses them. In other words, they’re held together, in one place, because of outside forces, but once the setting is established—the story follows Rick and his arc.
Do you need to have the world in place first? It depends. Has your reader been there before? Is it an alternate history or different dimension? Do the laws of nature operate differently—in an open way? Is it a historical?
A historical might not be an alternate world—but your reader hasn’t been there. The cold biting through a canvas tent and picking weevils out of the flour are things that add to the world.
Maybe they’re in a gold rush? Can your reader smell the stench of a thousand unwashed bodies, hear the screams, or feel the pounding rattle of wagons?
In Casablanca, we see the crowded streets and people trying to raise money. Nazis, the police? Danger everywhere. Music pours from Sam’s piano. People drink and smoke.
Rick’s bar doesn’t look like the standard American bar, but once the elements are in place—the servers, drinks, and music. Little tables, dark corners? It “becomes” a bar.
Is the clothing consistent with the time period and place? Are the accents real or consistent with your vision?
Arnold Schwarzenegger speaks with an Austrian German accent. And while filming Conan showed the world all Cimmerians speak with the same accent. Later Cimmerians also spoke with an Austrian German accent because that’s how Cimmerians speak. Consistency is an important part of creating the world your characters inhabit. All Cimmerians dress in a loincloth—check. All of them sound alike. Check again.
The only thing “missing” from Casablanca is Casablanca itself. There are mosques, the tallest minaret in the world, beaches, but none of it shows. Not even as painted backdrops.
Because it’s not important to the story.
There's no point in creating something if you never mention it. If somewhere, sometime over the course of your writing, you "might" mention it, start a file. Get a notebook, or open a folder, and start collecting bits and pieces. By the time you’re ready to use your knowledge, it should be easy.
Build what you need.
If your hero is going to cross an ocean, and your reader has never “seen” that particular ocean, you need to create an ocean--stuff in the ocean, colors and smells, clouds in the sky and people on the boat. Are the people important enough to mention? Are you going to tell your reader about them? Then who they are, where they come from and everything associated with their culture "in regards to that person" need a little thought.
Everything interlocks, but "everything" doesn't need to be there. The size of the ocean is good, but if the tallest minaret in the world exists in Casablanca and no one other than the writer cares, it's a waste of time. If Rick meets Laszlo at the top of the minaret, the minaret “becomes” important.
Stuff—like the minaret expands outward, so now we have clergy and callers. Perhaps an ointment seller to sooth tired feet, a road leading to the tower?
So world-building yes--an encyclopedia? No. Not unless you personally know how everything works. Most people don't. I know if you do "this" thing you get "that" result. But I don't know everything and your hero doesn't have to know everything too.
Basic rules, like the water is wet. People drown (or don't drown as the case may be) Magic works "this" way (however it works in your world), wizards wear pointy hats (or don't). The King is the boss. But if there's a minaret and your hero never goes near it--then it's just procrastination. World-building needs to work for the purposes of the story.