Download

Procedural terrain generation via materials or landscapes

So I’ve been trying to get things working for procedural map generation. My end goal is pretty simple. A top down game with a tile system (or hexagon?) I just want to use 4 or 5 textures to blend together and basically have a grid layout like this but having some height information to each tile https://www.youtube.com/watch?v=nGA7lAumQwU

my game and how it will play: tile based, top down shoot 'em up http://i.imgur.com/utt4x9W.png

How I’ve been trying currently is using a square 1 polygon tile and then applying a material with color, normal, height etc. that blends between the textures. So grass and dirt, etc. The problem with this method is that collision cannot be generated based on a height map.

http://i.imgur.com/gKAFyxg.jpg

What would be some workarounds for that? Or would there be an entirely better way to go about it? Because how I’m doing it now is a grid block system and it’s quite hard to get natural blending between each square tile.

Would I want to try out landscapes? Something like this https://www.youtube.com/watch?v=39uMosogVog would be perfect since it generates the colission but I have no idea where to start to get something like it

Bump

If I’m being unclear or phrasing anything wrong let me know and I can try clarifying.

Thanks again!

What do you mean collision can’t be generated from a heightmap ? :

Also one of your imgur links aren’t working, maybe that’s partially why you’ve not had any responses, I just got ‘one’ of them working today but the other remains unworking for me at least.

later
nl

Thanks for the reply. I checked both imgur links and they load fine. Weird.

Collision can’t be generated from a height map on a material that tesselates the object via the world displacement and tesselation modifier on the material. At least from what I researched. If there’s some way for a material to produce the collision map I would love any pointers for that. Because how I would like to have it is the terrain is generated by a material with the heightmap instead of using landscapes because landscapes can’t tile and the way i want my game is via tileable assets.

Bumpity bump

check this: https://forums.unrealengine.com/showthread.php?58288-WIP-Procedural-Terrain

Alright I will try my best to explain everything from your post(I will even have a go at creating a project file to replicate what you want if you like when I get home, for practice).
The Youtube video showed used a blueprint with the contruction features to spawn a static mesh next to itself in a random direction, unless an object was already there(ocupying the space) thus creating a randomly placed corridor.

TODO this(better then the video did) you would

  1. create a mesh with blueprint which spawns a title next to the mesh on spawn(this should give you the same results as the video)
  2. Add a bool check using a line trace to detect if their is an object in the area where it will be spawned.(if there is then don’t spawn and spawn somewhere else)
  3. Add a bool check to check for the number of meshes spawned by class(or enum) and basically when this turns true provent more objects spawning(This will provent your level from being to big)
    Note this is just one method of doing it another is shown in this video: https://www.youtube.com/watch?v=kmnC6IUPGjI

If you want to make it in a more grid pattern(it becomes more compicated using this method and it would quickly become a resource hog. As for colisions your using a material to create the landscape(if i’m mistaken then let me know) which creates a problem because as far as I know colusion boxes are fixed

However I think you can use the mesh itself as a colideable object(if you change a property of it) However its important to note that in the 2nd YOUTUBE VIDEO!! The guy had created those meshes using a 3d modeling program instead of a material.(gtg)

Excellent information! Thank you so so much!

This is exactly what I’m looking for. And I would be more than grateful if you want to try and replicate a project file for it. I’m pretty new and bad at this stuff as I’m just an artist haha.

To address your last point tho, I would really like to create the landscape with the materials, because it gives it the best bang for the buck. Between variety and blending as the material spits out the actual 3d model with all the hills and crevices and what not. Would there be some other way you would recommend still being able to have the grid pattern but having textures/meshes blend together? The only way I can think of, while using the method you outlined, is to manually create dozens of variations of mesh tiles that fit together. But this would take a lot of time and articulation and for my game I don’t have that kind of time because I want several different worlds to be on which would requires hundreds of tile meshes and textures.

Thanks again so much for the help!