Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Optiknights · Jul 26, 2015 at 08:25 AM · sceneprogrammingscene-loadingloadingsceneview

RPG - Battle loading, Scene Management.

Good day,

I am trying to find the best way to manage RPG Battle scenes for my game, currently I have a main game using a 3d interactive map and a 2d battle interface. My options that I currently thought of are as follows;

Create a new scene, store the reference positions of my character and gameobjects within former scene. When battle is completed, reset playerposition based on old position. This unfortunatly has additional load times between battles that could be unacceptable. (I have not tested the scene load but previously Ive had scenes take even half a minute to load.) there may be a way to optimize the loading of a scene if so I would be very happy to learn.

-or-

Create battle scenes within same worldmap being used but out of camera view (i.e at z=100). When a battle is engaged I disable current playercontrols and current camera view and activate a new 2d character/camera set. Once battle is completed I reactivate the world player and reset the battle scene in preparation of next battle.

I am leaning towards the second option (even though it will require more gameobjects within a scene and therefor reduce performance. I am unsure of any unforseen bugs or issues dealing with this.

Please let me know if there is a better or more standard way with dealing with these types of game within a game events.

**Note I do not have Unity Pro for any pro features that would solve this. i.e Aysync loading.

As always Thank you so much for your help,

You guys are awesome!

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
1

Answer by Ehnn · Jul 26, 2015 at 05:51 PM

here's another option similar to #1, let's call it option #3

Have a data class that stores the state of the 3D interactive map: player positions, state of map locations, etc. Lets say this class is called MapStateData, or CampaignStateData if this is part of a campaign

Whenever a battle is entered, we save MapStateData in a way that is accessible regardless of scene (I like having it in a static variable. A file or PlayerPreference also works, depending on your situation), then we can completely un-load the current scene and load the battle one, access the data to initialize whatever we want in battle (if relevant), and at the end of the battle update the data with unit exp progression / whatever, and re-load the map scene once again using our data object

The advantages this offers don't seem dramatic at first, but they make for very correct architecture which ends up saving a lot of headaches and time:

  1. At some point in the project, we'll likely want to serialize data, either to create save/load options, communicate over a network, or just for easier debugging, and saving all our relevant information in a data class will be very helpful there

  2. It means we can completely unload and load scenes in unity. This is how unity is meant to be used and is generally good practice, for a bunch of reasons

  3. It makes the different systems much more independent of each other, which is again good practice - one good example is that now if we want to load level 5 in the campaign with so-and-so data, we can tweak our data object and do it relatively easily and directly from the battle scene itself instead of awkwardly starting the entire campaign and getting to that point

Comment
Add comment · Show 3 · 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 Optiknights · Jul 26, 2015 at 06:54 PM 0
Share

Thanks for that, its basically the correct version of my #1. How would you handle the loading of battle scenes to make them as efficient as possible? $$anonymous$$y big concern is the load time between battle Scenes and the "world" or "campaign" scene. I wouldnt want the player to experience more then a few seconds of "wait time" which I can hide by some transit screen/music.

avatar image Ehnn · Jul 27, 2015 at 06:48 AM 1
Share

Haven't delved into this one, I imagine there aren't a lot of easy solutions. Here's my guess at it

But first - Before going into these things, we should make sure there actually is a problem, the loading might take less than 3 seconds. No point prematurely optimizing

Scenes, in my experience, load pretty fast. It's not surprising, because even if we wrote a lot of code in them it won't run until after it's loaded. So the main thing (that I can think of) that would slow down the loading is either

  1. Un-loading huge references from the current scene. Lets say we have a gameobject that references a bunch of 2048x2048 textures, that could take some time. $$anonymous$$ore suspicious points would be referenced 3D models, large images, huge text files, etc

  2. Loading huge references from the scene we want to load - Same deal here, avoid 2048x2048 textures/images, 3D models, etc

Lastly, a lot of making games is smoke and mirror tricks. I know for my game there's a loading splash screen with text, and then once the scene loads, it usually stutters for a moment, so a fade-in to hide that

avatar image JaiCrimson · Aug 23, 2015 at 12:02 PM 0
Share

Are there any good tutorials that would go over how to do something like this or something similar to this?

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

22 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

Related Questions

Multiple Cars not working 1 Answer

Load all scenes on begning.... 1 Answer

How to have the scene load after a few seconds 1 Answer

Generating a preview for a scene. 0 Answers

Does Active/Inactive and Enabled/Disabled save memory? 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