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
1
Question by sam 1 · Feb 13, 2011 at 04:15 PM · aienemybeginner

How to make AI look like swat team members?

Hello everyone. Im a noob at unity 3d. I am currently making a FPS game in unity 3d. one thing Im having trouble with is AI.

What I want to do is make some AI that look like swat team members or police officers. I already know how to make robot enemy, but they look so dull and boring. I want a swat team member (I already have a model) to look and shoot a machine gun at me when I attack him.

Please I am dying to know how to make enemys like this. If anyone could give a good and specific step by step answer, i would really apprciate it. Thanks you guys!

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 Thom Denick · Feb 13, 2011 at 05:51 PM 0
Share

As $$anonymous$$atthew says, this is a gigantic problem, you need to start smaller. Break your problem into components and start solving them one by one. $$anonymous$$G. (-First Step get a model to appear correctly in game, -Step Two get an animation working on the model, -Step Three get an animation to fire from a script, Step Four, Start working on the AI (which is a huge set of more steps.)

avatar image Peter G · Feb 14, 2011 at 12:13 AM 0
Share

There's nothing really wrong with this question. I flagged it for close just because its getting off topic and the discussion isn't relevant.

3 Replies

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

Answer by Peter G · Feb 13, 2011 at 10:28 PM

This tread is getting really strange, so I'm going to end it by answering it. :)

Creating an AI routine isn't easy. There are a couple things to consider:

  1. I'll start with the easiest. Animating your model isn't very challenging. You can play an animation simply by calling animation.Play("AnimationName"); The only trick is coordinating it so that it works with the characters motion. Unity put out an IK solver called "Locomotion System" that will take your FK and place feet on the ground and such.

  2. You can divide the AI tasks multiple ways; for simplicities sake, I'm going divide it into pathfinding and stimulus response.

  3. Pathfinding is very complicated and people have written entire books on it. The robots use a simple waypoint system. Another popular method is A* (pronounced A-star) Aaron Granberg and AngryAnt have implementations of A* designed for Unity that you could look at. A simple search for pathfinding on the web will bring up loads of examples.

  4. Responding to stimuli is another aspect of AI routines. This ranges from extremely simple to highly complex. Something like the robots in the FPS tutorial are very basic. They just check to see if the enemy is within "x" meters of themselves. If you want the NPC to account for the environment, then you have even more calculations. Such as the player being outside their field of view, or behind a wall. Using the environment is another wrinkle, hiding behind walls all add more complicated algorithms.

  5. Flocking requires awareness of other NPC's and that can be expensive. The Unify Wiki has a flocking algorithm that could be modified to let enemies work together.

If you can do all this, then your in good shape. Otherwise, I suggest that you learn to program, read a book on the logic behind AI programming, and get to work. :) One of the biggest problems you will find is the performance hit from iterating through all the data needed.

I would also recommend checking out developer websites. Plenty of big devs such as Valve and Bungie publish presentations of various topics such as AI.

Here's an example: http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdf

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 Uriel_96 · Feb 13, 2011 at 11:54 PM 1
Share

there is also a question $$anonymous$$e that is about the advanced AI http://answers.unity3d.com/questions/35421/online-advanced-aiartificial-intelligence-with-js

avatar image Peter G · Feb 14, 2011 at 12:09 AM 0
Share

Good link. I had not seen that.

avatar image sam 1 · Feb 14, 2011 at 04:34 PM 0
Share

you see guys, now thats an answer. Thanks peter

avatar image
1

Answer by Matthew Weitzel · Feb 13, 2011 at 05:15 PM

Sam, you are asking questions in a way that Unity Answers is not designed for. If you have a technical question and you have given it your best shot, then a specific question can be given a specific answer.

The questions you have been asking are very broad and imply you either have no idea what you are doing or expect someone to put together a tutorial for you, holding your hand and walking you through step by step. I don't know if you realize that something of that nature takes hours of time to create. And it looks like someone were to hold your hand and walk you from where you are at to where you are trying to go, it could take years, there is no quick easy answer.

Are you willing to dedicate years to the cause of being able to make and interactive experience for another? If that is case, then please be satisfied with my answer to this question as "its not as easy as you think".

I could give you directions to Carnegie Hall, but that wouldn't get you in. Practice will get you in. Right now you are standing outside with a cello you found and nobody can tell if you have even tried playing it.

Did you make this model? Do you write code? This link is pointing at someone else's portfolio, that's not OK. How many hours have you spent developing games? If you are actually serious, I will try to point you in the right direction, but you have to know the right direction is an unbelievable amount of work in a certain (or multiple) area(s) that everyone here has gone through. It's a long way to the top if you wanna rock and roll.

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
avatar image
0

Answer by sam 1 · Feb 13, 2011 at 06:16 PM

Ive been working with unity for about 6 months. im sorry, i dont write down how many hours everyday i use unity.
another thing, I know its not easy doing this. and I know you guys cant answer this my question with a quck solution. but something you guys can do is at least try to help me somehow. you dont have to write a tutorial but maybe you can give me a link on a tutorial. or maybe you guys can suggest something. another thing. i have my own model of a swat team member. i dont know who told you that picture was my model, but its not. I never stated that was my picture/model so learn to read please. but i have my own model. it dosent matter who made it so im not answering your question about if i made the model or not. and i dont unerstand what you mean by"did you write code?" which dosent even make sense. i told you guys im sort of a noob at unity and that i needed some help. if you guys dont wanna help, then dont bother answering my question. but if you do wanna help, please give me a good answer to my question. not a 5 paragrapgh essay on why Im asking this quesion

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 Uriel_96 · Feb 13, 2011 at 11:06 PM 0
Share

maybe your not new to unity itself, but I think your new to unity answers because, first, make your questions more specific, second Peter's answer is just a very good answer, third, it doesnt matter you have 6 months into Unity, I have been into unity for 2 years and I can tell you I only know the 30% of Unity(Unity is a complex program that handles many things), and fourth, that you just put is a reply not answer and that kind of things need to be in the comments not in the answers, hope this reply help you know how to make your questions and answers :P.

avatar image Peter G · Feb 13, 2011 at 11:35 PM 0
Share

@Uriel. I agree with everything you say, I would like to point out though that you cannot comment on other's posts until you get 15 reputation.

avatar image Uriel_96 · Feb 13, 2011 at 11:51 PM 0
Share

oh yeah, sorry I forget it:P

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

No one has followed this question yet.

Related Questions

Enemy AI Problem: Dancing? 1 Answer

Shooting Damage Help 1 Answer

Complete AI Tutorial? 1 Answer

2D Random AI 1 Answer

free roaming enemy ai 1 Answer


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