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 Glutax · Apr 01, 2020 at 02:56 PM · savingscriptable objectbest practicequests

Best Practice for creating quests and saving progress

Hello,

im trying to develop a Quest system for a singleplayer adventure like game. At the moment I've got my Quest as a Scriptable Object with an Array of an abstract Scriptable Object "Goal". Goal has one Array of Results, which are indeed Scriptable Objects.

 public class Quest : ScriptableObject
 {
     public COMPLETIONTYPE completionType;
     public Goal[] goals;
     public string title;
     public string descr;
 
 }
 
 public abstract class Goal : ScriptableObject
 {
     public Quest partOf;
     public bool Initialized;
     public bool done;
     public Result[] results;
     public virtual bool evaluateGoal() { return true; }
     public virtual void init() { }
 
     public virtual void goalToText()
     {
 
     }
 }
 

With that I can create Assets for Quests, Goals and Results and easily connect them. I think this raises some problems:

  1. I think this is abusing ScriptableObjects

  2. The parts are not reusable without instantiating

  3. If I dont instantiate every asset, i wouldnt know how to reset the save game so the player can start over.

I am kinda stuck right now and dont know what a good practice would be. Is it a bad idea to keep with the idea of scriptable Objects and instantiate them?

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 mottzy · Dec 28, 2020 at 06:21 AM

Did you every come to a solution on this? I'm working on a quest system as well and it's surprisingly similar to your structure (though I haven't really considered abstractions just yet. I'm curious if you went with this approach, or found one that worked best for your needs?

Conceptually your idea makes sense. The approach I'm using is to have scriptable objects so I can have configurable quests, and then at runtime I instantiate a different type of object that has runtime information. The runtime quest tracker retains a reference to the quest object, but stores it's own data related to the quest.

The reason I did this is that I needed to track the status of goals, and it didn't make sense to store it back in the scriptable object that defines the quest. Anyway, just curious where you got!

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 Glutax · Dec 28, 2020 at 08:31 PM 0
Share

I've changed Goal and Results to be normal classes instead of Scriptable Objects. That way i didnt have to worry about reference from SO to other SOs while instantiating. With a custom editor script i was still able to create the quests in Editor (even if poorly executed). Ive then saved the quests which are active through my questmanagers reference.

But I've dropped the project already some time ago.

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

126 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

Related Questions

Scriptable object sub-classes list 1 Answer

How To Save User Created Custom Object 1 Answer

How do I save a list of scriptable objects? 0 Answers

Hero and enemies level up best practice 0 Answers

Google Play Games Services process reward data? C# 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