Spending a summer afternoon playing games in the yard — softball, volleyball, badminton, et al. — is a wonderful way families and friends can bond and relax.

It’s also an opportunity for a relative or friend to ruin everyone’s afternoon.

There’s the guy who takes recreational competition way too seriously. Perhaps he cheats. Or maybe he wants to show his athletic skills by whomping a bunch of 7- and 8-year-olds while spewing trash talk.

Games are supposed to be taken seriously, but they’re also designed to be fun. Yet as we know about human nature, people like to win, and that can lead to problems.

Understanding why people behave like they do can relieve some of the frustration and help us keep things — and spoilsports — in perspective.

Nicole M. LaVoi, associate director of the Tucker Center for Research on Girls & Women in Sport at the University of Minnesota, said that those who want to win at any cost are referred to as having an “ego orientation.” That’s opposed to a person with a “mastery orientation,” where success is based on self-improvement and doing one’s best rather than outperforming others.

Ego-oriented people “derive their self-worth on winning and outperforming others, proving one’s ability, being better than others, and they don’t care if they act in over- or hyper-competitive ways,” she said. “They are more likely to cheat to win, trash talk, act in inappropriate ways [and exhibit] bad sportsmanship because the focus is on winning and proving they are superior.”

The two orientations are developmental, she said. By adulthood most — though not all — people move to a mastery orientation.

“It is those that get stuck in a strong ego orientation who usually ruin the back-yard games’ fun for everyone,” LaVoi said.

Social psychologist and Marquette University professor Stephen Franzoi said that when we think of spoilsports, the classic Type A individual comes to mind. These people always are trying to one-up others.

That behavior can lead to success in business, “but when you go to a picnic and they carry it over to friendly baseball games or volleyball games, it becomes problematic,” he said. “Certain individuals have trouble turning off a personality style that has proven successful in their careers.”

Jim Fannin, author, performance coach and a former tennis pro, said that self-discipline is one of the markers of champions. Wild-eyed Uncle Bob lacks that.

“The best in the world have tremendous self-discipline,” Fannin said.

Sometimes you can see the meltdown coming, he said. The average person breathes 15 to 17 times per minute. When people start getting too emotionally involved in something — even if it’s croquet — their breathing rate can climb past 20.

“When you get in a stress situation where you want an outcome, you increase your breathing, increase your heart rate and, if you don’t pay attention, frustration, impatience, embarrassment all happen,” he said.

The solution is for the offender to step back, take a deep breath, relax and refocus.

Pick your spots

Some spoilsports might be doing things right, but in the wrong situation.

John Kessel, director of sport development for USA Volleyball, said that the spoilsport in a family volleyball game often is an experienced player who focuses on passing and setting and expects the same from his teammates. But that’s not how most recreational volleyball is played, and their frustration over that can lead to conflict.

The solution: “They just have to lighten up,” he said.

If they don’t lighten up, you have to deal with them, said Brooks Butler Hays, author of “Balls on the Lawn: Games to Live By.”

“My advice would be to lead by example and maintain a calm and gentlemanly demeanor,” he said. “It’s also always good to take someone aside instead of admonishing them in front of a crowd. Demonstrative people like that don’t like to be embarrassed. Calling them out in public would probably make matters worse.”

On the other hand, embarrassment can be an effective remedy for cheaters, he said. “Shame is a pretty good technique [to counteract] cheating.”

There is a potential benefit to having a spoilsport on the team, LaVoi said: the Teaching Moment. Before you start playing, remind the kids that Uncle Bob can get out of control, but encourage them to do their best and have fun. Acknowledge that he will do what he does, but let them know your expectations for them.

“One of the good things about sports is you can teach kids how to win and lose, and how to react to that,” LaVoi said.

The lesson should be: “Give full effort, play with respect, follow the rules and, win or lose, you act with grace,” she said.