| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| AI sight question | |
|---|---|
| Tweet Topic Started: Nov 5 2012, 03:48 AM (277 Views) | |
| RonBurgundy | Nov 5 2012, 03:48 AM Post #1 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I'am using FOV and Ray casting to check to see if the player is visible. It would work good but if the ray intersects part of the map, FOV checking gets nulled, UNLESS the player's distance is smaller than the AI's Ray distance (or line of sight. See below). I guess what I could do is find the area between where the AI's FOV starts and the ray cast. Then determine if the player is within this area. so... FOV = / \ RAY = | FOV + RAY = / | \ Area to find : / | or | \ Helps?
Edited by RonBurgundy, Nov 5 2012, 03:49 AM.
|
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| alexmach1 | Nov 5 2012, 04:15 AM Post #2 |
![]()
Graphics addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
you can use a 3D point function to get the rotx and roty between the player and enemy;
then, using Longi (rotx) and Lati (roty), you can check the difference of the rotations with the enemy;
Edited by alexmach1, Nov 5 2012, 04:15 AM.
|
![]() |
|
| Despellanion | Nov 5 2012, 11:09 AM Post #3 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
MysteriXYZ did an example of this if I remember correctly. |
![]() |
|
| Reikyrr | Nov 6 2012, 01:02 AM Post #4 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
http://s9.zetaboards.com/Ultimate3D_community/topic/173865/1 Its in the example list topic which is pinned in the Tutorials and examples forum. |
|
~Inspirational quote~ | |
![]() |
|
| RonBurgundy | Nov 6 2012, 04:57 AM Post #5 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
@Alex thanks for that ill try it tmrw. Desp and Reikyrr I do know about that example but I don't think it's exactly what I'm getting after, but it may be I'll have another look thanks. E D I T : Thanks to everyone for there suggestions. I took another look at Mysteri's example. I basically used the same idea in the example: DO a raycast that always points to the player. Use the GetIntersectedObject script to see if there is anything in between the player and the ray. Using angle difference, calculate an FOV use if statements to check the FOV( if angle_difference > FOVrange ), and also checking that the intersected object is the player. Bingo!
Edited by RonBurgundy, Nov 7 2012, 07:36 AM.
|
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)




2:22 AM Jul 11