What are Subscenes in Unity? (Massive Worlds!)

  Рет қаралды 95,152

Code Monkey

Code Monkey

Күн бұрын

✅ Get the Project files and Utilities at unitycodemonkey.com/video.php...
Let's check out Subscenes in Unity, what they are and how we can use them to make Massive Worlds!
Subscenes use Unity DOTS / ECS in order to be insanely performant with nearly instant loading.
When closed they represent their contents as Entities and when you need to modify something you can open the Subscene which will convert all objects into Game Objects that you can edit as usual.
If you have any questions post them in the comments and I'll do my best to answer them.
🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
See you next time!
📍 Support on Patreon / unitycodemonkey
🤖 Join the Community Discord / discord
📦 Grab the Game Bundle at unitycodemonkey.com/gameBundl...
📝 Get the Code Monkey Utilities at unitycodemonkey.com/utils.php
#unitytutorial #unity3d #unity2d
--------------------------------------------------------------------
Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.
I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
You can see my games at www.endlessloopstudios.com
--------------------------------------------------------------------
- Website: unitycodemonkey.com/
- Twitter: / unitycodemonkey
- Facebook: / unitycodemonkey

Пікірлер: 256
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Here's a really great Unity feature you might now know about, build massive worlds! 🌐 Have you found the video Helpful and Valuable? ❤️ Support on Patreon www.patreon.com/unitycodemonkey or get the Game Bundle unitycodemonkey.com/gamebundle.php
@Gmania999
@Gmania999 4 жыл бұрын
Hi, I have all the characters in the RTS game controlled by one script (for optimization), please tell me is it possible to use hybrid render for their rendering and physics? Without ECS
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
@@Gmania999 The Hybrid Renderer is a renderer that works with ECS components so you can't really use it without ECS. You can manually draw a Mesh with Graphics.DrawMesh();
@joepeters8746
@joepeters8746 4 жыл бұрын
I can not make a subscene, the option is greyed out, can anyone help please?
@christofstanits
@christofstanits 2 жыл бұрын
@@joepeters8746 you need to save your currently open scene first.
@toppefall
@toppefall 4 жыл бұрын
As always, delivering cutting edge DOTS insight. Very helpful and never stops amazing me how well you break these complex topics down into biteable chunks!
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Thanks!
@Anthrocarbon
@Anthrocarbon Жыл бұрын
First of all your typing speed and accuracy sounds like a stampede of little keyboard construction workers and I love it! Secondly, thanks for another great source of information about Unity features that are somewhat buried behind a competence barrier. I refer constantly to the official unity script API page and would never have found this info considering the way I browse it. I've been looking for a mechanism to increase performance on a single-scene game I'm building with a huge number of unique one-off meshes and materials, and I think this will be key to the solution. Thirdly, I continue to find it amazing how your videos make me feel smart and also stupid at the same time! This is great for helping me get an objective sense of my capabilities as a game dev, and I appreciate the opportunity to see how pro-level development is approached. Once again, the Unity community has shown that it follows an unspoken credo of helpfulness, unlike many other programming niches where the professionals and wizards treat the newcomers like worthless scum. CM, you make me feel included and respected.
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
That's great to hear! I'm glad the video helped you! Thanks!
@-pcmr-108
@-pcmr-108 4 жыл бұрын
This is exactly what I thought of doing when I heard of subscenes when they were originally announced. Just got back into messing with unity and was going to toy with this. Great that you have something up on it.
@petarstoyanov9024
@petarstoyanov9024 4 жыл бұрын
This is amazing! Thank you from the bottom of my soul, we need such in-depth tutorials on various systems!
@onerimeuse
@onerimeuse 2 жыл бұрын
You're basically my dictionary for when I'm watching more advanced dots concept videos and someone says something I don't understand (like subscene, for example). Fantastic channel, man.
@N1ghtR1der666
@N1ghtR1der666 2 жыл бұрын
I would love to see how you break up a 3d continuous world with subscenes and also once your world gets bigenough how the editor window performance is effected and can be improved. Another aspect with 3d worlds would be how do you deal with distant but visable objects that are visible from multiple subscenes away (consider a tower in or mountain in the distance)
@00xenobil00
@00xenobil00 2 жыл бұрын
Its the same thing, but you render everything in in a line in front of the character and dont render anything in the back and sides of the character.
@Sim2322
@Sim2322 Жыл бұрын
@@00xenobil00 culling and dynamically loading map chunks are not the same thing. You definitely can use both
@therealpeter2267
@therealpeter2267 Жыл бұрын
You could use multiple LOD levels of subscenes, so like layer bigger subscenes, holding towers and big things, and smaller subscenes, holding trees, then grass, etc...
@JiraMelaj
@JiraMelaj Жыл бұрын
Also helpful would be how to build a full size spherical (or geodesic polyhedra) planet without crashing the editor. There is a bit of a catch 22 with needing it cut up before making it. Looks like it would need to be done in stages with math & not just plopped in...
@JiraMelaj
@JiraMelaj Жыл бұрын
Basically, some in editor dots terrain generation. Probably need to start as base shape before transformed into stuff & it's LODs.
@yarikar
@yarikar 3 жыл бұрын
WOW this is so helpful! Thank you! I can't wait finishing my bachelor thesis. I'll totally get either into your patreon or get the bundle this summer and start making small game projects. Your tutorials are such great entry points into larger systems. This is gold!
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
That's awesome! Best of luck with your thesis!
@DeadWayfes
@DeadWayfes 4 жыл бұрын
This really helped me! I look forward to apply this to my project! Thanks a lot!!
@born2kiss
@born2kiss 4 жыл бұрын
Great video. Please do a video about Animations using DOTS. Either with new Unity.Animations or some other way. Keep up the great work!
@speedrob
@speedrob 4 жыл бұрын
Thank you so much for this particular tutorial, very useful indeed.
@GakuCMDR
@GakuCMDR 4 жыл бұрын
Thank you, I was looking for this kind of solution to my game
@superbhack2034
@superbhack2034 Жыл бұрын
bro you deserve at least 1 million subscribers. Your videos are amazing man
@erikm9768
@erikm9768 4 ай бұрын
Thank you for this tutorial. I had no idea it was this simple
@estebansustacha1911
@estebansustacha1911 4 жыл бұрын
I don't know what I would do without your videos man! Thanks for the hard work, hope one day be able to support you on Patreon!
@cgh353
@cgh353 4 жыл бұрын
Im really thankful for all your video's. Thank You.
@seithcg
@seithcg 4 жыл бұрын
That's a great tutorial, thank you!
@falsecalamity
@falsecalamity 4 жыл бұрын
Once again Code Monkey proves they are the best!!
@zombiehacker1941
@zombiehacker1941 3 жыл бұрын
This Is Very Helpful Thanks For The Tutorial
@shuashuashua1
@shuashuashua1 4 жыл бұрын
As allways great vid !
@make-a-game-com
@make-a-game-com 4 жыл бұрын
Cool. Always. Keep it up!
@marcelocosta9620
@marcelocosta9620 3 жыл бұрын
Wow! Great video! This is like Minecraft chunk loading system.
@MrDeivis666
@MrDeivis666 4 жыл бұрын
I like this tutorial. Thank you
@kken8766
@kken8766 4 жыл бұрын
This is awesome!!!! Thank you very much ~
@sekker2k446
@sekker2k446 4 жыл бұрын
Awesome!! Thanks
@dclxviclan
@dclxviclan 2 жыл бұрын
Amazing perfomance
@misterquantum9840
@misterquantum9840 4 жыл бұрын
You are the fastest typist I have ever seen on KZfaq.
@edwardjsparrow
@edwardjsparrow 3 жыл бұрын
He uses speed force 😂
@blobfish5713
@blobfish5713 4 жыл бұрын
Thanks for the juicy upload once again! can't wait to learn more !!
@eddyrc7
@eddyrc7 2 жыл бұрын
OMG YOU ARE PURE GOLD.
@AyItsKevin
@AyItsKevin 3 жыл бұрын
You just saved me so many overlap triggers lol
@ChrisTharpArt
@ChrisTharpArt 4 жыл бұрын
Very interesting stuff.
@F3L0
@F3L0 4 жыл бұрын
Yep , there we go !
@iCeDrAgOn2025
@iCeDrAgOn2025 4 жыл бұрын
There is so many possibilities that this can be useful for besides extremely Thing of a game that has a very complex UI with multiple windows or sections, those could all be saved in to a Subscene and loaded and unloaded as needed
@magnusm4
@magnusm4 4 жыл бұрын
Subscenes, LOD, repeating texture render on multiple objects and Occlusion Culling. Ah there's so many built in easy performance improving features it's sad how few use this to make huge games
@iCeDrAgOn2025
@iCeDrAgOn2025 4 жыл бұрын
@@magnusm4 The reason why not many are using it yet is because the DOTS packages are still in preview and aren't ready yet for production, but yes I do agree there is a lot of things in there than can help with 2D and 3D to greatly increase performance
@foomaster6353
@foomaster6353 Жыл бұрын
New to Unity, have been watching you videos and they have really helped me out a lot, thank you! Quick but possibly stupid question, would using prefabs in subscenes still propagate changes like they do if they weren't in a subscene? For example, if you wanted to change the color of the grass would you just change the prefab or would you have to "unpack" all the subscenes, change the prefab, then "repack" them?
@souhailla10
@souhailla10 3 жыл бұрын
looks great sir ! do you also have an example in 3d scenes ?
@josueccama303
@josueccama303 4 жыл бұрын
wonderful, video, as always, details that make a difference, but I doubt, how would join sub scenes with path finding?. It would be a great video, that you could show how to make that union. Very good video, thanks for your time and dedication.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Pathfinding for massive worlds is definitely a topic I'd like to cover
@ODCrab
@ODCrab 4 жыл бұрын
Cool concept. It seems a lot cleaner than having scenes that are only whole if you remember to load in it's sibling scenes. And I never even thought of doing LOD's for entire scenes. I feel like you should have left a disclaimer when you just cycled through the whole sub-scene array to find the closest ones. That is bound to get slow when you have hundreds of these things. Its a weird problem to solve in code. So I think I would add a collider to each sub-scene and put them on a "sub-scene" physics layer. Then do a sphere cast with a layer mask for the sub-scene layer, from the player's position to find which ones are close. Sort of like a radar.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Sure if performance becomes an issue you could build some colliders or just simply test the distance only once per 5 seconds instead of every frame.
@witek_smitek
@witek_smitek 4 жыл бұрын
Hi Code Monkey, Thanks for great (as usual) tutorial! I have one question for you - how do you handle obstacle collisions and movement constraints with ECS? Let's say we have one character controlled with WASD movement. What is the best way to constrain it so player wouldn't be able to move through objects? In legacy unity we have CharacterController script, but how we can achieve it in ECS? Is using DOTS Physics lib is good for it? Let me know what you think...
@Kenbomp
@Kenbomp Жыл бұрын
Only thing is you need to do your own format to track what's the next scene without hard coding it. But still useful
@armoredgreatbear
@armoredgreatbear 4 жыл бұрын
Very useful and very cool, thank you so much for the tutorial, but I have a question, can this system be used with the grid based map unity system? If so, a tutorial on that will be awesome.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Hmm used with the Grid System how? I guess you could make a subscene and store it in each grid position but that's what's already being done here so no need for the Grid System in this case.
@aster5031
@aster5031 2 жыл бұрын
10/10
@johnnydoe6696
@johnnydoe6696 3 жыл бұрын
Is it possible to create a new subscene from selection, and then close for editing at runtime? For example if you wanted to split a large existing scene into subscenes at the start of the game.
@christofstanits
@christofstanits 4 жыл бұрын
another great video! thank you very much! Going on from this. How would you add components to the entities in your subscene? What would be a proper way to identify entities in the subscene so you can add components correctly?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Usually you can identify a certain entity by adding a empty tag component
@christofstanits
@christofstanits 4 жыл бұрын
​@@CodeMonkeyUnity thank you! My Problem was that I hadnt known I can just add IConvertGameObjectToEntity to the subscene gameObjects. there I can add all the tags and whatever I need.
@mehcaqueen
@mehcaqueen 3 жыл бұрын
Can subscenes be different sizes or must they remain in a grid of all the same size? Say there is a very large scene where the camera zooms out and you want to contain it all in one scene, but there are other surrounding ones that are much smaller. Would this have any long term problems? Assuming all of the subscenes along side the edge of the largest one still have the same length and there arent any gaps within the map.
@MasterofFire-sc3yn
@MasterofFire-sc3yn 4 жыл бұрын
I would like to ask you if you can actually do an in-depth tutorial on animations in ECS.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
I haven't yet looked at DOTS animations but it's on my list
@MasterofFire-sc3yn
@MasterofFire-sc3yn 4 жыл бұрын
@@CodeMonkeyUnity Thanks, be sure to check your videos out!
@thibaudgayraud6400
@thibaudgayraud6400 4 жыл бұрын
Hi, Awesome stuff as always, I really like your tutorials on DOTS with unity. I was wondering, in this vidéo you create a variable of class :"SceneSystem" and I can't seem to access it, am I missing a package or something? Take care and I can't wait for your next video.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
It's inside Unity.Scenes
@thibaudgayraud6400
@thibaudgayraud6400 4 жыл бұрын
@@CodeMonkeyUnity Thanks for your answer :D, I'm implementing Unity.Scenes, but it seams like there is no system called SceneSystem. I have access to something called SubSceneStreamingSystem but then there is no function called loadSceneAsync or anything alike.
@Ahmed-ic9ft
@Ahmed-ic9ft 4 жыл бұрын
hi, how would this work if i had objects that the player would interact with such as trees that fade when player is behind or effects like particles which is not static. also dose the vector3.distance work if my player is normal object and compare to entity pos?
@yaarrghmematey
@yaarrghmematey 4 жыл бұрын
This is awesome! I haven't looked into SubScenes and your video is the first time I heard of SubScenes, I have been waiting for DOTS to mature before I rewrite the game engine for YAARRGH! Correct me if I am wrong and what I can tell after watching your video, I could replace my cached queue LIFO Chunk Manager with SubScenes? With your experience using SubScenes and its seems plausible, to have multiple SubScenes of about 10x10x10 size for a 3D procedural world? This is why I am loving DOTS, been working with DOTS for about a year, it is awesome and now with SubScenes, if it can do chunk management, procedural worlds will be amazing!
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
The one thing that I'm still not entirely sure about is if you can create or modify subscenes in runtime so I don't know how they would work for a procedural world. I'm guessing it should be possible since it does seem perfect for that use case but still need to research that.
@yaarrghmematey
@yaarrghmematey 4 жыл бұрын
@@CodeMonkeyUnity Thanks mate, I will check it out later, hope it works out
@DeadFrontierPinoyRambulan
@DeadFrontierPinoyRambulan 2 жыл бұрын
Hey CodeMoney Can I use triggers for this too? trigger enter and exit?
@zy-blade
@zy-blade 4 жыл бұрын
Just as I needed it, great! One question though; How to handle dynamic objects like enemies? They can't be loaded/unloaded based on the subscene, because they could follow the player for example. And what, if I want to save the state of an object, before it gets unloaded, so when I go back later, the object remains like the player left it? I will surely implement this, but this could be content for some of your next videos =) Keep up those awesome videos! (yea, that were 2 questions ^-^)
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
SubScenes are only meant for either static entities or entities where the state doesn't matter (like a flock of birds) so if you want some sort of state to persist then don't unload it through a SubScene. As soon as you load it loads from the data on the binary file regardless of what changes you made while the SubScene was loaded.
@zy-blade
@zy-blade 4 жыл бұрын
@@CodeMonkeyUnity Yup, that makes sense. Thanks.
@andrewshandle
@andrewshandle 4 жыл бұрын
This is a great video and I can't wait to give it a try. One thing I've noticed on this and the Prefab video is you are making Systems instead of Jobs for some of these systems. While I haven't tried this particular one out yet, shouldn't a "SceneJob" work fine to handle all of this or would it not worth with the Burst Compiler? Similarly I've found that spawning a prefab in a Job with DOTS also doesn't work with the Burst Compiler which is frustrating, if I want a Player to fire a Projectile Entity (something that would be incredibly common in a game), not being able to do that in a worker thread seems to be a problem. That, or am I missing something? (I really hope I am).
@iCeDrAgOn2025
@iCeDrAgOn2025 4 жыл бұрын
Not every system has to contain a job. Systems such as movement or turning on or off a single entity would run so quickly that it's actually better not to set such up as a job because it would just lead to you as the developer needing to write more code.
@andrewshandle
@andrewshandle 4 жыл бұрын
@@iCeDrAgOn2025 The new JobComponentSystem in the latest preview is the same amount of code as a ComponentSystem and it'll use Burst Compile by default. You'd think for consistency you'd just use the same one all the time if possible. I do think Systems are a bit easier by default since it doesn't require using Buffers, but it'd be nice for the future of DOTS if there'd be a consistent way to do it.
@MechabitGames
@MechabitGames 4 жыл бұрын
@@andrewshandle I think creating a job has an overhead so for player interactions for a single character you're probably better off not using jobs?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Normally I use the ComponentSystem when its something very simple like here just moving a single Player but yes ideally in a proper game you would make Jobs for everything. I believe the plan is to merge ComponentSystem and JobComponentSystem into one so in the future it'll be very easy to convert them. There is a small overhead when creating the job and their goal is to bring that down as much as possible. In terms of spawning prefabs you can do it with Burst but you don't do it with EntityManager.Instantiate(); You do it with a EntityCommandBuffer.Concurrent
@andrewshandle
@andrewshandle 4 жыл бұрын
@@CodeMonkeyUnity I definitely understand that for input, since Job or otherwise, it'll pretty tiny, it's not like movement, rotation or pathfinding which might influence 10s of thousands of entities (depending on your game of course). I should probably stop worrying around a tenth of a millisecond here or there with small Systems and Jobs. ;) Keep up the good work, I find these videos incredibly helpful.
@MatthewTrecozzi
@MatthewTrecozzi 4 жыл бұрын
Hey! Is there any way to integrate the visuals of the converted "Quad-Sprites" in the sub scenes with the 2D Renderer in the Universal Render Pipeline? I wouldn't expect them to work with with say 2D lights, but I'd be interested in a system where Sub scenes can stream various background details in parallax with a standard foreground workflow using UWRP's 2D Features. Thanks for the content as always.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Hmm I'm not sure, right now the Hybrid Renderer is really meant to only work with 3D although I believe there's a massive update coming soon around GDC so looking forward to seeing what they add.
@pietromaggi9259
@pietromaggi9259 4 жыл бұрын
It would be possibile to create subscenes from sprites and tilemaps ? Maybe you should implement some sort of conversion to meshes, I guess
@BarioIDL
@BarioIDL Жыл бұрын
can i use subscenes for each characters like the layers of subscenes you mentioned?
@user-dd4dw2zf5b
@user-dd4dw2zf5b 4 жыл бұрын
As always great video. Could you answer is it possible to save subscene like prefab and use it for instantiating in further? And how could we process some managed object inside subscene, like npc? Will they unload with the subscene and won't being processing? or maybe is there some work around?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
When the Subscene is unloaded the objects are destroyed. But you could keep the logic of the NPC in another Entity that is outside the subscene and only have the visual inside the subscene and when that is loaded you look up the current state of the logic Entity to display the visual.
@user-dd4dw2zf5b
@user-dd4dw2zf5b 4 жыл бұрын
@@CodeMonkeyUnity thank you for answering. but what about subscene like prefab? is there not some tricky with it?
@emoneydatruth1
@emoneydatruth1 2 жыл бұрын
Can we do this with bolt? I want to try and make a big world and this seems like the best way.
@DanyloSyrotynskyy
@DanyloSyrotynskyy 4 жыл бұрын
They should have implemented open/close subscene on right click context menu or with shortcut
@Gonzakoable
@Gonzakoable 4 жыл бұрын
know any way to dynamically create subscenes at runtime?
@calebvaccaro
@calebvaccaro 3 жыл бұрын
Would this work with Multiplayer? I have some ideas on how to use it but just wanted to make sure it's feasible.
@lucaGameDev
@lucaGameDev Жыл бұрын
Thanks always for your great work and ispiration. I reimplemented your example using Unity 2022.3 with Entity 1.0 and compare with MonoBehavior SceneManager.LoadSceneAsync. I create a demo Scene with 10000 SpriteRenderers. ECS -> SceneSystem.LoadSceneAsync has a very huge peak (FPS drop) at the really begin and it takes 37 frames to load the Subscene Mono -> SceneManager.LoadSceneAsync does not have any huge peak at the start and it takes 21 frames to load the scene (LoadSceneMode.Additive) During scene async loading they both have a similar fps It would be interesting if you create similar tests, to compare these two worlds (Mono and ECS). I guess with your experience you can create more reliable test results than mine.
@Lythowastaken
@Lythowastaken 4 жыл бұрын
So if I understand right. I could use SubScene to put a level into it? So I can load unload levels with it?
@sanzjulio
@sanzjulio 3 жыл бұрын
how can be changed from distance to trigger with colliders?
@Dimencia
@Dimencia 4 жыл бұрын
tbh the thing that I'm amazed about in this video ... I didn't think unity's DOTS worked with its physics. But if you can convert a subscene to Entities, then I imagine all the colliders, meshes, etc all still function. And I thought the problem with DOTS right now was that we didn't have access to physics with it? Guess I'm gonna have to do some research
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
DOTS Physics has been in development for quite a while and is already very advanced, check it out kzfaq.info/get/bejne/eJmDebqens3PfGw.html
@manicmillennial3287
@manicmillennial3287 4 жыл бұрын
omg code monkey character that is so cool xD
@Adamthegeek70
@Adamthegeek70 2 жыл бұрын
How would this work with basic multiplayer (lan or intenet via photon etc) with players far and near. each other.
@mmx.official
@mmx.official 3 жыл бұрын
Can you upgrade the package dependencies to 2019.4 LTS please?
@serjserj7850
@serjserj7850 2 жыл бұрын
Hi, I have problem with sub scenes, in my game when I am activating subscene the models are loading but, colliders does not work, So I can go through with my character or any other physical object
@ColtPtrHun
@ColtPtrHun 3 жыл бұрын
What does it mean that GameObjects are converted to entities? What are the pros and cons? What do entities have to do with subscenes?
@mikoaj7956
@mikoaj7956 4 жыл бұрын
What packages have you used?
@ItsYourBoPhase
@ItsYourBoPhase 4 жыл бұрын
Do you still have to worry about the issues when you get far away from the origin using this method?
@STARmod
@STARmod 8 ай бұрын
How the reserved memory gets with this implementation?
@jittojoseph9195
@jittojoseph9195 2 жыл бұрын
how do you prefer to use subscenes in multiplayer?
@daniilparokonnyy7980
@daniilparokonnyy7980 4 жыл бұрын
Do you think, is it a good idea to load a subscene with common game manager and canvas to similar scenes, such as levels?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Yup, from what I know the goal is to eventually have everything inside SubScenes so you won't even need to use the ConvertToEntity Script However there are still a handful of things that don't work as Entities like the Camera and the UI so for now those have to stay in normal game objects and everything else can be inside a SubScene
@bodyclockgames9272
@bodyclockgames9272 4 жыл бұрын
Been playing around with this. All works fine in the editor - but doesn't seem to work in a build :(
@GunslingerP
@GunslingerP 4 жыл бұрын
How would you create subscenes to make procedurally generated content? it seems you have to have a subscene created before you start a game, but there is no way to duplicate scenes. So there's really not a way to use this to make infinite worlds...
@jobinjeeji3502
@jobinjeeji3502 3 жыл бұрын
Its working fine on pc but when i build on android its not rendering objects inside subscene. I have intsalled hybrid renderer. Please suggest a solution. Im using unity 2019.4 so im also using hybrid renderer v1 do you think that could be the issue? Do i have to upgrade to unity 2020
@brockormond4131
@brockormond4131 4 жыл бұрын
As a theoretical, can you still have interactions in unloaded subscenes? Say you have a NPC chopping a tree down in an unloaded scene, can it make a sound? ;P But seriously, if there is a dynamic system in an unloaded subscence, can you still have its effects spill into loaded scenes? (Ex. A dam is set to blow on a timer and flood a region, but no one is around to see it, can other regions down river get flooded anyway?)
@washynator
@washynator 4 жыл бұрын
I'm an idiot, so you should probably wait for a comment from someone who knows anything. But I would imagine that it wouldn't be possible to have stuff happen in unloaded scenes (they are unloaded, after all). My (stupid) solution would be to use some kind of a trigger to make the thing happen anyway (you can use whatever system to load the scene to make the flood happen). For example game time? As in "after the game has been going for 50minutes, load the scene with the dam and destroy the town, then unload the scene until the player comes near".
@brockormond4131
@brockormond4131 4 жыл бұрын
@@washynator That's certainly one way for that sort of thing; but I'm thinking about dealing with massive dynamic environments where things can happen even without player involvement. Maybe something like another 'subscene layer' like how there can be a 'low render' and 'high render' scene depending on distance; there could be a 'data layer' which needs what's in the environment, but not any of the visual components (meshs/partical effects). Really just thoughts that came to me while watching the video.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Unloaded Subscenes don't really exist, if you look in the Entity Debugger the entities don't exist. I'm not sure if you can modify SubScenes after they've been converted, I believe they are meant more for the static parts of your game, so in your case you could use it for the terrain and whatever trees and rocks that never move but the dam and the water would be in normal entities on in a subcene that is never unloaded.
@zaingill9527
@zaingill9527 4 жыл бұрын
@@CodeMonkeyUnity So anything that is unloaded as a part of the subscene can't hold any state or persist and do it's own thing due to it not existing makes sense
@martimking1craft
@martimking1craft 4 жыл бұрын
You should do what terraria does to subscenesyou have a timer always running and when a subscene is loaded it grabs your timer and do some time checks to decide what is the current state of the sub scene
@JC-jz6rx
@JC-jz6rx 3 жыл бұрын
can i implement the same on a unity terrain?
@MilkyGamesOfficial
@MilkyGamesOfficial 7 ай бұрын
Is this better performance for 3d or would unity addressables be better for 3d?
@Un4GivNX
@Un4GivNX Жыл бұрын
How does lightmaps work with subscene? Let's say you have one big world with 100 subscenes, I intended to bake the lighting. It is something that just works or will I be facing many bumps along the road? Also, same question but regarding baking occlusion.
@TheAnonymPL
@TheAnonymPL 4 жыл бұрын
Is it possible to add entities to Subscene in runtime or generate new Subscene with some entities? For example for procedurally generated terrain in ECS?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
I'm not sure, that's something I still have to research. I imagine it should be possible since that would be a perfect application of this system.
@vildauget
@vildauget 4 жыл бұрын
@@CodeMonkeyUnity Looking for the same, it'd be great for procedural work. I don't see any methods for it in Unity.Scenes, but I might miss something with my limited understanding of it all, docs.unity3d.com/Packages/com.unity.entities@0.5/api/Unity.Scenes.html
@JimboS1ice999
@JimboS1ice999 Жыл бұрын
So you create the large world then split highlighted poritons into subscenes?
@SCOTTINPYOHONG
@SCOTTINPYOHONG 4 жыл бұрын
After adding another gameobject into subscene, all gameobjects are drawn in wrong place, but their colliders are on correct position. Do you know how to fix it?
@shiv-iwnl8188
@shiv-iwnl8188 3 жыл бұрын
how do I add a LOD system, my meshes are created at runtime but I don't know how to have the chunks change their mesh to a lower detail mesh if the camera is further. I know how to actually load the entire chunk but not the lower detail one is the problem!
@tonymax7503
@tonymax7503 3 жыл бұрын
Is there a way to await subscene completely loaded?
@erikm9768
@erikm9768 4 ай бұрын
If changes are made to a subscene in run-time, are these changes persisted if you unload and load again?
@youtubechannel548
@youtubechannel548 4 жыл бұрын
Would it be possible to see a video on the day and night cycle for 3D games? Like some procedural skybox that uses a custom shader. I'm terrible when it comes to shaders..
@youtubechannel548
@youtubechannel548 4 жыл бұрын
@@bezoro2008 Yeah but it's way to basic looking. Wish there would be a way to add more details to the skybox. Like the moon and stars. Also if you want to have different settings, like completely couldy sky.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Not sure about 3D games but the Lost Crypt demo has a gorgeous Day Night transition
@youtubechannel548
@youtubechannel548 4 жыл бұрын
@@CodeMonkeyUnity Yeah I have looked at the Lost Crypt demo project, but unfortunately for 3D this method for the day and night cycle would not really work. :/
@erikm9768
@erikm9768 4 ай бұрын
You didnt mention much about the LOD system with subscenes, but are these essentially just a substitute subscene if a subscene is very far away? Sounds like it could be faster than just relying on LOD gameobjects in a single subscene , but not a huge difference unless you have thousands of objects in your subscene
@nickdev
@nickdev 2 жыл бұрын
iknow this video is little ...old.. but... this can solve Float Origin Problems too? if yes... how?
@adrim.m.7149
@adrim.m.7149 2 жыл бұрын
how did you use the subscene I entered Unity and if I drag a Scene inside my actual Scene it is not child of the first
@Andrew90046zero
@Andrew90046zero 4 жыл бұрын
So this subscene stuff can be used without dots right? Or at least, without me needing to use ECS in any way. Like I can still safely use this with Monobehaviours EDIT: Nevermind I just watched the rest of the video lol But just to make sure, because I plan on having massive levels in my game, and I have already made a system for loading and unloading parts of my game, but I haven't yet made it so it saves to file or anything. But with this system, does it support destructible levels? Like you can modify parts of a subscene at runtime and it still unload properly?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Everything inside a Subscene gets automatically converted into Entities. But you can mix Entities with Game Objects. So even if your game is fully made with Game Objects you can still use Subscenes for dynamically loading any static objects that don't interact with your game objects. I have not experimented with modifying them in runtime so not sure about that.
@sumppi95
@sumppi95 3 ай бұрын
for some reason the componentsystem namespace doesn't exist for me? What have I Done wrong?
@gdb5549
@gdb5549 2 жыл бұрын
does this work for 3d too?
@MsDakota7
@MsDakota7 3 жыл бұрын
Maybe a stupid question, but say an enemey is supposed to patrol 3 different subscenes, how can we ensure the patrol actually happens when we unload one or multiple of the subscenes?
@euming
@euming 3 жыл бұрын
3:49 when I right-click in Unity v2020.1.6f1, I don't have the option to "create subscene" at the bottom of the dropdown menu. I just have 'properties' as the last menu item. Is there some setting I need to check or some package I need to install first? Do I need to buy Unity Pro version? Is there another component I need to add somewhere? What's the missing information here?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Do you have the Entities package installed? Haven't touched DOTS in quite a while so it's possible the menu changed.
@flashpointstudios7910
@flashpointstudios7910 4 жыл бұрын
Aren't infinite worlds still plagued by floating point precision issues? Or do subscenes fix this by default?
@alcofribasnasier1838
@alcofribasnasier1838 3 жыл бұрын
floating points can easily be fixed with a simple return to origin, and it doesn't take more than 50 lines of code to do it.
@flashpointstudios7910
@flashpointstudios7910 3 жыл бұрын
@@alcofribasnasier1838 I know and I've done that myself. The question was do subscenes fix the floating origin problem. Also congrats on 50 lines of code, but I doubt that works for larger projects.
@magnusm4
@magnusm4 4 жыл бұрын
I've thought of using this for large open world games. Like GTA. Though I wonder, what stops you from making an entire game like this instead of using actual scenes, like making Half Life entirely into subscenes to remove the loading in between? Imagine making the entire summer camp in Psychonauts into one single map using this method. Thing go on in the background far away but the objects's functions are inactive and are basically in a passive mode that simply makes them move. Or having a massive building surrounded by a smaller base with a circle of water to a whole city. And you can see everything moving and being alive and go there. As I said, passively active to give the illusion of everything being one scene.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
There's nothing stopping you, that's exactly how massive games like Skyrim are made. The world gets loaded in and out as the player moves around. It can become very complex though which is why a lot of games use the typical level structure.
@magnusm4
@magnusm4 4 жыл бұрын
@@CodeMonkeyUnity That and open worlds means typical optimization methods don't work like disabling objects obstructed by view. Even if they're far away, it's still a whole open plane of objects you'l have to low poly render and the sheer number alone can cause trouble even with less than 300 polygons. Then the engine itself can be limited. Like with Cursed Halo he explains there's a vertice limit of about 20 000 or more. This means regardless of your optimization you're automatically constricted by the engine unless you do like some developers and either modify the engine, or make a third party software to allow more to be rendered without lag or crashing.
@mohamedhazeem411
@mohamedhazeem411 4 жыл бұрын
Can you tell me how to localize in- game and liveops content? Have you any idea about that?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Normally I have a giant enum with values for all the text used in the game and then a dictionary of each language and a string for each enum. Dictionary
@mohamedhazeem411
@mohamedhazeem411 4 жыл бұрын
@@CodeMonkeyUnity Can you make a video about this topic?
@f11bot
@f11bot 2 жыл бұрын
Okay so basically this is like loading scenes additively but better!?
@trexarain794
@trexarain794 3 жыл бұрын
Do this work on mobile and for 3d worlds?
Getting Started with HDRP in Unity (Awesome Graphics!)
16:19
Code Monkey
Рет қаралды 115 М.
Getting Started with the Job System in Unity 2019
25:54
Code Monkey
Рет қаралды 180 М.
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 82 МЛН
Пранк пошел не по плану…🥲
00:59
Саша Квашеная
Рет қаралды 5 МЛН
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 170 МЛН
БАБУШКИН КОМПОТ В СОЛО
00:23
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 13 МЛН
Watch This Before Working on a Big Game in Unity
18:44
John Leorid
Рет қаралды 293 М.
Подробный урок по Entity Component System в Unity
15:27
Insane One - Разработка игр
Рет қаралды 42 М.
Implementing World Streaming in my Unity Game! | Devlog
9:16
Kyle Banks // Farewell North
Рет қаралды 40 М.
Should You Use DOTS in 2024? (plus what is Unity ECS)
30:15
Turbo Makes Games
Рет қаралды 38 М.
You're not using Godot to its potential
6:12
Tienne_k
Рет қаралды 84 М.
What are Interfaces? (C# Basics)
13:54
Code Monkey
Рет қаралды 204 М.
We Need to Rethink Exercise - The Workout Paradox
12:00
Kurzgesagt – In a Nutshell
Рет қаралды 4,8 МЛН
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 82 МЛН