LONDON, England (CNN) -- If riding on top of a Mexican freight train while bandits lie in wait, or inviting real-life gang members to improvise street battles doesn't sound like the wisest approach to making your first feature film, try telling Cary Fukunaga.
"Sin Nombre" portrays one boy's struggle to escape Mexico's gang culture set against the backdrop of the trade in illegal immigrants.
Because those are exactly the scrapes the 32-year-old writer-director got into during production of his highly-acclaimed debut "Sin Nombre."
Set in Mexico against the backdrop of the country's ballooning people trafficking problem, Fukunaga's social-political thriller shows one boy's struggle to escape Mexican gang culture after meeting a Honduran immigrant girl.
The half-Japanese half-Swedish director decided that it would be impossible to portray street gang culture or the treacherous immigrant experience without fully immersing himself in both.
"To tell a story of what it's like to travel on top of freight trains, or the camaraderie of living in a gang, are all things I could imagine maybe," Fukunaga told CNN.
"But I wouldn't be able to get it right without meeting the people who actually experienced it, and experiencing some of that with them."
After Fukunaga first conceived "Sin Nombre" (which translates as "Without a Name") in 2005 he embarked on a mammoth research tour in order to fully understand what it is like to be both a desperate immigrant and a street gang member.
He spent two weeks with immigrants at a train yard in Tapachula, Mexico, before risking his life illegally riding on the roof of a train traveling across the border state of Chiapas.
"People get shot, trains derail, assaults happen," said Fukunaga. "I had to understand that if I fell off the train and lost a limb, I could just bleed to death out there, there'd be no-one to come pick me up."
The filmmaker, who is an American citizen, was taken aback by the camaraderie among the immigrants in spite of the danger and violence.
"Some of the bits of humor that would happen on the journey really surprised me," he told CNN. "You could laugh minutes after someone had been shot."
It is this 27-hour train ride, during which a there was a bandit attack, that forms the basis of a substantial portion of the action in "Sin Nombre."
Fukunaga also visited members of the notoriously violent Mara Salvatrucha street gangs in jail in Mexico.
"I spent about two years in two different prisons, and reduced a group of gang members down to a couple guys I could trust," he explained.
Fukunaga courted them with with gifts in the hope they would aid his research.
"After bringing them grilled chickens and enough India ink and CD components so they could make tattoo guns, they felt like they could trust me enough to hook me up with one of their outside people. Then they knew I wasn't just a cop."
The end result is a starkly realistic portrayal of the Central American gangs that make their living trafficking people to the United States.
The film's action includes a dramatic shootout scene featuring real gang members as extras alongside actors.
"All the guns had blanks," Fukunaga said. "I had a gun too, if I had to regulate the situation."
Not that that made the scene entirely unproblematic: "The guy who plays the leader in that scene is a gang member," said Fukunaga.
"Once we shot that scene he was gone. I don't know where he went, and there was no way to track him down to come back in and record audio or anything."
Nevertheless, Fukunaga maintains that the characters he chose to portray are inherently likeable people.
"I liked the gang members and the immigrants I met equally, and had equal respect for them" Fukunaga said.
"Some of the kids in these gangs, they seem like they're 28-years-old, but they're actually only 19. They just look old because of the things they've experienced."
"Sin Nombre" is executive produced by acclaimed Mexican actors Gael Garcia Bernal and Diego Luna.
It impressed judges at this year's Sundance Film Festival so much they awarded it directing and cinematography awards.
But even after such an ambitious and successful debut, Fukunaga is not ready to let up and his next project couldn't be more different: a musical with Arcade Fire collaborator Owen Pallett. After all, he said, "If you're just going to do a paint-by-numbers film, then what's the point?"