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 edman3d · May 30, 2017 at 09:15 PM · gameobjectscene-loading

Best practice for storing objects

I've been developing a game for a while now (I'm experienced with Unity) and it has gotten complex enough where I need to take a step back and make sure I'm using efficient practices before it gets any larger. Here is a brief rundown of what is going on and what I'm trying to do (I've attached an example image): alt text 1) This is a 2D Isometric RPG game. 2) When the player collides with an enemy in the overworld, a new scene is loaded and a battle takes place. 3) When the battle ends, the player returns to the previous scene to continue exploring

I've started looking into object pooling & other methods for handling this, but I'm not sure how to go about it yet.

What I need: - There is 1 player party and an undetermined amount of enemy parties. - When a scene is loaded, the enemies in that scene should appear - When you leave a scene, the state of the scene should be saved, including the enemy objects within it (e.g. if you killed an enemy it should not respawn next time you enter the scene)

What is the most efficient way to do this? Pool objects? Is it too memory in-efficient to store all possible enemy gameobjects and simply activate them when needed?

sceneflow.png (17.2 kB)
Comment
Add comment · 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 Glurth · May 30, 2017 at 09:58 PM 0
Share

migt want to check this out: https://forum.unity3d.com/threads/serializehelper-free-save-and-load-utility-de-serialize-all-objects-in-your-scene.338148/page-2#post-2784585

avatar image sleepandpancakes · May 31, 2017 at 03:59 AM 0
Share

How big are your battle scenes? $$anonymous$$aybe you could just load them additively and disable the main scene until you return to it.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by cgraf1 · May 30, 2017 at 09:21 PM

It sounds to me like after you kill an enemy, you could do a PlayerPrefs.Save() after destroying the enemy object

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

6 People are following this question.

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

Related Questions

Loading a level and getting all new gameobjects 1 Answer

How to destroy a gameobject on collision and keep it dead on reload of the scene? 1 Answer

Asset Bundle starts loaded 0 Answers

survival shooter game restarting when player dies 2 Answers

DontDestroyOnLoad problem 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