NPC View Distance
Hello, I'm working on zombie npc, which I don't really know what this is called. I'll use image illustration.
Black circle: NPC (info_target entity) Blue circle: Players Red border: The view distance of the NPC Question is how to detect players only inside the view distance? My current code just detects the nearby players around the npc. I want to make the NPC chases (I already knew how to make the NPC moves) the player who is in it's view distance. Thank you before. |
Re: NPC View Distance
This may help you: https://mxr.alliedmods.net/hlsdk/sou...ombat.cpp#1164
|
Re: NPC View Distance
Quote:
|
Re: NPC View Distance
I don't know what do you mean by "create the NPC's viewcone", but look at line 1176:
PHP Code:
https://mxr.alliedmods.net/hlsdk/source/dlls/util.h#161 Here you can see values that the game uses. Dot product result is always between -1.0 and 1.0. It's all calculated with some simple math. |
Re: NPC View Distance
Quote:
|
Re: NPC View Distance
Did you make a pathfinding yet?
Seem this is hardest work on AI gameplay. :D |
Re: NPC View Distance
Quote:
|
All times are GMT -4. The time now is 04:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.