My very first time as a GM, I showed up to the session with a great pile of notes and plot. Half an hour later I threw it out and started improvising because they'd gone in a totally different direction. Over the years most of my players have been willing to follow a railroad if I ask them to, but I've developed a totally different kind of session prep which makes it so I don't have to ask that:
Don't have a plot.
Instead, have a status quo, something which disrupts the status quo, and a reason that the disruption forces action.
This isn't the kind of pre-made adventure we usually see, because it's hard to generalise for a widely published product whose point is to minimise the pressure on the GM mid-session (other systems, like Fate Core, take an approach similar to mine for some of their published adventures). But for individual campaigns it can be very powerful.
This concept is predicated on the idea that the only thing you can count on a group of player characters to do is to be unexpected. Planned plots tend to fall apart at their touch.
I'll run through the process with a quick example, but keep in mind that it's going to be a lot more organic than I make it seem. In practice, I go back and forth between the steps as one part gives me new ideas for another.
What's the status quo?
I need a location, and its inhabitants. The scope is up to me--maybe just a small dungeon, maybe a town and a nearby cave, maybe a whole nation. Let's start small. The reason "dungeons" work so well is that they're contained and limited: the number of options (places to go, people to meet) is more controllable than in a sprawling open area where the players can choose to wander any which way.
Location
A small underground catacomb: crypts, inner chamber, secret chamber connected to both.
Notice that since I don't need to control what order the party does things in, I'm free to have the secret chamber connected to both of the other areas. This also increases opportunities for the party to find it, since I really want them to do that.
Now I establish who's living there: why they're there, what they want, and what they are doing to get what they want (intelligent recurring NPCs may also have secondary goals, and backup plans and contingencies!). I'm going to choose things that I think are cool. That way no matter what happens, cool stuff will be involved. I like Sealed Evil In A Can plots; the idea that kobolds worship dragons; and the notion that dragon magic is closely linked to their physicality. I also like setting up situations where it's equally reasonable for the players to conflict or cooperate with an NPC.
Inhabitants
The crypts are home to a small tribe of kobolds who worship and serve the dragonling that lives in the inner chamber. A malevolent spirit is trapped in the catacomb's inner chamber.
- The spirit is the ghost of a tyrannical king. He wants to break free and possess the most cunning person he can find. The major obstacle to the king's freedom is the dragonling. He's influencing the kobolds to be more violent and aggressive, to call attention to the catacomb and thus hopefully get rid of the dragon.
- The dragonling lives in the inner chamber to keep the spirit trapped. Her spells of binding are powerful, but fade quickly in her absence, so she has to remain in the catacomb. She doesn't want to spend her whole life like this, so she's planning an exorcism ritual which requires a holy relic from a nearby village temple.
- The kobolds worship the dragon and serve her, raiding nearby towns for food and valuables so she can concentrate on keeping the spirit entombed. They've just stolen a relic from a temple and (because of the ghost's influence) killed a priest.
So we've set the stage: the ghost and the dragonling have goals they're working towards, and the kobolds are their pawns.
What's disruptive to the status quo?
In most D&D adventures the most disruptive force you can possibly muster is the party of player characters. I've dropped plot hooks into my adventure: stolen religious relic, murderous kobolds, and the promise of treasure. That should be enough cues for any party to start sharpening their swords.
But more specifically, I've engineered the adventure for a specific kind of disruption: the tenuous balance between the ghost and the dragonling will be tipped one way or the other depending on what the party does, but it'll be very hard for them to not tip it at all.
What does this look like in terms of what I bring to the session?
I sketch out maps of the location and its major areas; make the stat blocks for kobolds, dragonling, and ghosts; find a few interesting terrain hazards to use; and sprinkle loot drops through the catacombs as needed (most of it is probably in the dragonling's inner chamber, with another single big piece in the secret chamber). I'll knit these mechanics together into encounters on the fly, as needed depending on the party's actions.
Now I don't have to anticipate what my players will do or try to force them into certain channels in order for plot to happen. If they set foot in the caves, I've got a delicate situation they'll disrupt and NPCs whose responses to the disruption I can improvise on the fly. The order they go through the crypts, and whether they find the secret chamber before they encounter the dragon, doesn't matter to my prep: I've created and statted a living environment rather than making canned encounters which require the players to follow an anticipated set of particular future actions.
This is a lot more work--at least until I got the hang of it--and it often means that parts of my environment don't get used so that preparation effort is wasted. That's sad. But in a prep-heavy system like 4e, this is the best way I've found to avoid railroading: create living environments with NPCs that have plans and goals they're working toward, and provide plenty of spots for the party to mess up their plans. It enables a lot more dynamism than coming up with a plot I need them to goosestep through.
Roll20 is not kind to this approach.
Because you have to input your work to the system ahead of time, it doubles the wasted effort of anything which doesn't get used. Additionally, whipping up an encounter on the fly is easy when you've got a handful of stat blocks and a wet-erase map, but it's a lot harder when you've got to put all of that together beforehand.
All I can suggest is that you use narrowly defined locations (like the catacombs) so you can put in the maps ahead of time, and drop all the stat blocks into every map so you have them available if you need them. I don't have enough experience with roll20 to give any more specific advice on that front, but I know that it may be a big enough obstacle that my answer could be next to useless for your particular situation.
What you might be able to do is create generic setpiece encounters which can be quickly re-fluffed to meet the narrative's current needs. I dunno how much Roll20 will support that, but it shouldn't be too insanely difficult; I've even made sets of generic monsters which I could drop into most any situation with a different name each time.
Make them stumble upon and want to bite the hook.
Expecially in a homebrew campaign, players will want to get their bearings: take a look around, see what the locals are like etc. This is where you come in:
- They hit the tavern? Have the innkeeper talk about how it's not been going well lately because for some reason less visitors drop by for drinks and beds.
- They go hiking? Monster attack!
- They do go talk to the priest? Let him to his story!
Now, you do not need to have every event from killing dragons to going to the outhouse involve a plot-important event. Instead, let them use the village where they start as their sort-of home base, where they get invested in by doing things big and small. But here's the twist: after every second or third sidemission something happens regarding to the plot hooks: wounded travelers come in, speaking of bandits; one of the local lord's men is in search for people who could lend their swords to the aid of the realm, or have Sir Murder von Evilstabbings ride into town, off some folks, then go on. Eventually this will drive the players to want to take the hook, if only to put an end to the schemes of Larrenyyys the lich.
Have their actions improve the game world, then have setbacks (minor or major) kick in until the party kicks someone's door down and give them greatsword accupuncture.
Best Answer
My suggestion? Don't.
When I run sandbox games, I tend to divide the world into regions of general power; I start the players off in a low threat zone, full of mudcrabs, rattata, and the occasional goblin. Then, in universe, I tell the players what areas are safe. Rumors in the bar that the road to Harborhead has been having some bandit troubles. The city watch warning them as they leave town to take the left fork, not the right one, because the Ghostgate is full of terrifying spirits. A traveler who explains he and his whole town had to pick up and leave because a dragon took up residence in the mountains to the north. These hints allow the players to decide how much they're willing to risk; the loot and XP for taking out that dragon will be incredible, but it's very likely to roast them alive on the first round.
It sounds like you've played 4th edition in the past, which had a fairly strict power curve. 5th edition actually works even if the characters aren't at the same level as their opponents, helped by the fact that there isn't as big a difference between low and high level characters. Still, you and your players may have some habits to break.
As players, they need to learn how to pick their battles, estimating which fights they can win and setting things up to give them a leg up. They also need to learn when to retreat and back off. Some fights aren't winnable, for reasons nothing to do with levels. As a DM, you need to learn to foreshadow encounter difficulty clearly. (Honestly if you feel like you haven't made something clear, it's okay to drop out of character for a moment. "You can totally fight the dragon today if you want, but you guys should know I set him up to be a level twenty battle and I'm going to play him that way. If you beat him though, his hoard and XP will be on the same scale.")
5th edition plays to a slightly different tune than 4th, but for a sandbox game like yours, it should be an easier one to dance to.