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 theorbitgames · Jul 15, 2014 at 04:04 AM · aiadvice

Change the way the AI works? (Need an opinion)

We're considering changing the AI for the enemy in our horror game. Here's the 2 types of AI we can choose from:

  • Simple AI: The enemy just walks towards the player without stopping.

  • Slender AI: Only moves when not looking at enemy, player dies if looking at enemy for too long.

The problems with these two types, the simple AI might just ruin the game. It's called Stalker, but running towards the player probably wouldn't be considered "stalky". And for the Slender AI, we haven't figured out how to make the player die from looking at the enemy.

We need some advice, which AI would you prefer?

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 Anti-Social Fred · Jul 15, 2014 at 05:29 AM

Not to be "that guy" but this is a question that would be best for the forums because there's no real answer to this due to it being based solely on opinion.

IF you're asking how to make the player die by looking at an enemy then that's completely different, and completely do-able. Even a simple raycast would probably suffice:

             float damage = 0;       // Damage dealt to the player by looking at the enemy
             Transform playerEyes;   // Eye-level for the player
             float playerHealth = 0; // Current health the player has
             float distance = 0;     // How far away the character can see
 
             Ray ray = new Ray(playerEyes.position, playerEyes.forward);
             RaycastHit hit;
 
             if (Physics.Raycast(ray, out hit, distance))
             {
                 if (hit.transform != null)// If the transform exists
                 {
                     if (hit.transform.tag == "Enemy")// If the transform is the enemy
                     {
                         playerHealth -= damage; // Apply Damage
                     }
                 }
             }

To answer the actual presented question, though... it's impossible to say because I know nothing about your game :(

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 theorbitgames · Jul 15, 2014 at 11:04 PM 0
Share

Already found a way around our problem, but thanks anyway :)

avatar image
0

Answer by Kiwasi · Jul 15, 2014 at 05:32 AM

I'd prefer an AI that took more then a minute to code. One that gives the semblance of making intelligent decisions based on the game situation.

AI code downloaded from the net falls pretty low on my list of games to play.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Horror Game AI script recommendation? 1 Answer

AI wandering script? 5 Answers

Stay Back! 2 Answers

C# multiple AI Waypoint tutorial 0 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