eventually the boy and the king became friends , joined by their shared love of the princess , and they would ride out to hunt together in the cold morning air of the forest , but the boy had to be back at the palace before sunset or the penance would be broken .