Open World Navigation... is it impossible?

My current plan is to build a dataset containing all of the outer edges of the navmesh for each chunk: these edges will be possible locations for navmesh links

Then when a neighbor chunk is loading, it will compare these edges to find matching pairs or points that are somewhat close to each other, then connect them using a navmesh link. And of course, along a long edge, multiple links will be needed.

We shall see where this goes!!

Edit: one possible issue will be overlapping navmeshes, aka on one navmesh there was a rock so it’s slightly higher than the other navmesh. So I guess it’ll need to check if the point is underneath the other navmesh. This of course will need to be thought out in the future.

You could limit the number of links using topology. Rivers and mountains are good natural barriers and create chokepoints like bridges and passes.

I’m also not sure a waiting time is necessary. It makes it more realistic, but I can’t think of any game that does that. For example, in Breath of the Wild, there are lots of quests where you find a character and send them somewhere. I’m sure there is no wait time. Every character you send to Tarrey Town, will instantly appear there. I remember specifically being curious about that and trying to beat characters there. I’m also fairly certain that Kass the singing bird thing is literally just in multiple places at once, he doesn’t seem to actually travel at all.

2 Likes

Sadly my chunks are pretty small (300x300) so this isn’t an option :cry:

And that’s true! Maybe I am overthinking it!

300m? that’s not small that’s huge!
Skyrim’s chunk is exactly 57.6 meters (63 yards) to the side

2 Likes

That’s something I never understood! Apparently Skyrim also only loads size chunks (so a total of 9 chunks at a time), which seems SO small! Should I shrink my cells?

A major reason why I have cells so big is simply because otherwise I’ll have dozens of scenes open at once in the editor, which makes it very annoying :confused:

A scene can have multiple cells? small cell makes bitsize loading/generating less chokeful by separating the load, it also make it easier for job like multithread.

Just had one level of grouping more, that would be a chunk = 6 cells side? assuming 50m side cells. Would be useful to have for LOD evaluation (like updating beat) on chunks, then cells, then objects level, it would be a sorts of spatial partitioning for various optimization almost free too. Using a position hash makes it easy to reference any chunk/cell per object position super easy too, which is cool for update.

1 Like

That’s true, my foliage system’s LOD utilizes cells, and I plan on building an automated LOD system for buildings and such, which will also use cells as well (applying a lod to the entire cell)

I think trying to further split my cells is going to make things pretty tough, I think 150x150 is a good size for me. (Houses for scale)

Ideally the splitting (assuming you haven’t build the world yet) should be handled invisibly in edition by tools, it’s basically assigning the right data to the right container. You basically edit by operating on group at a certain level (like chunk level) but the system use cells under the hood. Therefore editing still happen in a chunk size group of 3*3 for example?

1 Like

Ahhh that makes a lot of sense.

What exactly would I gain by doing this? My foliage system already uses subcells (4x4) since I had to program culling and LODS specifically for the system, but for actual scene objects culling, occlusion culling, and LODS are already handled by Unity without the need for subcells… I can only imagine it would allow for the disabling objects if they are in a “disabled” subcell, which does sound interesting…

It reduce hick ups when saving, streaming or updating, it allow you to spread the load, which is what you must be doing already with the foliage system. Streaming in and out is what I had in mind mostly.

I’m just giving you options anyway, we can make it infinitely complex lol, and playtest will be needed to see what’s best for your game. For example not all object have the same importance depending on their size and whether they are static, vegetation, background animation, cosmetic, dynamic or agent, maybe subcells can vary across these category, who knows. It also depend on the sparsity of the world and the speed of travel, or even the type of travel, (no man’s sky don’t load objects other than landmark and megafauna up until we land).

Funnily I just made a huge post about it with save system on the game kit controller thread lol.

2 Likes

Ahh I see! I very much value your thoughts, since it seems these sort of things isn’t talked much on this forum. I’ll check out that post! However, if objects are in a scene but in separate subcells/containers, wouldn’t loading that scene load all of the containers?

