It seems like it could work as a good basis for what I’m needing - obviously if I limit the size of the terrain tiles in certain directions, as the game is sidescrolling.
I’d like to have the land gradually trend downward across each tile from left to right, with each tile continuing down lower than the last - but still with hills and bumps being generated as this script does. Any pointers for me would be greatly appreciated.
Your best bet is to learn how to generate a plane programmatically first. Take apart this script and learn what makes it tick, then you can start adjusting the position of each vertices to get your slope.
After that it’s just about randomly selecting some vertices to create a hill and use Gaussian fall off.
Firstly though, really try figure out how to make your own plane from scratch it’ll really help you understand what you are trying to achieve (it did for me).
Hint: If you are editing your plane you’ll need to mathematically figure out which vertices are being deleted and added so your terrain cleans up after it self, you don’t want to rebuilding the entire array all the time, just the ends.
Thank you for your advice. That does make sense, it’s definitely feeling quite ambitious for a beginner to scripting trying to get this working, so probably starting with generating a very basic plane and adding complexity as I proceed would be a better way to learn this. I’m sure it will be much more satisfying to build myself too (once I get my head around it!)
You could subtract a value from the Y axis whose height would be based on the noise field. Have it so that the farther from the starting point the greater the subtraction by multiplying the distance by a negative float. So basically get the height of the vertice after being effected by the noise for the hills and subtract the resultant float from the negative multiplication based on the distance from an arbitrary starting point in the XY axis.
Thanks for that, this is all good stuff. I need a better understanding of coding before I can get much further with this I think, but these suggestions are very helpful in getting an overview for how this could work.