Continuing Harvest System Part 1 (Patreon)
Content
There was something I had to do to fix navigation before properly finishing the harvest system. This was related to the navigation system for the AI.
See, in most unity games, the navigation mesh is baked once for the whole map for the AI to use. Typically this works well for maps that don't change shape (walls, moving floors, etc.). With Viva, because people can now make their own custom items (furniture, walls, etc.), it was necessary to make the navigation system work with these dynamic properties. In comes the improved navigation system:
Let's say you made a new custom prop (a tree) and you spawned it into the world:

NPC characters don't know how to navigate around this new obstacle. This is where my new navigation system comes in. It detects changes in certain props that require a navigation rebake at runtime:


Now NPC characters can properly navigate around the tree. This also means that any surface that you make will also become traversable by the navigation system. For example, as a stress test I built a bunch of immovable pallets and placed them like a ramp to make a small platform:

As I was building the platform, the game was properly rebuilding the navigation system. And the NPCs were able to get to me properly! The performance was very good and is done asynchronously to maintain framerate (it's almost instant anyways)

The navigation path can be as complicated as you want it to be so this opens up big customizability possibilities. What this really means is that technically v0.9 will support custom maps (navigation was pretty much the big hurdle and it was sort of accidentally solved). All I have to do now is just add another option to start the map in a blank map instead of the onsen in case you want to build your own map (think gm_flatgrass but for Viva). That shouldn't be difficult to do but I'm gonna put it on somewhat mediocre priority for now.
Stay tuned!
Files
Previews only