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 eagle4 · Feb 02, 2012 at 10:35 PM · aibeginnerstatesteam

simple AI - Beginner question

I am very new to programming, just thought I'd get that out to start with.

I am working on a Rugby League game at the moment and I have my player running around and acting the way he should, and I would like to animate his team mates to run around with him.

Now as I've not done any kind of AI programming before I'm not sure the first place I should start.

I reckon I need to have states set up (somehow), like Offence or Defence. So then I can set some rules for them to try to follow depending on the state they are in. eg if they are in Offence to stay behind the character with the ball, and to try to spread out evenly across the field

How should I go about setting up these states? I think if I get started on the right foot I should be about to work out the rest (or maybe not lol)

Would you have each state a different procedure? Would I handle states with triggers? would I have all the code for each state in a different script or should I have them all in one, just different procedures?

Am I even aiming in the right direction? should I not be worrying about states and just deal with behaviours?

Any help you could give me on this would be super.

Thanks guys

P.S The AI would be kind of similar to what you see in this old game ARL96

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
0

Answer by Posly · Feb 02, 2012 at 11:03 PM

If your new to programming this is going to be hard, AI isn't simple. Anyway's I would just have a lot of booleans and if they set the boolean true then they do something. That's how I do AI's.

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 TheCraiggers · Feb 03, 2012 at 01:21 AM

In the game I made, I used different scripts for each AI difficulty, but inherited the common stuff from a generic AI script. This allowed me to keep all the functions the same name, etc, although I could have probably done it just as easily with one mega script and a public variable or two. The way Unity is set up where you usually have to know the name of the script in order to interface with it removes some of the positives of inheriting code in my opinion. Still, this worked well in my case.

Which approach you take will likely boil down to how you want to interact with the AI, and how they will interact with each other.

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

6 People are following this question.

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

Related Questions

NPC movement 1 Answer

Audio clip change via script,changing audio clip in audio source via script 1 Answer

Help With Basic AI, Keep Specific Distance From Player 2 Answers

Suggestions for AI Selecting From Multiple Targets? 3 Answers

Why won't my AI change waypoints for patroling? 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