Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Cygon · Sep 28, 2011 at 02:29 PM · airtsgame object

How would the commander AI in an RTS game be realized?

After checking out some of the Unity concepts just recently, Unity seems to be all about constructing a game from small autonomous "game objects". This is a perfect match for shooters and other games where you essentially encounter individual enemies.

Now in a realtime strategy or tower defense game, for example, individual units have very simplistic behavior while there's a commander AI that controls them.

Where exactly would this commander AI be placed in Unity? Would I create a game object for that as well, driving all of the decision making logic from its Update() function or does Unity provide provide a special place for game controlling AI like this?

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

1 Reply

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

Answer by timsk · Sep 28, 2011 at 02:43 PM

I find, the problem with questions about AI, is that its all situational or personal preference.

I imagine, in most general TD games, there's the path-finding, creep picking and creep spawning. Then the towers AI (range,speed,creep detection etc). It makes sense for the towers AI to be attached to the tower, but the creeps AI to be attached to an empty gameobject.

Personally, the way I am doing it, is have a gameobject that is the "AIManager" that has the overall AI, then, i attach each enemies AI to the enemies gameobject.

That's just the way I see it, I'm sure other people would do it differently, and I'm sure at some point so will I.

In an attempt to directly answer your question... no, there isn't anything in unity that is designed specifically to hold AI functions.

Comment
Add comment · Show 1 · 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 Cygon · Sep 28, 2011 at 05:22 PM 0
Share

Thanks. I agree, handling low-level behavior anywhere but in the game objects it applies to would be awkward. I was just wondering if there was some kind of game controller or conductor API that I could use or whether I would have to put it all in a game object (like your AI$$anonymous$$anager). Thanks for clearing it up!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Enemies Moving Through Terrain Help 1 Answer

AI enemy scripting help 1 Answer

My Script keeps destroying all enemies instead of just one. 3 Answers

Shooting Damage Help 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