Well only if you load the scene in a single load, they are subcells for the organization level, so the scene logic would manage loading its part on a per cells or even per objects. It depend on what you want to use on a logic or editing level, maybe cells makes more sense for logic and scene for editing.

Now I research this because I want to do (space travel) open (planetary) world too, I haven’t implemented that in unity (yet), so I’m not sure how it would work effectively in unity, especially streaming, especially with resources folder and streaming assets, which seems to have some issue in unity (The dev of inside, which isn’t an open world, had to use access to unity’s source code to solve this problem). But minecraft chunk size was adjusted to remove hickup in the original game release made in java. I’m passing what I have learned. In general smaller bit size allow you to smoothly cut the load in manageable time, but it also have risk of overhead, so there is a balancing issue.

But right now, I think we have reach a point where it’s only testing that will gave us further answer. If you get result please report back :slight_smile:

I hope this is good too:
[Released] Game Kit Controller: Engine with melee, weapons, vehicles, crafting & more! 3.76 page-32#post-3492956

2 Likes

Skyrim had to work with very tight hardware limitations. Fallout 4 had far fewer restrictions and as a result if you tell your dog to head home and follow him he will eventually make it there. If you want to see it in action there’s a video recording below in the spoiler.

1 Like

It could also be an artefact of the dog never crossing the event horizon, thus never been unload to lower simulation LOD. I think it also happen for some (important) character in skyrim too, though I could check on companion too, not all character are treated the same by the logic. I assume NPC would be more tied to area and thus cheat (to avoid all npc wandering teh world at the same time for whatever unforeseen reason) while dynamic character that are supposed to be everywhere worked differently. I’m sure dogmeat reach destination without fighting enemy if you don’t follow him to kill obstacle.

In zelda BOTW, kass can be pushed everywhere to another kass, as long you don’t get too far from him, and that works for many object too.

1 Like

Quite possibly. There is an actual stage in the main story where you are supposed to follow the dog. It’s possible that the game keeps a minimal world navmesh in memory at all times that entities follow and only improves their placement and navigation if the cell they’re currently in is loaded by the player being nearby.

@neoshaman Thanks for posting that, i got lot of new info / ideas reading it. I think you should post it to https://forum.unity.com/forums/game-design.71/

I figured you could probably do that. Lots of games act like that. Does mass actually still have AI though? Most of the time if you push a character too far, their AI will unload.

Are chunks fixed sizes in most games? I would make the assumption that instead they would use a dynamically created BSP system, where dense areas have smaller chunks and empty areas have much larger ones.

The reason for the automation is that it makes world editing much easier, since all I gotta do is press a single button to extend the map, and don’t have to worry about resizing cells for example (since 99% of the time the first initial location of a city will not be the final location). Not only this, but it makes a whole lot of calculations a hell of a lot easier, since everything fits into everything, and each cell has 4 neighbors.

Elder scrolls has fixed chunks, as does of course minecraft.

I plan onn adding non-chunked cells, but these are not gridded and the loading / unloading of them is not automatic. I plan on allowing level designers to add some logic to the loading of these special cells (for example, there may be a dungeon cell underground… this isn’t loaded until the player enters a volume that triggers the loading and another volume triggers the unloading of the overworld since the player will be underground.

I handle this logic by grouping cells into “Cell Layers”, which can be gridded (automatically loaded depending on player distance) and non gridded (requiring custom logic).

This of course is extremely custom to my game and my goals :slight_smile:

1 Like

Do you know if it works with floating origin (moving the entire world with moving agents while everything continue working)? I’m with the same problem, I cannot use Navmesh due to open world … I bought NAV-AI (from the Asset Store) but it does not work with my large projects, the navigation mesh appears empty (maybe because they are too large).

Never tried, but i don’t see why not. However, it’s been awhile i’ve used it for anything, but simple pathfinding. I had to check the docs, and not sure if it was this what i used: https://arongranberg.com/astar/docs/class_procedural_grid_mover.php …anyway there still seems to be free version, check it out (and see procedural example). I haven’t use 4.x (free or pro), so there might be something better for these kind of problems.

1 Like