Railroad prewritten adventures SUCK.
Old news, but honestly this weekend I was playing a Void Master in a Rogue Trader game when the group was basically being driven through hallways in a wrecked ship fighting space zombies when every creative solution we came up with to solve the issue was answered in the module with a 'nope that won't work'. Who the heck writes these things? If I was this persons editor I would have gone through the adventure with a very angry red marker.
*ahem* Point being, it's not the GM's fault, the adventure s written was to be a 'teaching' game. However, it's teaching exactly the wrong skill sets. It undervalues critical thinking, alternative solutions, and non-combat focus. Honestly, good cover and a steady laspistol was all you really wanted in this game. First off when you are in any protracted or hard puzzle like fight with an NPC where only thing will hurt them...you need to make it obvious pretty fast so you don't loose a session to one protracted battle.
It all goes back to 'Perception' checks to notice things. I'm growing to HATE this mechanic. I understand that the GM needs to hold some details close to the chest in the long term, but obvious stuff in a scene needs to be called out right away. I like how GUMSHOE handles it that the clues are there, the PCs WILL find them, what it does it present the puzzle, the clues, and lets them build the case from there. In the case of a puzzle fight the way to do it is to write down a top 3 things each character 'might' catch on to. Tech-Priest notices strange cabling all running to Captains Chair MUCH earlier in the fight. Rogue Trader notices the box for the xeno artifact. Navigator notices the Navigator Spire door is open and seems to be a great fallback position, etc, etc. The point is, give the players the clues with their 'get a clue' first scene description and let them decide if they are going to call out the obvious to everyone else.
But Joe? You ask, what about ambushes? What about danger sense?
That's a good question, when you need to surprise players a lot of it has to do with how the system handles surprise. Some games like GURPS gives the players an advanced warning, basically GM radar. This is...bad. It destroys the sense of urgency. Other games all the player who has danger sense and awareness to act normally when surprise happens. They can defend, seek cover, etc. This is way better and still preserves the sense of surprise. Precognitive powers, divine questions, they all exist in many games and one skill the newbie GM needs to learn is 'be vague'. Not be quiet, oh no. False alarms, half clues, hints, and common sense help is always a useful thing to direct or at least advise PCs. Just avoid giving them the solution, unless it's after the fact. And honestly even then, don't rub it in the PC's noses they missed clues X, Y, and Z. Just makes them less happy they didn't optimize for clue finding. Honestly, don't force PC's to dedicate their stats on detectin the obvious. Just don't.
The next issue is in adventure writing. You need to come up with more than one ending. You need to have a very simple 4 part tree of pass-fail:
Succeed With Bonus, Succeed with Clues, Fail with Bonus, Fail with Clues.
What is this? This is how you get your players coming back for more. Here is what each of the following pass/fail grades mean.
Succeed with Bonus - The PC's find the baddy, save the day, finish the needed quest and they are given a reward above and beyond what was promised. This could be an ally NPC, more treasure, or a new Ship, better spells. Whatever the setting calls for. You did good, enjoy the reward.
Succeed With Clues - The PC's just pulled it off, they barely succeeded, maybe they needed help. Either way the job is done and they can move on. The Clue part is they get hints about things they missed but might still be able to check out. A lead to more treasure, a possible NPC contact for future missions. This is the reward that motives them to dig deeper into the mission. This often leads to the next.
Fail with Bonus - The PC's can't save the day but maybe they saved someone else? As in the case of taking on the hulking space ship. We can't recover the whole thing but we CAN save the NPC crew and maybe loot some relic gear and weapons. Loot the armory and bug out. It's not so much a consolation prize, it's often how old school D&D session went. You can't take on the whole dungeon but you can claim a part of the loot and maybe come back later. Or if not, you are better equipped to handle the next mission.
Fail with Clue - This is the minimum failure/reward tier. This is where the PC's fail saving the day, gaining the final treasure, but they hear about alternative ways to win the day. A new mission or another angle to get at the badguy NPCs. Now if the game was a pass/fail where a friend dies, or some resource is gone for good then allow the option of revenge. Never underestimate the pleasure of a group of players take from seeking revenge against a hard NPC.
When you finish a session the players need to feel like they accomplished something, even if they only succeed at finding out some minor but critical intel on their foe. Every SINGLE SESSION there needs to be some reward. Money, information, emotional. It may be Pavlovian but the idea is to get the reward pleasure center going.
And for those players that LIKE loosing, well did they laugh and smile going down? Well, that's their reward. Don't assume however though that the 'joy' of a session is reward or pleasure enough. Allow even the most hallway of quests to have alternative reward structures. One PC's treasure might have been trash in the GM's mind eye. I've discovered this so many times.
Players seek the freedom to try crazy ideas and seek something, anything for their effort. Don't just 'nope can't do that'. Just don't. Get off the rails if you want to save your game.