It’s the eternal struggle of good versus evil. Sandbox games, where players can basically choose to do whatever they want and they have the latitude to do so, are often heralded as good. Railroaded games (which many of the pre-printed D&D adventures are assumed to be), where players are herded through a specific string of events and have absolutely no leeway to go off and do what they want, are seen as bad. A player’s experience sometimes seems to hinge on whether or not they can say something to their DM like “you know what? I catch a boat to a different continent and start a life as a slaver,” and be indulged. Obviously that's a really obscure and hyperbolic example, but sometimes the way these things are discussed leaves me with that distinct impression.
Example: An Extreme Sandbox
Over a number of sessions, the party has built themselves up into a position where they want to become known as dragon hunters, and they’ve tracked a green dragon to its lair. It’s badly wounded, but they’re all chaotic good, so they decide that actually they’ve taught it enough of a lesson now and dragon hunting is lame. Someone has seen a really good video about Acquisitions Inc prior to this session and hyped it up to the party before play started, so they want to switch to that kind of gameplay. Not just mid-adventure, but mid-session. They're expecting you as the DM to be able to facilitate that.
This kind of thing doesn’t happen often, but it does happen. Some groups of players do want their world to be really sandboxy. They see it as being their game, not yours. You’re a facilitator. If this is what your party is like then by all means, facilitate, but they better hope that you’re amazing at improvising, because unless you know your rule books inside out or you’re prepared to fudge things to the extreme, you’re all sunk.
Example: An Extreme Railroad
Let’s switch to the other extreme. You, the DM, have decided everything that your party is going to achieve. Sometimes, they want to go a little bit off script, but you drop heavy hints that they shouldn't be doing this, or outright stonewall them. The game is a series of chances to react to what crosses their characters' paths. The game is the same as a movie - the party will be entertained, but it's not really up to them to come up with ideas. They will roll dice, they might occasionally come out with something you feel like developing a bit, but they otherwise are just there to see how the story plays out. This can absolutely come as a result of a DM preparing an adventure from one of the published modules, usually because the DM doesn't feel confident in straying from the script themself, or because they didn't have time to prepare anything other than what is in the book.
This is where most of the complaints about railroading tend to arise, and how the published adventures seem to have acquired a reputation for shutting down player choice. People appreciate having some degree of player agency and therefore railroading tends to be more problematic than allowing some lovely sandboxy latitude.
The Sliding Scale
Of course, as with many things in life, this is not a black and white contrast, it’s a sliding scale. If you place your railroad on one end and your sandbox on the other, you start at ‘choose your own adventure’ (somewhat ironically titled for something that presents you with a series of multiple choice paths through one very specific story aimed at finishing in a specific place). Your next notable landmark along the sliding scale is something like the Dragon Age video game series, where there is a set end point to each game. Every choice you make along your journey to get there has clear consequences that do have a noticeable effect on the events that transpire. Further still, and you hit a D&D pre-printed adventure - your decisions still have consequences, but those decisions are no longer multiple choice. One of the last stepping off points before you hit a completely improvised world where you can literally do anything you want (which could be described as a fabricated reality) would be Skyrim - there are signposts and small nudges of direction, but you can spend most of your time ignoring those and going around the world encountering things in the order you choose.
But which is good? It sounds very much like railroading is awful and sandboxing is great? Right?
Finding a balance
Let’s turn this on its head, and hopefully not in the way you expect. Railroading is bad - your players need to feel like there is a point to them being there. You’re not reading a book to them and occasionally making them read one of the characters’ voices. However, I would argue that DMing a game from the position of total player freedom can be just as bad. If you happen to have a group of people who are good at picking up on the elements of your world and running with them - the races, the factions, the ethos and tone of what you have created - then great, you’re very lucky, and maybe your players will have a great deal of fun. But, for it to be 100% sandbox, you won’t have any further input into the world or the way the game plays out. It’s all theirs. And at the end of it all, when the dust settles at level 20 or TPK, the world is now theirs, not yours, because you’ve asked them to take your building blocks and make what they want with them. As part of that process, they will squish the blocks and reform them into the shape they want, and you won’t do anything about it. The thing is, though, you will be really very lucky indeed if you actually get to that point rather than people sitting around chanting “Er…” for long periods of the game.
Here’s an example from a world I built where I wanted my players to have near total creativity over just one aspect of their characters. We were demon hunters in a post-apocalyptic setting, and the character classes all had 2 abilities that came as standard. From there, players could choose to attempt to manifest a power that built on and developed either of those abilities and, depending on how well they rolled, earn the power they made up and see just how effective it was. (There were ways that they could make the roll not totally random, too - we were playing a Marvel Super Heroes system that let you slowly stockpile additional dice that you could pump into a single roll for a big number. Doing that allowed you the chance to do something awesome on a crucial roll that you badly wanted to succeed). For the entirety of a 2 year campaign, despite regular encouragement, one group of experienced players developed maybe one power each. None, in some cases. In another, much shorter campaign, with less experienced players, no-one even tried a roll for a new power, no matter how big their dice pool, except for one, who wanted their character to be able to Force Choke demons.
So why was that unsatisfying for me and for them? Because it was too sandboxy. They didn’t have anywhere near enough guidelines. Give someone total creative leeway and they are likely to have so many options and ideas that they can’t reconcile them all. Give them a set of clear guidelines, and they are probably going to come up with something awesome that you didn’t expect. If I had provided, say, a few more building blocks for powers, I might have seen one or two more of my players try to come up with something unique, rather than look at me blankly when I asked if they’d had any ideas. Even better - and this is where I will be going with my game setting when I get the chance - provide your characters with a clear set of options for how to develop. A skill tree. This is where 5th edition D&D has things absolutely nailed - you have your class, you have subclasses to give you choices and options to customise things somewhat, plus the ability to multiclass into other classes and subclasses if your game allows it.
I can already hear people disagreeing with me because they don’t like Rangers, or they don’t like the Way of the Four Elements, but to those people I say that people take these tools and they then attempt to do creative things with them. “Can I use the Gust cantrip to change the direction of my fall?” Eight or nine times out of ten the answer to that might be no, but the player was inspired to ask, and it won’t be the last time they do it. Your job is to think about how to say yes sometimes, if you’re looking to give them some creative leeway.
Of course, the sandbox vs railroad issue usually tends to relate more to plot than to character creation (although the argument is equally valid in both fora), and of course, the point of an article like this is to give you something to think about. So here it is.
It’s perfectly possible to have a plot, with an idea of an endpoint, all laid out and loosely planned, without railroading your players very much at all. Some railroading is good. Total railroading is bad. In fact, thinking of things in terms of sandbox and railroad is not necessarily the best way of approaching things at all. Good stories, including ones with a large degree of player agency, have strong plots. So, write plots, but bear in mind that the players should be allowed freedom. They should be allowed to guide the plot, but they shouldn’t be driving it, because that’s your job. Does this take anything away from them? No. It gives to them, because it means you can give them something memorable built from decisions that they make as the campaign progresses. A bit of guidance means you can throw things in from people’s back stories, for example, without them having to work it in themselves. You can control the tension levels and generate a sense of approaching a climax at the end of an act - moreover you can have a structure where there are acts. It’s satisfying for players, and for you, and it keeps things from becoming aimless.
It should also be possible for you to feel out where the boundaries are, and when players feel like they’re being forced to take the path you want them to take rather than having a genuine choice. It’s very rare that a player won’t question you when they feel like their options have been curtailed, and it’s always worth taking a step back at that point to consider whether or not you can rework things to accommodate an unexpected direction for the plot. Some improvisation will always be required as a DM. But then it’s also possible for you to gently steer players down certain paths without them feeling like they’re being forced into it. All you have to do is give them tasty plot hooks that you know they and their characters can’t refuse. If it makes sense for them to be following them, they’re likely to be happy to walk those paths without feeling like they’re stuck on a train with no control over their destiny.