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 xhays · Aug 24, 2014 at 10:03 AM · multiplayermultipletab

Creating Multiple Game Screens

Greetings,

I am tryin to create a multiplayer room based game which the players can join multiple rooms at same time. Every rooms need to have big space like infinity.

I will create a invidual new tab for every rooms when a player select a room and join in game.

I have a long time experience as desktop software developer. Thats why i'm thinking i need to handle screen as an object to achieve this. Create a new screen as object, place game objects, set scripts and play.

It's highly possible to interfere rooms each other or possbile to reach to other rooms if i place all of rooms in same screen (i cant set border lines to limit players movements). Thats why i have to draw every rooms individually.

But still i dont have any idea how to create a new game screen and can i show or hide it when user changes the tabs.

Is this possible with Unity without loading scenes in same screen?

Best Regards,

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 screenname_taken · Aug 24, 2014 at 11:54 AM 0
Share

If by scenes you mean the files, then no. It's only one. However, if by scene you mean the rooms, then it's fine. You can have 4 rooms in different places, and 4 cameras each looking at one room, and each camera is rendering at one portion of the screen. So you can be looking at all 4 cameras at the same time. The file you'll save on your project though will be just one. But you can have multiple prefabs and activate which ones are suitable at the time.

(Hint: with Unity you need to refer to the stuff by their right name. If by scene you meant the view of the player, then call it view, or room, or level... because in Unity scenes are the files containing the data for a level lets say.)

avatar image xhays · Aug 24, 2014 at 12:34 PM 0
Share

Thank you for your answer,

You are right, i should use "rooms" ins$$anonymous$$d of "scenes".

Having all the rooms in same space is not possible in my case. As i said; rooms can interfere each other or player can reach to other rooms in free move mode (i cant set border lines to limit players movements). Only way is drawing one room on screen but still other rooms have to be alive.

And yes, me too thinking putting all room objects in a prefab which created on runtime and show or hide prefab. But this is a avatar based game, thats why im thinking handling prefabs on every changes will be cause a big performance loss.

Best Regards,

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Alessio89 · Aug 24, 2014 at 11:48 AM

Your logic is pretty good and indeed treating "screens" as objects is a diffuse technique. But sadly (as far as I know) unity isn't really suited for this kind of logic. You would have to code that yourself, handle the different screens and decide what's visible and what's not (maybe give a tag to every object to determine in what screen they should be drawn? And then have a general screen manager that decides what to draw based on what screen the player is in... The possibilities are infinite if you want to invest some time in coding them).

I don't understand, however, why you can't use different scenes for different rooms? If that's because you need to pass over some gameobject to a new room, you can always use DontDestroyOnLoad(GameObject object) so that when you switch scene the object stays there.

Comment
Add comment · 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 xhays · Aug 24, 2014 at 12:02 PM 0
Share

Thank for your answer,

There is 2 reason to explain why i cant use differet scenes; 1-) Rooms are creating by data files at runtime. I mean i dont have any pre created scene (player can edit the room freely). 2-) I have to keep alive all the rooms at same time. I can only hide and show the screen.

Additionally, I cant use same scene to draw all rooms as game objects because room sizes are flexible (unpredictable) and have own cameras and scripts. It will be really shameful for me if player can discover other opened room on free move mode :)

Best Regards,

avatar image Alessio89 · Aug 24, 2014 at 12:27 PM 0
Share

A solution then would be as I mentioned early. $$anonymous$$eep a static manager class that handles what is visible and what not for the local player. For example you could have a tag for each room and every item in that room will have that tag. In the manager class you keep a variable to store in which room the player is in and then hide everything that's not tagged for that room. Never done this myself, but this is what I would try first to see if it's doable that way :)

avatar image xhays · Aug 24, 2014 at 12:42 PM 0
Share

Thank you,

Your idea sounds like its possbile to be useful. I will try to learn about tags.

But something confusing me. Will scripts, animations or on air sounds continue to their process when i hide the room together its objects?

Best Regars,

avatar image Alessio89 · Aug 24, 2014 at 01:04 PM 0
Share

If you disable the whole object, yes all the components included (audio sources, scripts, controller, renderers) will be disabled. If the gameobject holding the audio source have the right tag it will get enabled, otherwise it will stay off. There may be better ways of handling it, however. But I'm sure you'll figure it out as you go :)

avatar image xhays · Aug 24, 2014 at 01:11 PM 0
Share

Thank you,

I'm feeling like disabling will be bad :) Hiding is only way to solve my problem. I decided to try your advice after reading documentations about tags and layers. But still it would be best if i could treat screen as object, create as much i need and handle at same time. Thank you again.

Best Regards,

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Entering multiple variables into a function 1 Answer

Multiple player spawnpoints 0 Answers

Unity networking tutorial? 6 Answers

Unity pauses when tabbing out! 3 Answers

Got multiplayer to work with 2 clients on 1 pc. I cant get it to work on 2 different computers. Help! 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