So we've all heard how much players hate DMPCs (Dungeon Master Player Character), which is where a Game Master either introduces their own PC because they'd like to also play - or they introduce a tag-along NPC that steals the limelight and so is called as much. Of course, not every NPC that tags along is a DMPC. At least, I sure hope not because this ship-based campaign needs more NPCs than PCs in order for them to move any reasonably sized ship. So, how do you do it? Well, it's important to hold the distinction between an NPC and a PC.
The PCs are the protagonists. They make the decisions that move the plot. They decide where they're going and what they're doing. They get the limelight. They get the best loot. They strike the killing blow (ensure that NPCs who assist in combat never kill the big bad monster, or any monster the PCs are keen to kill, by always giving the monster 1 more hit point after taking into account NPC damage).
The NPCs tag alongs are the minor characters. They certainly influence the plot. They can complain, whine, or encourage certain courses of action, but they can't dictate it and they shouldn't expect to dictate it (unless you want the PCs to want to ditch them). They should have their own goals and motivations and you can even track how much they like the various PCs Dragon Age-style by adding ticks to the PCs who've gifted them nice loot, paid attention to them, or agreed with their sorts of ideas.
They can expect to get paid, or get a smaller proportion of the loot, but they never get to decide which loot to take unless they're not a tagalong and, in fact, are a quest giving NPC who's come along with them for a single adventure. Then they get to demand the agreed upon piece of loot and, either fight the PCs for it or take it and leave. The PCs, of course, may decide that the NPC should get more, or even equal, shares of the loot but it's THEIR decision. Gratitude on the part of the NPC is endearing. If your NPC isn't like this, create a different one who is. And always ALWAYS ensure you drop enough loot for your players to develop their characters by being generous without ending up with only +1 swords at level 10 (and thus getting curb stomped and repeatedly killed). The more NPCs you have along, the more loot needs to be dropped.
NPCs can leave the group, but just like in Dragon Age, they should generally find excuses not to unless the PCs treat them so badly it'd be stupid for them to stay. Of course, their general demeanor and personality can evolve through mistreatment and this often proves the best medicine to players who want to abuse an NPC. The bright and bubbly NPC who slowly becomes a miserable curmudgeon, always desperate to drown their sorrows, can sober Players and make them re-think their actions.
If the PCs are in trouble, can you send in the cavalry?
Absolutely. But always make die rolls for the NPCs. Make it seem realistic. Have the rogue NPC sneak in and pick the locks, not sneak attack the guardsman three levels above them and kill him. Or, of course, you could ask the players if they mind you using a cinematical for the cavalry so the excitement occurs right where it belongs ... when the PCs are doing stuff. Put the option in their hands and they might like to see what the NPCs can do. And, of course, once the cavalry have done their bit and the PCs have had a chance to heal or escape their bonds, the onus should be handed back to the PCs. The NPCs should ask for more orders from the PCs, in other words, though they can give further information that they've found on the way in.
Also, remember to keep meta-game knowledge separate from the NPC. Would Joe Bloggs, the rogue, really figure out that plot with his paltry Intelligence 10? They can give hints or happen to make a joke that is strikingly close to the truth to get the PCs thinking, but they shouldn't be all-knowing. This can be hard as a DM as you know everything, but try to keep it to what the NPC SHOULD know.
DMPCs are generally bossy, demanding, require equal loot like a PC, have equal time in the spotlight, and benefit from all sorts of meta-game knowledge. They know that trolls hate fire because the DM does and automatically cast fireball. The DM becomes attached to them and starts hand waving traps that would've killed them or monsters never attack them even when they should. This isn't cool. The Players are just as attached to their PCs.
If you really care about the NPC and want to bring them back, make them fantastic NPCs who the players really care about. Then, when they die fair and square, give them the resources to raise the NPC from the dead over and above their usual loot (perhaps as a boon from a cleric if they don't have anyone who could cast it). Don't force their hand but let them know that, should they choose (perhaps with a Knowledge Religion roll) that they have this long to raise that dead NPC.
If they don't want to do it, satisfy yourself by daydreaming about the NPC's epic tales that could've followed or write a fanfiction about it. Otherwise, accept it, just as a player must accept the death of the PC they may have worked for years on.
Oh, and word to the wise, NEVER convert an old Player Character you once played into an NPC. You can use inspiration from them but never make the same thing. You will automatically be attached to them and be quite insulted if the players hate that character. After all, even if he was a beloved party member last time, this particular party composition and the different rules of what a PC and an NPC should be like, may change the outcome.
So, have you guys got any advice on the difference between an NPC and a DMPC? Or have you got any examples of where it's worked or not worked?