Hyperboloidal slices for the wave equation of Kerr–Schild metrics and numerical applications