This is my formula:
For table service: I start with the presumption that I will tip 20%. If there is a discount involved (sometimes there is a coupon, or the server just being kind doesn't charge for a salad or a dessert, anything that reduces the cost to me) I will add that discounted amount BACK IN to the total cost to determine the tip. The server should be tipped on the entire cost of the check.
Servers are taxed on a presumed 10% tip. So, not tipping a server is a VERY effective way of making your displeasure known, as they have essentially lost money. If I am not going to tip, as Catrancher says, I'll almost always speak with the manager. However, sometimes the situation is so ridiculous (as with Keith's) that I won't bother. I don't go out to have to be hassled in any form.
If it is a counter service (by that I mean, I order, am given my food at the counter and walk away to find my own place to sit, ect) I do not tip. There is nothing to tip for.
At a bar, I tip 20% of the total bill (pre tax) for drinks.
If it's a buffet, I'll ususally start at 15% but often (as with Cape May) the servers there work harder than a full service server, so I'll tip the 20%. We recently dined at Boma, and the server was desultory at best. He recieved 12%. He was shocked to the core to see us pull out money. I know he thought we were on DDP, and so felt he didn't have to work for the tip. Mistake on his part.
So, then if the service is not good, we reduce from 20% to 18 to 15 to 12 to nothing as the case may be.
I know that servers don't get paid a fair wage by hour, that they depend on their tips. However, they chose that profession, and the pay scheme that accompanies it, so I'm not going to be held hostage to their choice. If they want T(o) I(nsure) P(roper) S(ervice) from me that are "fair" then I will expect fair service.
If I know the server, like our sweet boy Drake at Uno's I'll always add extra. He works very hard for us, and is very, very good to us. Regulars should make it clear that it's worth a restaurants while to have regular patrons. We tip accordingly.
Now, all that to say to a visitor.
Tips are expected in a full service restaurant and at buffets. The amount is based on the total cost of the bill, pre tax. The customary starting point for full table service is 20% up or down accordingly. Buffets are a judgment call but 15% up or down is just fine. Bartenders are customarily tipped 20% of the bar bill.
Hope that helps and isn't too confusing.
(Tink. The QUEEN of hating the tipping system in the US).