ST. LOUIS — A professor in Missouri said he's working to understand how mass killers think in order to help people see the signs before another tragedy hits home.

"How do you get in front of it to prevent it and predict it? That's where my emphasis is," said Gregory Vecchi, who is an assistant professor of criminal justice at Missouri Western State University.

Vecchi also served as the chief of the behavioral science unit at the FBI, where they work to figure out why criminals commit their crimes.

He said law enforcement does a great job responding quickly, stopping whoever is responsible and then investigating. Reports on Sunday indicated police killed the gunman in Dayton in 30 seconds.

"But here's the problem. It's already happened. You already got a whole bunch of people dead," he said.

Law enforcement officials said it took just 30 seconds for the gunman in Dayton to kill nine people.

RELATED: 9 killed in 30 seconds: Timeline of Dayton shooting

He said far too many people don't know or understand the signs that someone could be thinking about, or on the verge of, committing a mass killing.

"We're talking about planned lethal violence. It's not something they just wake up in the middle of the night and go, 'I'm going to go out and shoot up 100 people at Walmart,'" said Vecchi.

RELATED: Here are the victims of the El Paso Walmart shooting

He's started training people on recognizing them. He said teachers, peers, employers and organizations could all benefit from that knowledge.

"You have to understand how people think, why they do it, the motivation," he said.

Vecchi said it could be months or even years of planning before one of these tragedies.

"Frankly, there are a ton of dots to connect," he said.

He said the biggest motivation is a grievance.

"Something against a group, an organization for whatever reason," he said.

Vecchi said that could mean against a group of people, but it could also mean something else. He said it could be against a school over bullying or a job over a firing.

The other common motivation in mass killings is ideological, which Vecchi said is closely associated with terrorism.

"Regardless of those [motivations] we talked about, they make a conscious decision they're going to deal with the situation with violence," Vecchi said.

He said recognizing the signs is not just about mass shootings. That's why he calls them mass killings.

"We have so many other cases where guns are not available, they could not get the gun, they couldn't operate the gun, they chose knives, they chose acid, they decided to run somebody over with a car," he said.

He said there are usually red flags before the violence. The key is knowing "the normal behavior" of the person.

Vecchi calls it the baseline. And he said many of the people perpetrating the violence have the same changes in behavior.

It could be what the person's watching, posting on social media, what they're reading, where they're going.

He said if that's concerning, people should watch out for signs of preparation. He gave the following example for someone potentially looking to commit a mass shooting.

"You have got to get ammo, you have to get the gun, you have to do training, right? He's asking people to go shooting," he said. "He's asking people to go borrow a gun; maybe he goes out and buys a gun. He's never bought a gun before."

He said there could be signs someone is planning by surveying a location.

If the red flags add up, then Vecchi said it's time to react and contact law enforcement.

Vecchi said it's crucial for police to have strong community policing, so members of the public feel comfortable approaching them about any potential threat.

RELATED: VERIFY: False political info being shared on mass shooting suspects

RELATED: Dayton: 9 killed in the US's 2nd mass shooting in 24 hours

RELATED: 'Do something!' | Crowd drowns out Ohio Gov. Mike DeWine's speech at vigil honoring those killed in Dayton mass shooting

RELATED: Trump tweets, stays out of sight for hours after shootings

RELATED: El Paso shooting suspect booked on capital murder charges

RELATED: Dayton gunman drove to shooting with sister, who became one of his 9 victims