- Home /
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.
Answer by AngryAnt · Jan 05, 2010 at 12:12 PM
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.
$$anonymous$$y friend, you have truly saved me, i thank you :D
Hello! Is there some examples of such treadmill script? How does it work in the editor? Do you display all the tiles without the treadmill algorithm?
Will such a 'treadmill' concept work in a $$anonymous$$ultiplayer space-game with movement possible in all directions on any axis?
In your scenario, it sounds as though you're describing forward/back/left/right movement .... can treadmills go one more step into true 3D movement (i.e: outer space)? And if so, can this concept work within a multiplayer conetext ?
3D is perfectly feasible. The concept operates on a grid - that could just a well be a 3D grid. $$anonymous$$ultiplayer has no impact on the idea as it is a client side visualization setup.
Hello there. Would you have more details on this concept of "slack" ? How could it work ? Based on distance to tile center ? I'm actually having trouble with the harsh transition from tile to tile given the fact I'm downloading terrain tile ... 10x
Answer by Looney Lizard · Jul 18, 2012 at 02:22 PM
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. :)
Answer by m50 · Jan 02, 2010 at 04:05 PM
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.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Loading terrainData from Resources into existing Terrain object using UnityScript 1 Answer
Making an object stay parallel to the terrain it is on? 2 Answers
Terrain Generation Problem 1 Answer
Terrain generation problem 0 Answers