BERLIN (Reuters) - The director Jeff Nichols has a knack for turning his personal life into cinema, and he’s done it again in “Midnight Special,” a sci-fi-tinged movie about a boy with extraordinary powers inspired by his own son.

Starring Michael Shannon, Joel Edgerton, Adam Driver and Kirsten Dunst, the film was shown on Friday at the Berlin film festival, in competition for the festival’s top prize, the Golden Bear.

The protagonist is about an eight-year-old boy named Alton (Jaeden Lieberher), who has the power to detect encrypted government data transmissions - among other things. He also has eyes that can emit laser-type beams, which makes the government think he may be a secret weapon.

His father Roy (Shannon) and mother Sarah (Dunst) have to take extraordinary steps to keep Alton from being captured by the FBI, or by a religious cult who believe he is the Messiah.

Nichols was widely praised for his 2012 feature film “Mud,” about two boys who befriend a drifter who lives on an otherwise deserted Mississippi River island. He has said that film was inspired by his experiences as an adolescent boating on the Mississippi.

His new film had its genesis in an illness suffered by his young son, and the realization of how important parenting was.

“If anything ever happened to him out in the world I would be devastated, and I had no control over that, and this fear kind of overtook me because I realized how delicate this situation was and this relationship was,” Nichols told a news conference.

Slideshow ( 2 images )

“And I think ‘Midnight Special’ began as a way for me to process that fear. I think the reason why we love our children so much is because of this fear and I made a film about it.”

The importance of relationships in childhood became a theme of the press conference, with Dunst being asked how she had managed the often awkward and sometimes fatal transition from child actress to adult screen star.

“It’s hard to be a child actress and make sure it’s balanced with school and friends and all of that stuff and I always had that so I got lucky with growing up in that way,” she said.

“But there is a point I think with any job that you do if you do it that long that you question whether you want to continue doing that and I definitely had that and I kind of, I think when I was around 27, I kind of shifted the way I worked and it made me love it even more.

“So in a way I have kind of waited more for projects the older I get and, you know, been a little pickier because I have to be extremely passionate about something in order to do a role.”