Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Twitch375 · Feb 25, 2015 at 09:00 PM · raycastaicover

Detecting degrees of cover around a point?

I'm trying to develop an ai that hides from the player through waypoints placed around the map that relay information about that position to the ai which then chooses the optimum spot and goes to it. Not ground breaking I know but the parameters for selecting the optimal position are way too vague to get a smart ai. As of now it usually chooses the furthest point that isn't visible to the player. It also takes into consideration where the player is looking making waypoints behind the player better options. This is a good start for me but I would like to get a waypoint to detect the degrees of cover around the object within some close distance.

One way I was trying to do it is have raycasts emit from the object every x amount of degrees around the waypoint and if two rays next to each other hit an object it would assume the degrees between the two rays provide cover there. This obviously has accuracy issues not to mention performance issues if I ever wanted to implement dynamically changing maps. I'm dumbfounded and there isn't much discussion on how to achieve this. Is there an easier and more accurate way to do this that I'm missing?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hexagonius · Feb 25, 2015 at 10:39 PM 1
Share

I don't think this will get easy at any point, but you could inverse the process and look for the closest vertices of obstacles to a waypoint. If there's more than one vertex not obscured by another related to the same obstacle, it's the closest to it and providing cover along their vertices the furthest apart. Out something like that ;)

avatar image Lahzar · Jun 27, 2015 at 02:45 PM 0
Share

You should read this documentation on the AI from the first $$anonymous$$illzone game: http://www.cgf-ai.com/docs/straatman_remco_killzone_ai.pdf

There are several ways to do this. First thing you could do is have several THREADS and COROUTINES running in the background that do these heavy calculations so that they are ready when an AI requests it. This could take some time, but it wouldn't take much performance, and you can easily check

To how you would calculate it would be something like you said, or again you should check the killzone docs. If you have a sortof linear level design, where covers are only facing 4 or 8 directions, you would only need to check every 90 or 45 degrees. Or you could use spherecasts.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

WayPoints mixed with Raycast 1 Answer

Have falling object exit from a collider after collision? 2 Answers

AI Evasion help 1 Answer

How can I get a character to patrol and follow terrain? 1 Answer

How to render AI view area (taking obstacles into consideration) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges