Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Grouping NPCs

$
0
0
Hey folks, I'm about to start work on a system that involves grouping NPCs located within a certain distance from the player in to cells; eventually each cell may exhibit different behaviors based on the 'mood' of the contained NPCs, although the NPCs themselves will have control over their own position & orientation (so no flocking). Before I begin work on this system I wanted to reach out and see if there are any algorithms that I should check out with regard to creating the NPC cells. At the moment my plan is pick a random NPC from a list of those around the player, and search within a small radius (from the chosen NPC) to find other nearby NPCs and create a cell. For each NPC added to a cell I repeat this radius check until there are no more valid NPCs for the current cell. Then repeat the cell creation process for any remaining NPCs in my list of those around the player: Example! So is that a reasonable approach to take? Thanks for the advice!

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>