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 icelated · Oct 25, 2012 at 07:55 PM · aienemywaypoints

Enemy AI things to consider

I am making a first person shooter something like cysis where you navigate a terrain and enemies will attack you when you get close.Now, i have an enemy soldier with animation ready to use. I want the soldiers to have a small designated area they stay in. Like they patrol a small area and when im in range they take cover and fire at me. I dont need for them to follow me beyond the designated area.

What are things i need to consider using for the enemy AI? Waypoints? Raycasting? Im just not sure. Thank you

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Montraydavis · Oct 25, 2012 at 09:04 PM

Well, not only do you need to consider Waypoints and definitely Raycasting, you need the actual essence of life.

For instance, vision/sight, hearing/range-detection. Things like how to find a target ( Perhaps you should look into NavMesh, or purchase a cheap unity asset. There are plenty ).

There are actually lots of Unity assets to get these jobs done spontaniously, but, if you prefer to code your own classes and what not, here are a few starter tutorials from YouTube.

Here is my own ZombieAI . Keep in mind that this is by no means standard code practice, and I only persuade you to use this as a starting point if you need. But none the less, compile-able.

http://pastebin.com/DczwH38D Zombie Motor

http://pastebin.com/n0bSFXen Zombie Controller

But what I believe you really want is http://pastebin.com/6WfhS8q7 AI . You can at least gain an understanding of what's needed to be known, and improve the flaws it currently has. (ps: runs smoothly though)

http://www.youtube.com/watch?v=POUbAsr-6q4 http://www.youtube.com/watch?v=oytm0eYCQw4 http://www.youtube.com/watch?v=WS8OBRWgbo0 http://www.youtube.com/watch?v=4j94OBb8lDo

Even if you don't want to watch the videos, just skim through them, and point out the parts of the AI system.

Best video I have seen is here : http://www.youtube.com/watch?v=i3HunQfX5fA


Comment
Add comment · Show 3 · Share
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 icelated · Oct 26, 2012 at 06:52 PM 0
Share

Thank you so much i am looking over some of the code you provided. I do want to do this myself rather than use assets. Thank you for all the links and youtube videos i am looking at everything.

avatar image icelated · Oct 26, 2012 at 06:56 PM 0
Share

Would i need pathfinding and waypoints?

avatar image Montraydavis · Oct 27, 2012 at 03:23 AM 0
Share

They are not a complete necessity, per-say, giving the example above uses only a raycast system. They are however, much more realistic, and efficient.

And you are welcome.

avatar image
1

Answer by code-blep · Oct 25, 2012 at 09:38 PM

Hi icelated,

You seem to have asked this question twice. It might be a good idea to remove one of them ;)

Here is my answer in your other post:

To be honest all the above are generally needed. I've looked at this a number of times, and the conclusion I always come to is the keep up the creative flow and reduce development time is to use one of the pre-built ones from the asset store. Here is a selection of the ones I think look good:

http://u3d.as/content/aron-granberg/a-pathfinding-project-pro/2h6

http://u3d.as/content/alex-kring/simple-path/1QM

http://u3d.as/content/rival-theory-/rain-one-/22D

I know they seem a little expensive but considering the time saved it works out to be a massive cost saver!

Hope this little list helps!

Paul

Comment
Add comment · Share
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

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

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Enemy AI things to consider 1 Answer

how to make a basic AI script in a short time 2 Answers

Enemy Follow Script Help 2 Answers

Waypoint Setup: How? 4 Answers

Stay Back! 2 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