Infinite flat world generation based on player location

Hi there!

I want to make an infinite-like flat world, like the Eden Editor in Arma 3. For it I have a plane mesh of 10x10 meters, and the idea is to generate and delete them based on the player position, like Minecraft chunks, so it give the illusion of a infite surface but it only generates a bit of them, enough to cover the horizon.

Any idea of how to do it on blueprints. I know 0 C++ so it’s not an option, also the plane scale xxxx units is also not an option, it must be infinite.

Clarification: I already have searched a lot in Google, Youtube and forums for a solution and also I’ve tried many ways myself in the editor, but nothing works, so I’m a little desperate.

@Birgkitt I have several levels like this in my current game development. Although they don’t reach to the horizon, they are generated on the fly and the player can wander for ever, basically. It looks to them as if they are in an infinite maze / area, but actually the mesh only goes around the corner / out of sight each time.

It only needs to look like it reaches the horizon, I think even a moderate size mesh could achieve this.

Basically I have collision boxes towards the edge of the mesh, as the player approaches, a new area is spawned ( just out of player view ). If they decide not to go that way, the mesh / BP is discarded. If they do decide to go that way, after some distance, the previous mesh is discarded.

Each mesh is in fact a BP of course…

Does that make sense?

Couldn’t having those collision boxes bog down performance in a large scene? I assume you could instead have one set of boxes that surrounds the player’s tile and follows the player to any tiles they walk to.

@NotSoAccurateNo1 No performance hit, because there’s only ever a few of them. As you move from one segment to another, previous segments are destroyed. It’s never more than a handful of boxes…

Edit: the boxes are part of the BP :slight_smile:

@Birgkitt I was thinking about this. You could also use BP level streaming if your ‘zones’ are complex. Same concept, as the play heads for a new area, you can stream in BP. Once they are in that area, previous areas can be dropped.

This means you can still have an unlimited world, because you don’t have to do it with volumes, just a BP that knows where to stream relative to the current locaton.

@ClockworkOcean I see, I’ll give it a try later on, thanks for your responses :slight_smile:

Look into endless runner tutorials. It’s similar theory.

I attempted a “move with character” approach, but the floor tile stats to jump around because of the fact the collision from characters and the movement on the tile over interact.

You need simple collision of you would fall down, but you also need the plane to change location.

The only other way is to fake the movement and lock the character position at 0,0,0.
this results in funny stuff happening if your character is set to use Speed variables, so it’s not viable.

In the end you are left with 9 floor tiles and 6 trigger boxes (hex shape) to determine what needs to be spawned.

You can fake a distance mesh with an overall stretched floor tile, absolute world position material no collision and following the chatater x/y.
to avoid fighting you have to set it up just right.