• 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 /
  • Help Room /
This question was closed Jul 05, 2018 at 11:47 AM by xxZap for the following reason:

La domanda è off-topic o non pertinente

avatar image
Question by xxZap · Oct 20, 2016 at 09:55 AM · c#eventrpgquest

QuestSystem: the right way

The problem

Hi guys, I read a lot about QuestSystem but everytime I found only bad monobehaviour-based patterns that I really don't like ("use triggers...!", "use colliders...!", ecc... I hate this kind of programming). [My english is not good ;)]

So, I decided to write a QuestSystem based to interfaces and events, but are 2 days that I'm stuck with the event system.


The objects

I will try to summarize, I have:

  1. IQuestObjective: an interface with UpdateProgress() method and OnComplete event; it's a simple task for complete a quest.

  2. Quest: an object with a List of IQuestObjective. In this way, for example, a single Quest can have multiple tasks. For each objectives the quest adds itself to the OnComplete event. So, when all of the objectives are completed, the quest will too.

  3. Various type of IQuestObjective like CollectionObjective (collect this, this and that), InteractionObjective (talk with P), LocationObjective (go to K position), etc...

  4. A lot of other stuff.

The problem is that I'm stuck with the event system network between the QuestManager, the Player, the locations, the npcs, ecc...


Questions

I will take the example of the InteractionObjective (talk with X). Every NPC monobehaviour has a Character model assigned to, with some cool informations and stuff like the dialogues he has to show when the player interact with, or the quests he has to show. All of these interactions are done inside an Interact() method.

What should be the right flow and what are the events I must to implement? Should be the QuestManager to managed all the event flow? How?

It's the first time I'm approaching to a "complex" event system and I have a lot to learn. Unfortunately I think the best way is always "try and try and try...".

If you need I can post my code, but is a lot of code and a lot of classes (OOP)

Comment
winkgroup

People who like this

1 Show 2
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 Owen-Reynolds · Oct 20, 2016 at 02:23 PM 1
Share

The Answers main area is best for simple 1-time help on a common problem. I moved this into the Answers HelpRoom area, but only because that's more informal.

The Forums (lower top bar, 1st item) non-commercial collaboration area is probably more suited for a lengthy discussion Q like this.

As far as using triggers, that's just the easiest way for Unity (I think most game engines) to send events.

avatar image xxZap Owen-Reynolds · Oct 20, 2016 at 02:32 PM 0
Share

Thanks a lot, you're right. I'll try in the forum.

0 Replies

  • Sort: 

Update about the future of Unity Answers

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta later in June. Please note, we are aiming to set Unity Answers to read-only mode on the 31st of May in order to prepare for the final data migration.

For more information, please read our full announcement.

Follow this Question

Answers Answers and Comments

226 People are following this question.

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

Related Questions

How to save player1's stats separate from player2's i.e. Health, Damage, Etc.. 1 Answer

Exposing a function to the inspector 3 Answers

Missing something fundamental about scripting an RPG party system - specifically, keeping characters in a list. 0 Answers

Change UI image in a conversation 1 Answer

[URGENT!] Unity crashing when I level up my character in game? 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