While this phenomenon might not be a surprise to those who have been known to enjoy a few, scientists have figured out a reason why you tend to only remember the fun parts of a night of drinking, while the less-enjoyable elements fade away.

Researchers at Brown University made a breakthrough using fruit flies, which have genetic similarities with humans. Oh, and they like to drink, too.

It's pretty technical, but it comes down to a gene called dopamine-2-like receptor, which actually encodes whether a memory is pleasant or not.

As luck would have it, alcohol affects the gene, by altering a protein it makes on a molecular level -- meaning your memories under the influence tend to highlight the good stuff.

The scientists note this "hijacking" of the memory pathways can last an hour with one drink, but as much as a day if you tie a couple on.

However, these molecular changes can have a negative effect: the altered protein also forms "craving memories" in the brain.

"All drugs of abuse -- alcohol, opiates, cocaine, methamphetamine -- have adverse side effects," Dr. Karla Kaun of Brown University said in a press release. "They make people nauseous or they give people hangovers, so why do we find them so rewarding? Why do we remember the good things about them and not the bad?"

These "craving memories" could be why so many addicts find it hard to kick the habit, the researchers say. However, more study is needed on human subjects, the scientists say.