Spellcaster Studios

Make it happen…

Random Missions: More areas and (yay) pathfinding

Today I mostly built new areas for the random missions, so the player sees some different stuff… It’s not highly complex, but it’s some polish…

screen290

In the process, I found a silly bug…

Basically, the enemies (in this case, the mechanoids) were going through the wall on this “custom map”… First, I saw that the navigation mesh was overlapping the wall (which is weird, considering how it’s built)… After a bit, I found out that the issue was that the wall wasn’t touching the ground, so there was a small gap between the wall and the ground, and the navmesh was being built there!

This would have been removed automatically, if I didn’t have an optimization stopping it, because this case shouldn’t happen!

Looking further into the issue, I finally found that it was the “terrain corrector” algorithm…

Basically, I have an algorithm that goes through the terrain and check if all areas of it are accessible… If he finds an area that’s big enough, he makes it accessible, by raising/lowering it, creating “stairs” between traversable and the area, etc…

So this algorithm was triggering after the map was put in place, so the algorithm would lower the terrain below the map (because the map is not part of this process, it’s visually added later), but the positioning of the map wouldn’t change… that would cause the crack and the problems…

This one was tricky to figure out! Disappointed smile

Now listening to “Under The Same Sky” by “Sleeping Pulse”

Comment