Possible Infinite Terrain Plane?

Hello everyone, i have a quick question for everyone! As i have been working a a huge game world i thought wouldn't it just be easier to have an infinite terrain plane i could just work on, so the question i ask is, is it possible to make an infinite terrain plane through scripting? Answers are greatly appreciated.

Yes. With a treadmill. This is what you need:

  • A set of Terrains of equal dimensions. One you're standing on and a few more around that - arranged in a grid.
  • Make sure that your far clip plain limits the camera vision so that its not possible to see more than one terrain length.
  • When you move from one grid cell to another (you should implement some slack here - rather than a strict boundary which would result in flickering back and forth between grid configurations), you rearrange the position of the grid cells to make sure that you're now again position on the centred cell.
  • Whenever you (re)configure your grid, you should update Terrain.SetNeighbors to match. This ensures that the terrains seamlessly match up.

Based on the recommendations above I have implemented a very simple script to do the “treadmill” infinite terrain. Attach this script to a terrain and it will repeat that terrain in a 3x3 grid, with the original terrain in the middle. Drag and drop the player game object onto the PlayerObject property of the script. As the PlayerObject moves onto a new grid cell (terrain), this new terrain will become the middle cell and the terrain copies will be cycled around so that the new middle cell is again completely surrounded by terrain copies. For my purposes I simply needed a completely flat terrain (never-ending floor), but if that is not what you need, the terrain needs to be tilable, ie the left must match up with the right and the top must match up with the bottom.

Hope this helps someone. :slight_smile:

[1978-infiniteterrain.zip|1978]

no, but you can make a really large one. Go to Terrain->Resolution, and set the resolution to like 12000 (i dunno max resolution) in both width and length. You will, however, need to take into consideration, that your PC WILL lag when doing so. and you should NEVER build a game with a terrain that large. If you going to be making an MMO, like WoW, with multiple zones, you should to Application.LoadLevelAdditive or something like that, look it up in the script reference, and make all your zones with different levels. I do not know how this works, since i have never tried it, but yah.