Ah, I found the right keyword combination a few minutes later. A search for
paperback book son "pirate game" gallowglass brought up an eBook site with Orson Scott Card's Lost Boys.
The novel, set in 1983, revolves around a game programmer and his family. His claim to fame is a fictional Atari computer game called Hacker Snack. Step Fletcher, a devout Mormon, moves his pregnant wife DeAnne and their three children (Stevie, Robbie and Elizabeth, respectively seven, four and two years old) from Indiana to Steuben, North Carolina so he can start a new job as a technical writer. Fletcher must deal with several unpleasant situations. His manager, Dicky Northranger, is a greedy, petty and manipulative man who does everything he can to undermine Step's position, while the owner of the company, Ray Keene, asks him to cross-check whatever technical job Dicky does as it seems he is not very comfortable about Dicky's competence.
Glass is a young programmer at work who is very friendly towards Step and always offering to babysit his kids. Later on, Step comes to realize that Glass is a child molester who loves washing little girls' privates. This nauseates Step, and he vows that Glass shall never get near his children.
Meanwhile, Stevie's teacher at his new school hates him and Stevie becomes withdrawn. Step confronts the teacher and she leaves, but Stevie becomes even more withdrawn, playing only with his imaginary friends in the garden and on his computer. As Stevie's group of imaginary friends, who are all boys, grows, his parents become increasingly concerned and eventually take him to a psychiatrist, against their better judgment. Then they see a newspaper article about young boys who are disappearing. The names of Stevie's imaginary friends are exactly the same as the missing children; Stevie also knows the boys' nicknames. They notify the police, who come over to the house and question Stevie briefly, but they leave with little to go on other than the confirmation that the boys are indeed dead, as opposed to simply missing. Step, who is a video games expert, notices that the video game that Stevie uses to play with his imaginary friends has graphics that are way beyond anything that could actually run on the computer but fails to investigate further.
Step and DeAnne are happy that they have finally seen Stevie's friends. When Stevie is asked why he didn't bring in his friends earlier, he confesses that he himself was surprised that others were not able to see them. Then, he says that now that he is finally like them, he has shown them the way to make others see them. Everyone is confused with what he says. He then explains that the disappearance of the little boys at Steuben has to do with Bappy, and that he had confronted him directly on the day he had been fixing lights. Bappy was too fast for him and had murdered him before he could come running in. He said that the underspace below the house had eight graves among which his was the last. He also says that he had done what his parents had taught him, which was to do what he felt was right. He had felt that he was the one whose job it was to stop Bappy from doing this thing to other boys.