Hey/ I need to make an endless generating world which has to follow the 3 rules:
It is endless
it shall to move. So a chunk spawns in front of the character, moves pass it and dissapears, making an illusion of moving forward (like a conveyer belt, for instance)
I suppose the sphere will be too big for that. plus t can’t generate new random chunks. Basically, the game will be about watching a window in a train, so allthis is needed to make diffrent and interesting views. Have any Idea for that?
The above is randomised and using Instanced Static Meshes so it’s speedy. And yes, the idea would be to write algorithms that distribute elements randomly but also intelligently; you don’t want a forest in the middle of the river and no roads should intersect mountains.
However complex this is going to be, you’d need to work with layers of generation. Theme, ground, major features, minor features, details. Either generate content [procedurally from simple geometry][1] (or even procedural mesh) or have a vast library of ready-to-go assets and scatter them according to the some rules. Or, ideally, both - hand made, large, eye-catching elements & then procedural fillers like debris, small rocks, vegetation, etc. And work really hard on blending the edges.
So if you wanted a seamless bridge, you’d divide into min 3 bits and have a chunk manager actor control when to start the bridge, how many chunks have the middle bridge section and when the bridge ends.
Here’s the setup for the above (although this can be done in many ways and this may not be the best):
a chunk is an actor with an InterpToMovement component that moves the actor over 1500uus (750 to -750) over 5s and then resets
5x5 sectors of 200uu each produces a square with a 1000uu side
each ISMC generates up to 25 instances of random mesh in its own sector, with randomised scale
This whole thing is a glorified grid and would work OK for a city or park (or an endless Flippy Bird orwhatshisname runner) where things are organised in a man-made fashion. For more organic stuff you’d need a very different algorithm.
Anyway, this is just an idea of how to potentially approach it. The actual generation would be an order of magnitude more complex but procedural generation is well covered.
I haven’t worked with landscapes much but afaik they’re static so this method is not too suitable. When you said chunks, I thought you meant procedural / semi-procedural generation.
Technically, nothing should stop you from moving the camera instead. Would streaming levels work for you?
well, I am afraid, that if I use level streaming, then it will still start to lag if you move far enough from the center of coordinates. But how can I make the system work with chunks and procedual generation? You’re actually helping me with this)
Not sure why it’d lag. You can always reset world origin if you worry about float precision. But it has nothing to do to with performance.
The original idea was for each chunk to generate the desired elements and slide the whole thing in front of the player’s camera. When no longer in camera frustum, the chunk is repositioned and regenerated. And the observer will never notice…
That looks fantastic. So the chunks are meshes, right? And they move from right to left. Is there a way to make them generate randomly? I mean make trees and roads and houses spawn in diffrent places, following certain rules. Procedual generation, basically
But you can update their transforms (and batching does not kill all the performance benefits of using (H)ISM. Even though the target here is ISM, it does work on HISMs.
That looks great, mate. The radius makes be dizzy. This is not good for someone with vertigo. I feel like I must run forward or I’ll slide down to the back…
Yes, in fact there is no traditional player. You can still use WASD, but the planet rotates. Collsion was a bit of a ‘mare’, as everything is instanced.
I also got the little ‘Epic birthday present’ of discovering that AddLocationRotation doesn’t work for instances, and you can’t scale HISM without getting culling problems.