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 Caiuse · Aug 01, 2012 at 08:06 PM · eventdelegate

Best approach to a interaction management system

I have a small sandbox world with various objects that can be interacted with. Each object has a set of possible interactions (slightly like The Sims). I'm trying to work out the best approach to managing the unique logic for each task, and assigning various objects with the various tasks. An example would be a Tree with the 3 interactions "Shake", "Climb" and "Chop down".

I've been considering a singleton approach with each method defined in some "TaskManager" class, or maybe a delegate and event approach (not sure how this would be implemented in this case).

Has anyone got any good suggestions for this type of system. Cheers, Caius.

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
0

Answer by IndieScapeGames · Aug 01, 2012 at 09:00 PM

I would be interested in a similar system.

Perhaps your TaskManager class would be a good idea. Checking the object's tag could pull up a list of interactions. There would have to be certain criteria set up to make interactions only possible within a certain radius of the other objects, or certain checks to ensure that the objects have all requirements met.

The example you shared about the tree, allow me to think of a scavenger who is looking for resources. If he is within a radius of 10m and then interacts with the tree, if he wants food he may "shake", if he's escaping attack from a wild animal or another player, he may "climb", or if he is collecting resources such as wood he may "Chop Down".

We should create an Asset for Unity's Asset Store :)

Comment
Add comment · Show 2 · 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 Caiuse · Aug 01, 2012 at 09:34 PM 0
Share

Lol thats the exact thoughts I had! Nice suggestion. I've had various ideas about how to approach this programatically but I would really like someone to point me towards some examples.

avatar image IndieScapeGames · Aug 01, 2012 at 09:40 PM 0
Share

Well I will put something together and share with you later. I've favorite-ed this so I can easily find this topic again later.

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

7 People are following this question.

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

Related Questions

How to make Delegates/Events survive assembly reload? 3 Answers

Is there a more efficient way to make events for keyboard key presses? 0 Answers

Navmesh event on navigation end 0 Answers

Parametrize generic event system (DRY it) 1 Answer

Prevent fire event from all instances. 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