Hi,
Im wondering if there’s any info about how Babylon can handle this.
Let’s say I have a 2d array map, for a tiled-based game (absolute x,y positions).
I want it to be infinite in both X and Y directions. Like a treadmill.
For example, this world has 9 chunks.
Let’s say a player starts at chunk 5 and walk right (+X). It would be looping: 5,6,4,5,6,4… and so on.
Im already rendering whatever the server sends me as a “nextChunk” in any direction im walking.
If I keep walking +x, my mesh.position would continue incrementing and rendering chunks in that direction (absolute x > 30), exceeding boundaries, even if server-side the player already turned around the world back to x=0.
So I guess im supossed to move my mesh and its camera back to x=0 too.
What I’m confused about is:
How to do this movement as seamless as possible.
Is it okay to render clones of opposite chunk at boundaries?
So player wont face a black void at limits before re-position takes place. Like so:
//when moving ->
[4][5][6][c4]
Im still quite a noob, maybe my whole approach is wrong. I read you…
I’ve been reading about Dynamic Terrain the whole day but I think I just don’t completely get it.
When I first saw it in the docs I just skipped it cause it seemed more like procedural seed generation.
I get the scrolling part. Is exactly what I need.
But isn this a divided mesh morphing? (to make mountain-like stuff)?
Or is there a way to load my own separate tiles meshes as terrain?
where in all of this should I call my “chunkBuilder” function?
If the map data aren’t updated or if a new data array isn’t passed to the terrain when it reaches the map edges, then the terrain goes on moving as if the current map where repeated on the current axis.
So basically you need to call chunks at edges and add/update their data to the map.