Hammel also got some help from manager Joe Maddon, who employed a couple key defensive shifts.
"Today, I got a little taste of Joe's shifts because we had Starlin [Castro] up the middle on a hard-hit ball and Javy [Baez] made a great play to knock a ball down," Hammel said. "That's what I do is put the ball in play."
He wasn't worried about the early struggles.
"I have plenty of confidence in myself to get it done and be ready and today was a step towards that," he said.
The Cubs loaded the bases with two outs in the third as Dexter Fowler walked, Chris Denorfia singled and Anthony Rizzo was hit by a pitch. Danny Duffy then walked Castro to force in a run.
Alcides Escobar doubled to open the Royals' sixth against Jorge De Leon and scored one out later on Lorenzo Cain's double. But Miguel Montero led off the Chicago sixth with a double and pinch-runner Billy McKinney then scored on Junior Lake's single.
The Royals' Omar Infante, who has yet to play in the field because of discomfort with his right elbow, went 2-for-3.
Duffy went four innings, allowing three hits, one earned run and two walks while striking out five.
Both walks came with two out in the third inning.
"I liked how I did out there," Duffy said. "There were a couple of instances in the third inning when I started nibbling. With two outs, you got to bear down. I know that better than anyone else with all the two-out walks I've had in my career."
After the rough third inning, Duffy bounced back and put the Cubs down in order in the fourth.
"I was pretty pumped about that," he said. "I was pretty happy with my location. Slider was biting today."
"I thought he was good," Royals manager Ned Yost said. "He got his fastball up to 96 [mph] and it was in the 94-95 range consistently. Good tempo."
The Royals nearly rallied in the late innings. Lane Adams had his first home run of the spring in the top of the eighth to make it 4-2. Jorge Bonifacio had an RBI single with two outs in the top of the ninth to cut the Cubs' lead to 4-3. Stephen Perakslis struck out Adams on three pitches to end the game.
Up next: The Royals will send out right-hander Edinson Volquez, expected to be the No. 3 starter, to face the Brewers in a 3:05 p.m. CT start on Wednesday at Surprise Stadium. The game can be heard live on Gameday Audio.