Been trying to figure this out for a while now, so thought i’d bring in the big guns (you).
my game’s landscape is a grid based tile system. The player starts with a set number of tiles centred around 0,0,0, like this, the “dropped” areas are where the player and enemies can walk:
Think something like dungeon keeper logic.
As the game progresses they can add additional tiles around the edge, growing the world. Something like this:
As the player progresses they will uncover, enemy spawn points which will, you guessed it, spawn enemies. These enemies then use a nav mesh to move towards zero (the yellow building in the centre.
The problem is that the levels are technically infinite where the only real limitation is the players PC. There are systems that are going to be in place to make the player WANT to move to the next level, but nothing forcing them.
In theory the player could just continuously be spawning more and more of the tiles as the game continues.
I see a few options:
- Spawn a small nav mesh on each walkable tile (the ones that are “dropped” in these images.
- Change the X and Y size in the Nav Mesh bounds volume at run time to make sure all paths are covered. (so get the distance between the two furthest apart hexagon tiles on the Y axis, set that as the size of the box and then set it’s Y location to the average of the two locations. repeat for X)
- Make a massive (for example 1,000,000x1,000,000x500) NavMesh bounds volume and hope the player gets bored before they get that far.
1 and 3 feel like they’re the wrong way to go, i imagine they’re going to be very heavy on the players computer.
2 feels like the ideal way but i can’t seem to access those values through BPs. I know that they can be accessed via C++ but that is unfortunately beyond me, i tried.
There is an option 4 where i change the game rules to have a more finite world and have the Nav mesh cover the maximum possible area (similar to 3), This is probably the direction I’m headed at the moment but it still doesn’t feel like the “correct” way to do this.
Can anyone offer any advice, really struggling with this one. what would be the “proper” way to do this. (other than in C++, i know that would be best)
Appreciate any help people can offer. sorry for the long post.
Thanks.