NPC Line of sight

Posted by : at

Category : Shards


Just a short update to the progress I'm making on Shards of Magic. I've finished another round of AI improvements and have reconfigured how the NPCs see the world.

Originally NPCs polled the world around them for what other objects and NPCs were in various ranges. Ranges include line-of-sight, Agro (distance to where an NPC would initiate an attack), and object avoidance. It was hastily put together and a large system drain.

In this revamped system NPCs shoot out rays corresponding to their maximum sight range and only whatever is found has its distance checked for the smaller ranges. This cuts out a lot of processing and allows me to customize an NPC's field of vision. It also allows the player to duck behind objects and camouflage themselves; which will be heavily used feature in my upcoming puzzle game "Shards of Magic: Puzzle Heist".

In general this is a better system that I should have taken the time to implement from the start.


Categories
Useful Links