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
0
Question by Atmey · May 06, 2013 at 12:00 PM · positionscenedestroylevelloadlevel

Can I utilize LoadLevelAdditive for immersive game?

Lets say a game like Skyrim or GTA, somewhat a sandbox game, each scene is a city, plains or a cave. When the player gets within X distance from the edge of the current scene I would run the script (or LoadLevelAdditiveAsync).

The problem is re-positioning the whole new scene to the current one, and sometimes more than a single scene each at it's own position.

Another problem could be manually destroying objects from scenes no longer needed.

What is the best way to solve these problems?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by TonyLi · May 06, 2013 at 08:33 PM

Why not build the level in its correct place, so you don't have to reposition it?

In my current project, each level is contained in a single empty game object. Makes it easy to unload a level. (Just destroy the level's main game object.) I suppose you could also reposition this object to reposition the whole level.

I keep some management scripts on the level's main object to do things like save/load changes from the default version of the scene. For example, if the NPC is at (0,0) in the level's scene file, and moves to (10,10), I record this before unloading the level. Then, when the player re-enters that level, I move the NPC to (10,10).

You'll probably want to make the levels fairly granular so you can cache them in and out quickly, and keep something like a 3x3 or 5x5 grid of levels loaded around the player.

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 Atmey · May 07, 2013 at 06:42 AM 0
Share

Is there some limitations when using an Empty for the whole level?

For storing data like NPC position, I don't think it will be applicable in my case, the previous few levels will be still loaded, when you travel very far (2~3 levels distance) I will unload the level the NPC will return to his initial position or his state depending on the time in the game (day/night).

Thanks for the help.

avatar image TonyLi · May 07, 2013 at 01:18 PM 0
Share

Not really. Some people get concerned if the top-level empty isn't at (0,0,0) because Unity will have to apply the transform to all of the child objects, but in the big picture the benefits strongly outweigh the $$anonymous$$iscule overhead.

I haven't seen any problems with occlusion culling and LoadLevelAdditiveAsync in Unity 4 Pro, and I use it pretty heavily. However, you should get familiar with occlusion culling and Nav$$anonymous$$eshes (if you use this for pathfinding/navigation) because there are some gotchas when you're loading levels additively. For example, each level is going to have its own Nav$$anonymous$$esh. As you patch together levels in your continuous world, you'll need to devise a way to let characters cross Nav$$anonymous$$eshes. I use off-mesh links (http://docs.unity3d.com/Documentation/Components/class-Off$$anonymous$$eshLink.html).

If you have access to Jason Gregory's Game Engine Architecture (http://www.amazon.com/Game-Engine-Architecture-Jason-Gregory/dp/1568814135), the sections on world management have some good info on level loading, continuous worlds, and saving/loading games.

avatar image
0

Answer by Fornoreason1000 · May 07, 2013 at 07:20 AM

changing scenes will slow you down. anyway a brief explanation on how skyrim does it.

okay Skyrim uses a array of multiple of terrains, each sharing the same height map but only a small section of it(they also overlap a little bit, if you have creation kit, skyrim references these as "cells" when you are in the Tamriel scene). In games like this Occlusion culling plays a big role in performance. so Skyrim just uses one really big scene for it world , things like the inside towns have there own scene, inside caves and dungeons have there own scene. because they use lots of terrains, occlusion culling will render whats visible instead of the whole terrain/level.

GTA does something similar to this, at least in GTA IV.

however unity is a bit different to creation engine. and may have more limitations in a sense of terrain/levels. you can still replicate this, easily even without terrains. its better to use smaller terrains than the original 2 square Kilometer terrain. (2000x2000) as a soon as a bit of it visible it will render the entire thing.

this is what im using in my game now and it works great(until my trial ran out lol). I used a large height map then divided it to scale to make the Mini terrains connect properly. Occlusion Culling should handle the rest.

hope it helps

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 Atmey · May 07, 2013 at 07:53 AM 0
Share

I heard there are some problems with Occlusion Culling and LoadLevelAdditive, were they fixed? I am not very familiar with height maps, I'll look it up. Thanks.

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

14 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

Related Questions

Load a Scene and Move the Player to an Specific Location. 6 Answers

Problem to go to another world scene in level select lock/unlock 0 Answers

linking levels? 2 Answers

Transform child object over time and then destroy it. 1 Answer

Character duplicates herself when re-entering the home level 2 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