I’m doing some tests for a mechanic I want to implement.
The basic gist is that I want my terrain to tile so that regardless of how much my character strays he always has terrain to go into. so when he approaches the borders of the terrain, a new terrain with the exact same borders spawns in that direction. And they have to line up always.
So for my tests I created a 256*256 tillable noise texture and load it up as terrain but when I duplicate and move the landscape it doesn’t match.
I have found other posts that might solve this but they don’t work for me because I want to have 3 or 4 instances of the tillable terrain that matches on the edges but are actually different in the middle so that they tile but they are not exactly the same.
I attempted to do the same thing but could not get it to work correctly, it seems importing the heightmap does not always translate exactly as it should, im not sure if this has something to do with Unreal only allowing .png Heightmaps instead of .exr (which allows you to use true White instead of the “extremely close to white” that png gives).
Anyway what i decided to do for now to get going was create a massive heightmap from within Blender and then use the import settings to split the heightmap into the correct grid sizes i want, world partition can then spawn and cull the actors as it goes.
I dont know if there is a better way to do this?? I was brainstorming that maybe the landscape mesh’s could be put into Blueprints and instances spawned on the fly?
Would be interesting to know what the correct method of achieving this is as i am a total noob with UE.
My tiles are all exactly the same so maybe there is a better method for me.
I suppose there is no correct method. If it works and it’s efficient it’s fine. I didn’t want to do meshes because I’ll lose all the functionality of “terrain material” and painting/texturing in engine.
Created a heightmap that is 1x3 and it tiles on the y axis (I actually only want to allow tiling on that axis). When you travel north and hit the green coilider you get translated to the red one and vice versa.
It works OKish, there is a slight blink effect with shadows and it’s going to be a big hassle to triplicate all the assets place them in the correct positions, especially trees and grass. I haven’t tested foliage yet and this might even break the effect because the “wind effect” will not be seamless.
I’m not considering this a solution to my problem at all. Just testing out possibilities.
And I just thought about another, i’m about to test.
There it is. The edges match now.
I just remembered that a tileable bitmap doesn’t have the leftmost column of pixels equal to the rightmost one. Not the top and bottom lines do. Which works for images but for not terrains doesn’t because a terrain system needs to create the mesh to even those columns and lines of pixels.
So I altered my bitmap to have the exact same line of pixels on the top and bottom. And same for left and right most columns. And now it matches.
That was a hiccup on my brain that I didn’t figure this out earlier.
That looks great nice one, i forgot to add to my previous reply that very minor mis matches can be corrected by enabling nanite on the landscape and also enabling Nanite Skirt which will blend the edges together.
If you enable Nanite on the landscape you might see see gaps appear anyway and will need to enable the skirt.
Could the issues be due to file formal interpolation?
16bit being what you need, vs noise generation only having 255 levels?
another hiccup. If you move tiles at gameplay, then won’t you need an underlying mesh impostor to still show for the rendering to happen?
Otherwise I guess you’d be dealing with a 9x9 tile setup in which as you approach the next tile, the edge tiles shift over in the other direction.
Its not impossible its a perfoemance issue.
Keeping 9 tiles loaded (when all you possibly need max is 4) is costly to performance…
Each tile will be a couple of kms plus there will be a thick fog to prevent seeing too far. As I said in an earlier reply I only need tiling in one axis so in fact I only ever need to have 2 tiles. The one you’re in and the one you’re going towards.
If it’s really just 2 titles and only 1 needs re/writing or adjusting, then I suggest you do the writing at runtime.
There was recently a somewhat objectionable post where some c++ was shared to alter the landscape terrain at runtime.
Your situation is unique enough that you could make use of this without suffering performance costs.
As a general rule I have to disagree with it, since making your own analaitical mesh out of the same texture is just overall better for performance.
But if you dont want to mess around with that, this one particular case may just be able to swing it.
All you really need to change is the Edge pixel of the next adjacent tile to get it running without seams.
Further, you can actually levarage the pixel calculations of the next adjacent pixel strip to make sure the terrain is accessible / potentially create a pathway if needed.
All at runtime… without a procedural mesh component and loads of tris math…
I’ve followed a couple of courses on c++ unreal development and in seems simple enough, but I just keep putting off working with it because blueprints seem so functional for what I want and then, coming from unity where you can have a script along side the visual components of the game object, I just find it incredibly off putting to have to hand code the components, and configure the components in code, instead of visually.
Thank you for your reply @MostHost_LA . i’ll keep it in mind if I can’t find any other solution.