Quote:Original post by Possumdude0
I guess what I really need is info on how to do a dialouge system and an an NPC system. Like when you talk to an NPC, how does the game know which NPC you're looking at? Do you have to search through all the NPC's data to find matching coordinates?
Yes and no, and it depends. :)
If you have to deal with massive worlds, thousands of NPC's and all, you'd want to do some culling beforehand. Like checking in what region the player is, and only taking the NPC's in that region into account. If you're dealing with only few characters, then such an approach might be overkill. Either way, in the end there's still a (hopefully small) list of NPC's to test against. Usually it's not worth culling every other character since that could take more time than testing the resulting list of a rough, but fast, culling method.