Absolutely there are good and bad ways to write an ending to any literary, interactive or video fiction, but inevitably the adage "You cannot please everyone" becomes known.
Herein lies the dilemma writers are faced with when the end is in sight. You can do a happy ending, a sad ending or a surprising one. That's the general gist of it, though there are variations and others (eg. open or closed ended, predictable or not, etc). What you'll find now a lot of is that writers opt for the surprise ending because for whatever reason they think it makes them clever, or the ending itself more memorable. In a way, they're right. A controversial or twist ending certainly gets talked about more and is likely more memorable (though whether that's a good thing or not is debatable...not to mention whether an ending even needs to be memorable).
More significantly, we know in advance that we cannot please everyone. If an ending were happy, critics would deride it for being predictable, sacarine, unrealistic, etc. If it were sad those hoping for a happily ever after will be disappointed. Write a surprise ending and people may yell "Deus Ex Machina" or perhaps even more simply, "WTF?".
Getting an ending right is not easy, particularly when considering the fandom surrounding a piece of fiction. IMHO, a good writer will steer the "endgame" towards the ending early on, foreshadowing a little here and there. It keeps people guessing, builds excitement and precludes anyone from shouting "No fair!" if they pull something entirely unexpected out of the bag. I personally like to see things wrapped up mostly neatly, though with a couple of teeny unknowns to keep people talking and wondering what might've come next if the series continued beyond its ending. I also generally prefer happier endings to sad, bittersweet or dark endings. It's like the final note of a song that lingers and stays with you and I like to remember it ending on a good note, not an unpleasant one. It should have something to get fans thinking and talking.
So yeah, a little foreshadowing to keep fans guessing as the final stretch approaches, but not enough to spoil *some* surprises. Happy-ish with most things tied up, but with a little twist or some unknowns to leave the universe feeling like even tho we won't be there to witness it, there is a future for our world and characters (eg. the file dropped in front of Bond in the last shots of Skyfall).
Or you do what Smallville did and announce the ending even as the show is just starting.
