Complete navigation overhaul (Patreon)
Content
Hey everyone!
So the first dialogue pieces have gone into the game. These just cover from your Mom and Sister through to the Entrance of the University. It's nice to finally start getting new dialogue in.
However, I've finally had to fix the NPC movement. As everyone is aware the previous system was always very unstable. I should have thrown out Unity's own navigation system on day 1 but now I'm a little too deep in so I've thrown out every confounding factor and linked it into a single meathod that will force you into place no matter what happens.
So previously the way the movement worked was each character has a basic character controller. This controller has all the information for basic movement. This is what you control when using WSAD and what the Navigation uses to move you or an NPC.
I broke down this system line by line ....
I made some important discoveries. Three core elements of the system relied on Path.Valid() , Path.RemainingDistance() , Automatic Deceleration. In trying to figure out why my system was going wrong I discovered that the path is listed as Valid even when it is not. Path Remaining Distance just returns random garbage numbers and Automatic Deceleration doesn't do anything.
So about 80 percent of my problems surrounded trying to get the character to walk to a point with so many Unity components returning the wrong number I've just written my own distance and validity test.
I've also completely ripped out the connection between the controller and the Navagation. I've wired the movement directly into the Navigation. The generated path already avoids obstacles so why not just move it along the path directly. To do this I have to completely shut down the controller while this is happening.
So what is different?. Character's will no longer collide with each other or the terrain. They now simply move through each other and go where they need. This only happens when they are navigating to a specific point. If they are wondering generally they will still avoid each other and when you are moving normally they will still be physical.
This is the last time I'm going to "fix this" system. It is done. It took days of bug testing to find all the strange edge cases.
Now that dialogue and events are starting to go in I've been creating more general use triggers and events to speed up events. I can have two characters talk to each other. Walk around, block you from going areas.
So the next thing I'm going to add is a map tab. With so many areas now in the university I'm going to create a series of maps for each zone. These probably won't exist for every area but for the big ones.
I might even make it something you can unlock, or get from specific characters.
Anway that's all for now I hope to have some mockups or a quick prototype of a map at the end of the week!
Files
Previews only