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 Spac3Rat · Jan 18, 2014 at 01:00 AM · 2dlayersscenestop-down

What should the best practice be to teleport player on top-down game

Hello everyone.

I've been developing software for quite some time already but I'm just starting with Unity.

To help me get started and learn to use Unity, I'm developing a prototype for a PC top-down game in which my player is walking around in a city block and he can enter buildings, which may have several floors. I though of 3 ways of doing this and was wondering what the veterans here have to say about it. Of course, please feel free to suggest other solutions.

1) Have the buildings and floors on the same scene, away from the action so that they cannot be seen, and move the player and camera accordingly. When a player enters a door (which would have a trigger), I would transport the player to the ground floor and move the camera too. When the player moves up or down the building I would keep moving according. The pros would be that all the assets would be loaded already, removing any loading. The cons would be that the assets would be loaded already (which uses more memory).

2) Have several layers (one for the city, one for the ground floor, one for the first floor, etc.) and show and hide layers. BTW I haven't managed to hide and show them programmaticaly yet, so I'm not sure if this would be a huge no-no from the start. Pros and cons would be the same as for option 1.

3) Use and load scenes. Pros would be memory usage, cons would be the possibility of having small load hiccups, which I would very much prefer not to have, of course.

Thank you all very much in advance for any light you may cast into this matter.

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
Best Answer

Answer by rutter · Jan 18, 2014 at 01:40 AM

Short answer: I'd recommend option 1 to start with.

Reasoning:

  • You mentioned you're developing for PC. It is possible to run out of memory, but ultimately that's going to come down to the complexity of your assets and scripts. Render time is a more likely concern, in my experience.

  • Option 1 takes advantage of frustum culling: anything outside of the camera's view area just won't be rendered. It's simple, automatic, and cheap (in terms of effort and runtime).

  • Option 1 may be able to transition to options 2 or 3, if it turns out you'd like to switch later in development.

  • Option 2 sounds like a nightmare for level design; I would not want to edit a bunch of objects that are all tightly packed and stacked together. This might be mitigated if you build them separately and use a script to stack them later.

  • Option 2 may suffer severe overdraw if you don't take careful advantage of layer and occlusion culling. Layer culling avoids drawing objects on certain layers; it's a camera setting, but it relies on properly configuring every object in the scene. Occlusion culling avoids drawing objects which are "hidden" behind other objects, but it's pro-only, and requires some advanced setup in your build process.

  • Option 3 requires programming time and may have loading hiccups, like you mentioned. If anything, I'd be more inclined to break things down by city blocks, tens of floors, or other large "sectors"? Depending on how complex each area is. Unless you have pro, level loads are blocking operations.

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 Spac3Rat · Jan 19, 2014 at 07:48 PM 0
Share

Thanks, Rutter. That's some nice chunks of precious information right there.

avatar image radioact1ve · Jan 19, 2014 at 08:46 PM 0
Share

Excellent points. I believe Pokemon does it this way too. Think I read this somewhere but can't find it. Could be completely wrong though.

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

20 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

Related Questions

2D Top-Down 3D-Like effect 2 Answers

How can I make my Enemy look/flip towards my player (2D TOP-DOWN) 1 Answer

Select 2D Object By Mouse ? 4 Answers

Sliding along walls in top-down 2D with no diagonal movement 1 Answer

2D Reflection Ripple effect 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