Hi.
I currently have this small aircraft/spacecraft game. I want to make an endlessly scrolling terrain to create the illusion of flight for the craft. Any pointers to how to get started please? Tnx.
Current state:
Hi.
I currently have this small aircraft/spacecraft game. I want to make an endlessly scrolling terrain to create the illusion of flight for the craft. Any pointers to how to get started please? Tnx.
Current state:
Mesh generation is not a lesson for the faint of heart, and making it efficient even harder.
Truthfully, Iâd recommend grabbing something from the Asset Store for this - thereâs very little to be gained by writing your own, as itâs not something that interacts deeply with the rest of your gameâs systems, and an asset is more likely to be robust, performant, and well-tested. Thereâs at least 2 free ones and countless better paid ones up there.
This is true. But fortunately we can stand on the shoulders of giants (figuratively speaking). There is plenty of material to be found on the interweb. Some examples:
https://github.com/Unity-Technologies/MeshApiExamples
I just would have some âpatchesâ or âchunksâ which are placed around the player and when the player leaves an area it is placed in front of him again (reused) and just populated with new height values (like the OP of the last link which is 404 but you could try to find it with internet archive).
Most basic examples just create a grid of quads, this you fill with noise values for some heights and apply some colors (potentially via shaders). And you should be done. Given that you aim for a lowpoly style look. Highly realistic terrain is better done by specialized tools like Gaia or similar. Itâs just the question if you want to spend the time to learn this stuff or spend the money to have it ready.
I think you need to maybe be more specific in exactly what youâre trying to do, how complicated is your game, is it it more arcade and you want scrolling terrain to go by? Or is it a full open world youâre thinking of? Depending on the answer it might be easier than people are making out.
Thanks for the replies!
Itâs a simple game. The craft wonât leave the small boundary it was put in. So Iâm not trying to spawn terrains while I flyby. What I want is an endlessly scrolling 3D background / terrain, so it would create the illusion of flight. And, No itâs not an open world. More in the arcade side.
You could look into parallax scrolling in that case but just have the effect on each side you want it being viewed in the cockpit. Even with the possibility of a complicated mesh generation a technique used to give the impression of a bigger world is when games developers make âcellsâ instantiate before hand when youâre moving forward and you could make use of a perlin noise generator to make something more fancy. After that, if youâre not wanting to do anything complicated like spawning enemies on the terrain since it looks like a space sim itâs just a matter of them having instantiate at random points as you go forward.
Donât know why people are making it out that itâs too complicated, sure if youâre a complete noob yes, but if you take the time to study it you can still learn it no problem. There are multiple techniques you can use for mesh generation, it doesnât have to be all about generating triangles from scratch.