Add MapGenerator, avoid some invalid values and division by zero