Migration based on environment comparison promotes cooperation in evolutionary games