Improved collision and terrain generation