terrain generator and fix some shooting bugs