After all that, I cannot use the other threads for physics, yet.
So, It currently works, but it uses only one CPU core so it takes 8x longer to map out the paths ATM.
I am looking into a different way to check if the location is occupied. But unity is working on something that can put these collision checks off the main CPU thread. So, whichever comes first I guess.
But as always I learned a lot along the way, and since ive been programming for around 2 years I should know this stuff better, I guess. But its getting easier
Visually Debugging: the CorridorPoint.size == Life; So it gets smaller as it searches for its destination.
Essentially, I am pathfinding. Its similar to A* but I dont need the faster route, I need the optimal route. So, think of it like this, if I was creating a floorpan for a building such as a hospital, It would be best to have long corridors with the least amount of turns. Even if the Distance or time is longer, its essentially easier to navigate longer hallways with less turns. So thats what im making.
So far the level has been set small still, but essentially its clamped to 10 x 10 floors, with 10 levels. but I can scale that up if players want to take an extra bit of time when the level is loading (Generating)
But once I can have all my Cores building the level, It will be much faster so, fingers crossed!
I hope to make the levels the largest possible since for the most part the player won't need to visit all of it, but also allow they player to option as well as the feel that this is in fact a very large facility.
Note that this level is currently 4 x 4 with a single floor. the Rooms are roughly 3 x 3 on the Grid (which is 20 metres cubed. As stated earlier, its set to 10 x 10 max currently.
For those who are still wondering since I have not made it super clear, this is essentially what it will look like for the players, this image is from one doom game or another but its how I explain it to my parents :P