• 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
2
Question by TyrantTR · Apr 28, 2010 at 02:16 AM · ai

Free Roaming AI

Me and a friend are working on a unity game. (actually my friend, I'm just modeling) Its a hunting game and were talking about the system for the animals, he wants to use something from some FPS tutorial where the enemies follow a path and react when your x amount of distance away.

or so he describes.

I don't find this appropriate for the game, I'd much prefer it if the animals free roamed the environment, and even engaged in hunting activities themselves, or simply went to the nearest water source to get some water.

Does anyone know how to achieve a system where they would roam freely across the land and act like natural animals, not just drones waiting to kill or be killed? If you have links to tutorials or you can explain it yourself please tell, because we both are not that experienced in the scripting field.

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
4

Answer by Random Indie · Apr 28, 2010 at 06:53 AM

My suggestion would be to start with a simple agent based model such as BOIDS (little history). There's a tutorial on the unity wiki that should get you started.

I'll give you a quick rundown, each boid has three behaviours:

  1. they try to stay close to other nearby boids
  2. they try not to run into anyone close by
  3. they try to go in roughly the same direction as other nearby boids

These three simple rules give rise to fairly complex behaviours (ie: bird flocking) such as flock splitting and merging.

You can expand on this pretty easily. There are variations on this that introduce "hawks" that when hungry attack boids (chase them) which makes the boids try to run away from the hawks. You can also add obstacle avoidance or any number of behaviours. I've modified and used them for schools of fish (just make sure they know not to fly or burrow :P), wolf packs, Zombie hoards, etc... It's a really powerful little algorithm.

Simple agent based models are really easy to understand conceptually so that might be the best place to start.

Looking into ALife is definitely a good idea too. You might want to glance over cellular automata while you're at it, may not need it but it might come in handy.

If you go with something like BOIDS you might want to think about making them finite state machines with states such as hungry, sleepy, curious or some such.

There are a tonne of resources out there that should help you out, you should be able to find most of what you need with the links I've provided. Good luck!

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 spinaljack · Apr 28, 2010 at 04:37 AM

You can google ALife AI which will give you plenty of links to libraries and research in the field and STALKER will also pop up as they used ALife in their game. It's a huge topic but boiled down you can think of it like the sims, characters have certain factors that influence their behaviour such as thirst or fear which can be modelled with fuzzy logic with the combination of these factors ultimately leading to a decision on the next action the character will make (doing nothing is also a decision). If you want an in-depth discussion I suggest the forums as it's difficult to answer here.

Here's a nice set of AI related links

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

AI Monster Problem 3 Answers

Following the next item in an array 0 Answers

AI isn't looping (Javascript) 1 Answer

Steering Overcompesation 0 Answers

Ai pathing through a maze 3 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