• 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 /
This question was closed Jul 24, 2013 at 09:23 PM by clunk47 for the following reason:

The question is answered, right answer was accepted

avatar image
Question by MilosM · Dec 09, 2012 at 08:56 PM · graphicsoptimizationscenesrpg

Multiple scenes or one scene?

Hello, something has been really troubling my mind recently.

I'm currently making an RPG with a vast world, and one of the first thing that pops to mind is how to make it in Unity. Should I use one large scene for the whole world (which would severely lag, I think - the world is really big) or should I make more scenes? I recall from a time when I was modding for TES that they divided the whole world by it's coordinates. That way, I could tend to one area, and give a much better finished product. However, I don't think a hovering platform would suit well, so... how can I make the game start rendering the scene that the player should transfer to when on the edge? Or, should I make one large scene, but only render and calculate the objects in proximity of the player?

I hope I didn't confuse you all, I'm quite so myself. If needed, I can further explain the question.

Thanks for reading, and any help in advance.

Comment
clunk47
Yharooer
MI_Buddy
SweetMarkey

People who like this

4 Show 3
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 bompi88 · Dec 09, 2012 at 10:25 PM 0
Share

You got pro or free?

avatar image Hugs Are Drugs · Dec 09, 2012 at 11:36 PM 0
Share

Well, one issue with making one large scene is floating point precision limits which can cause things to be buggy, but then there's what's known as the "Futurama method" which fixes that by instead of the player moving the entire world moves around you. Unity Pro does have occlusion culling which means what you don't see the GPU doesn't bother to render which would be VERY important if you're making one large world, if you don't have pro I would try making a bunch of small scenes stitched together. If you ever played any of the STALKER games, they're worlds are made up of a bunch of reasonably sized maps all stitched together, it got on my nerves a little bit but it did work.

avatar image POLYGAMe · Dec 10, 2012 at 12:00 AM 0
Share

It would be an absolute mission to keep track of everything if it were all in one scene. I'd just use multiple scenes and just choose the loading points wisely ;-)

3 Replies

  • Sort: 
avatar image
Best Answer

Answer by CodeMasterMike · Dec 10, 2012 at 06:49 AM

I think I would divide the world up in different scenes. And I would add these scenes into different areas.

So in the beginning, you load a scene from the area that the player is currently in. But only one scene, the start scene for example, and then keep track of which scene the player is currently in. When necessary you load the "neighbour" scene/s with Application.LoadLevelAdditive as the game goes by.

So when the player goes into a new Area (enters a house/elevator/new Enviornment which means the whole world will change to something new) then you load this scene with the normal Application.LoadLevel function. So then you would clear out some memory and other stuff you don't need.

And if the player would return to the old area he just was in, then you load the old scene with the Application.LoadLevel function.

And as the player progress through the new Area, or the old area, add new scenes with the LoadLevelAdditive function.

It would take some design-thinking, but I think that would be a nice and smart way to do a big RPG-game without too many loading scenes, or one huge map that will take a long time to load.

Comment
clunk47
Eugenius
johnnymoha
ohboyotero
MI_Buddy
codedbythet

People who like this

6 Show 5 · 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 clunk47 · Dec 10, 2012 at 07:18 AM 1
Share

Dude thank you! I never took the time to find out what LoadLevelAdditive was, but read up about it. I say your answer should be the accepted one, because I was talking about enabling / disabling things, but this works way better by loading content from the new level into the current scene :D Thanks again.

avatar image frank45 · Dec 10, 2012 at 02:12 PM 0
Share

would that be not complicated..!!making vast number of scenes and loading each and everything..!!if i have an open world or huge map then what will i do..?

avatar image CodeMasterMike · Dec 10, 2012 at 02:31 PM 0
Share

This design idea would work on a open world as well. As I said, it takes some design-thinking to do, but its doable.

If you want to use a huge map, then you will have at some point, cut it up and only load parts of which you need, or else you will get into trouble performance-wise and memory-wise.

Using several different scenes that are loaded together makes it a lot easier to control rather than having one big map with thousands of objects with thousands of scripts running to the left and right. And you can load and close scenes as you need them, or not need them.

I would say almost all games with a bigger map uses some kind of technique where they either load a new scene seamlessly in realtime, or uses a "loading..." scene while loading the new content.

avatar image MilosM · Dec 12, 2012 at 04:16 PM 0
Share

The "loading..." idea would work perfectly. I'll have to think this out properly. Thank you all for your comments. You guys(and gals!) are the best!

avatar image clunk47 · Dec 12, 2012 at 05:12 PM 0
Share

Accept this answer! :D

avatar image

Answer by KyleW007 · Jul 10, 2013 at 10:57 AM

You should use Triggers to achieve this.

Create a new GameObject to represent the trigger area. Choose the most appropriate shape. This will be the area that you have to enter in order to cause the teleport to occur.

Now select the new object you just made, and tick the "Is Trigger" option in the collider component, shown in the inspector pane. This changes the collider from a solid object to an area that you can walk into.

Un-tick the "Mesh Renderer" component, so that the GameObject becomes invisible.

You probably also want to specify a destination for the teleporter, and an easy way to do this is to create another invisible GameObject. This time however you don't need a collider either, so it's best to use "Create Empty" to create a completely empty GameObject. Name it "Teleport Destination".

Now, depending on how you want the teleporter to work, you need to either add some script to the teleporter object, or to the player object.

If you want the teleporter to teleport any object which enters it, add a script something like this to the teleporter object:

var destination : Transform;

function OnTriggerEnter(other : Collider) { other.transform.position = destination.position; } If you only want the player to teleport when it enters the trigger, you should make sure your player object is tagged as "Player", then add a check for this in your teleporter script, making it look more like this:

var destination : Transform;

function OnTriggerEnter(other : Collider) { if (other.tag == "Player") { other.transform.position = destination.position; } } See the Colliders Manual Page for more information about triggers.

Now for the camera. If your camera is parented to your player (as it is, in the case of the first-person controller prefab), then you need do nothing. The camera will be moved along with the player automatically.

If you're using a chase-style camera however, you'll probably want to make the camera jump the same relative distance as the player just jumped. You could do this by measuring the distance that the player moved, and then adding that distance to the camera too - something like this:

var destination : Transform;

function OnTriggerEnter(other : Collider) { if (other.tag == "Player") { var startPosition = other.transform.position; other.transform.position = destination.position; var moveDelta = other.transform.position - startPosition; Camera.main.transform.position += moveDelta; } }

Comment

People who like this

0 Show 0 · 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

Answer by Yharooer · Jul 12, 2013 at 05:52 AM

I would say split it up into multiple scenes. If its all one scene, and if the world is really big, then heaps of RAM will be used.

Comment

People who like this

0 Show 0 · 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

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

18 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

Related Questions

How Would I Create An (FPS RPG)? 1 Answer

Gear VR Frame Rate Optimization? 1 Answer

How to implement an ammo counter using textured quads? [Scripting doubts] 2 Answers

Multi Resolution 1 Answer

Why is the CPU usage so high? 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